diff --git a/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-1jMRt52t.js b/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-1jMRt52t.js new file mode 100644 index 00000000..949033a7 --- /dev/null +++ b/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-1jMRt52t.js @@ -0,0 +1,12 @@ +import{aA as O,hT as D}from"./story-DT1Ep1ux.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{T as F}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{G as P}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{r as v}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; + uniform mat3 u_dvsMat3; + + attribute vec2 a_position; + + void main() { + mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0); + gl_Position = vec4(pos.xy, 0.0, 1.0); + }`,r=`precision mediump float; + void main() { + gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75); + }`;this._program=t.programCache.acquire(e,r,S().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:r,size:a,resolution:m,pixelRatio:n,rotation:o,viewpoint:i}=e,l=q*o,{x:s,y:A}=i.targetGeometry,M=k(s,e.spatialReference);this._localOrigin.x=M,this._localOrigin.y=A;const p=n*a[0],_=n*a[1],y=m*p,B=m*_,u=T(this._dvsMat3);w(u,u,r),E(u,u,L(p/2,_/2)),N(u,u,$(a[0]/y,-_/B,1)),G(u,u,-l)}_updateBufferData(t,e){const{x:r,y:a}=this._localOrigin,m=2*Y*e.length,n=new Float32Array(m),o=new Uint32Array(8*e.length);let i=0,l=0;for(const s of e)s&&(n[2*i]=s[0]-r,n[2*i+1]=s[1]-a,n[2*i+2]=s[0]-r,n[2*i+3]=s[3]-a,n[2*i+4]=s[2]-r,n[2*i+5]=s[3]-a,n[2*i+6]=s[2]-r,n[2*i+7]=s[1]-a,o[l]=i+0,o[l+1]=i+3,o[l+2]=i+3,o[l+3]=i+2,o[l+4]=i+2,o[l+5]=i+1,o[l+6]=i+1,o[l+7]=i+0,i+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(n.buffer):this._vertexBuffer=v.createVertex(t,x.DYNAMIC_DRAW,n.buffer),this._indexBuffer?this._indexBuffer.setData(o):this._indexBuffer=v.createIndex(t,x.DYNAMIC_DRAW,o),!this._vao){const s=S();this._vao=new j(t,s.attributes,s.bufferLayouts,new Map([["geometry",this._vertexBuffer]]),this._indexBuffer)}}}const S=()=>P("bounds",{geometry:[{location:0,name:"a_position",count:2,type:R.FLOAT}]});class ut extends I{constructor(t){super(t),this._instanceStore=new W,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=O(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(t){this._boundsRenderer=new J(t),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(t,e){t.onMessage(e),this.contains(t)||this.addChild(t),this.requestRender()}_renderChildren(t,e){t.selection=e;for(const r of this.children)r.visible&&r.getDisplayList(this._instanceStore,C.STRICT_ORDER)?.render(t)}}export{ut as K}; diff --git a/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-BEOATdol.js b/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-BEOATdol.js deleted file mode 100644 index 5550c674..00000000 --- a/custom-toc-separator/assets/AGraphicContainer-LUCT6Gle-BEOATdol.js +++ /dev/null @@ -1,12 +0,0 @@ -import{aA as O,hT as D}from"./story-OUarUCIt.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{T as F}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{G as P}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{r as v}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; - uniform mat3 u_dvsMat3; - - attribute vec2 a_position; - - void main() { - mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0); - gl_Position = vec4(pos.xy, 0.0, 1.0); - }`,r=`precision mediump float; - void main() { - gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75); - }`;this._program=t.programCache.acquire(e,r,S().attributes)}_updateMatricesAndLocalOrigin(t){const{state:e}=t,{displayMat3:r,size:a,resolution:m,pixelRatio:n,rotation:o,viewpoint:i}=e,l=q*o,{x:s,y:A}=i.targetGeometry,M=k(s,e.spatialReference);this._localOrigin.x=M,this._localOrigin.y=A;const p=n*a[0],_=n*a[1],y=m*p,B=m*_,u=T(this._dvsMat3);w(u,u,r),E(u,u,L(p/2,_/2)),N(u,u,$(a[0]/y,-_/B,1)),G(u,u,-l)}_updateBufferData(t,e){const{x:r,y:a}=this._localOrigin,m=2*Y*e.length,n=new Float32Array(m),o=new Uint32Array(8*e.length);let i=0,l=0;for(const s of e)s&&(n[2*i]=s[0]-r,n[2*i+1]=s[1]-a,n[2*i+2]=s[0]-r,n[2*i+3]=s[3]-a,n[2*i+4]=s[2]-r,n[2*i+5]=s[3]-a,n[2*i+6]=s[2]-r,n[2*i+7]=s[1]-a,o[l]=i+0,o[l+1]=i+3,o[l+2]=i+3,o[l+3]=i+2,o[l+4]=i+2,o[l+5]=i+1,o[l+6]=i+1,o[l+7]=i+0,i+=4,l+=8);if(this._vertexBuffer?this._vertexBuffer.setData(n.buffer):this._vertexBuffer=v.createVertex(t,x.DYNAMIC_DRAW,n.buffer),this._indexBuffer?this._indexBuffer.setData(o):this._indexBuffer=v.createIndex(t,x.DYNAMIC_DRAW,o),!this._vao){const s=S();this._vao=new j(t,s.attributes,s.bufferLayouts,new Map([["geometry",this._vertexBuffer]]),this._indexBuffer)}}}const S=()=>P("bounds",{geometry:[{location:0,name:"a_position",count:2,type:R.FLOAT}]});class ut extends I{constructor(t){super(t),this._instanceStore=new W,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=O(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(t){this._boundsRenderer=new J(t),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(t,e){t.onMessage(e),this.contains(t)||this.addChild(t),this.requestRender()}_renderChildren(t,e){t.selection=e;for(const r of this.children)r.visible&&r.getDisplayList(this._instanceStore,C.STRICT_ORDER)?.render(t)}}export{ut as K}; diff --git a/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-CLspp1LR.js b/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-CLspp1LR.js deleted file mode 100644 index fb4305af..00000000 --- a/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-CLspp1LR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as s,i as a}from"./story-OUarUCIt.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; diff --git a/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-WDHyZfLR.js b/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-WDHyZfLR.js new file mode 100644 index 00000000..d76772c7 --- /dev/null +++ b/custom-toc-separator/assets/APIKeyMixin-BUMSx9ny-WDHyZfLR.js @@ -0,0 +1 @@ +import{v as r,S as s,i as a}from"./story-DT1Ep1ux.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; diff --git a/custom-toc-separator/assets/Analysis-BPgJ-FCw-DzBMoBqT.js b/custom-toc-separator/assets/Analysis-BPgJ-FCw-DzBMoBqT.js deleted file mode 100644 index cffc5c63..00000000 --- a/custom-toc-separator/assets/Analysis-BPgJ-FCw-DzBMoBqT.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./story-OUarUCIt.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; diff --git a/custom-toc-separator/assets/Analysis-BPgJ-FCw-Y4Lx0iev.js b/custom-toc-separator/assets/Analysis-BPgJ-FCw-Y4Lx0iev.js new file mode 100644 index 00000000..1d2b279e --- /dev/null +++ b/custom-toc-separator/assets/Analysis-BPgJ-FCw-Y4Lx0iev.js @@ -0,0 +1 @@ +import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./story-DT1Ep1ux.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; diff --git a/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-BFUuSyiK.js b/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-BFUuSyiK.js new file mode 100644 index 00000000..4e5ff7e7 --- /dev/null +++ b/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-BFUuSyiK.js @@ -0,0 +1 @@ +import{v as l,S as i,a0 as m,J as v,i as S}from"./story-DT1Ep1ux.js";import{V as d}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js";import{f as I}from"./TilemapCache-CRRxws77-CQyTs6St.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; diff --git a/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-CD3MqLHR.js b/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-CD3MqLHR.js deleted file mode 100644 index 206149ca..00000000 --- a/custom-toc-separator/assets/ArcGISCachedService-C64Ko1TY-CD3MqLHR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as i,a0 as m,J as v,i as S}from"./story-OUarUCIt.js";import{V as d}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js";import{f as I}from"./TilemapCache-CRRxws77-Buzexpoq.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; diff --git a/custom-toc-separator/assets/ArcGISService-BYA-y6X6-6EgTwM9y.js b/custom-toc-separator/assets/ArcGISService-BYA-y6X6-6EgTwM9y.js deleted file mode 100644 index 571e35a2..00000000 --- a/custom-toc-separator/assets/ArcGISService-BYA-y6X6-6EgTwM9y.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as r,i as s,a1 as n}from"./story-OUarUCIt.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; diff --git a/custom-toc-separator/assets/ArcGISService-BYA-y6X6-BWJQc6nI.js b/custom-toc-separator/assets/ArcGISService-BYA-y6X6-BWJQc6nI.js new file mode 100644 index 00000000..b7695bfc --- /dev/null +++ b/custom-toc-separator/assets/ArcGISService-BYA-y6X6-BWJQc6nI.js @@ -0,0 +1 @@ +import{v as i,S as r,i as s,a1 as n}from"./story-DT1Ep1ux.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; diff --git a/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-B1dXzA4o.js b/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-B1dXzA4o.js new file mode 100644 index 00000000..9e90c9fd --- /dev/null +++ b/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-B1dXzA4o.js @@ -0,0 +1 @@ +import{v as o,S as e,bB as s,i as u,e as f}from"./story-DT1Ep1ux.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=l=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; diff --git a/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-qR5MPnw_.js b/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-qR5MPnw_.js deleted file mode 100644 index 30251196..00000000 --- a/custom-toc-separator/assets/AttachmentInfo-D9RFO8W2-qR5MPnw_.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as e,bB as s,i as u,e as f}from"./story-OUarUCIt.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=l=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; diff --git a/custom-toc-separator/assets/AttributeArray-BWXEft_i-Bq20cXL-.js b/custom-toc-separator/assets/AttributeArray-BWXEft_i-Bq20cXL-.js deleted file mode 100644 index 87d863b5..00000000 --- a/custom-toc-separator/assets/AttributeArray-BWXEft_i-Bq20cXL-.js +++ /dev/null @@ -1,1068 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./QueryEngine-CH5uUhZK-B7KHLDgB.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./LRUCache-C3erQTWv-6ABNHME-.js","./WhereClause-DxwoyBMS-D_DBEuLt.js","./TimeOnly-DSMefxKy-C9JclgbM.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./timeSupport-jPViR5jn-BLBOCVnL.js","./queryUtils-Brxu6254-BZ9oWgik.js","./json-BI97KiBB-Ce5cWfI2.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./utils-HtkT8Fn3-CjrLkz9Y.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-DyydRFHu-uR3F5VAW.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./loadAll-e978YItg-cyBswBq0.js","./PortalItem-CctGdnxF-DgukgleB.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./utils-tNxq3jkf-CgPuWip3.js","./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./signal-CETehA7D-TD-k6B-y.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./PooledRBush-DbfAmeLn-D1-Igyfv.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./query-DFW9-NG_-CLOB0soI.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./Indices-DEr2HrWx-Bin5_zrY.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./glUtil-n1JOrdV3-CRAZdee5.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./Util-BjGjeg6f-08Szkf4F.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./InterleavedLayout-DXzw3B2n-BGmZ7EU1.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./types-ChhhI6OU-Cxh6dPlX.js","./Octree-CJNwbhg4-DhnIMuUV.js","./sphere-BenPORjV-CkV41Bdd.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-DlxNxa6f.js","./quatf64-C16JxGFv-BKWK1F8U.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./BufferObject-BM_7mcDb-Pn3dvEnK.js","./Texture-BCt2hphT-Bv29bzNX.js","./boundedPlane-DlvE0eNx-DGqkTDRl.js","./lineSegment-CcqvCARM-CznIGfdF.js","./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./floatRGBA-4pIJN00G-DCWbfrRi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./renderState-Dap0WV9P-D4IHxyei.js","./projectVectorToVector-sIYLNlex-CdnDHDm4.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./vec3f32-BS0cezmI-B_madU1n.js","./orientedBoundingBox-oHezdpWm-BMbvjED3.js","./quat-BODLR7mS-BrN0ZBC_.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./triangle-hqU-Tc1X-DnaZZmrr.js","./BindType-9iOk18Ed-CRW1cdX4.js","./requestImageUtils-Ut4YcoNU-BuJzHX4v.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js"])))=>i.map(i=>d[i]); -import{_ as _t}from"./main-lj2zzr_L.js";import{v as m,S as z,i as ur,gU as go,c$ as si,j as li,dg as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,d2 as di,h_ as Ke,i0 as ut,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,cO as Ir,cw as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./story-OUarUCIt.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-BuJzHX4v.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-Bv29bzNX.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-BGmZ7EU1.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import{t as zt}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import{b as gi,F as _e}from"./sphere-BenPORjV-CkV41Bdd.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";function Wl(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` - vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { - float symbolAlpha = 0.0; - - const float maxTint = 85.0; - const float maxReplace = 170.0; - const float scaleAlpha = 3.0; - - if (symbolColor.a > maxReplace) { - colorMixMode = ${s.int(fe.Multiply)}; - symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); - } else if (symbolColor.a > maxTint) { - colorMixMode = ${s.int(fe.Replace)}; - symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); - } else if (symbolColor.a > 0.0) { - colorMixMode = ${s.int(fe.Tint)}; - symbolAlpha = scaleAlpha * symbolColor.a; - } else { - colorMixMode = ${s.int(fe.Multiply)}; - symbolAlpha = 0.0; - } - - return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); - } - `)}let J=class{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={[R.Pass]:null,[R.Draw]:null},i)switch(r){case R.Pass:this.bind[R.Pass]=i;break;case R.Draw:this.bind[R.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}},pt=class extends J{constructor(e,t){super(e,"sampler2D",R.Draw,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function da(){return!!_o("enable-feature:objectAndLayerId-rendering")}function bi({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(s`vec3 dpPlusFrc(vec3 a, vec3 b) { -return mix(a, a + b, vec3(notEqual(b, vec3(0)))); -} -vec3 dpMinusFrc(vec3 a, vec3 b) { -return mix(vec3(0), a - b, vec3(notEqual(a, b))); -} -vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { -vec3 t1 = dpPlusFrc(hiA, hiB); -vec3 e = dpMinusFrc(t1, hiA); -vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; -return t1 + t2; -}`):e.add(s`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { -vec3 t1 = hiA + hiB; -vec3 e = t1 - hiA; -vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; -return t1 + t2; -}`)}let le=class extends J{constructor(e,t){super(e,"vec3",R.Draw,(r,i,o,a)=>r.setUniform3fv(e,t(i,o,a)))}},q=class extends J{constructor(e,t){super(e,"vec3",R.Pass,(r,i,o)=>r.setUniform3fv(e,t(i,o)))}},ie=class extends J{constructor(e,t){super(e,"float",R.Pass,(r,i,o)=>r.setUniform1f(e,t(i,o)))}},Ei=class extends J{constructor(e,t){super(e,"mat3",R.Draw,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},ue=class extends J{constructor(e,t){super(e,"mat3",R.Pass,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},Xe=class extends J{constructor(e,t){super(e,"mat4",R.Pass,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}},U=class extends li{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};m([z()],U.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_GRID",void 0),m([z()],U.prototype,"LABELS_SHOW_BORDER",void 0),m([z()],U.prototype,"TEXT_SHOW_BASELINE",void 0),m([z()],U.prototype,"TEXT_SHOW_BORDER",void 0),m([z()],U.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),m([z()],U.prototype,"OVERLAY_SHOW_CENTER",void 0),m([z()],U.prototype,"SHOW_POI",void 0),m([z()],U.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),m([z()],U.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),m([z()],U.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),m([z()],U.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),m([z()],U.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_SHOW_MODIFICATIONS",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),m([z()],U.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),m([z()],U.prototype,"LINE_WIREFRAMES",void 0),U=m([ur("esri.views.3d.support.debugFlags")],U);const jl=new U;var st;(function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=16]="DRAPED_MATERIAL",e[e.DRAPED_WATER=17]="DRAPED_WATER",e[e.VOXEL=18]="VOXEL",e[e.MAX_SLOTS=19]="MAX_SLOTS"})(st||(st={}));function pr(e){e.attributes.add(p.POSITION,"vec3"),e.vertex.code.add(s`vec3 positionModel() { return position; }`)}function ua(e,t){e.include(pr);const r=e.vertex;r.include(bi,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new q("transformWorldFromViewTH",i=>i.transformWorldFromViewTH),new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new ue("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new Xe("transformProjFromView",i=>i.transformProjFromView),new Ei("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new le("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new le("transformWorldFromModelTL",i=>i.transformWorldFromModelTL)),r.code.add(s`vec3 positionWorldCameraRelative() { -vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); -vec3 transform_CameraRelativeFromModel = dpAdd( -transformWorldFromModelTL, -transformWorldFromModelTH, --transformWorldFromViewTL, --transformWorldFromViewTH -); -return transform_CameraRelativeFromModel + rotatedModelPosition; -}`),r.code.add(s` - void forwardPosition(float fOffset) { - vPositionWorldCameraRelative = positionWorldCameraRelative(); - if (fOffset != 0.0) { - vPositionWorldCameraRelative += fOffset * ${t.spherical?s`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:s`vec3(0.0, 0.0, 1.0)`}; - } - - vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; - gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); - } - `),e.fragment.uniforms.add(new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL)),r.code.add(s`vec3 positionWorld() { -return transformWorldFromViewTL + vPositionWorldCameraRelative; -}`),e.fragment.code.add(s`vec3 positionWorld() { -return transformWorldFromViewTL + vPositionWorldCameraRelative; -}`)}let ha=class extends Qe{constructor(){super(...arguments),this.transformWorldFromViewTH=I(),this.transformWorldFromViewTL=I(),this.transformViewFromCameraRelativeRS=bt(),this.transformProjFromView=fr()}},ma=class extends Qe{constructor(){super(...arguments),this.transformWorldFromModelRS=bt(),this.transformWorldFromModelTH=I(),this.transformWorldFromModelTL=I()}};function Si(e,t){switch(t.normalType){case Q.Attribute:case Q.Compressed:e.include(Bt,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new Ei("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel),new ue("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),e.vertex.code.add(s`void forwardNormal() { -vNormalWorld = transformNormalGlobalFromModel * normalModel(); -vNormalView = transformNormalViewFromGlobal * vNormalWorld; -}`);break;case Q.ScreenDerivative:e.vertex.code.add(s`void forwardNormal() {}`);break;default:zt(t.normalType);case Q.COUNT:}}let fa=class extends ha{constructor(){super(...arguments),this.transformNormalViewFromGlobal=bt()}},pa=class extends ma{constructor(){super(...arguments),this.transformNormalGlobalFromModel=bt(),this.toMapSpace=Ht()}};const Ai=new Map([[p.POSITION,0],[p.NORMAL,1],[p.NORMALCOMPRESSED,1],[p.UV0,2],[p.COLOR,3],[p.COLORFEATUREATTRIBUTE,3],[p.SIZE,4],[p.TANGENT,4],[p.CENTEROFFSETANDDISTANCE,5],[p.SYMBOLCOLOR,5],[p.FEATUREATTRIBUTE,6],[p.INSTANCEFEATUREATTRIBUTE,6],[p.INSTANCECOLOR,7],[p.OBJECTANDLAYERIDCOLOR,7],[p.INSTANCEOBJECTANDLAYERIDCOLOR,7],[p.ROTATION,8],[p.INSTANCEMODEL,8],[p.INSTANCEMODELNORMAL,12],[p.INSTANCEMODELORIGINHI,11],[p.INSTANCEMODELORIGINLO,15]]);let Ci=class{constructor(){this.id=To()}},va=class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=I(),this._tmpMbs=gi(),this._tmpObb=new ea,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=xe(e)}applyToVertex(e,t,r){const i=Y(wi,e,t,r),o=Y(_a,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/xe(o);return He(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],l=e[5]+t,c=Math.abs(r),u=Math.abs(i),d=Math.abs(o),h=Math.abs(a),v=Math.abs(n),f=Math.abs(l),T=.5*(1+Math.sign(r*a))*Math.min(c,h),_=.5*(1+Math.sign(i*n))*Math.min(u,v),x=.5*(1+Math.sign(o*l))*Math.min(d,f),V=Math.max(c,h),D=Math.max(u,v),B=Math.max(d,f),P=Math.sqrt(T*T+_*_+x*x),G=Math.sign(c+r),w=Math.sign(u+i),S=Math.sign(d+o),E=Math.sign(h+a),M=Math.sign(v+n),O=Math.sign(f+l),g=this._totalOffset;if(P{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=Vo()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(t?.glName==null){const i=this._textures.get(e);return i&&(this._context.bindTexture(null,i.unit),this._freeTextureUnit(i),this._textures.delete(e)),null}let r=this._textures.get(e);return r==null?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)}),this._fragmentUniforms?.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}},vr=class{constructor(e,t,r,i,o=Ai){this.release=i,this.locations=o,this.primitiveType=zo.TRIANGLES,this.key=t.key,this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{if(a&&await r.reload(),!this.key.equals(t.key))throw new Error("Configuration was changed after construction, cannot reload shader");Rt(this._program),this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=Rt(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return Gt({blending:Xo,colorWrite:Vt})}};var vt;(function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"})(vt||(vt={}));let Ca=class extends Ci{constructor(e,t){super(),this.type=vt.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=Ai,this._pp0=It(0,0,1),this._pp1=It(0,0,0),this._parameters=new t,Vr(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){Vr(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,o,a){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,o)}};var ir;(function(e){e[e.None=0]="None",e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"})(ir||(ir={}));var k;(function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"})(k||(k={}));const yi=Yo(At.ONE,At.ZERO,At.ONE,At.ONE_MINUS_SRC_ALPHA);function kl(e){return e===k.FrontFace?null:yi}function wa(e){switch(e){case k.NONE:return Zo;case k.ColorAlpha:return yi;case k.FrontFace:case k.COUNT:return null}}function Ma(e){if(e.draped)return null;switch(e.oitPass){case k.NONE:case k.FrontFace:return e.writeDepth?Ko:null;case k.ColorAlpha:case k.COUNT:return null}}const Oa=5e5,ya={factor:-1,units:-2};function Ra(e){return e?ya:null}function Ia(e,t=de.LESS){return e===k.NONE||e===k.FrontFace?t:de.LEQUAL}function La(e,t){const r=vi(t);return e===k.ColorAlpha?r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1,ye.COLOR_ATTACHMENT2]}:{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:null}de.LESS,de.ALWAYS;const Na={mask:255},Pa={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.ZERO}},Da={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.REPLACE}};de.EQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP,de.NOTEQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP;function Yl({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return e==null&&t==null&&o==null&&(a==null||fi(a,Ke))&&n==null&&(i==null||i===1)&&(r==null||r===1)}const Fa=ut(1,1,.5),Xl=ut(0,.6,.2),Jl=ut(0,1,.2);let Ze=class extends J{constructor(e,t){super(e,"vec2",R.Pass,(r,i,o)=>r.setUniform2fv(e,t(i,o)))}};function Ur(e){e.varyings.add("linearDepth","float")}function Ri(e){e.vertex.uniforms.add(new Ze("nearFar",(t,r)=>r.camera.nearFar))}function Ii(e){e.vertex.code.add(s`float calculateLinearDepth(vec2 nearFar,float z) { -return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); -}`)}function Li(e,t){const{vertex:r}=e;switch(t.output){case F.Color:case F.ColorEmission:if(t.receiveShadows)return Ur(e),void r.code.add(s`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:return e.include(ua,t),Ur(e),Ri(e),Ii(e),void r.code.add(s`void forwardLinearDepth() { -linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); -}`)}r.code.add(s`void forwardLinearDepth() {}`)}function Ni(e){e.vertex.code.add(s`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { -vec3 camToVert = posWorld - camPosWorld; -bool isBackface = dot(camToVert, normalWorld) > 0.0; -if (isBackface) { -posClip.z += 0.0000003 * posClip.w; -} -return posClip; -}`)}function Ue(e,t){Ba(e,t,new le("slicePlaneOrigin",(r,i)=>za(t,r,i)),new le("slicePlaneBasis1",(r,i)=>Wr(t,r,i,i.slicePlane?.basis1)),new le("slicePlaneBasis2",(r,i)=>Wr(t,r,i,i.slicePlane?.basis2)))}function Ba(e,t,...r){if(!t.hasSlicePlane){const n=s`#define rejectBySlice(_pos_) false -#define discardBySlice(_pos_) {} -#define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(n),void e.fragment.code.add(n)}const i=s`struct SliceFactors { -float front; -float side0; -float side1; -float side2; -float side3; -}; -SliceFactors calculateSliceFactors(vec3 pos) { -vec3 rel = pos - slicePlaneOrigin; -vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); -float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); -float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); -float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); -float basis1Dot = dot(slicePlaneBasis1, rel); -float basis2Dot = dot(slicePlaneBasis2, rel); -return SliceFactors( -dot(slicePlaneNormal, pos) + slicePlaneW, --basis1Dot - basis1Len2, -basis1Dot - basis1Len2, --basis2Dot - basis2Len2, -basis2Dot - basis2Len2 -); -} -bool sliceByFactors(SliceFactors factors) { -return factors.front < 0.0 -&& factors.side0 < 0.0 -&& factors.side1 < 0.0 -&& factors.side2 < 0.0 -&& factors.side3 < 0.0; -} -bool sliceEnabled() { -return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; -} -bool sliceByPlane(vec3 pos) { -return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); -} -#define rejectBySlice(_pos_) sliceByPlane(_pos_) -#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=s`vec4 applySliceHighlight(vec4 color, vec3 pos) { -SliceFactors factors = calculateSliceFactors(pos); -const float HIGHLIGHT_WIDTH = 1.0; -const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); -factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); -factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); -factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); -factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); -factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); -if (sliceByFactors(factors)) { -return color; -} -float highlightFactor = (1.0 - step(0.5, factors.front)) -* (1.0 - step(0.5, factors.side0)) -* (1.0 - step(0.5, factors.side1)) -* (1.0 - step(0.5, factors.side2)) -* (1.0 - step(0.5, factors.side3)); -return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); -}`,a=t.hasSliceHighlight?s` - ${o} - #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) - `:s`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r).code.add(i),e.fragment.uniforms.add(...r).code.add(i),e.fragment.code.add(a)}function Pi(e,t,r){return e.instancedDoublePrecision?Y(Ga,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function Di(e,t){return e!=null?nt(Lt,t.origin,e):t.origin}function Fi(e,t,r){return e.hasSliceTranslatedView?t!=null?rr(Va,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function za(e,t,r){if(r.slicePlane==null)return Ke;const i=Pi(e,t,r),o=Di(i,r.slicePlane),a=Fi(e,i,r);return a!=null?mt(Lt,o,a):o}function Wr(e,t,r,i){if(i==null||r.slicePlane==null)return Ke;const o=Pi(e,t,r),a=Di(o,r.slicePlane),n=Fi(e,o,r);return n!=null?(Uo(tt,i,a),mt(Lt,a,n),mt(tt,tt,n),nt(tt,tt,Lt)):i}const Ga=I(),Lt=I(),tt=I(),Va=fr();function We(e){Ii(e),e.vertex.code.add(s`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { -vec4 eye = view * vec4(pos, 1.0); -depth = calculateLinearDepth(nearFar,eye.z); -return proj * eye; -}`),e.vertex.code.add(s`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { -return proj * (view * vec4(pos, 1.0)); -}`)}let Ha=class extends J{constructor(e,t){super(e,"mat4",R.Draw,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}};function gt(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",Ke):e.uniforms.add(new le("cameraPosition",(r,i)=>Y(Bi,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function je(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Ha("view",(i,o)=>rr(jr,o.camera.viewMatrix,i.origin)),new le("localOrigin",i=>i.origin));const r=i=>Y(Bi,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Xe("view",(i,o)=>rr(jr,o.camera.viewMatrix,r(o))),new q("localOrigin",(i,o)=>r(o)))}const jr=fr(),Bi=I();function Ua(e){e.uniforms.add(new Xe("viewNormal",(t,r)=>r.camera.viewInverseTransposeMatrix))}function Zl(e){e.uniforms.add(new ie("pixelRatio",(t,r)=>r.camera.pixelRatio/r.overlayStretch))}const $r=bt();function zi(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new Xe("model",a=>a.modelTransformation??Fr)),e.vertex.uniforms.add(new ue("normalLocalOriginFromModel",a=>(Qo($r,a.modelTransformation??Fr),$r)))),t.instanced&&i&&(e.attributes.add(p.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(p.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(p.INSTANCEMODEL,"mat3"),e.attributes.add(p.INSTANCEMODELNORMAL,"mat3"));const o=e.vertex;i&&(o.include(bi,t),o.uniforms.add(new le("viewOriginHi",(a,n)=>na(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)),new le("viewOriginLo",(a,n)=>sa(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)))),o.code.add(s` - vec3 getVertexInLocalOriginSpace() { - return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"}; - } - - vec3 subtractOrigin(vec3 _pos) { - ${i?s` - // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped - // working for macOS 14+ and iOS 17+. - // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 - vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); - return _pos - originDelta;`:"return vpos;"} - } - `),o.code.add(s` - vec3 dpNormal(vec4 _normal) { - return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); - } - `),t.output===F.Normal&&(Ua(o),o.code.add(s` - vec3 dpNormalView(vec4 _normal) { - return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); - } - `)),t.hasVertexTangents&&o.code.add(s` - vec4 dpTransformVertexTangent(vec4 _tangent) { - ${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} - }`)}const Ct=I();let gr=class extends J{constructor(e,t){super(e,"int",R.Pass,(r,i,o)=>r.setUniform1i(e,t(i,o)))}};function Gi(e,t){t.hasSymbolColors?(e.include(ca),e.attributes.add(p.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(s`int symbolColorMixMode; -vec4 getSymbolColor() { -return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; -} -void forwardColorMixMode() { -colorMixMode = float(symbolColorMixMode) + 0.5; -}`)):(e.fragment.uniforms.add(new gr("colorMixMode",r=>Aa[r.colorMixMode])),e.vertex.code.add(s`vec4 getSymbolColor() { return vec4(1.0); } -void forwardColorMixMode() {}`))}var K;function Ne(e,t){switch(t.textureCoordinateType){case K.Default:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`void forwardTextureCoordinates() { -vuv0 = uv0; -}`);case K.Compressed:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`vec2 getUV0() { -return uv0 / 16384.0; -} -void forwardTextureCoordinates() { -vuv0 = getUV0(); -}`);case K.Atlas:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(p.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(s`void forwardTextureCoordinates() { -vuv0 = uv0; -vuvRegion = uvRegion; -}`);default:zt(t.textureCoordinateType);case K.None:return void e.vertex.code.add(s`void forwardTextureCoordinates() {}`);case K.COUNT:return}}(function(e){e[e.None=0]="None",e[e.Default=1]="Default",e[e.Atlas=2]="Atlas",e[e.Compressed=3]="Compressed",e[e.COUNT=4]="COUNT"})(K||(K={}));function Vi(e,t){t.hasVertexColors?(e.attributes.add(p.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(s`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(s`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(s`void forwardVertexColor() {} -void forwardNormalizedVertexColor() {}`)}function Wa(e){e.vertex.code.add(s`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { -return absCosAngle * absCosAngle * absCosAngle; -}`),e.vertex.code.add(s`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { -return vec3( -min(params.x / (distanceToCamera - params.y), 1.0), -screenSizePerspectiveViewAngleDependentFactor(absCosAngle), -params.z -); -}`),e.vertex.code.add(s`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { -return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); -}`),e.vertex.code.add(s`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { -return applyScreenSizePerspectiveScaleFactorFloat( -size, -screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) -); -}`),e.vertex.code.add(s`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { -return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); -}`),e.vertex.code.add(s`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { -return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); -}`)}function Kl(e){e.uniforms.add(new q("screenSizePerspective",t=>Hi(t.screenSizePerspective)))}function ja(e){e.uniforms.add(new q("screenSizePerspectiveAlignment",t=>Hi(t.screenSizePerspectiveAlignment||t.screenSizePerspective)))}function Hi(e){return Y($a,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const $a=I();let te=class extends J{constructor(e,t){super(e,"vec4",R.Pass,(r,i,o)=>r.setUniform4fv(e,t(i,o)))}};function Ui(e,t){const r=e.vertex;t.hasVerticalOffset?(ka(r),t.hasScreenSizePerspective&&(e.include(Wa),ja(r),gt(e.vertex,t)),r.code.add(s` - vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { - float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); - ${t.spherical?s`vec3 worldNormal = normalize(worldPos + localOrigin);`:s`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} - ${t.hasScreenSizePerspective?s` - float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); - float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:s` - float verticalOffsetScreenHeight = verticalOffset.x;`} - // Screen sized offset in world space, used for example for line callouts - float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); - return worldNormal * worldOffset; - } - - vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { - return worldPos + calculateVerticalOffset(worldPos, localOrigin); - } - `)):r.code.add(s`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const qa=Ht();function ka(e){e.uniforms.add(new te("verticalOffset",(t,r)=>{const{minWorldLength:i,maxWorldLength:o,screenLength:a}=t.verticalOffset,n=Math.tan(.5*r.camera.fovY)/(.5*r.camera.fullViewport[3]),l=r.camera.pixelRatio||1;return oe(qa,a*l,n,i,o)}))}function Ya(e,t){if(t.output!==F.ObjectAndLayerIdColor)return e.vertex.code.add(s`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?p.INSTANCEOBJECTANDLAYERIDCOLOR:p.OBJECTANDLAYERIDCOLOR,"vec4"),e.vertex.code.add(s` - void forwardObjectAndLayerIdColor() { - objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451; - }`),e.fragment.code.add(s`void outputObjectAndLayerIdColor() { -fragColor = objectAndLayerIdColorVarying; -}`)}function Wi(e){e.code.add(s`const float MAX_RGBA4_FLOAT = -15.0 / 16.0 + -15.0 / 16.0 / 16.0 + -15.0 / 16.0 / 16.0 / 16.0 + -15.0 / 16.0 / 16.0 / 16.0 / 16.0; -const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); -vec4 floatToRgba4(const float value) { -float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); -vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); -const float toU4AsFloat = 1.0 / 15.0; -return fixedPointU4 * toU4AsFloat; -} -const vec4 RGBA4_2_FLOAT_FACTORS = vec4( -15.0 / (16.0), -15.0 / (16.0 * 16.0), -15.0 / (16.0 * 16.0 * 16.0), -15.0 / (16.0 * 16.0 * 16.0 * 16.0) -); -float rgba4ToFloat(vec4 rgba) { -return dot(rgba, RGBA4_2_FLOAT_FACTORS); -}`)}function Xa(e,t){switch(t.output){case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:e.fragment.include(Wi),e.fragment.code.add(s`float _calculateFragDepth(const in float depth) { -const float SLOPE_SCALE = 2.0; -const float BIAS = 20.0 * .000015259; -float m = max(abs(dFdx(depth)), abs(dFdy(depth))); -return depth + SLOPE_SCALE * m + BIAS; -} -void outputDepth(float _linearDepth) { -fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); -}`)}}let Ja=class extends J{constructor(e,t){super(e,"ivec2",R.Pass,(r,i,o)=>r.setUniform2iv(e,t(i,o)))}},X=class extends J{constructor(e,t){super(e,"sampler2D",R.Pass,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function ji(e,t){const{fragment:r}=e;t.output===F.Highlight?(r.uniforms.add(new X("depthTexture",(i,o)=>o.mainDepth),new X("highlightTexture",(i,o)=>o.highlightMixTexture),new gr("highlightLevel",(i,o)=>o.highlightLevel),new Ja("highlightMixOrigin",(i,o)=>o.highlightMixOrigin)),e.outputs.add("fragHighlight","vec2",0),r.code.add(s`vec2 getAccumulatedHighlight() { -return texelFetch(highlightTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg; -} -void outputHighlight(bool occluded) { -if (highlightLevel == 0) { -uint bits = occluded ? 3u : 1u; -fragHighlight = vec2(float(bits) / 255.0, 0.0); -} else { -int ll = (highlightLevel & 3) << 1; -int li = (highlightLevel >> 2) & 3; -uint bits; -if (occluded) { -bits = 3u << ll; -} else { -bits = 1u << ll; -} -vec2 combinedHighlight = getAccumulatedHighlight(); -uint accumulatedI = uint(combinedHighlight[li] * 255.0); -combinedHighlight[li] = float(bits | accumulatedI) / 255.0; -fragHighlight = combinedHighlight; -} -} -bool isHighlightOccluded() { -float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x; -return gl_FragCoord.z > sceneDepth + 5e-7; -} -void calculateOcclusionAndOutputHighlight() { -outputHighlight(isHighlightOccluded()); -}`),t.canHaveOverlay&&(r.constants.add("occlusionAndMask","int",85),r.code.add(s`void outputAllHighlights(vec2 highlightToAdd) { -if (highlightToAdd == vec2(0.0)) { discard; } -int occludedOrMask = isHighlightOccluded() ? 0xaa : 0; -ivec2 added = ivec2(highlightToAdd * 255.0); -ivec2 masked = (added & ivec2(occlusionAndMask)) | (ivec2(occludedOrMask) & (added<<1)); -fragHighlight = vec2(masked) / 255.0; -}`))):r.code.add(s`void calculateOcclusionAndOutputHighlight() {}`)}let Za=class extends J{constructor(e,t,r){super(e,"vec4",R.Pass,(i,o,a)=>i.setUniform4fv(e,t(o,a)),r)}},Ka=class extends J{constructor(e,t,r){super(e,"float",R.Pass,(i,o,a)=>i.setUniform1fv(e,t(o,a)),r)}};var qr,kr;(function(e){e[e.Undefined=0]="Undefined",e[e.DefinedSize=1]="DefinedSize",e[e.DefinedScale=2]="DefinedScale"})(qr||(qr={})),function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(kr||(kr={}));function Ql(e,t,r){if(!t.vvSize)return Y(e,1,1,1),e;for(let i=0;i<3;++i){const o=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=hr(o,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}const Xt=8;function lt(e,t){const{vertex:r,attributes:i}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&i.add(p.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new q("vvSizeMinSize",o=>o.vvSize.minSize)),r.uniforms.add(new q("vvSizeMaxSize",o=>o.vvSize.maxSize)),r.uniforms.add(new q("vvSizeOffset",o=>o.vvSize.offset)),r.uniforms.add(new q("vvSizeFactor",o=>o.vvSize.factor)),r.uniforms.add(new ue("vvSymbolRotationMatrix",o=>o.vvSymbolRotationMatrix)),r.uniforms.add(new q("vvSymbolAnchor",o=>o.vvSymbolAnchor)),r.code.add(s`vec3 vvScale(vec4 _featureAttribute) { -return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); -} -vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { -return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); -}`),r.code.add(s` - const float eps = 1.192092896e-07; - vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { - vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); - return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); - } - - ${t.hasVvInstancing?s` - vec4 vvLocalNormal(vec3 _normal) { - return vvTransformNormal(_normal, instanceFeatureAttribute); - } - - vec4 localPosition() { - return vvTransformPosition(position, instanceFeatureAttribute); - }`:""} - `)):r.code.add(s`vec4 localPosition() { return vec4(position, 1.0); } -vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",Xt),r.uniforms.add(new Ka("vvColorValues",o=>o.vvColor.values,Xt),new Za("vvColorColors",o=>o.vvColor.colors,Xt)),r.code.add(s` - vec4 interpolateVVColor(float value) { - if (value <= vvColorValues[0]) { - return vvColorColors[0]; - } - - for (int i = 1; i < vvColorNumber; ++i) { - if (vvColorValues[i] >= value) { - float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); - return mix(vvColorColors[i-1], vvColorColors[i], f); - } - } - return vvColorColors[vvColorNumber - 1]; - } - - vec4 vvGetColor(vec4 featureAttribute) { - return interpolateVVColor(featureAttribute.y); - } - - ${t.hasVvInstancing?s` - vec4 vvColor() { - return vvGetColor(instanceFeatureAttribute); - }`:"vec4 vvColor() { return vec4(1.0); }"} - `)):r.code.add(s`vec4 vvColor() { return vec4(1.0); }`)}function $e(e,t){Qa(e,t,new ie("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function Qa(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case ge.Blend:e.fragment.code.add(s` - #define discardOrAdjustAlpha(color) { if (color.a < ${s.float(be)}) { discard; } } - `);break;case ge.Opaque:i.code.add(s`void discardOrAdjustAlpha(inout vec4 color) { -color.a = 1.0; -}`);break;case ge.Mask:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case ge.MaskBlend:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function $i(e,t){const{vertex:r,fragment:i}=e,o=t.hasColorTexture&&t.alphaDiscardMode!==ge.Opaque,{output:a,normalType:n,hasColorTextureTransform:l}=t;switch(a){case F.Depth:je(r,t),e.include(We,t),e.include(Ue,t),e.include(Ne,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPosition(proj, view, vpos); -forwardTextureCoordinates();`),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)}`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:case F.ObjectAndLayerIdColor:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),e.include(Xa,t),e.include(Ue,t),e.include(Ya,t),Ri(e),e.varyings.add("depth","float"),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); -forwardTextureCoordinates(); -forwardObjectAndLayerIdColor();`),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - ${a===F.ObjectAndLayerIdColor?s`outputObjectAndLayerIdColor();`:s`outputDepth(depth);`}`);break;case F.Normal:{je(r,t),e.include(We,t),e.include(Bt,t),e.include(Si,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",u=>u.texture)),n===Q.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const c=n===Q.Attribute||n===Q.Compressed;r.main.add(s` - vpos = getVertexInLocalOriginSpace(); - ${c?s`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:s`vPositionView = (view * vec4(vpos, 1.0)).xyz;`} - vpos = subtractOrigin(vpos); - vpos = addVerticalOffset(vpos, localOrigin); - gl_Position = transformPosition(proj, view, vpos); - forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - - ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionView);`:s`vec3 normal = normalize(vNormalWorld); - if (gl_FrontFacing == false){ - normal = -normal; - }`} - fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case F.Highlight:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); -vpos = subtractOrigin(vpos); -vpos = addVerticalOffset(vpos, localOrigin); -gl_Position = transformPosition(proj, view, vpos); -forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),e.include(ji,t),i.main.add(s` - discardBySlice(vpos); - ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); - discardOrAdjustAlpha(texColor);`)} - calculateOcclusionAndOutputHighlight();`)}}function en(e){e.fragment.code.add(s`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) { -vec2 atlasScale = atlasRegion.zw - atlasRegion.xy; -vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy; -float maxdUV = 0.125; -vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale; -vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale; -return textureGrad(tex, uvAtlas, dUVdx, dUVdy); -}`)}function xr(e,t){const{textureCoordinateType:r}=t;if(r===K.None||r===K.COUNT)return;e.include(Ne,t);const i=r===K.Atlas;i&&e.include(en),e.fragment.code.add(s` - vec4 textureLookup(sampler2D tex, vec2 uv) { - return ${i?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"}; - } - `)}function tn(e,t){const r=e.fragment;switch(r.code.add(s`struct ShadingNormalParameters { -vec3 normalView; -vec3 viewDirection; -} shadingParams;`),t.doubleSidedMode){case re.None:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return normalize(params.normalView); -}`);break;case re.View:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); -}`);break;case re.WindingOrder:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { -return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); -}`);break;default:zt(t.doubleSidedMode);case re.COUNT:}}var re;(function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.WindingOrder=2]="WindingOrder",e[e.COUNT=3]="COUNT"})(re||(re={}));function rn(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(p.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===re.WindingOrder?r.code.add(s`mat3 computeTangentSpace(vec3 normal) { -float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; -vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); -vec3 bitangent = cross(normal, tangent) * tangentHeadedness; -return mat3(tangent, bitangent, normal); -}`):r.code.add(s`mat3 computeTangentSpace(vec3 normal) { -float tangentHeadedness = vTangent.w; -vec3 tangent = normalize(vTangent.xyz); -vec3 bitangent = cross(normal, tangent) * tangentHeadedness; -return mat3(tangent, bitangent, normal); -}`)):r.code.add(s`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { -vec3 Q1 = dFdx(pos); -vec3 Q2 = dFdy(pos); -vec2 stx = dFdx(st); -vec2 sty = dFdy(st); -float det = stx.t * sty.s - sty.t * stx.s; -vec3 T = stx.t * Q2 - sty.t * Q1; -T = T - normal * dot(normal, T); -T *= inversesqrt(max(dot(T,T), 1.e-10)); -vec3 B = sign(det) * cross(normal, T); -return mat3(T, B, normal); -}`),t.textureCoordinateType!==K.None&&(e.include(xr,t),r.uniforms.add(t.bindType===R.Pass?new X("normalTexture",i=>i.textureNormal):new pt("normalTexture",i=>i.textureNormal)),t.hasNormalTextureTransform&&(r.uniforms.add(new Ze("scale",i=>i.scale??la)),r.uniforms.add(new ue("normalTextureTransformMatrix",i=>i.normalTextureTransformMatrix??et))),r.code.add(s`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { -vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(s`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0, -normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0, -0.0, 0.0, 0.0 ); -rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s`return tangentSpace * rawNormal; -}`))}var or,ct;(function(e){e.OPAQUE="opaque-color",e.TRANSPARENT="transparent-color",e.COMPOSITE="composite-color",e.FINAL="final-color"})(or||(or={})),function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color"}(ct||(ct={}));var qe,Yr;(function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"})(qe||(qe={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(Yr||(Yr={}));let Ge=class extends li{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=or.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([ci(()=>this.view.ready,e=>{e&&this.view._stage?.renderer.addRenderNode(this)},xo)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Te("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===Qt.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view._stage.renderView.renderingContext}get renderContext(){return this.view._stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:t})=>t===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};m([z({constructOnly:!0})],Ge.prototype,"view",void 0),m([z({constructOnly:!0})],Ge.prototype,"consumes",void 0),m([z()],Ge.prototype,"produces",void 0),Ge=m([ur("esri.views.3d.webgl.RenderNode")],Ge);const on=Ge,an=3e5,Xr=5e5;function qi(e,t=!0){e.attributes.add(p.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(s` - gl_Position = vec4(position, 0.0, 1.0); - ${t?s`uv = position * 0.5 + vec2(0.5);`:""} - `)}function _r(e){e.uniforms.add(new Ze("zProjectionMap",(t,r)=>nn(r.camera))),e.code.add(s`float linearizeDepth(float depth) { -float depthNdc = depth * 2.0 - 1.0; -float c1 = zProjectionMap[0]; -float c2 = zProjectionMap[1]; -return -(c1 / (depthNdc + c2 + 1e-7)); -}`),e.code.add(s`float depthFromTexture(sampler2D depthTexture, vec2 uv) { -ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); -float depth = texelFetch(depthTexture, iuv, 0).r; -return depth; -}`),e.code.add(s`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) { -return linearizeDepth(depthFromTexture(depthTexture, uv)); -}`)}function nn(e){const t=e.projectionMatrix;return Pe(sn,t[14],t[10])}const sn=Ut();let ln=class extends J{constructor(e,t){super(e,"vec2",R.Draw,(r,i,o,a)=>r.setUniform2fv(e,t(i,o,a)))}};const cn=()=>hi.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let ki=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},jt=class extends ki{constructor(){super(...arguments),this.vertex=new Jr,this.fragment=new Jr,this.attributes=new mn,this.varyings=new fn,this.extensions=new ar,this.outputs=new sr}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),l=o.main.generateSource(),c=e==="vertex"?gn:vn,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es -${t.join(` -`)} - -${c} - -${u.join(` -`)} - -${a.join(` -`)} - -${r.join(` -`)} - -${i.join(` -`)} - -${d.join(` -`)} - -${n.join(` -`)} - -${l.join(` -`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a)=>{for(let n=0;n{const a=o.bind[R.Draw];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Draw];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a,n)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},un=class{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() { - ${this._bodies.join(` -`)||""} -}`];throw new Te("Shader does not contain main function body.")}},hn=class{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}},Jr=class extends ki{constructor(){super(...arguments),this.uniforms=new dn(this),this.main=new un(this),this.code=new hn(this),this.constants=new pn(this)}get builder(){return this}},mn=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},fn=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&W(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push(e==="vertex"?`out ${r} ${i};`:`in ${r} ${i};`)),t}},ar=class nr{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const r=t==="vertex"?nr.ALLOWLIST_VERTEX:nr.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>r.includes(i)).map(i=>`#extension ${i} : enable`)}};ar.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],ar.ALLOWLIST_VERTEX=[];let sr=class lr{constructor(){this._entries=new Map}add(t,r,i=0){const o=this._entries.get(i);o?W(o.name===t&&o.type===r,`Fragment shader output location ${i} occupied`):this._entries.set(i,{name:t,type:r})}generateSource(t){if(t==="vertex")return[];this._entries.size===0&&this._entries.set(0,{name:lr.DEFAULT_NAME,type:lr.DEFAULT_TYPE});const r=new Array;return this._entries.forEach((i,o)=>r.push(`layout(location = ${o}) out ${i.type} ${i.name};`)),r}};sr.DEFAULT_TYPE="vec4",sr.DEFAULT_NAME="fragColor";let pn=class j{constructor(t){this._stage=t,this._entries=new Set}add(t,r,i){let o="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":o=j._numberToFloatStr(i);break;case"int":o=j._numberToIntStr(i);break;case"bool":o=i.toString();break;case"vec2":o=`vec2(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])})`;break;case"vec3":o=`vec3(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])})`;break;case"vec4":o=`vec4(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])}, ${j._numberToFloatStr(i[3])})`;break;case"ivec2":o=`ivec2(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])})`;break;case"ivec3":o=`ivec3(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])})`;break;case"ivec4":o=`ivec4(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])}, ${j._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${r}(${Array.prototype.map.call(i,a=>j._numberToFloatStr(a)).join(", ")})`}return this._entries.add(`const ${r} ${t} = ${o};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};const vn=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp sampler2D; -#else - precision mediump float; - precision mediump sampler2D; -#endif`,gn=`precision highp float; -precision highp sampler2D;`,Jt=4;function xn(){const e=new jt,t=e.fragment;e.include(qi);const r=(Jt+1)/2,i=1/(2*r*r);return t.include(_r),t.uniforms.add(new X("depthMap",o=>o.depthTexture),new pt("tex",o=>o.colorTexture),new ln("blurSize",o=>o.blurSize),new ie("projScale",(o,a)=>{const n=a.camera.distance;return n>5e4?Math.max(0,o.projScale-(n-5e4)):o.projScale})),t.code.add(s` - void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { - float c = texture(tex, uv).r; - float d = linearDepthFromTexture(depthMap, uv); - - float ddiff = d - center_d; - - float w = exp(-r * r * ${s.float(i)} - ddiff * ddiff * sharpness); - wTotal += w; - bTotal += w * c; - } - `),e.outputs.add("fragBlur","float"),t.main.add(s` - float b = 0.0; - float w_total = 0.0; - - float center_d = linearDepthFromTexture(depthMap, uv); - - float sharpness = -0.05 * projScale / center_d; - for (int r = -${s.int(Jt)}; r <= ${s.int(Jt)}; ++r) { - float rf = float(r); - vec2 uvOffset = uv + rf * blurSize; - blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); - } - fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { -return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); -}`)}function wn(e){const t=e.projectionMatrix;return t[11]===0?oe(Kr,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):oe(Kr,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}const Kr=Ht();function Mn(e){return e.projectionMatrix[11]===0?Pe(Qr,0,1):Pe(Qr,1,0)}const Qr=Ut(),ei=16;function On(){const e=new jt,t=e.fragment;return e.include(qi),e.include(Cn),t.include(_r),t.uniforms.add(new ie("radius",(r,i)=>Tr(i.camera))).code.add(s`vec3 sphere[16] = vec3[16]( -vec3(0.186937, 0.0, 0.0), -vec3(0.700542, 0.0, 0.0), -vec3(-0.864858, -0.481795, -0.111713), -vec3(-0.624773, 0.102853, -0.730153), -vec3(-0.387172, 0.260319, 0.007229), -vec3(-0.222367, -0.642631, -0.707697), -vec3(-0.01336, -0.014956, 0.169662), -vec3(0.122575, 0.1544, -0.456944), -vec3(-0.177141, 0.85997, -0.42346), -vec3(-0.131631, 0.814545, 0.524355), -vec3(-0.779469, 0.007991, 0.624833), -vec3(0.308092, 0.209288,0.35969), -vec3(0.359331, -0.184533, -0.377458), -vec3(0.192633, -0.482999, -0.065284), -vec3(0.233538, 0.293706, -0.055139), -vec3(0.417709, -0.386701, 0.442449) -); -float fallOffFunction(float vv, float vn, float bias) { -float f = max(radius * radius - vv, 0.0); -return f * f * f * max(vn - bias, 0.0); -}`),t.code.add(s`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { -vec3 v = Q - C; -float vv = dot(v, v); -float vn = dot(normalize(v), n_C); -return fallOffFunction(vv, vn, 0.1); -}`),t.uniforms.add(new X("normalMap",r=>r.normalTexture),new X("depthMap",r=>r.depthTexture),new ie("projScale",r=>r.projScale),new X("rnm",r=>r.noiseTexture),new Ze("rnmScale",(r,i)=>Pe(ti,i.camera.fullWidth/r.noiseTexture.descriptor.width,i.camera.fullHeight/r.noiseTexture.descriptor.height)),new ie("intensity",r=>r.intensity),new Ze("screenSize",(r,i)=>Pe(ti,i.camera.fullWidth,i.camera.fullHeight))),e.outputs.add("fragOcclusion","float"),t.main.add(s` - float depth = depthFromTexture(depthMap, uv); - - // Early out if depth is out of range, such as in the sky - if (depth >= 1.0 || depth <= 0.0) { - fragOcclusion = 1.0; - return; - } - - // get the normal of current fragment - vec4 norm4 = texture(normalMap, uv); - if(norm4.a != 1.0) { - fragOcclusion = 1.0; - return; - } - vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; - - float currentPixelDepth = linearizeDepth(depth); - vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); - - float sum = 0.0; - vec3 tapPixelPos; - - vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); - - // note: the factor 2.0 should not be necessary, but makes ssao much nicer. - // bug or deviation from CE somewhere else? - float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); - - for(int i = 0; i < ${s.int(ei)}; ++i) { - vec2 unitOffset = reflect(sphere[i], fres).xy; - vec2 offset = vec2(-unitOffset * radius * ps); - - // don't use current or very nearby samples - if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ - continue; - } - - vec2 tc = vec2(gl_FragCoord.xy + offset); - if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; - vec2 tcTap = tc / screenSize; - float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap); - - tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); - - sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); - } - - // output the result - float A = max(1.0 - sum * intensity / float(${s.int(ei)}), 0.0); - - // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 - A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2; - - fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { -vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); -return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; -} -float evaluateAmbientOcclusion() { -return 1.0 - evaluateAmbientOcclusionInverse(); -}`)):r.code.add(s`float evaluateAmbientOcclusionInverse() { return 1.0; } -float evaluateAmbientOcclusion() { return 0.0; }`)}let In=class{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}acquireTechnique(e,t){return this._techniques.acquire(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return er.LOADED}},Ln=class extends In{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,t=>this._texture=t),this._acquire(e.normalTextureId,t=>this._textureNormal=t),this._acquire(e.emissiveTextureId,t=>this._textureEmissive=t),this._acquire(e.occlusionTextureId,t=>this._textureOcclusion=t),this._acquire(e.metallicRoughnessTextureId,t=>this._textureMetallicRoughness=t)}dispose(){super.dispose(),this._texture=Oe(this._texture),this._textureNormal=Oe(this._textureNormal),this._textureEmissive=Oe(this._textureEmissive),this._textureOcclusion=Oe(this._textureOcclusion),this._textureMetallicRoughness=Oe(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?er.LOADED:er.LOADING}get textureBindParameters(){return new Pn(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=Oe(this._texture),this._textureId=e,this._acquire(this._textureId,t=>this._texture=t))}_acquire(e,t){if(e==null)return void t(null);const r=this._textures.acquire(e);if(Eo(r))return++this._numLoading,void r.then(i=>{if(this._disposed)return Oe(i),void t(null);t(i)}).finally(()=>--this._numLoading);t(r)}},Nn=class extends Qe{constructor(e=null){super(),this.textureEmissive=e}},Pn=class extends Nn{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}};var N;(function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"})(N||(N={}));function Yi(e,t){const r=t.pbrMode,i=e.fragment;if(r!==N.Schematic&&r!==N.Disabled&&r!==N.Normal)return void i.code.add(s`void applyPBRFactors() {}`);if(r===N.Disabled)return void i.code.add(s`void applyPBRFactors() {} -float getBakedOcclusion() { return 1.0; }`);if(r===N.Schematic)return void i.code.add(s`vec3 mrr = vec3(0.0, 0.6, 0.2); -float occlusion = 1.0; -void applyPBRFactors() {} -float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:o,hasMetallicRoughnessTextureTransform:a,hasOcclusionTexture:n,hasOcclusionTextureTransform:l,bindType:c}=t;(o||n)&&e.include(xr,t),i.code.add(s`vec3 mrr; -float occlusion;`),o&&i.uniforms.add(c===R.Pass?new X("texMetallicRoughness",u=>u.textureMetallicRoughness):new pt("texMetallicRoughness",u=>u.textureMetallicRoughness)),n&&i.uniforms.add(c===R.Pass?new X("texOcclusion",u=>u.textureOcclusion):new pt("texOcclusion",u=>u.textureOcclusion)),i.uniforms.add(c===R.Pass?new q("mrrFactors",u=>u.mrrFactors):new le("mrrFactors",u=>u.mrrFactors)),i.code.add(s` - ${y(o,s`void applyMetallicRoughness(vec2 uv) { - vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; - mrr[0] *= metallicRoughness.b; - mrr[1] *= metallicRoughness.g; - }`)} - - ${y(n,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")} - - float getBakedOcclusion() { - return ${n?"occlusion":"1.0"}; - } - - void applyPBRFactors() { - mrr = mrrFactors; - occlusion = 1.0; - - ${y(o,`applyMetallicRoughness(${a?"metallicRoughnessUV":"vuv0"});`)} - ${y(n,`applyOcclusion(${l?"occlusionUV":"vuv0"});`)} - } - `)}function Dn(e,t){const r=e.fragment,i=t.lightingSphericalHarmonicsOrder!==void 0?t.lightingSphericalHarmonicsOrder:2;i===0?(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec3 ambientLight = 0.282095 * lightingAmbientSH0; -return ambientLight * (1.0 - ambientOcclusion); -}`)):i===1?(r.uniforms.add(new te("lightingAmbientSH_R",(o,a)=>oe(me,a.lighting.sh.r[0],a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3])),new te("lightingAmbientSH_G",(o,a)=>oe(me,a.lighting.sh.g[0],a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3])),new te("lightingAmbientSH_B",(o,a)=>oe(me,a.lighting.sh.b[0],a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec4 sh0 = vec4( -0.282095, -0.488603 * normal.x, -0.488603 * normal.z, -0.488603 * normal.y -); -vec3 ambientLight = vec3( -dot(lightingAmbientSH_R, sh0), -dot(lightingAmbientSH_G, sh0), -dot(lightingAmbientSH_B, sh0) -); -return ambientLight * (1.0 - ambientOcclusion); -}`)):i===2&&(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0])),new te("lightingAmbientSH_R1",(o,a)=>oe(me,a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3],a.lighting.sh.r[4])),new te("lightingAmbientSH_G1",(o,a)=>oe(me,a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3],a.lighting.sh.g[4])),new te("lightingAmbientSH_B1",(o,a)=>oe(me,a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3],a.lighting.sh.b[4])),new te("lightingAmbientSH_R2",(o,a)=>oe(me,a.lighting.sh.r[5],a.lighting.sh.r[6],a.lighting.sh.r[7],a.lighting.sh.r[8])),new te("lightingAmbientSH_G2",(o,a)=>oe(me,a.lighting.sh.g[5],a.lighting.sh.g[6],a.lighting.sh.g[7],a.lighting.sh.g[8])),new te("lightingAmbientSH_B2",(o,a)=>oe(me,a.lighting.sh.b[5],a.lighting.sh.b[6],a.lighting.sh.b[7],a.lighting.sh.b[8]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { -vec3 ambientLight = 0.282095 * lightingAmbientSH0; -vec4 sh1 = vec4( -0.488603 * normal.x, -0.488603 * normal.z, -0.488603 * normal.y, -1.092548 * normal.x * normal.y -); -vec4 sh2 = vec4( -1.092548 * normal.y * normal.z, -0.315392 * (3.0 * normal.z * normal.z - 1.0), -1.092548 * normal.x * normal.z, -0.546274 * (normal.x * normal.x - normal.y * normal.y) -); -ambientLight += vec3( -dot(lightingAmbientSH_R1, sh1), -dot(lightingAmbientSH_G1, sh1), -dot(lightingAmbientSH_B1, sh1) -); -ambientLight += vec3( -dot(lightingAmbientSH_R2, sh2), -dot(lightingAmbientSH_G2, sh2), -dot(lightingAmbientSH_B2, sh2) -); -return ambientLight * (1.0 - ambientOcclusion); -}`),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||r.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); -vec3 calculateAmbientRadiance(float ambientOcclusion) -{ -vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; -return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; -}`))}const ii=I(),me=Ht();function Nt(e){e.uniforms.add(new q("mainLightDirection",(t,r)=>r.lighting.mainLight.direction))}function xt(e){e.uniforms.add(new q("mainLightIntensity",(t,r)=>r.lighting.mainLight.intensity))}function Fn(e){Nt(e.fragment),xt(e.fragment),e.fragment.code.add(s`vec3 applyShading(vec3 shadingNormalWorld, float shadow) { -float dotVal = clamp(dot(shadingNormalWorld, mainLightDirection), 0.0, 1.0); -return mainLightIntensity * ((1.0 - shadow) * dotVal); -}`)}function Bn(e){const t=e.fragment.code;t.add(s`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) -{ -return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; -}`),t.add(s`float integratedRadiance(float cosTheta2, float roughness) -{ -return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); -}`),t.add(s`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) -{ -float cosTheta2 = 1.0 - RdotNG * RdotNG; -float intRadTheta = integratedRadiance(cosTheta2, roughness); -float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; -float sky = 2.0 - ground; -return (ground * ambientGround + sky * ambientSky) * 0.5; -}`)}function Xi(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}function Er(e,t){const r=e.fragment.code;e.include(Xi),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic&&t.pbrMode!==N.Simplified&&t.pbrMode!==N.TerrainWithWater||(r.add(s`float normalDistribution(float NdotH, float roughness) -{ -float a = NdotH * roughness; -float b = roughness / (1.0 - NdotH * NdotH + a * a); -return b * b * INV_PI; -}`),r.add(s`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); -const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); -const vec2 c2 = vec2(-1.04, 1.04); -vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { -vec4 r = roughness * c0 + c1; -float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; -return c2 * a004 + r.zw; -}`)),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||(e.include(Bn),r.add(s`struct PBRShadingInfo -{ -float NdotV; -float LdotH; -float NdotNG; -float RdotNG; -float NdotAmbDir; -float NdotH_Horizon; -vec3 skyRadianceToSurface; -vec3 groundRadianceToSurface; -vec3 skyIrradianceToSurface; -vec3 groundIrradianceToSurface; -float averageAmbientRadiance; -float ssao; -vec3 albedoLinear; -vec3 f0; -vec3 f90; -vec3 diffuseColor; -float metalness; -float roughness; -};`),r.add(s`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { -vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); -vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); -vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; -vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); -vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; -vec3 specularComponent = specularColor * indirectSpecular; -return (diffuseComponent + specularComponent); -}`),r.add(s`float gamutMapChanel(float x, vec2 p){ -return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); -}`),r.add(s`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ -vec3 outColor; -vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); -outColor.x = gamutMapChanel(inColor.x, p) ; -outColor.y = gamutMapChanel(inColor.y, p) ; -outColor.z = gamutMapChanel(inColor.z, p) ; -return outColor; -}`))}let zn=class extends J{constructor(e,t){super(e,"bool",R.Pass,(r,i,o)=>r.setUniform1b(e,t(i,o)))}};const Gn=.4;function Sr(e){e.constants.add("ambientBoostFactor","float",Gn)}function Ar(e){e.uniforms.add(new ie("lightingGlobalFactor",(t,r)=>r.lighting.globalFactor))}function Ji(e,t){const r=e.fragment;switch(e.include(br,t),t.pbrMode!==N.Disabled&&e.include(Er,t),e.include(Dn,t),e.include(Xi),r.code.add(s` - const float GAMMA_SRGB = 2.1; - const float INV_GAMMA_SRGB = 0.4761904; - ${t.pbrMode===N.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} - `),Sr(r),Ar(r),Nt(r),r.code.add(s` - float additionalDirectedAmbientLight(vec3 vPosWorld) { - float vndl = dot(${t.spherical?s`normalize(vPosWorld)`:s`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); - return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); - } - `),xt(r),r.code.add(s`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { -float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); -return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; -}`),t.pbrMode){case N.Disabled:case N.WaterOnIntegratedMesh:case N.Water:e.include(Fn),r.code.add(s`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) { -vec3 mainLighting = applyShading(normalWorld, shadow); -vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); -vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); -vec3 totalLight = mainLighting + ambientLighting + additionalLight; -totalLight = min(totalLight, vec3(PI)); -vec3 outColor = vec3((albedoLinear / PI) * totalLight); -return pow(outColor, vec3(INV_GAMMA_SRGB)); -}`);break;case N.Normal:case N.Schematic:r.code.add(s`const float fillLightIntensity = 0.25; -const float horizonLightDiffusion = 0.4; -const float additionalAmbientIrradianceFactor = 0.02; -vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec4 _emission, float additionalAmbientIrradiance) -{ -vec3 viewDirection = -viewDir; -vec3 h = normalize(viewDirection + mainLightDirection); -PBRShadingInfo inputs; -inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); -inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); -vec3 reflectedView = normalize(reflect(viewDirection, normal)); -inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); -inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); -inputs.ssao = ssao; -inputs.metalness = mrr[0]; -inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(s`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; -inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); -inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new zn("hasFillLights",(i,o)=>o.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(s`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); -ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); -inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; -float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); -vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity; -vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; -vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; -inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; -inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new ie("lightingSpecularStrength",(i,o)=>o.lighting.mainLight.specularStrength),new ie("lightingEnvironmentStrength",(i,o)=>o.lighting.mainLight.environmentStrength)).code.add(s`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; -vec3 horizonRingH = normalize(viewDirection + horizonRingDir); -inputs.NdotH_Horizon = dot(normal, horizonRingH); -float NdotH = clamp(dot(normal, h), 0.0, 1.0); -vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); -vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; -vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; -float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); -inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; -inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; -inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(s` - vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); - vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; - vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : pow(_emission.rgb, vec3(GAMMA_SRGB)); - vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; - ${t.pbrMode!==N.Schematic||t.hasColorTexture?s`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:s`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} - return outColor; - } - `);break;case N.Simplified:case N.TerrainWithWater:Nt(r),xt(r),r.code.add(s`const float roughnessTerrain = 0.5; -const float specularityTerrain = 0.5; -const vec3 fresnelReflectionTerrain = vec3(0.04); -vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { -vec3 viewDirection = -vd; -vec3 h = normalize(viewDirection + mainLightDirection); -float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); -float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); -float NdotH = clamp(dot(n, h), 0.0, 1.0); -float NdotNG = clamp(dot(n, nup), -1.0, 1.0); -vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); -float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; -vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; -vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); -vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; -vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; -vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; -vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; -vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; -vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; -vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); -vec3 specularColor = f0 * dfg.x + f90 * dfg.y; -vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; -vec3 outColorLinear = outDiffColor + specularComponent; -vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); -return outColor; -}`);break;default:zt(t.pbrMode);case N.COUNT:}}let Vn=class extends J{constructor(e,t,r){super(e,"mat4",R.Draw,(i,o,a,n)=>i.setUniformMatrix4fv(e,t(o,a,n)),r)}},Hn=class extends J{constructor(e,t,r){super(e,"mat4",R.Pass,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a)),r)}};function Zi(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Hn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Ki(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Vn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Qi(e){const t=e.fragment;t.include(Wi),t.uniforms.add(new X("shadowMap",(r,i)=>i.shadowMap.depthTexture),new gr("numCascades",(r,i)=>i.shadowMap.numCascades),new te("cascadeDistances",(r,i)=>i.shadowMap.cascadeDistances)).code.add(s`int chooseCascade(float depth, out mat4 mat) { -vec4 distance = cascadeDistances; -int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; -mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; -return i; -} -vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { -vec4 lv = mat * vec4(_vpos, 1.0); -lv.xy /= lv.w; -return 0.5 * lv.xyz + vec3(0.5); -} -vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { -float xScale = float(textureSize.y) / float(textureSize.x); -return vec2((float(i) + lvpos.x) * xScale, lvpos.y); -} -float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { -return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); -} -float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { -return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; -} -float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { -vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); -ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); -float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); -float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); -float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); -float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); -return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); -} -float readShadowMap(const in vec3 _vpos, float _linearDepth) { -mat4 mat; -int i = chooseCascade(_linearDepth, mat); -if (i >= numCascades) { return 0.0; } -vec3 lvpos = lightSpacePosition(_vpos, mat); -if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } -ivec2 size = textureSize(shadowMap, 0); -vec2 uv = cascadeCoordinates(i, size, lvpos); -return filterShadow(uv, lvpos, size, shadowMap); -}`)}function eo(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:i}){r?(e.fragment.include(_r),e.fragment.uniforms.add(new X("terrainDepthTexture",(o,a)=>a.terrainDepth?.attachment)).code.add(s` - ${t?"bool":"void"} terrainDepthTest(float fragmentDepth) { - float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r; - float linearDepth = linearizeDepth(depth); - ${t?s`return fragmentDepth < linearDepth && depth < 1.0;`:s`if(fragmentDepth ${i?">":"<="} linearDepth) discard;`} - }`)):t?e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) false`):e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) {}`)}function Un(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new ue("colorTextureTransformMatrix",r=>r.colorTextureTransformMatrix??et)).code.add(s`void forwardColorUV(){ -colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardColorUV(){}`)}function Wn(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new ue("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??et)).code.add(s`void forwardNormalUV(){ -normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardNormalUV(){}`)}function jn(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new ue("emissiveTextureTransformMatrix",r=>r.emissiveTextureTransformMatrix??et)).code.add(s`void forwardEmissiveUV(){ -emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardEmissiveUV(){}`)}function $n(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new ue("occlusionTextureTransformMatrix",r=>r.occlusionTextureTransformMatrix??et)).code.add(s`void forwardOcclusionUV(){ -occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardOcclusionUV(){}`)}function qn(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new ue("metallicRoughnessTextureTransformMatrix",r=>r.metallicRoughnessTextureTransformMatrix??et)).code.add(s`void forwardMetallicRoughnessUV(){ -metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; -}`)):e.vertex.code.add(s`void forwardMetallicRoughnessUV(){}`)}function to(e){e.code.add(s`vec4 premultiplyAlpha(vec4 v) { -return vec4(v.rgb * v.a, v.a); -} -vec3 rgb2hsv(vec3 c) { -vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); -vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); -float d = q.x - min(q.w, q.y); -float e = 1.0e-10; -return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); -} -vec3 hsv2rgb(vec3 c) { -vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); -return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} -float rgb2v(vec3 c) { -return max(c.x, max(c.y, c.z)); -}`)}function ro(e){e.include(to),e.code.add(s` - vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { - // workaround for artifacts in macOS using Intel Iris Pro - // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 - vec3 internalMixed = internalColor * textureColor; - vec3 allMixed = internalMixed * externalColor; - - if (mode == ${s.int(fe.Multiply)}) { - return allMixed; - } - if (mode == ${s.int(fe.Ignore)}) { - return internalMixed; - } - if (mode == ${s.int(fe.Replace)}) { - return externalColor; - } - - // tint (or something invalid) - float vIn = rgb2v(internalMixed); - vec3 hsvTint = rgb2hsv(externalColor); - vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); - return hsv2rgb(hsvOut); - } - - float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { - // workaround for artifacts in macOS using Intel Iris Pro - // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 - float internalMixed = internalOpacity * textureOpacity; - float allMixed = internalMixed * externalOpacity; - - if (mode == ${s.int(fe.Ignore)}) { - return internalMixed; - } - if (mode == ${s.int(fe.Replace)}) { - return externalOpacity; - } - - // multiply or tint (or something invalid) - return allMixed; - } - `)}var se;(function(e){e[e.None=0]="None",e[e.Value=1]="Value",e[e.Texture=2]="Texture",e[e.COUNT=3]="COUNT"})(se||(se={}));function kn(e,t){if(!ft(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:i,bindType:o}=t,a=r===se.Texture;a&&(e.include(xr,t),e.fragment.uniforms.add(o===R.Pass?new X("texEmission",l=>l.textureEmissive):new pt("texEmission",l=>l.textureEmissive)));const n=r===se.Value||a;n&&e.fragment.uniforms.add(o===R.Pass?new q("emissionFactor",l=>l.emissiveFactor):new le("emissionFactor",l=>l.emissiveFactor)),e.fragment.code.add(s` - vec4 getEmissions() { - vec4 emissions = ${n?"vec4(emissionFactor, 1.0)":"vec4(0.0)"}; - ${y(a,`emissions *= textureLookup(texEmission, ${i?"emissiveUV":"vuv0"}); - emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}; - return emissions; - } - `)}function io(e,t){e.include(ji,t),e.include(kn,t),e.fragment.include(to);const r=t.output===F.ObjectAndLayerIdColor,i=vi(t.output),o=ft(t.output)&&t.oitPass===k.ColorAlpha,a=ft(t.output)&&t.oitPass!==k.ColorAlpha,n=t.discardInvisibleFragments;let l=0;(a||i||o)&&e.outputs.add("fragColor","vec4",l++),i&&e.outputs.add("fragEmission","vec4",l++),o&&e.outputs.add("fragAlpha","float",l++),e.fragment.code.add(s` - void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) { - ${y(r,s`finalColor.a = 1.0;`)} - - ${y(n,s`if (finalColor.a < ${s.float(be)}){ - discard; - return; - }`)} - - finalColor = highlightSlice(finalColor, vWorldPosition); - ${y(o,s`fragColor = premultiplyAlpha(finalColor); - fragAlpha = finalColor.a;`)} - ${y(a,"fragColor = finalColor;")} - ${y(i,"fragEmission = getEmissions();")} - calculateOcclusionAndOutputHighlight(); - ${y(r,"outputObjectAndLayerIdColor();")} - } - `)}function Yn(e){const t=new jt,{vertex:r,fragment:i,varyings:o}=t,{output:a,normalType:n,offsetBackfaces:l,instancedColor:c,spherical:u,receiveShadows:d,snowCover:h,pbrMode:v,textureAlphaPremultiplied:f,instancedDoublePrecision:T,hasVertexColors:_,hasVertexTangents:x,hasColorTexture:V,hasNormalTexture:D,hasNormalTextureTransform:B,hasColorTextureTransform:P}=e;if(je(r,e),t.include(pr),o.add("vpos","vec3"),t.include(lt,e),t.include(zi,e),t.include(Ui,e),t.include(Un,e),!ft(a))return t.include($i,e),t;t.include(Wn,e),t.include(jn,e),t.include($n,e),t.include(qn,e),gt(r,e),t.include(Bt,e),t.include(We,e);const G=n===Q.Attribute||n===Q.Compressed;return G&&l&&t.include(Ni),t.include(rn,e),t.include(Si,e),c&&t.attributes.add(p.INSTANCECOLOR,"vec4"),o.add("vPositionLocal","vec3"),t.include(Ne,e),t.include(Li,e),t.include(Gi,e),t.include(Vi,e),r.uniforms.add(new te("externalColor",w=>w.externalColor)),o.add("vcolorExt","vec4"),e.terrainDepthTest&&o.add("depth","float"),r.main.add(s` - forwardNormalizedVertexColor(); - vcolorExt = externalColor; - ${y(c,"vcolorExt *= instanceColor * 0.003921568627451;")} - vcolorExt *= vvColor(); - vcolorExt *= getSymbolColor(); - forwardColorMixMode(); - - if (vcolorExt.a < ${s.float(be)}) { - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - } else { - vpos = getVertexInLocalOriginSpace(); - vPositionLocal = vpos - view[3].xyz; - vpos = subtractOrigin(vpos); - ${y(G,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")} - vpos = addVerticalOffset(vpos, localOrigin); - ${y(x,"vTangent = dpTransformVertexTangent(tangent);")} - gl_Position = transformPosition(proj, view, vpos); - ${y(G&&l,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} - } - - ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} - forwardLinearDepth(); - forwardTextureCoordinates(); - forwardColorUV(); - forwardNormalUV(); - forwardEmissiveUV(); - forwardOcclusionUV(); - forwardMetallicRoughnessUV(); - `),t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(T?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(i,e),i.uniforms.add(r.uniforms.get("localOrigin"),new q("ambient",w=>w.ambient),new q("diffuse",w=>w.diffuse),new ie("opacity",w=>w.opacity),new ie("layerOpacity",w=>w.layerOpacity)),V&&i.uniforms.add(new X("tex",w=>w.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),t.include(tn,e),Sr(i),Ar(i),xt(i),i.main.add(s` - discardBySlice(vpos); - ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} - ${V?s` - vec4 texColor = texture(tex, ${P?"colorUV":"vuv0"}); - ${y(f,"texColor.rgb /= texColor.a;")} - discardOrAdjustAlpha(texColor);`:s`vec4 texColor = vec4(1.0);`} - shadingParams.viewDirection = normalize(vpos - cameraPosition); - ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionLocal);`:s`shadingParams.normalView = vNormalWorld; - vec3 normal = shadingNormal(shadingParams);`} - applyPBRFactors(); - float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion(); - - vec3 posWorld = vpos + localOrigin; - - float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); - float shadow = ${d?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":y(u,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")}; - - vec3 matColor = max(ambient, diffuse); - vec3 albedo = mixExternalColor(${y(_,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(${y(_,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode)); - ${D?`mat3 tangentSpace = computeTangentSpace(${x?"normal":"normal, vpos, vuv0"}); - vec3 shadingNormal = computeTextureNormal(tangentSpace, ${B?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"} - vec3 normalGround = ${u?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"} - - ${y(h,s` - float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); - albedo = mix(albedo, vec3(1), snow); - shadingNormal = mix(shadingNormal, normal, snow); - ssao = mix(ssao, 1.0, snow);`)} - - vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; - - ${v===N.Normal||v===N.Schematic?s` - float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; - ${y(h,s`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)} - vec4 emission = ${h?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"}; - vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} - vec4 finalColor = vec4(shadedColor, opacity_); - outputColorHighlightOID(finalColor, vpos); - `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},ec=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let tc=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` -`);return this._parameterBits=t,r}};function b(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const i=e.count||2,o=Math.ceil(Math.log2(i)),a=t._parameterBits;let n=0;for(;a[n]+o>16;)n++,n>=a.length&&a.push(0);const l=a[n],c=(1<>l},set(u){if(this[r]!==u){if(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<>l)},set(u){if(this[r]!==u&&(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<v.externalColor)),o.add("vcolorExt","vec4"),r.main.add(s` - forwardNormalizedVertexColor(); - vcolorExt = externalColor; - ${y(l,"vcolorExt *= instanceColor * 0.003921568627451;")} - vcolorExt *= vvColor(); - vcolorExt *= getSymbolColor(); - forwardColorMixMode(); - - if (vcolorExt.a < ${s.float(be)}) { - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - } else { - vpos = getVertexInLocalOriginSpace(); - localvpos = vpos - view[3].xyz; - vpos = subtractOrigin(vpos); - vNormalWorld = dpNormal(vvLocalNormal(normalModel())); - vpos = addVerticalOffset(vpos, localOrigin); - gl_Position = transformPosition(proj, view, vpos); - ${y(n,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} - } - ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} - forwardLinearDepth(); - forwardTextureCoordinates();`)),a===F.Color){const{hasColorTexture:v,hasColorTextureTransform:f,receiveShadows:T}=e;t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(e.instancedDoublePrecision?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(t.fragment,e),Nt(i),Sr(i),Ar(i),i.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new q("ambient",_=>_.ambient),new q("diffuse",_=>_.diffuse),new ie("opacity",_=>_.opacity),new ie("layerOpacity",_=>_.layerOpacity)),v&&i.uniforms.add(new X("tex",_=>_.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),xt(i),i.main.add(s` - discardBySlice(vpos); - ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} - vec4 texColor = ${v?`texture(tex, ${f?"colorUV":"vuv0"})`:" vec4(1.0)"}; - ${y(v,`${y(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")} - discardOrAdjustAlpha(texColor);`)} - vec3 viewDirection = normalize(vpos - cameraPosition); - applyPBRFactors(); - float ssao = evaluateAmbientOcclusionInverse(); - ssao *= getBakedOcclusion(); - - float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); - vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; - float shadow = ${T?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":d?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; - vec3 matColor = max(ambient, diffuse); - ${e.hasVertexColors?s`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:s`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); - float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} - ${y(u,"albedo = mix(albedo, vec3(1), 0.9);")} - ${s`vec3 shadingNormal = normalize(vNormalWorld); - albedo *= 1.2; - vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); - float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); - float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); - float treeRadialFalloff = vColor.r; - float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); - additionalLight += backLightFactor * mainLightIntensity;`} - ${y(h,`vec3 normalGround = ${d?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)} - ${h?s`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; - ${y(u,s`mrr = vec3(0.0, 1.0, 0.04);`)} - vec4 emission = ${u?"vec4(0.0)":"getEmissions()"}; - vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} - vec4 finalColor = vec4(shadedColor, opacity_); - outputColorHighlightOID(finalColor, vpos);`)}return t.include($i,e),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,build:el},Symbol.toStringTag,{value:"Module"}));class rl extends oo{constructor(t,r,i){super(t,r,i,new Wt(tl,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class oc extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;di.map(i=>d[i]); +import{_ as _t}from"./main-BTdHgocv.js";import{v as m,S as z,i as ur,gU as go,c$ as si,j as li,dg as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,d2 as di,h_ as Ke,i0 as ut,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,cO as Ir,cw as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./story-DT1Ep1ux.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-CZrsQx74.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-B6HwLstV.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import{t as zt}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-D5uXMAZI.js";import{b as gi,F as _e}from"./sphere-BenPORjV-B4r28WKg.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-B27FdgMD.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-Dv7NCnc6.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function Wl(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` + vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { + float symbolAlpha = 0.0; + + const float maxTint = 85.0; + const float maxReplace = 170.0; + const float scaleAlpha = 3.0; + + if (symbolColor.a > maxReplace) { + colorMixMode = ${s.int(fe.Multiply)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); + } else if (symbolColor.a > maxTint) { + colorMixMode = ${s.int(fe.Replace)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); + } else if (symbolColor.a > 0.0) { + colorMixMode = ${s.int(fe.Tint)}; + symbolAlpha = scaleAlpha * symbolColor.a; + } else { + colorMixMode = ${s.int(fe.Multiply)}; + symbolAlpha = 0.0; + } + + return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); + } + `)}let J=class{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={[R.Pass]:null,[R.Draw]:null},i)switch(r){case R.Pass:this.bind[R.Pass]=i;break;case R.Draw:this.bind[R.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}},pt=class extends J{constructor(e,t){super(e,"sampler2D",R.Draw,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function da(){return!!_o("enable-feature:objectAndLayerId-rendering")}function bi({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(s`vec3 dpPlusFrc(vec3 a, vec3 b) { +return mix(a, a + b, vec3(notEqual(b, vec3(0)))); +} +vec3 dpMinusFrc(vec3 a, vec3 b) { +return mix(vec3(0), a - b, vec3(notEqual(a, b))); +} +vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = dpPlusFrc(hiA, hiB); +vec3 e = dpMinusFrc(t1, hiA); +vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; +return t1 + t2; +}`):e.add(s`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = hiA + hiB; +vec3 e = t1 - hiA; +vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; +return t1 + t2; +}`)}let le=class extends J{constructor(e,t){super(e,"vec3",R.Draw,(r,i,o,a)=>r.setUniform3fv(e,t(i,o,a)))}},q=class extends J{constructor(e,t){super(e,"vec3",R.Pass,(r,i,o)=>r.setUniform3fv(e,t(i,o)))}},ie=class extends J{constructor(e,t){super(e,"float",R.Pass,(r,i,o)=>r.setUniform1f(e,t(i,o)))}},Ei=class extends J{constructor(e,t){super(e,"mat3",R.Draw,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},ue=class extends J{constructor(e,t){super(e,"mat3",R.Pass,(r,i,o)=>r.setUniformMatrix3fv(e,t(i,o)))}},Xe=class extends J{constructor(e,t){super(e,"mat4",R.Pass,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}},U=class extends li{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};m([z()],U.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),m([z()],U.prototype,"DECONFLICTOR_SHOW_GRID",void 0),m([z()],U.prototype,"LABELS_SHOW_BORDER",void 0),m([z()],U.prototype,"TEXT_SHOW_BASELINE",void 0),m([z()],U.prototype,"TEXT_SHOW_BORDER",void 0),m([z()],U.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),m([z()],U.prototype,"OVERLAY_SHOW_CENTER",void 0),m([z()],U.prototype,"SHOW_POI",void 0),m([z()],U.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),m([z()],U.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),m([z()],U.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),m([z()],U.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),m([z()],U.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_TREE_SHOW_TILES",void 0),m([z()],U.prototype,"I3S_SHOW_MODIFICATIONS",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),m([z()],U.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),m([z()],U.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),m([z()],U.prototype,"LINE_WIREFRAMES",void 0),U=m([ur("esri.views.3d.support.debugFlags")],U);const jl=new U;var st;(function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=16]="DRAPED_MATERIAL",e[e.DRAPED_WATER=17]="DRAPED_WATER",e[e.VOXEL=18]="VOXEL",e[e.MAX_SLOTS=19]="MAX_SLOTS"})(st||(st={}));function pr(e){e.attributes.add(p.POSITION,"vec3"),e.vertex.code.add(s`vec3 positionModel() { return position; }`)}function ua(e,t){e.include(pr);const r=e.vertex;r.include(bi,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new q("transformWorldFromViewTH",i=>i.transformWorldFromViewTH),new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL),new ue("transformViewFromCameraRelativeRS",i=>i.transformViewFromCameraRelativeRS),new Xe("transformProjFromView",i=>i.transformProjFromView),new Ei("transformWorldFromModelRS",i=>i.transformWorldFromModelRS),new le("transformWorldFromModelTH",i=>i.transformWorldFromModelTH),new le("transformWorldFromModelTL",i=>i.transformWorldFromModelTL)),r.code.add(s`vec3 positionWorldCameraRelative() { +vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); +vec3 transform_CameraRelativeFromModel = dpAdd( +transformWorldFromModelTL, +transformWorldFromModelTH, +-transformWorldFromViewTL, +-transformWorldFromViewTH +); +return transform_CameraRelativeFromModel + rotatedModelPosition; +}`),r.code.add(s` + void forwardPosition(float fOffset) { + vPositionWorldCameraRelative = positionWorldCameraRelative(); + if (fOffset != 0.0) { + vPositionWorldCameraRelative += fOffset * ${t.spherical?s`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:s`vec3(0.0, 0.0, 1.0)`}; + } + + vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; + gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); + } + `),e.fragment.uniforms.add(new q("transformWorldFromViewTL",i=>i.transformWorldFromViewTL)),r.code.add(s`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`),e.fragment.code.add(s`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`)}let ha=class extends Qe{constructor(){super(...arguments),this.transformWorldFromViewTH=I(),this.transformWorldFromViewTL=I(),this.transformViewFromCameraRelativeRS=bt(),this.transformProjFromView=fr()}},ma=class extends Qe{constructor(){super(...arguments),this.transformWorldFromModelRS=bt(),this.transformWorldFromModelTH=I(),this.transformWorldFromModelTL=I()}};function Si(e,t){switch(t.normalType){case Q.Attribute:case Q.Compressed:e.include(Bt,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new Ei("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel),new ue("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),e.vertex.code.add(s`void forwardNormal() { +vNormalWorld = transformNormalGlobalFromModel * normalModel(); +vNormalView = transformNormalViewFromGlobal * vNormalWorld; +}`);break;case Q.ScreenDerivative:e.vertex.code.add(s`void forwardNormal() {}`);break;default:zt(t.normalType);case Q.COUNT:}}let fa=class extends ha{constructor(){super(...arguments),this.transformNormalViewFromGlobal=bt()}},pa=class extends ma{constructor(){super(...arguments),this.transformNormalGlobalFromModel=bt(),this.toMapSpace=Ht()}};const Ai=new Map([[p.POSITION,0],[p.NORMAL,1],[p.NORMALCOMPRESSED,1],[p.UV0,2],[p.COLOR,3],[p.COLORFEATUREATTRIBUTE,3],[p.SIZE,4],[p.TANGENT,4],[p.CENTEROFFSETANDDISTANCE,5],[p.SYMBOLCOLOR,5],[p.FEATUREATTRIBUTE,6],[p.INSTANCEFEATUREATTRIBUTE,6],[p.INSTANCECOLOR,7],[p.OBJECTANDLAYERIDCOLOR,7],[p.INSTANCEOBJECTANDLAYERIDCOLOR,7],[p.ROTATION,8],[p.INSTANCEMODEL,8],[p.INSTANCEMODELNORMAL,12],[p.INSTANCEMODELORIGINHI,11],[p.INSTANCEMODELORIGINLO,15]]);let Ci=class{constructor(){this.id=To()}},va=class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=I(),this._tmpMbs=gi(),this._tmpObb=new ea,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=xe(e)}applyToVertex(e,t,r){const i=Y(wi,e,t,r),o=Y(_a,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/xe(o);return He(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],l=e[5]+t,c=Math.abs(r),u=Math.abs(i),d=Math.abs(o),h=Math.abs(a),v=Math.abs(n),f=Math.abs(l),T=.5*(1+Math.sign(r*a))*Math.min(c,h),_=.5*(1+Math.sign(i*n))*Math.min(u,v),x=.5*(1+Math.sign(o*l))*Math.min(d,f),V=Math.max(c,h),D=Math.max(u,v),B=Math.max(d,f),P=Math.sqrt(T*T+_*_+x*x),G=Math.sign(c+r),w=Math.sign(u+i),S=Math.sign(d+o),E=Math.sign(h+a),M=Math.sign(v+n),O=Math.sign(f+l),g=this._totalOffset;if(P{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=Vo()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(t?.glName==null){const i=this._textures.get(e);return i&&(this._context.bindTexture(null,i.unit),this._freeTextureUnit(i),this._textures.delete(e)),null}let r=this._textures.get(e);return r==null?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)}),this._fragmentUniforms?.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}},vr=class{constructor(e,t,r,i,o=Ai){this.release=i,this.locations=o,this.primitiveType=zo.TRIANGLES,this.key=t.key,this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async a=>{if(a&&await r.reload(),!this.key.equals(t.key))throw new Error("Configuration was changed after construction, cannot reload shader");Rt(this._program),this._program=new Hr(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=Rt(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return Gt({blending:Xo,colorWrite:Vt})}};var vt;(function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"})(vt||(vt={}));let Ca=class extends Ci{constructor(e,t){super(),this.type=vt.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=Ai,this._pp0=It(0,0,1),this._pp1=It(0,0,0),this._parameters=new t,Vr(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){Vr(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,o,a){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,o)}};var ir;(function(e){e[e.None=0]="None",e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"})(ir||(ir={}));var k;(function(e){e[e.NONE=0]="NONE",e[e.ColorAlpha=1]="ColorAlpha",e[e.FrontFace=2]="FrontFace",e[e.COUNT=3]="COUNT"})(k||(k={}));const yi=Yo(At.ONE,At.ZERO,At.ONE,At.ONE_MINUS_SRC_ALPHA);function kl(e){return e===k.FrontFace?null:yi}function wa(e){switch(e){case k.NONE:return Zo;case k.ColorAlpha:return yi;case k.FrontFace:case k.COUNT:return null}}function Ma(e){if(e.draped)return null;switch(e.oitPass){case k.NONE:case k.FrontFace:return e.writeDepth?Ko:null;case k.ColorAlpha:case k.COUNT:return null}}const Oa=5e5,ya={factor:-1,units:-2};function Ra(e){return e?ya:null}function Ia(e,t=de.LESS){return e===k.NONE||e===k.FrontFace?t:de.LEQUAL}function La(e,t){const r=vi(t);return e===k.ColorAlpha?r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1,ye.COLOR_ATTACHMENT2]}:{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:r?{buffers:[ye.COLOR_ATTACHMENT0,ye.COLOR_ATTACHMENT1]}:null}de.LESS,de.ALWAYS;const Na={mask:255},Pa={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.ZERO}},Da={function:{func:de.ALWAYS,ref:ve.OutlineVisualElementMask,mask:ve.OutlineVisualElementMask},operation:{fail:ae.KEEP,zFail:ae.KEEP,zPass:ae.REPLACE}};de.EQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP,de.NOTEQUAL,ve.OutlineVisualElementMask,ve.OutlineVisualElementMask,ae.KEEP,ae.KEEP,ae.KEEP;function Yl({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return e==null&&t==null&&o==null&&(a==null||fi(a,Ke))&&n==null&&(i==null||i===1)&&(r==null||r===1)}const Fa=ut(1,1,.5),Xl=ut(0,.6,.2),Jl=ut(0,1,.2);let Ze=class extends J{constructor(e,t){super(e,"vec2",R.Pass,(r,i,o)=>r.setUniform2fv(e,t(i,o)))}};function Ur(e){e.varyings.add("linearDepth","float")}function Ri(e){e.vertex.uniforms.add(new Ze("nearFar",(t,r)=>r.camera.nearFar))}function Ii(e){e.vertex.code.add(s`float calculateLinearDepth(vec2 nearFar,float z) { +return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); +}`)}function Li(e,t){const{vertex:r}=e;switch(t.output){case F.Color:case F.ColorEmission:if(t.receiveShadows)return Ur(e),void r.code.add(s`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:return e.include(ua,t),Ur(e),Ri(e),Ii(e),void r.code.add(s`void forwardLinearDepth() { +linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); +}`)}r.code.add(s`void forwardLinearDepth() {}`)}function Ni(e){e.vertex.code.add(s`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { +vec3 camToVert = posWorld - camPosWorld; +bool isBackface = dot(camToVert, normalWorld) > 0.0; +if (isBackface) { +posClip.z += 0.0000003 * posClip.w; +} +return posClip; +}`)}function Ue(e,t){Ba(e,t,new le("slicePlaneOrigin",(r,i)=>za(t,r,i)),new le("slicePlaneBasis1",(r,i)=>Wr(t,r,i,i.slicePlane?.basis1)),new le("slicePlaneBasis2",(r,i)=>Wr(t,r,i,i.slicePlane?.basis2)))}function Ba(e,t,...r){if(!t.hasSlicePlane){const n=s`#define rejectBySlice(_pos_) false +#define discardBySlice(_pos_) {} +#define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(n),void e.fragment.code.add(n)}const i=s`struct SliceFactors { +float front; +float side0; +float side1; +float side2; +float side3; +}; +SliceFactors calculateSliceFactors(vec3 pos) { +vec3 rel = pos - slicePlaneOrigin; +vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); +float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); +float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); +float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); +float basis1Dot = dot(slicePlaneBasis1, rel); +float basis2Dot = dot(slicePlaneBasis2, rel); +return SliceFactors( +dot(slicePlaneNormal, pos) + slicePlaneW, +-basis1Dot - basis1Len2, +basis1Dot - basis1Len2, +-basis2Dot - basis2Len2, +basis2Dot - basis2Len2 +); +} +bool sliceByFactors(SliceFactors factors) { +return factors.front < 0.0 +&& factors.side0 < 0.0 +&& factors.side1 < 0.0 +&& factors.side2 < 0.0 +&& factors.side3 < 0.0; +} +bool sliceEnabled() { +return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; +} +bool sliceByPlane(vec3 pos) { +return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); +} +#define rejectBySlice(_pos_) sliceByPlane(_pos_) +#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=s`vec4 applySliceHighlight(vec4 color, vec3 pos) { +SliceFactors factors = calculateSliceFactors(pos); +const float HIGHLIGHT_WIDTH = 1.0; +const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); +factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); +factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); +factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); +factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); +factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); +if (sliceByFactors(factors)) { +return color; +} +float highlightFactor = (1.0 - step(0.5, factors.front)) +* (1.0 - step(0.5, factors.side0)) +* (1.0 - step(0.5, factors.side1)) +* (1.0 - step(0.5, factors.side2)) +* (1.0 - step(0.5, factors.side3)); +return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); +}`,a=t.hasSliceHighlight?s` + ${o} + #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) + `:s`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r).code.add(i),e.fragment.uniforms.add(...r).code.add(i),e.fragment.code.add(a)}function Pi(e,t,r){return e.instancedDoublePrecision?Y(Ga,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function Di(e,t){return e!=null?nt(Lt,t.origin,e):t.origin}function Fi(e,t,r){return e.hasSliceTranslatedView?t!=null?rr(Va,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function za(e,t,r){if(r.slicePlane==null)return Ke;const i=Pi(e,t,r),o=Di(i,r.slicePlane),a=Fi(e,i,r);return a!=null?mt(Lt,o,a):o}function Wr(e,t,r,i){if(i==null||r.slicePlane==null)return Ke;const o=Pi(e,t,r),a=Di(o,r.slicePlane),n=Fi(e,o,r);return n!=null?(Uo(tt,i,a),mt(Lt,a,n),mt(tt,tt,n),nt(tt,tt,Lt)):i}const Ga=I(),Lt=I(),tt=I(),Va=fr();function We(e){Ii(e),e.vertex.code.add(s`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { +vec4 eye = view * vec4(pos, 1.0); +depth = calculateLinearDepth(nearFar,eye.z); +return proj * eye; +}`),e.vertex.code.add(s`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { +return proj * (view * vec4(pos, 1.0)); +}`)}let Ha=class extends J{constructor(e,t){super(e,"mat4",R.Draw,(r,i,o)=>r.setUniformMatrix4fv(e,t(i,o)))}};function gt(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",Ke):e.uniforms.add(new le("cameraPosition",(r,i)=>Y(Bi,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function je(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Ha("view",(i,o)=>rr(jr,o.camera.viewMatrix,i.origin)),new le("localOrigin",i=>i.origin));const r=i=>Y(Bi,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new Xe("proj",(i,o)=>o.camera.projectionMatrix),new Xe("view",(i,o)=>rr(jr,o.camera.viewMatrix,r(o))),new q("localOrigin",(i,o)=>r(o)))}const jr=fr(),Bi=I();function Ua(e){e.uniforms.add(new Xe("viewNormal",(t,r)=>r.camera.viewInverseTransposeMatrix))}function Zl(e){e.uniforms.add(new ie("pixelRatio",(t,r)=>r.camera.pixelRatio/r.overlayStretch))}const $r=bt();function zi(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new Xe("model",a=>a.modelTransformation??Fr)),e.vertex.uniforms.add(new ue("normalLocalOriginFromModel",a=>(Qo($r,a.modelTransformation??Fr),$r)))),t.instanced&&i&&(e.attributes.add(p.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(p.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(p.INSTANCEMODEL,"mat3"),e.attributes.add(p.INSTANCEMODELNORMAL,"mat3"));const o=e.vertex;i&&(o.include(bi,t),o.uniforms.add(new le("viewOriginHi",(a,n)=>na(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)),new le("viewOriginLo",(a,n)=>sa(Y(Ct,n.camera.viewInverseTransposeMatrix[3],n.camera.viewInverseTransposeMatrix[7],n.camera.viewInverseTransposeMatrix[11]),Ct)))),o.code.add(s` + vec3 getVertexInLocalOriginSpace() { + return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"}; + } + + vec3 subtractOrigin(vec3 _pos) { + ${i?s` + // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped + // working for macOS 14+ and iOS 17+. + // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 + vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); + return _pos - originDelta;`:"return vpos;"} + } + `),o.code.add(s` + vec3 dpNormal(vec4 _normal) { + return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); + } + `),t.output===F.Normal&&(Ua(o),o.code.add(s` + vec3 dpNormalView(vec4 _normal) { + return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); + } + `)),t.hasVertexTangents&&o.code.add(s` + vec4 dpTransformVertexTangent(vec4 _tangent) { + ${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} + }`)}const Ct=I();let gr=class extends J{constructor(e,t){super(e,"int",R.Pass,(r,i,o)=>r.setUniform1i(e,t(i,o)))}};function Gi(e,t){t.hasSymbolColors?(e.include(ca),e.attributes.add(p.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(s`int symbolColorMixMode; +vec4 getSymbolColor() { +return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; +} +void forwardColorMixMode() { +colorMixMode = float(symbolColorMixMode) + 0.5; +}`)):(e.fragment.uniforms.add(new gr("colorMixMode",r=>Aa[r.colorMixMode])),e.vertex.code.add(s`vec4 getSymbolColor() { return vec4(1.0); } +void forwardColorMixMode() {}`))}var K;function Ne(e,t){switch(t.textureCoordinateType){case K.Default:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`void forwardTextureCoordinates() { +vuv0 = uv0; +}`);case K.Compressed:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(s`vec2 getUV0() { +return uv0 / 16384.0; +} +void forwardTextureCoordinates() { +vuv0 = getUV0(); +}`);case K.Atlas:return e.attributes.add(p.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(p.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(s`void forwardTextureCoordinates() { +vuv0 = uv0; +vuvRegion = uvRegion; +}`);default:zt(t.textureCoordinateType);case K.None:return void e.vertex.code.add(s`void forwardTextureCoordinates() {}`);case K.COUNT:return}}(function(e){e[e.None=0]="None",e[e.Default=1]="Default",e[e.Atlas=2]="Atlas",e[e.Compressed=3]="Compressed",e[e.COUNT=4]="COUNT"})(K||(K={}));function Vi(e,t){t.hasVertexColors?(e.attributes.add(p.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(s`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(s`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(s`void forwardVertexColor() {} +void forwardNormalizedVertexColor() {}`)}function Wa(e){e.vertex.code.add(s`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { +return absCosAngle * absCosAngle * absCosAngle; +}`),e.vertex.code.add(s`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { +return vec3( +min(params.x / (distanceToCamera - params.y), 1.0), +screenSizePerspectiveViewAngleDependentFactor(absCosAngle), +params.z +); +}`),e.vertex.code.add(s`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),e.vertex.code.add(s`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorFloat( +size, +screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) +); +}`),e.vertex.code.add(s`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),e.vertex.code.add(s`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); +}`)}function Kl(e){e.uniforms.add(new q("screenSizePerspective",t=>Hi(t.screenSizePerspective)))}function ja(e){e.uniforms.add(new q("screenSizePerspectiveAlignment",t=>Hi(t.screenSizePerspectiveAlignment||t.screenSizePerspective)))}function Hi(e){return Y($a,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const $a=I();let te=class extends J{constructor(e,t){super(e,"vec4",R.Pass,(r,i,o)=>r.setUniform4fv(e,t(i,o)))}};function Ui(e,t){const r=e.vertex;t.hasVerticalOffset?(ka(r),t.hasScreenSizePerspective&&(e.include(Wa),ja(r),gt(e.vertex,t)),r.code.add(s` + vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { + float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); + ${t.spherical?s`vec3 worldNormal = normalize(worldPos + localOrigin);`:s`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} + ${t.hasScreenSizePerspective?s` + float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); + float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:s` + float verticalOffsetScreenHeight = verticalOffset.x;`} + // Screen sized offset in world space, used for example for line callouts + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); + return worldNormal * worldOffset; + } + + vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { + return worldPos + calculateVerticalOffset(worldPos, localOrigin); + } + `)):r.code.add(s`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const qa=Ht();function ka(e){e.uniforms.add(new te("verticalOffset",(t,r)=>{const{minWorldLength:i,maxWorldLength:o,screenLength:a}=t.verticalOffset,n=Math.tan(.5*r.camera.fovY)/(.5*r.camera.fullViewport[3]),l=r.camera.pixelRatio||1;return oe(qa,a*l,n,i,o)}))}function Ya(e,t){if(t.output!==F.ObjectAndLayerIdColor)return e.vertex.code.add(s`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(s`void outputObjectAndLayerIdColor() {}`);const r=t.objectAndLayerIdColorInstanced;e.varyings.add("objectAndLayerIdColorVarying","vec4"),e.attributes.add(r?p.INSTANCEOBJECTANDLAYERIDCOLOR:p.OBJECTANDLAYERIDCOLOR,"vec4"),e.vertex.code.add(s` + void forwardObjectAndLayerIdColor() { + objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451; + }`),e.fragment.code.add(s`void outputObjectAndLayerIdColor() { +fragColor = objectAndLayerIdColorVarying; +}`)}function Wi(e){e.code.add(s`const float MAX_RGBA4_FLOAT = +15.0 / 16.0 + +15.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 / 16.0; +const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); +vec4 floatToRgba4(const float value) { +float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); +vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); +const float toU4AsFloat = 1.0 / 15.0; +return fixedPointU4 * toU4AsFloat; +} +const vec4 RGBA4_2_FLOAT_FACTORS = vec4( +15.0 / (16.0), +15.0 / (16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0 * 16.0) +); +float rgba4ToFloat(vec4 rgba) { +return dot(rgba, RGBA4_2_FLOAT_FACTORS); +}`)}function Xa(e,t){switch(t.output){case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:e.fragment.include(Wi),e.fragment.code.add(s`float _calculateFragDepth(const in float depth) { +const float SLOPE_SCALE = 2.0; +const float BIAS = 20.0 * .000015259; +float m = max(abs(dFdx(depth)), abs(dFdy(depth))); +return depth + SLOPE_SCALE * m + BIAS; +} +void outputDepth(float _linearDepth) { +fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); +}`)}}let Ja=class extends J{constructor(e,t){super(e,"ivec2",R.Pass,(r,i,o)=>r.setUniform2iv(e,t(i,o)))}},X=class extends J{constructor(e,t){super(e,"sampler2D",R.Pass,(r,i,o)=>r.bindTexture(e,t(i,o)))}};function ji(e,t){const{fragment:r}=e;t.output===F.Highlight?(r.uniforms.add(new X("depthTexture",(i,o)=>o.mainDepth),new X("highlightTexture",(i,o)=>o.highlightMixTexture),new gr("highlightLevel",(i,o)=>o.highlightLevel),new Ja("highlightMixOrigin",(i,o)=>o.highlightMixOrigin)),e.outputs.add("fragHighlight","vec2",0),r.code.add(s`vec2 getAccumulatedHighlight() { +return texelFetch(highlightTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg; +} +void outputHighlight(bool occluded) { +if (highlightLevel == 0) { +uint bits = occluded ? 3u : 1u; +fragHighlight = vec2(float(bits) / 255.0, 0.0); +} else { +int ll = (highlightLevel & 3) << 1; +int li = (highlightLevel >> 2) & 3; +uint bits; +if (occluded) { +bits = 3u << ll; +} else { +bits = 1u << ll; +} +vec2 combinedHighlight = getAccumulatedHighlight(); +uint accumulatedI = uint(combinedHighlight[li] * 255.0); +combinedHighlight[li] = float(bits | accumulatedI) / 255.0; +fragHighlight = combinedHighlight; +} +} +bool isHighlightOccluded() { +float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x; +return gl_FragCoord.z > sceneDepth + 5e-7; +} +void calculateOcclusionAndOutputHighlight() { +outputHighlight(isHighlightOccluded()); +}`),t.canHaveOverlay&&(r.constants.add("occlusionAndMask","int",85),r.code.add(s`void outputAllHighlights(vec2 highlightToAdd) { +if (highlightToAdd == vec2(0.0)) { discard; } +int occludedOrMask = isHighlightOccluded() ? 0xaa : 0; +ivec2 added = ivec2(highlightToAdd * 255.0); +ivec2 masked = (added & ivec2(occlusionAndMask)) | (ivec2(occludedOrMask) & (added<<1)); +fragHighlight = vec2(masked) / 255.0; +}`))):r.code.add(s`void calculateOcclusionAndOutputHighlight() {}`)}let Za=class extends J{constructor(e,t,r){super(e,"vec4",R.Pass,(i,o,a)=>i.setUniform4fv(e,t(o,a)),r)}},Ka=class extends J{constructor(e,t,r){super(e,"float",R.Pass,(i,o,a)=>i.setUniform1fv(e,t(o,a)),r)}};var qr,kr;(function(e){e[e.Undefined=0]="Undefined",e[e.DefinedSize=1]="DefinedSize",e[e.DefinedScale=2]="DefinedScale"})(qr||(qr={})),function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(kr||(kr={}));function Ql(e,t,r){if(!t.vvSize)return Y(e,1,1,1),e;for(let i=0;i<3;++i){const o=t.vvSize.offset[i]+r[0]*t.vvSize.factor[i];e[i]=hr(o,t.vvSize.minSize[i],t.vvSize.maxSize[i])}return e}const Xt=8;function lt(e,t){const{vertex:r,attributes:i}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&i.add(p.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new q("vvSizeMinSize",o=>o.vvSize.minSize)),r.uniforms.add(new q("vvSizeMaxSize",o=>o.vvSize.maxSize)),r.uniforms.add(new q("vvSizeOffset",o=>o.vvSize.offset)),r.uniforms.add(new q("vvSizeFactor",o=>o.vvSize.factor)),r.uniforms.add(new ue("vvSymbolRotationMatrix",o=>o.vvSymbolRotationMatrix)),r.uniforms.add(new q("vvSymbolAnchor",o=>o.vvSymbolAnchor)),r.code.add(s`vec3 vvScale(vec4 _featureAttribute) { +return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); +} +vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { +return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); +}`),r.code.add(s` + const float eps = 1.192092896e-07; + vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { + vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); + return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); + } + + ${t.hasVvInstancing?s` + vec4 vvLocalNormal(vec3 _normal) { + return vvTransformNormal(_normal, instanceFeatureAttribute); + } + + vec4 localPosition() { + return vvTransformPosition(position, instanceFeatureAttribute); + }`:""} + `)):r.code.add(s`vec4 localPosition() { return vec4(position, 1.0); } +vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",Xt),r.uniforms.add(new Ka("vvColorValues",o=>o.vvColor.values,Xt),new Za("vvColorColors",o=>o.vvColor.colors,Xt)),r.code.add(s` + vec4 interpolateVVColor(float value) { + if (value <= vvColorValues[0]) { + return vvColorColors[0]; + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return mix(vvColorColors[i-1], vvColorColors[i], f); + } + } + return vvColorColors[vvColorNumber - 1]; + } + + vec4 vvGetColor(vec4 featureAttribute) { + return interpolateVVColor(featureAttribute.y); + } + + ${t.hasVvInstancing?s` + vec4 vvColor() { + return vvGetColor(instanceFeatureAttribute); + }`:"vec4 vvColor() { return vec4(1.0); }"} + `)):r.code.add(s`vec4 vvColor() { return vec4(1.0); }`)}function $e(e,t){Qa(e,t,new ie("textureAlphaCutoff",r=>r.textureAlphaCutoff))}function Qa(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case ge.Blend:e.fragment.code.add(s` + #define discardOrAdjustAlpha(color) { if (color.a < ${s.float(be)}) { discard; } } + `);break;case ge.Opaque:i.code.add(s`void discardOrAdjustAlpha(inout vec4 color) { +color.a = 1.0; +}`);break;case ge.Mask:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case ge.MaskBlend:i.uniforms.add(r).code.add(s`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function $i(e,t){const{vertex:r,fragment:i}=e,o=t.hasColorTexture&&t.alphaDiscardMode!==ge.Opaque,{output:a,normalType:n,hasColorTextureTransform:l}=t;switch(a){case F.Depth:je(r,t),e.include(We,t),e.include(Ue,t),e.include(Ne,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPosition(proj, view, vpos); +forwardTextureCoordinates();`),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)}`);break;case F.Shadow:case F.ShadowHighlight:case F.ShadowExcludeHighlight:case F.ViewshedShadow:case F.ObjectAndLayerIdColor:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),e.include(Xa,t),e.include(Ue,t),e.include(Ya,t),Ri(e),e.varyings.add("depth","float"),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); +forwardTextureCoordinates(); +forwardObjectAndLayerIdColor();`),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + ${a===F.ObjectAndLayerIdColor?s`outputObjectAndLayerIdColor();`:s`outputDepth(depth);`}`);break;case F.Normal:{je(r,t),e.include(We,t),e.include(Bt,t),e.include(Si,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",u=>u.texture)),n===Q.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const c=n===Q.Attribute||n===Q.Compressed;r.main.add(s` + vpos = getVertexInLocalOriginSpace(); + ${c?s`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:s`vPositionView = (view * vec4(vpos, 1.0)).xyz;`} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + + ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionView);`:s`vec3 normal = normalize(vNormalWorld); + if (gl_FrontFacing == false){ + normal = -normal; + }`} + fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case F.Highlight:je(r,t),e.include(We,t),e.include(Ne,t),e.include(lt,t),o&&i.uniforms.add(new X("tex",c=>c.texture)),r.main.add(s`vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPosition(proj, view, vpos); +forwardTextureCoordinates();`),e.include(Ue,t),e.include($e,t),e.include(ji,t),i.main.add(s` + discardBySlice(vpos); + ${y(o,s`vec4 texColor = texture(tex, ${l?"colorUV":"vuv0"}); + discardOrAdjustAlpha(texColor);`)} + calculateOcclusionAndOutputHighlight();`)}}function en(e){e.fragment.code.add(s`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) { +vec2 atlasScale = atlasRegion.zw - atlasRegion.xy; +vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy; +float maxdUV = 0.125; +vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale; +vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale; +return textureGrad(tex, uvAtlas, dUVdx, dUVdy); +}`)}function xr(e,t){const{textureCoordinateType:r}=t;if(r===K.None||r===K.COUNT)return;e.include(Ne,t);const i=r===K.Atlas;i&&e.include(en),e.fragment.code.add(s` + vec4 textureLookup(sampler2D tex, vec2 uv) { + return ${i?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"}; + } + `)}function tn(e,t){const r=e.fragment;switch(r.code.add(s`struct ShadingNormalParameters { +vec3 normalView; +vec3 viewDirection; +} shadingParams;`),t.doubleSidedMode){case re.None:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return normalize(params.normalView); +}`);break;case re.View:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); +}`);break;case re.WindingOrder:r.code.add(s`vec3 shadingNormal(ShadingNormalParameters params) { +return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); +}`);break;default:zt(t.doubleSidedMode);case re.COUNT:}}var re;(function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.WindingOrder=2]="WindingOrder",e[e.COUNT=3]="COUNT"})(re||(re={}));function rn(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(p.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===re.WindingOrder?r.code.add(s`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; +vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`):r.code.add(s`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = vTangent.w; +vec3 tangent = normalize(vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`)):r.code.add(s`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { +vec3 Q1 = dFdx(pos); +vec3 Q2 = dFdy(pos); +vec2 stx = dFdx(st); +vec2 sty = dFdy(st); +float det = stx.t * sty.s - sty.t * stx.s; +vec3 T = stx.t * Q2 - sty.t * Q1; +T = T - normal * dot(normal, T); +T *= inversesqrt(max(dot(T,T), 1.e-10)); +vec3 B = sign(det) * cross(normal, T); +return mat3(T, B, normal); +}`),t.textureCoordinateType!==K.None&&(e.include(xr,t),r.uniforms.add(t.bindType===R.Pass?new X("normalTexture",i=>i.textureNormal):new pt("normalTexture",i=>i.textureNormal)),t.hasNormalTextureTransform&&(r.uniforms.add(new Ze("scale",i=>i.scale??la)),r.uniforms.add(new ue("normalTextureTransformMatrix",i=>i.normalTextureTransformMatrix??et))),r.code.add(s`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { +vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormalTextureTransform&&r.code.add(s`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0, +normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0, +0.0, 0.0, 0.0 ); +rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s`return tangentSpace * rawNormal; +}`))}var or,ct;(function(e){e.OPAQUE="opaque-color",e.TRANSPARENT="transparent-color",e.COMPOSITE="composite-color",e.FINAL="final-color"})(or||(or={})),function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color"}(ct||(ct={}));var qe,Yr;(function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"})(qe||(qe={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(Yr||(Yr={}));let Ge=class extends li{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=or.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([ci(()=>this.view.ready,e=>{e&&this.view._stage?.renderer.addRenderNode(this)},xo)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Te("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view._stage.renderView.renderingContext.gl}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===Qt.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view._stage.renderView.renderingContext}get renderContext(){return this.view._stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:t})=>t===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};m([z({constructOnly:!0})],Ge.prototype,"view",void 0),m([z({constructOnly:!0})],Ge.prototype,"consumes",void 0),m([z()],Ge.prototype,"produces",void 0),Ge=m([ur("esri.views.3d.webgl.RenderNode")],Ge);const on=Ge,an=3e5,Xr=5e5;function qi(e,t=!0){e.attributes.add(p.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(s` + gl_Position = vec4(position, 0.0, 1.0); + ${t?s`uv = position * 0.5 + vec2(0.5);`:""} + `)}function _r(e){e.uniforms.add(new Ze("zProjectionMap",(t,r)=>nn(r.camera))),e.code.add(s`float linearizeDepth(float depth) { +float depthNdc = depth * 2.0 - 1.0; +float c1 = zProjectionMap[0]; +float c2 = zProjectionMap[1]; +return -(c1 / (depthNdc + c2 + 1e-7)); +}`),e.code.add(s`float depthFromTexture(sampler2D depthTexture, vec2 uv) { +ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0))); +float depth = texelFetch(depthTexture, iuv, 0).r; +return depth; +}`),e.code.add(s`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) { +return linearizeDepth(depthFromTexture(depthTexture, uv)); +}`)}function nn(e){const t=e.projectionMatrix;return Pe(sn,t[14],t[10])}const sn=Ut();let ln=class extends J{constructor(e,t){super(e,"vec2",R.Draw,(r,i,o,a)=>r.setUniform2fv(e,t(i,o,a)))}};const cn=()=>hi.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let ki=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},jt=class extends ki{constructor(){super(...arguments),this.vertex=new Jr,this.fragment=new Jr,this.attributes=new mn,this.varyings=new fn,this.extensions=new ar,this.outputs=new sr}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),l=o.main.generateSource(),c=e==="vertex"?gn:vn,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es +${t.join(` +`)} + +${c} + +${u.join(` +`)} + +${a.join(` +`)} + +${r.join(` +`)} + +${i.join(` +`)} + +${d.join(` +`)} + +${n.join(` +`)} + +${l.join(` +`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Pass];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a)=>{for(let n=0;n{const a=o.bind[R.Draw];a&&t.set(o.name,a)}),this.fragment.uniforms.entries.forEach(o=>{const a=o.bind[R.Draw];a&&t.set(o.name,a)});const r=Array.from(t.values()),i=r.length;return(o,a,n)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},un=class{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() { + ${this._bodies.join(` +`)||""} +}`];throw new Te("Shader does not contain main function body.")}},hn=class{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}},Jr=class extends ki{constructor(){super(...arguments),this.uniforms=new dn(this),this.main=new un(this),this.code=new hn(this),this.constants=new pn(this)}get builder(){return this}},mn=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},fn=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&W(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push(e==="vertex"?`out ${r} ${i};`:`in ${r} ${i};`)),t}},ar=class nr{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const r=t==="vertex"?nr.ALLOWLIST_VERTEX:nr.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>r.includes(i)).map(i=>`#extension ${i} : enable`)}};ar.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],ar.ALLOWLIST_VERTEX=[];let sr=class lr{constructor(){this._entries=new Map}add(t,r,i=0){const o=this._entries.get(i);o?W(o.name===t&&o.type===r,`Fragment shader output location ${i} occupied`):this._entries.set(i,{name:t,type:r})}generateSource(t){if(t==="vertex")return[];this._entries.size===0&&this._entries.set(0,{name:lr.DEFAULT_NAME,type:lr.DEFAULT_TYPE});const r=new Array;return this._entries.forEach((i,o)=>r.push(`layout(location = ${o}) out ${i.type} ${i.name};`)),r}};sr.DEFAULT_TYPE="vec4",sr.DEFAULT_NAME="fragColor";let pn=class j{constructor(t){this._stage=t,this._entries=new Set}add(t,r,i){let o="ERROR_CONSTRUCTOR_STRING";switch(r){case"float":o=j._numberToFloatStr(i);break;case"int":o=j._numberToIntStr(i);break;case"bool":o=i.toString();break;case"vec2":o=`vec2(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])})`;break;case"vec3":o=`vec3(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])})`;break;case"vec4":o=`vec4(${j._numberToFloatStr(i[0])}, ${j._numberToFloatStr(i[1])}, ${j._numberToFloatStr(i[2])}, ${j._numberToFloatStr(i[3])})`;break;case"ivec2":o=`ivec2(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])})`;break;case"ivec3":o=`ivec3(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])})`;break;case"ivec4":o=`ivec4(${j._numberToIntStr(i[0])}, ${j._numberToIntStr(i[1])}, ${j._numberToIntStr(i[2])}, ${j._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${r}(${Array.prototype.map.call(i,a=>j._numberToFloatStr(a)).join(", ")})`}return this._entries.add(`const ${r} ${t} = ${o};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};const vn=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif`,gn=`precision highp float; +precision highp sampler2D;`,Jt=4;function xn(){const e=new jt,t=e.fragment;e.include(qi);const r=(Jt+1)/2,i=1/(2*r*r);return t.include(_r),t.uniforms.add(new X("depthMap",o=>o.depthTexture),new pt("tex",o=>o.colorTexture),new ln("blurSize",o=>o.blurSize),new ie("projScale",(o,a)=>{const n=a.camera.distance;return n>5e4?Math.max(0,o.projScale-(n-5e4)):o.projScale})),t.code.add(s` + void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { + float c = texture(tex, uv).r; + float d = linearDepthFromTexture(depthMap, uv); + + float ddiff = d - center_d; + + float w = exp(-r * r * ${s.float(i)} - ddiff * ddiff * sharpness); + wTotal += w; + bTotal += w * c; + } + `),e.outputs.add("fragBlur","float"),t.main.add(s` + float b = 0.0; + float w_total = 0.0; + + float center_d = linearDepthFromTexture(depthMap, uv); + + float sharpness = -0.05 * projScale / center_d; + for (int r = -${s.int(Jt)}; r <= ${s.int(Jt)}; ++r) { + float rf = float(r); + vec2 uvOffset = uv + rf * blurSize; + blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); + } + fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { +return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); +}`)}function wn(e){const t=e.projectionMatrix;return t[11]===0?oe(Kr,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):oe(Kr,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}const Kr=Ht();function Mn(e){return e.projectionMatrix[11]===0?Pe(Qr,0,1):Pe(Qr,1,0)}const Qr=Ut(),ei=16;function On(){const e=new jt,t=e.fragment;return e.include(qi),e.include(Cn),t.include(_r),t.uniforms.add(new ie("radius",(r,i)=>Tr(i.camera))).code.add(s`vec3 sphere[16] = vec3[16]( +vec3(0.186937, 0.0, 0.0), +vec3(0.700542, 0.0, 0.0), +vec3(-0.864858, -0.481795, -0.111713), +vec3(-0.624773, 0.102853, -0.730153), +vec3(-0.387172, 0.260319, 0.007229), +vec3(-0.222367, -0.642631, -0.707697), +vec3(-0.01336, -0.014956, 0.169662), +vec3(0.122575, 0.1544, -0.456944), +vec3(-0.177141, 0.85997, -0.42346), +vec3(-0.131631, 0.814545, 0.524355), +vec3(-0.779469, 0.007991, 0.624833), +vec3(0.308092, 0.209288,0.35969), +vec3(0.359331, -0.184533, -0.377458), +vec3(0.192633, -0.482999, -0.065284), +vec3(0.233538, 0.293706, -0.055139), +vec3(0.417709, -0.386701, 0.442449) +); +float fallOffFunction(float vv, float vn, float bias) { +float f = max(radius * radius - vv, 0.0); +return f * f * f * max(vn - bias, 0.0); +}`),t.code.add(s`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { +vec3 v = Q - C; +float vv = dot(v, v); +float vn = dot(normalize(v), n_C); +return fallOffFunction(vv, vn, 0.1); +}`),t.uniforms.add(new X("normalMap",r=>r.normalTexture),new X("depthMap",r=>r.depthTexture),new ie("projScale",r=>r.projScale),new X("rnm",r=>r.noiseTexture),new Ze("rnmScale",(r,i)=>Pe(ti,i.camera.fullWidth/r.noiseTexture.descriptor.width,i.camera.fullHeight/r.noiseTexture.descriptor.height)),new ie("intensity",r=>r.intensity),new Ze("screenSize",(r,i)=>Pe(ti,i.camera.fullWidth,i.camera.fullHeight))),e.outputs.add("fragOcclusion","float"),t.main.add(s` + float depth = depthFromTexture(depthMap, uv); + + // Early out if depth is out of range, such as in the sky + if (depth >= 1.0 || depth <= 0.0) { + fragOcclusion = 1.0; + return; + } + + // get the normal of current fragment + vec4 norm4 = texture(normalMap, uv); + if(norm4.a != 1.0) { + fragOcclusion = 1.0; + return; + } + vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; + + float currentPixelDepth = linearizeDepth(depth); + vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); + + float sum = 0.0; + vec3 tapPixelPos; + + vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); + + // note: the factor 2.0 should not be necessary, but makes ssao much nicer. + // bug or deviation from CE somewhere else? + float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); + + for(int i = 0; i < ${s.int(ei)}; ++i) { + vec2 unitOffset = reflect(sphere[i], fres).xy; + vec2 offset = vec2(-unitOffset * radius * ps); + + // don't use current or very nearby samples + if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ + continue; + } + + vec2 tc = vec2(gl_FragCoord.xy + offset); + if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; + vec2 tcTap = tc / screenSize; + float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap); + + tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); + + sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); + } + + // output the result + float A = max(1.0 - sum * intensity / float(${s.int(ei)}), 0.0); + + // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 + A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2; + + fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { +vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); +return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; +} +float evaluateAmbientOcclusion() { +return 1.0 - evaluateAmbientOcclusionInverse(); +}`)):r.code.add(s`float evaluateAmbientOcclusionInverse() { return 1.0; } +float evaluateAmbientOcclusion() { return 0.0; }`)}let In=class{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context.stippleTextures}get _markerTextures(){return this._techniques.context.markerTextures}acquireTechnique(e,t){return this._techniques.acquire(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return er.LOADED}},Ln=class extends In{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,t=>this._texture=t),this._acquire(e.normalTextureId,t=>this._textureNormal=t),this._acquire(e.emissiveTextureId,t=>this._textureEmissive=t),this._acquire(e.occlusionTextureId,t=>this._textureOcclusion=t),this._acquire(e.metallicRoughnessTextureId,t=>this._textureMetallicRoughness=t)}dispose(){super.dispose(),this._texture=Oe(this._texture),this._textureNormal=Oe(this._textureNormal),this._textureEmissive=Oe(this._textureEmissive),this._textureOcclusion=Oe(this._textureOcclusion),this._textureMetallicRoughness=Oe(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?er.LOADED:er.LOADING}get textureBindParameters(){return new Pn(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=Oe(this._texture),this._textureId=e,this._acquire(this._textureId,t=>this._texture=t))}_acquire(e,t){if(e==null)return void t(null);const r=this._textures.acquire(e);if(Eo(r))return++this._numLoading,void r.then(i=>{if(this._disposed)return Oe(i),void t(null);t(i)}).finally(()=>--this._numLoading);t(r)}},Nn=class extends Qe{constructor(e=null){super(),this.textureEmissive=e}},Pn=class extends Nn{constructor(e=null,t=null,r=null,i=null,o=null,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}};var N;(function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Simplified=5]="Simplified",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"})(N||(N={}));function Yi(e,t){const r=t.pbrMode,i=e.fragment;if(r!==N.Schematic&&r!==N.Disabled&&r!==N.Normal)return void i.code.add(s`void applyPBRFactors() {}`);if(r===N.Disabled)return void i.code.add(s`void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`);if(r===N.Schematic)return void i.code.add(s`vec3 mrr = vec3(0.0, 0.6, 0.2); +float occlusion = 1.0; +void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:o,hasMetallicRoughnessTextureTransform:a,hasOcclusionTexture:n,hasOcclusionTextureTransform:l,bindType:c}=t;(o||n)&&e.include(xr,t),i.code.add(s`vec3 mrr; +float occlusion;`),o&&i.uniforms.add(c===R.Pass?new X("texMetallicRoughness",u=>u.textureMetallicRoughness):new pt("texMetallicRoughness",u=>u.textureMetallicRoughness)),n&&i.uniforms.add(c===R.Pass?new X("texOcclusion",u=>u.textureOcclusion):new pt("texOcclusion",u=>u.textureOcclusion)),i.uniforms.add(c===R.Pass?new q("mrrFactors",u=>u.mrrFactors):new le("mrrFactors",u=>u.mrrFactors)),i.code.add(s` + ${y(o,s`void applyMetallicRoughness(vec2 uv) { + vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; + mrr[0] *= metallicRoughness.b; + mrr[1] *= metallicRoughness.g; + }`)} + + ${y(n,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")} + + float getBakedOcclusion() { + return ${n?"occlusion":"1.0"}; + } + + void applyPBRFactors() { + mrr = mrrFactors; + occlusion = 1.0; + + ${y(o,`applyMetallicRoughness(${a?"metallicRoughnessUV":"vuv0"});`)} + ${y(n,`applyOcclusion(${l?"occlusionUV":"vuv0"});`)} + } + `)}function Dn(e,t){const r=e.fragment,i=t.lightingSphericalHarmonicsOrder!==void 0?t.lightingSphericalHarmonicsOrder:2;i===0?(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===1?(r.uniforms.add(new te("lightingAmbientSH_R",(o,a)=>oe(me,a.lighting.sh.r[0],a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3])),new te("lightingAmbientSH_G",(o,a)=>oe(me,a.lighting.sh.g[0],a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3])),new te("lightingAmbientSH_B",(o,a)=>oe(me,a.lighting.sh.b[0],a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec4 sh0 = vec4( +0.282095, +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y +); +vec3 ambientLight = vec3( +dot(lightingAmbientSH_R, sh0), +dot(lightingAmbientSH_G, sh0), +dot(lightingAmbientSH_B, sh0) +); +return ambientLight * (1.0 - ambientOcclusion); +}`)):i===2&&(r.uniforms.add(new q("lightingAmbientSH0",(o,a)=>Y(ii,a.lighting.sh.r[0],a.lighting.sh.g[0],a.lighting.sh.b[0])),new te("lightingAmbientSH_R1",(o,a)=>oe(me,a.lighting.sh.r[1],a.lighting.sh.r[2],a.lighting.sh.r[3],a.lighting.sh.r[4])),new te("lightingAmbientSH_G1",(o,a)=>oe(me,a.lighting.sh.g[1],a.lighting.sh.g[2],a.lighting.sh.g[3],a.lighting.sh.g[4])),new te("lightingAmbientSH_B1",(o,a)=>oe(me,a.lighting.sh.b[1],a.lighting.sh.b[2],a.lighting.sh.b[3],a.lighting.sh.b[4])),new te("lightingAmbientSH_R2",(o,a)=>oe(me,a.lighting.sh.r[5],a.lighting.sh.r[6],a.lighting.sh.r[7],a.lighting.sh.r[8])),new te("lightingAmbientSH_G2",(o,a)=>oe(me,a.lighting.sh.g[5],a.lighting.sh.g[6],a.lighting.sh.g[7],a.lighting.sh.g[8])),new te("lightingAmbientSH_B2",(o,a)=>oe(me,a.lighting.sh.b[5],a.lighting.sh.b[6],a.lighting.sh.b[7],a.lighting.sh.b[8]))),r.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +vec4 sh1 = vec4( +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y, +1.092548 * normal.x * normal.y +); +vec4 sh2 = vec4( +1.092548 * normal.y * normal.z, +0.315392 * (3.0 * normal.z * normal.z - 1.0), +1.092548 * normal.x * normal.z, +0.546274 * (normal.x * normal.x - normal.y * normal.y) +); +ambientLight += vec3( +dot(lightingAmbientSH_R1, sh1), +dot(lightingAmbientSH_G1, sh1), +dot(lightingAmbientSH_B1, sh1) +); +ambientLight += vec3( +dot(lightingAmbientSH_R2, sh2), +dot(lightingAmbientSH_G2, sh2), +dot(lightingAmbientSH_B2, sh2) +); +return ambientLight * (1.0 - ambientOcclusion); +}`),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||r.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); +vec3 calculateAmbientRadiance(float ambientOcclusion) +{ +vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; +return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; +}`))}const ii=I(),me=Ht();function Nt(e){e.uniforms.add(new q("mainLightDirection",(t,r)=>r.lighting.mainLight.direction))}function xt(e){e.uniforms.add(new q("mainLightIntensity",(t,r)=>r.lighting.mainLight.intensity))}function Fn(e){Nt(e.fragment),xt(e.fragment),e.fragment.code.add(s`vec3 applyShading(vec3 shadingNormalWorld, float shadow) { +float dotVal = clamp(dot(shadingNormalWorld, mainLightDirection), 0.0, 1.0); +return mainLightIntensity * ((1.0 - shadow) * dotVal); +}`)}function Bn(e){const t=e.fragment.code;t.add(s`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) +{ +return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; +}`),t.add(s`float integratedRadiance(float cosTheta2, float roughness) +{ +return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); +}`),t.add(s`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) +{ +float cosTheta2 = 1.0 - RdotNG * RdotNG; +float intRadTheta = integratedRadiance(cosTheta2, roughness); +float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; +float sky = 2.0 - ground; +return (ground * ambientGround + sky * ambientSky) * 0.5; +}`)}function Xi(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}function Er(e,t){const r=e.fragment.code;e.include(Xi),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic&&t.pbrMode!==N.Simplified&&t.pbrMode!==N.TerrainWithWater||(r.add(s`float normalDistribution(float NdotH, float roughness) +{ +float a = NdotH * roughness; +float b = roughness / (1.0 - NdotH * NdotH + a * a); +return b * b * INV_PI; +}`),r.add(s`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); +const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); +const vec2 c2 = vec2(-1.04, 1.04); +vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { +vec4 r = roughness * c0 + c1; +float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; +return c2 * a004 + r.zw; +}`)),t.pbrMode!==N.Normal&&t.pbrMode!==N.Schematic||(e.include(Bn),r.add(s`struct PBRShadingInfo +{ +float NdotV; +float LdotH; +float NdotNG; +float RdotNG; +float NdotAmbDir; +float NdotH_Horizon; +vec3 skyRadianceToSurface; +vec3 groundRadianceToSurface; +vec3 skyIrradianceToSurface; +vec3 groundIrradianceToSurface; +float averageAmbientRadiance; +float ssao; +vec3 albedoLinear; +vec3 f0; +vec3 f90; +vec3 diffuseColor; +float metalness; +float roughness; +};`),r.add(s`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { +vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); +vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); +vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; +vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); +vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; +vec3 specularComponent = specularColor * indirectSpecular; +return (diffuseComponent + specularComponent); +}`),r.add(s`float gamutMapChanel(float x, vec2 p){ +return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); +}`),r.add(s`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ +vec3 outColor; +vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); +outColor.x = gamutMapChanel(inColor.x, p) ; +outColor.y = gamutMapChanel(inColor.y, p) ; +outColor.z = gamutMapChanel(inColor.z, p) ; +return outColor; +}`))}let zn=class extends J{constructor(e,t){super(e,"bool",R.Pass,(r,i,o)=>r.setUniform1b(e,t(i,o)))}};const Gn=.4;function Sr(e){e.constants.add("ambientBoostFactor","float",Gn)}function Ar(e){e.uniforms.add(new ie("lightingGlobalFactor",(t,r)=>r.lighting.globalFactor))}function Ji(e,t){const r=e.fragment;switch(e.include(br,t),t.pbrMode!==N.Disabled&&e.include(Er,t),e.include(Dn,t),e.include(Xi),r.code.add(s` + const float GAMMA_SRGB = 2.1; + const float INV_GAMMA_SRGB = 0.4761904; + ${t.pbrMode===N.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} + `),Sr(r),Ar(r),Nt(r),r.code.add(s` + float additionalDirectedAmbientLight(vec3 vPosWorld) { + float vndl = dot(${t.spherical?s`normalize(vPosWorld)`:s`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); + return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); + } + `),xt(r),r.code.add(s`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { +float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); +return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; +}`),t.pbrMode){case N.Disabled:case N.WaterOnIntegratedMesh:case N.Water:e.include(Fn),r.code.add(s`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) { +vec3 mainLighting = applyShading(normalWorld, shadow); +vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); +vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +vec3 totalLight = mainLighting + ambientLighting + additionalLight; +totalLight = min(totalLight, vec3(PI)); +vec3 outColor = vec3((albedoLinear / PI) * totalLight); +return pow(outColor, vec3(INV_GAMMA_SRGB)); +}`);break;case N.Normal:case N.Schematic:r.code.add(s`const float fillLightIntensity = 0.25; +const float horizonLightDiffusion = 0.4; +const float additionalAmbientIrradianceFactor = 0.02; +vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec4 _emission, float additionalAmbientIrradiance) +{ +vec3 viewDirection = -viewDir; +vec3 h = normalize(viewDirection + mainLightDirection); +PBRShadingInfo inputs; +inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); +inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); +vec3 reflectedView = normalize(reflect(viewDirection, normal)); +inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); +inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +inputs.ssao = ssao; +inputs.metalness = mrr[0]; +inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(s`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; +inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new zn("hasFillLights",(i,o)=>o.enableFillLights)):r.constants.add("hasFillLights","bool",!1),r.code.add(s`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); +ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); +inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; +float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); +vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity; +vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; +inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; +inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new ie("lightingSpecularStrength",(i,o)=>o.lighting.mainLight.specularStrength),new ie("lightingEnvironmentStrength",(i,o)=>o.lighting.mainLight.environmentStrength)).code.add(s`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; +vec3 horizonRingH = normalize(viewDirection + horizonRingDir); +inputs.NdotH_Horizon = dot(normal, horizonRingH); +float NdotH = clamp(dot(normal, h), 0.0, 1.0); +vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); +vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; +vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; +float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); +inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(s` + vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); + vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; + vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : pow(_emission.rgb, vec3(GAMMA_SRGB)); + vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; + ${t.pbrMode!==N.Schematic||t.hasColorTexture?s`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:s`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} + return outColor; + } + `);break;case N.Simplified:case N.TerrainWithWater:Nt(r),xt(r),r.code.add(s`const float roughnessTerrain = 0.5; +const float specularityTerrain = 0.5; +const vec3 fresnelReflectionTerrain = vec3(0.04); +vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { +vec3 viewDirection = -vd; +vec3 h = normalize(viewDirection + mainLightDirection); +float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); +float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); +float NdotH = clamp(dot(n, h), 0.0, 1.0); +float NdotNG = clamp(dot(n, nup), -1.0, 1.0); +vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); +float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; +vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; +vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; +vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; +vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; +vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; +vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; +vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); +vec3 specularColor = f0 * dfg.x + f90 * dfg.y; +vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; +vec3 outColorLinear = outDiffColor + specularComponent; +vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); +return outColor; +}`);break;default:zt(t.pbrMode);case N.COUNT:}}let Vn=class extends J{constructor(e,t,r){super(e,"mat4",R.Draw,(i,o,a,n)=>i.setUniformMatrix4fv(e,t(o,a,n)),r)}},Hn=class extends J{constructor(e,t,r){super(e,"mat4",R.Pass,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a)),r)}};function Zi(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Hn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Ki(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new Vn("shadowMapMatrix",(r,i)=>i.shadowMap.getShadowMapMatrices(r.origin),4)),Qi(e))}function Qi(e){const t=e.fragment;t.include(Wi),t.uniforms.add(new X("shadowMap",(r,i)=>i.shadowMap.depthTexture),new gr("numCascades",(r,i)=>i.shadowMap.numCascades),new te("cascadeDistances",(r,i)=>i.shadowMap.cascadeDistances)).code.add(s`int chooseCascade(float depth, out mat4 mat) { +vec4 distance = cascadeDistances; +int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; +mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; +return i; +} +vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { +vec4 lv = mat * vec4(_vpos, 1.0); +lv.xy /= lv.w; +return 0.5 * lv.xyz + vec3(0.5); +} +vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { +float xScale = float(textureSize.y) / float(textureSize.x); +return vec2((float(i) + lvpos.x) * xScale, lvpos.y); +} +float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { +return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); +} +float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { +return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; +} +float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { +vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); +ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); +float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); +float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); +float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); +float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); +return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); +} +float readShadowMap(const in vec3 _vpos, float _linearDepth) { +mat4 mat; +int i = chooseCascade(_linearDepth, mat); +if (i >= numCascades) { return 0.0; } +vec3 lvpos = lightSpacePosition(_vpos, mat); +if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } +ivec2 size = textureSize(shadowMap, 0); +vec2 uv = cascadeCoordinates(i, size, lvpos); +return filterShadow(uv, lvpos, size, shadowMap); +}`)}function eo(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:i}){r?(e.fragment.include(_r),e.fragment.uniforms.add(new X("terrainDepthTexture",(o,a)=>a.terrainDepth?.attachment)).code.add(s` + ${t?"bool":"void"} terrainDepthTest(float fragmentDepth) { + float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r; + float linearDepth = linearizeDepth(depth); + ${t?s`return fragmentDepth < linearDepth && depth < 1.0;`:s`if(fragmentDepth ${i?">":"<="} linearDepth) discard;`} + }`)):t?e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) false`):e.fragment.code.add(s`#define terrainDepthTest(fragmentDepth) {}`)}function Un(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new ue("colorTextureTransformMatrix",r=>r.colorTextureTransformMatrix??et)).code.add(s`void forwardColorUV(){ +colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardColorUV(){}`)}function Wn(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new ue("normalTextureTransformMatrix",r=>r.normalTextureTransformMatrix??et)).code.add(s`void forwardNormalUV(){ +normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardNormalUV(){}`)}function jn(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new ue("emissiveTextureTransformMatrix",r=>r.emissiveTextureTransformMatrix??et)).code.add(s`void forwardEmissiveUV(){ +emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardEmissiveUV(){}`)}function $n(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new ue("occlusionTextureTransformMatrix",r=>r.occlusionTextureTransformMatrix??et)).code.add(s`void forwardOcclusionUV(){ +occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardOcclusionUV(){}`)}function qn(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==K.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new ue("metallicRoughnessTextureTransformMatrix",r=>r.metallicRoughnessTextureTransformMatrix??et)).code.add(s`void forwardMetallicRoughnessUV(){ +metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)):e.vertex.code.add(s`void forwardMetallicRoughnessUV(){}`)}function to(e){e.code.add(s`vec4 premultiplyAlpha(vec4 v) { +return vec4(v.rgb * v.a, v.a); +} +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +float rgb2v(vec3 c) { +return max(c.x, max(c.y, c.z)); +}`)}function ro(e){e.include(to),e.code.add(s` + vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { + // workaround for artifacts in macOS using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + vec3 internalMixed = internalColor * textureColor; + vec3 allMixed = internalMixed * externalColor; + + if (mode == ${s.int(fe.Multiply)}) { + return allMixed; + } + if (mode == ${s.int(fe.Ignore)}) { + return internalMixed; + } + if (mode == ${s.int(fe.Replace)}) { + return externalColor; + } + + // tint (or something invalid) + float vIn = rgb2v(internalMixed); + vec3 hsvTint = rgb2hsv(externalColor); + vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); + return hsv2rgb(hsvOut); + } + + float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { + // workaround for artifacts in macOS using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + float internalMixed = internalOpacity * textureOpacity; + float allMixed = internalMixed * externalOpacity; + + if (mode == ${s.int(fe.Ignore)}) { + return internalMixed; + } + if (mode == ${s.int(fe.Replace)}) { + return externalOpacity; + } + + // multiply or tint (or something invalid) + return allMixed; + } + `)}var se;(function(e){e[e.None=0]="None",e[e.Value=1]="Value",e[e.Texture=2]="Texture",e[e.COUNT=3]="COUNT"})(se||(se={}));function kn(e,t){if(!ft(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:i,bindType:o}=t,a=r===se.Texture;a&&(e.include(xr,t),e.fragment.uniforms.add(o===R.Pass?new X("texEmission",l=>l.textureEmissive):new pt("texEmission",l=>l.textureEmissive)));const n=r===se.Value||a;n&&e.fragment.uniforms.add(o===R.Pass?new q("emissionFactor",l=>l.emissiveFactor):new le("emissionFactor",l=>l.emissiveFactor)),e.fragment.code.add(s` + vec4 getEmissions() { + vec4 emissions = ${n?"vec4(emissionFactor, 1.0)":"vec4(0.0)"}; + ${y(a,`emissions *= textureLookup(texEmission, ${i?"emissiveUV":"vuv0"}); + emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}; + return emissions; + } + `)}function io(e,t){e.include(ji,t),e.include(kn,t),e.fragment.include(to);const r=t.output===F.ObjectAndLayerIdColor,i=vi(t.output),o=ft(t.output)&&t.oitPass===k.ColorAlpha,a=ft(t.output)&&t.oitPass!==k.ColorAlpha,n=t.discardInvisibleFragments;let l=0;(a||i||o)&&e.outputs.add("fragColor","vec4",l++),i&&e.outputs.add("fragEmission","vec4",l++),o&&e.outputs.add("fragAlpha","float",l++),e.fragment.code.add(s` + void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) { + ${y(r,s`finalColor.a = 1.0;`)} + + ${y(n,s`if (finalColor.a < ${s.float(be)}){ + discard; + return; + }`)} + + finalColor = highlightSlice(finalColor, vWorldPosition); + ${y(o,s`fragColor = premultiplyAlpha(finalColor); + fragAlpha = finalColor.a;`)} + ${y(a,"fragColor = finalColor;")} + ${y(i,"fragEmission = getEmissions();")} + calculateOcclusionAndOutputHighlight(); + ${y(r,"outputObjectAndLayerIdColor();")} + } + `)}function Yn(e){const t=new jt,{vertex:r,fragment:i,varyings:o}=t,{output:a,normalType:n,offsetBackfaces:l,instancedColor:c,spherical:u,receiveShadows:d,snowCover:h,pbrMode:v,textureAlphaPremultiplied:f,instancedDoublePrecision:T,hasVertexColors:_,hasVertexTangents:x,hasColorTexture:V,hasNormalTexture:D,hasNormalTextureTransform:B,hasColorTextureTransform:P}=e;if(je(r,e),t.include(pr),o.add("vpos","vec3"),t.include(lt,e),t.include(zi,e),t.include(Ui,e),t.include(Un,e),!ft(a))return t.include($i,e),t;t.include(Wn,e),t.include(jn,e),t.include($n,e),t.include(qn,e),gt(r,e),t.include(Bt,e),t.include(We,e);const G=n===Q.Attribute||n===Q.Compressed;return G&&l&&t.include(Ni),t.include(rn,e),t.include(Si,e),c&&t.attributes.add(p.INSTANCECOLOR,"vec4"),o.add("vPositionLocal","vec3"),t.include(Ne,e),t.include(Li,e),t.include(Gi,e),t.include(Vi,e),r.uniforms.add(new te("externalColor",w=>w.externalColor)),o.add("vcolorExt","vec4"),e.terrainDepthTest&&o.add("depth","float"),r.main.add(s` + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${y(c,"vcolorExt *= instanceColor * 0.003921568627451;")} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${s.float(be)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + vPositionLocal = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + ${y(G,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")} + vpos = addVerticalOffset(vpos, localOrigin); + ${y(x,"vTangent = dpTransformVertexTangent(tangent);")} + gl_Position = transformPosition(proj, view, vpos); + ${y(G&&l,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} + } + + ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} + forwardLinearDepth(); + forwardTextureCoordinates(); + forwardColorUV(); + forwardNormalUV(); + forwardEmissiveUV(); + forwardOcclusionUV(); + forwardMetallicRoughnessUV(); + `),t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(T?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(i,e),i.uniforms.add(r.uniforms.get("localOrigin"),new q("ambient",w=>w.ambient),new q("diffuse",w=>w.diffuse),new ie("opacity",w=>w.opacity),new ie("layerOpacity",w=>w.layerOpacity)),V&&i.uniforms.add(new X("tex",w=>w.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),t.include(tn,e),Sr(i),Ar(i),xt(i),i.main.add(s` + discardBySlice(vpos); + ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} + ${V?s` + vec4 texColor = texture(tex, ${P?"colorUV":"vuv0"}); + ${y(f,"texColor.rgb /= texColor.a;")} + discardOrAdjustAlpha(texColor);`:s`vec4 texColor = vec4(1.0);`} + shadingParams.viewDirection = normalize(vpos - cameraPosition); + ${n===Q.ScreenDerivative?s`vec3 normal = screenDerivativeNormal(vPositionLocal);`:s`shadingParams.normalView = vNormalWorld; + vec3 normal = shadingNormal(shadingParams);`} + applyPBRFactors(); + float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion(); + + vec3 posWorld = vpos + localOrigin; + + float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); + float shadow = ${d?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":y(u,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")}; + + vec3 matColor = max(ambient, diffuse); + vec3 albedo = mixExternalColor(${y(_,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(${y(_,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, int(colorMixMode)); + ${D?`mat3 tangentSpace = computeTangentSpace(${x?"normal":"normal, vpos, vuv0"}); + vec3 shadingNormal = computeTextureNormal(tangentSpace, ${B?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"} + vec3 normalGround = ${u?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"} + + ${y(h,s` + float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); + albedo = mix(albedo, vec3(1), snow); + shadingNormal = mix(shadingNormal, normal, snow); + ssao = mix(ssao, 1.0, snow);`)} + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${v===N.Normal||v===N.Schematic?s` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${y(h,s`mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);`)} + vec4 emission = ${h?"mix(getEmissions(), vec4(0.0), snow)":"getEmissions()"}; + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + vec4 finalColor = vec4(shadedColor, opacity_); + outputColorHighlightOID(finalColor, vpos); + `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},ec=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let tc=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` +`);return this._parameterBits=t,r}};function b(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const i=e.count||2,o=Math.ceil(Math.log2(i)),a=t._parameterBits;let n=0;for(;a[n]+o>16;)n++,n>=a.length&&a.push(0);const l=a[n],c=(1<>l},set(u){if(this[r]!==u){if(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<>l)},set(u){if(this[r]!==u&&(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<v.externalColor)),o.add("vcolorExt","vec4"),r.main.add(s` + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${y(l,"vcolorExt *= instanceColor * 0.003921568627451;")} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${s.float(be)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + localvpos = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + vNormalWorld = dpNormal(vvLocalNormal(normalModel())); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + ${y(n,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")} + } + ${y(e.terrainDepthTest,"depth = (view * vec4(vpos, 1.0)).z;")} + forwardLinearDepth(); + forwardTextureCoordinates();`)),a===F.Color){const{hasColorTexture:v,hasColorTextureTransform:f,receiveShadows:T}=e;t.include(Ji,e),t.include(br,e),t.include($e,e),t.include(e.instancedDoublePrecision?Zi:Ki,e),t.include(eo,e),t.include(Ue,e),t.include(io,e),gt(t.fragment,e),Nt(i),Sr(i),Ar(i),i.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new q("ambient",_=>_.ambient),new q("diffuse",_=>_.diffuse),new ie("opacity",_=>_.opacity),new ie("layerOpacity",_=>_.layerOpacity)),v&&i.uniforms.add(new X("tex",_=>_.texture)),t.include(Yi,e),t.include(Er,e),i.include(ro),xt(i),i.main.add(s` + discardBySlice(vpos); + ${y(e.terrainDepthTest,"terrainDepthTest(depth);")} + vec4 texColor = ${v?`texture(tex, ${f?"colorUV":"vuv0"})`:" vec4(1.0)"}; + ${y(v,`${y(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")} + discardOrAdjustAlpha(texColor);`)} + vec3 viewDirection = normalize(vpos - cameraPosition); + applyPBRFactors(); + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + float shadow = ${T?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":d?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + vec3 matColor = max(ambient, diffuse); + ${e.hasVertexColors?s`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:s`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${y(u,"albedo = mix(albedo, vec3(1), 0.9);")} + ${s`vec3 shadingNormal = normalize(vNormalWorld); + albedo *= 1.2; + vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); + float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); + float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); + float treeRadialFalloff = vColor.r; + float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); + additionalLight += backLightFactor * mainLightIntensity;`} + ${y(h,`vec3 normalGround = ${d?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)} + ${h?s`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${y(u,s`mrr = vec3(0.0, 1.0, 0.04);`)} + vec4 emission = ${u?"vec4(0.0)":"getEmissions()"}; + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + vec4 finalColor = vec4(shadedColor, opacity_); + outputColorHighlightOID(finalColor, vpos);`)}return t.include($i,e),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,build:el},Symbol.toStringTag,{value:"Module"}));class rl extends oo{constructor(t,r,i){super(t,r,i,new Wt(tl,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class oc extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;d=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const jt=t;export{jt as default}; diff --git a/custom-toc-separator/assets/BaseDynamicLayerView2D-AQ-6l0DU-DEkPHEPx.js b/custom-toc-separator/assets/BaseDynamicLayerView2D-AQ-6l0DU-DEkPHEPx.js new file mode 100644 index 00000000..54853cd8 --- /dev/null +++ b/custom-toc-separator/assets/BaseDynamicLayerView2D-AQ-6l0DU-DEkPHEPx.js @@ -0,0 +1 @@ +import{aU as e,a1 as a,v as o,S as p,i as s}from"./story-DT1Ep1ux.js";import{d as n}from"./BitmapContainer-BC8fvmFc-CdhuTm0j.js";import{X as h,Y as d}from"./LayerView-Bish-E63-B3VRdVIM.js";import{K as g}from"./ExportStrategy-BNE7Gp0u-BzAy5Mad.js";import{n as u}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import"./main-BTdHgocv.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./Bitmap-CcqmzvfR-ppkuK-SZ.js";let t=class extends u(h(d)){update(r){this._strategy.update(r).catch(i=>{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const jt=t;export{jt as default}; diff --git a/custom-toc-separator/assets/Basemap-BEqqSTw9-1Mix6R1G.js b/custom-toc-separator/assets/Basemap-BEqqSTw9-1Mix6R1G.js new file mode 100644 index 00000000..e4f9f66a --- /dev/null +++ b/custom-toc-separator/assets/Basemap-BEqqSTw9-1Mix6R1G.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-DnJXdOOq.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./portalLayers-Bh9bAhk4-iIxSwWC_.js","./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./styleUtils-ChrJTYIw-DnWMc-4t.js"])))=>i.map(i=>d[i]); +import{_ as A}from"./main-BTdHgocv.js";import{bw as t,v as l,bA as O,ag as h,a1 as u,aA as k,am as S,cz as L,P as D,cA as f,$ as T,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,cB as N,aB as C}from"./story-DT1Ep1ux.js";import{y as P}from"./loadAll-e978YItg-EK1YwFYX.js";import x from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{y as w}from"./writeUtils-D5qlLkwk-BD0oSm_9.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return t("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return t("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends O(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=k(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=D(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await A(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-DnJXdOOq.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,ae=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{ae as B,Q as F,F as s}; diff --git a/custom-toc-separator/assets/Basemap-BEqqSTw9-6qmF8bsX.js b/custom-toc-separator/assets/Basemap-BEqqSTw9-6qmF8bsX.js deleted file mode 100644 index 92d7dd56..00000000 --- a/custom-toc-separator/assets/Basemap-BEqqSTw9-6qmF8bsX.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-BV4FNk7k.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./portalLayers-Bh9bAhk4-DRZYQiud.js","./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./PortalItem-CctGdnxF-DgukgleB.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./styleUtils-ChrJTYIw-CbI3fdq_.js"])))=>i.map(i=>d[i]); -import{_ as A}from"./main-lj2zzr_L.js";import{bw as t,v as l,bA as O,ag as h,a1 as u,aA as k,am as S,cz as L,P as D,cA as f,$ as T,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,cB as N,aB as C}from"./story-OUarUCIt.js";import{y as P}from"./loadAll-e978YItg-cyBswBq0.js";import x from"./PortalItem-CctGdnxF-DgukgleB.js";import{y as w}from"./writeUtils-D5qlLkwk-BhsnyRJI.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return t("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return t("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return t("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return t("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return t("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return t("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return t("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return t("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return t("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends O(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=k(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=D(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await A(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-BV4FNk7k.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,ae=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{ae as B,Q as F,F as s}; diff --git a/custom-toc-separator/assets/BingMapsLayer-BigMnKl_-BIiqswnB.js b/custom-toc-separator/assets/BingMapsLayer-BigMnKl_-BIiqswnB.js deleted file mode 100644 index 3a198741..00000000 --- a/custom-toc-separator/assets/BingMapsLayer-BigMnKl_-BIiqswnB.js +++ /dev/null @@ -1 +0,0 @@ -import{J as h,n as j,bh as x,f as c,o as u,v as a,S as o,i as M,aK as B,w as U}from"./story-OUarUCIt.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as R}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as T}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{T as k}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as I}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{u as f}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import{V as m,d as r}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{e as L}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import{E as _}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";var v;const y=new L("0/0/0",0,0,0,void 0);let g=v=class extends T(I(k(R))){constructor(){super(...arguments),this.tileInfo=m.create({spatialReference:h.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,h.WebMercator),this.spatialReference=h.WebMercator}getTileBounds(e,t,i,l){const s=l||x();return y.level=e,y.row=t,y.col=i,y.extent=s,this.tileInfo.updateTileInfo(y),y.extent=void 0,s}fetchTile(e,t,i,l={}){const{signal:s}=l,p=this.getTileUrl(e,t,i),d={responseType:"image",signal:s,query:{...this.refreshParameters}};return c(p??"",d).then(b=>b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(K)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,H=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(H,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const mt=n;n.from=h(n);export{mt as default}; diff --git a/custom-toc-separator/assets/BinsQuery-DjwQZqB8-xSRrS-fI.js b/custom-toc-separator/assets/BinsQuery-DjwQZqB8-xSRrS-fI.js deleted file mode 100644 index f17b7be5..00000000 --- a/custom-toc-separator/assets/BinsQuery-DjwQZqB8-xSRrS-fI.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as B,e as g,v as e,S as r,i as y,bG as h,aK as R,bz as d,cr as O,aE as M,a1 as N,J as x,af as V,g as I,dK as j}from"./story-OUarUCIt.js";import{Z as S}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{m as Z,a as L,s as $}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./main-lj2zzr_L.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";let l=class extends B(g){constructor(t){super(t),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};e([r({type:String,json:{write:!0}})],l.prototype,"alias",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"expression",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"responseType",void 0),l=e([y("esri.rest.support.BinParametersAttributes")],l);const w=l;l.from=h(l);const K=new R({naturalLog:"natural-log",squareRoot:"square-root"});let s=class extends B(g){constructor(t){super(t),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};e([r({type:String,json:{write:!0}})],s.prototype,"expression",void 0),e([r({type:String,json:{name:"onField",write:!0}})],s.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"firstDayOfWeek",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"hideUpperBound",void 0),e([r({type:w,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(t,i)=>{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(K)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,H=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(H,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const mt=n;n.from=h(n);export{mt as default}; diff --git a/custom-toc-separator/assets/Bitmap-CcqmzvfR-BO796kOM.js b/custom-toc-separator/assets/Bitmap-CcqmzvfR-BO796kOM.js deleted file mode 100644 index f6a4e527..00000000 --- a/custom-toc-separator/assets/Bitmap-CcqmzvfR-BO796kOM.js +++ /dev/null @@ -1 +0,0 @@ -import{b as p,cW as c,bt as x}from"./story-OUarUCIt.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as v}from"./Texture-BCt2hphT-Bv29bzNX.js";class y{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof y?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{C as I,y as d,T as p,A as x}; diff --git a/custom-toc-separator/assets/Bitmap-CcqmzvfR-ppkuK-SZ.js b/custom-toc-separator/assets/Bitmap-CcqmzvfR-ppkuK-SZ.js new file mode 100644 index 00000000..463dee9b --- /dev/null +++ b/custom-toc-separator/assets/Bitmap-CcqmzvfR-ppkuK-SZ.js @@ -0,0 +1 @@ +import{b as p,cW as c,bt as x}from"./story-DT1Ep1ux.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as v}from"./Texture-BCt2hphT-B6HwLstV.js";class y{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof y?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{C as I,y as d,T as p,A as x}; diff --git a/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-CdhuTm0j.js b/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-CdhuTm0j.js new file mode 100644 index 00000000..555de9be --- /dev/null +++ b/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-CdhuTm0j.js @@ -0,0 +1 @@ +import{N as r,s as a}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{E as t}from"./MapView-BGOJJ8ch-Dabu63Ao.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};export{h as d}; diff --git a/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-kxGu4sMT.js b/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-kxGu4sMT.js deleted file mode 100644 index 170a0c15..00000000 --- a/custom-toc-separator/assets/BitmapContainer-BC8fvmFc-kxGu4sMT.js +++ /dev/null @@ -1 +0,0 @@ -import{N as r,s as a}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{E as t}from"./MapView-BGOJJ8ch-MH2z-up5.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};export{h as d}; diff --git a/custom-toc-separator/assets/BlendLayer-D1WkSmwP-Ci8H7GFA.js b/custom-toc-separator/assets/BlendLayer-D1WkSmwP-Ci8H7GFA.js deleted file mode 100644 index a415e5f1..00000000 --- a/custom-toc-separator/assets/BlendLayer-D1WkSmwP-Ci8H7GFA.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as t,i as n}from"./story-OUarUCIt.js";import{l,p as a}from"./jsonUtils-wIllKWI4-DQMnFF3M.js";const s={type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; diff --git a/custom-toc-separator/assets/BlendLayer-D1WkSmwP-DaCYrII3.js b/custom-toc-separator/assets/BlendLayer-D1WkSmwP-DaCYrII3.js new file mode 100644 index 00000000..0035421f --- /dev/null +++ b/custom-toc-separator/assets/BlendLayer-D1WkSmwP-DaCYrII3.js @@ -0,0 +1 @@ +import{v as r,S as t,i as n}from"./story-DT1Ep1ux.js";import{l,p as a}from"./jsonUtils-wIllKWI4-ChoaxSoX.js";const s={type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; diff --git a/custom-toc-separator/assets/BoundsStore--N6o1xkF-OMiRxUp-.js b/custom-toc-separator/assets/BoundsStore--N6o1xkF-OMiRxUp-.js deleted file mode 100644 index 4462aa2f..00000000 --- a/custom-toc-separator/assets/BoundsStore--N6o1xkF-OMiRxUp-.js +++ /dev/null @@ -1 +0,0 @@ -import{K as o,h6 as h}from"./story-OUarUCIt.js";import{N as a}from"./PooledRBush-DbfAmeLn-D1-Igyfv.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; diff --git a/custom-toc-separator/assets/BoundsStore--N6o1xkF-vTEQb1N7.js b/custom-toc-separator/assets/BoundsStore--N6o1xkF-vTEQb1N7.js new file mode 100644 index 00000000..a3308185 --- /dev/null +++ b/custom-toc-separator/assets/BoundsStore--N6o1xkF-vTEQb1N7.js @@ -0,0 +1 @@ +import{K as o,h6 as h}from"./story-DT1Ep1ux.js";import{N as a}from"./PooledRBush-DbfAmeLn-BhVBo5wc.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; diff --git a/custom-toc-separator/assets/BufferObject-BM_7mcDb-D5jPRgIi.js b/custom-toc-separator/assets/BufferObject-BM_7mcDb-D5jPRgIi.js new file mode 100644 index 00000000..892df84e --- /dev/null +++ b/custom-toc-separator/assets/BufferObject-BM_7mcDb-D5jPRgIi.js @@ -0,0 +1 @@ +import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./story-DT1Ep1ux.js";import{N as h}from"./Texture-BCt2hphT-B6HwLstV.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; diff --git a/custom-toc-separator/assets/BufferObject-BM_7mcDb-Pn3dvEnK.js b/custom-toc-separator/assets/BufferObject-BM_7mcDb-Pn3dvEnK.js deleted file mode 100644 index 926feba2..00000000 --- a/custom-toc-separator/assets/BufferObject-BM_7mcDb-Pn3dvEnK.js +++ /dev/null @@ -1 +0,0 @@ -import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./story-OUarUCIt.js";import{N as h}from"./Texture-BCt2hphT-Bv29bzNX.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; diff --git a/custom-toc-separator/assets/BufferView-PQoE3GL7-B_xfzNdr.js b/custom-toc-separator/assets/BufferView-PQoE3GL7-B_xfzNdr.js deleted file mode 100644 index e8b8f3e9..00000000 --- a/custom-toc-separator/assets/BufferView-PQoE3GL7-B_xfzNdr.js +++ /dev/null @@ -1 +0,0 @@ -import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(p,e,t)}static fromTypedArray(e,t){return new p(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}p.ElementType="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f64";class a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class b extends q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; diff --git a/custom-toc-separator/assets/BufferView-PQoE3GL7-Dv7NCnc6.js b/custom-toc-separator/assets/BufferView-PQoE3GL7-Dv7NCnc6.js new file mode 100644 index 00000000..4d95ed28 --- /dev/null +++ b/custom-toc-separator/assets/BufferView-PQoE3GL7-Dv7NCnc6.js @@ -0,0 +1 @@ +import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(p,e,t)}static fromTypedArray(e,t){return new p(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}p.ElementType="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f64";class a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class b extends q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; diff --git a/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-Bf9jDBFL.js b/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-Bf9jDBFL.js deleted file mode 100644 index 1551105c..00000000 --- a/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-Bf9jDBFL.js +++ /dev/null @@ -1 +0,0 @@ -import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./story-OUarUCIt.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-cyBswBq0.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as Te}from"./Layer-ChoECxvZ-DxWUU3pP.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{u as Be}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import oe from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-Dbvqi9tG.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js";import{b as Ce}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as Ue}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j-CH-xwlo7.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-911d_F5-.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as We}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Ei=n;export{Ei as default}; diff --git a/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-BzWvrqye.js b/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-BzWvrqye.js new file mode 100644 index 00000000..d9b2173c --- /dev/null +++ b/custom-toc-separator/assets/BuildingSceneLayer-IIePcdNz-BzWvrqye.js @@ -0,0 +1 @@ +import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./story-DT1Ep1ux.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-EK1YwFYX.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as Te}from"./Layer-ChoECxvZ-ocw70508.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{u as Be}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import oe from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-CobyO2zX.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js";import{b as Ce}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as Ue}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j-DOy8KABV.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as We}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./projectVectorToVector-sIYLNlex-DFXrlpsW.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./sphere-BenPORjV-B4r28WKg.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Ei=n;export{Ei as default}; diff --git a/custom-toc-separator/assets/Button-MQvwxOnj-K6z9w3ks.js b/custom-toc-separator/assets/Button-MQvwxOnj-K6z9w3ks.js new file mode 100644 index 00000000..f6861aeb --- /dev/null +++ b/custom-toc-separator/assets/Button-MQvwxOnj-K6z9w3ks.js @@ -0,0 +1 @@ +import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-Cwu0Sicn.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; diff --git a/custom-toc-separator/assets/Button-MQvwxOnj-bFRWo4ou.js b/custom-toc-separator/assets/Button-MQvwxOnj-bFRWo4ou.js deleted file mode 100644 index be94642f..00000000 --- a/custom-toc-separator/assets/Button-MQvwxOnj-bFRWo4ou.js +++ /dev/null @@ -1 +0,0 @@ -import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-DrMnmN3S.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; diff --git a/custom-toc-separator/assets/CSVLayer-CJQy-BsL-CjuxNbH0.js b/custom-toc-separator/assets/CSVLayer-CJQy-BsL-CjuxNbH0.js deleted file mode 100644 index 520435f9..00000000 --- a/custom-toc-separator/assets/CSVLayer-CJQy-BsL-CjuxNbH0.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as r,i as d,a0 as v,jy as w,cS as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./story-OUarUCIt.js";import J from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{q as C}from"./workers-PiCjreoO-mU03Z-E4.js";import{O as P}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{$ as j}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{b as l}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./main-lj2zzr_L.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(this.sourceJSON.extent=s),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([v("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const de=o;export{de as default}; diff --git a/custom-toc-separator/assets/CSVLayer-CJQy-BsL-DRo8sxgB.js b/custom-toc-separator/assets/CSVLayer-CJQy-BsL-DRo8sxgB.js new file mode 100644 index 00000000..37c9f0d6 --- /dev/null +++ b/custom-toc-separator/assets/CSVLayer-CJQy-BsL-DRo8sxgB.js @@ -0,0 +1 @@ +import{v as i,S as r,i as d,a0 as v,jy as w,cS as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./story-DT1Ep1ux.js";import J from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import{q as C}from"./workers-PiCjreoO-DrDY4oeh.js";import{O as P}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{$ as j}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{b as l}from"./Query-BrwMGK8U-FWeI_AU8.js";import"./main-BTdHgocv.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(this.sourceJSON.extent=s),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([v("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const de=o;export{de as default}; diff --git a/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-Cr9lyNSH.js b/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-Cr9lyNSH.js deleted file mode 100644 index a721b0d5..00000000 --- a/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-Cr9lyNSH.js +++ /dev/null @@ -1,4 +0,0 @@ -import{o as F,ay as j,aU as V,a1 as L,a as P,f as R,cl as T,ck as $,aC as A,dd as G,eM as M,J as Q,eS as Y,gK as Z,cp as I,gT as J}from"./story-OUarUCIt.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-Cytmrlsd.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{f as ee}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{Z as te}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{N as ie}from"./number-eRKYXfX9-DRLtE8-p.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{o as _}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` -`,le=[","," ",";","|"," "];function*O(o,i,e){let t=0;for(;t<=o.length;){const n=o.indexOf(i,t),a=o.slice(t,n>-1?n:void 0);t+=a.length+i.length,e&&!a.trim()||(yield a)}}function C(o){const i=o.includes(`\r -`)?`\r -`:S;return O(o,i,!0)}function q(o,i){return O(o,i,!1)}function ce(o,i,e){o=o.trim(),i=i?.trim();const t=[],n=Array.from(new Set([e?.delimiter,...le])).filter(s=>s!=null);for(const s of n){const l=N(o,s).length,c=N(i,s).length??l;l>1&&t.push({weight:Math.min(l,c),delimiter:s})}const a=t.sort(({weight:s},{weight:l})=>l-s).map(({delimiter:s})=>s);for(const s of a){const l=k(o,s).names,c=oe(l,e?.longitudeField,e?.latitudeField);if(c.longitudeFieldName&&c.latitudeFieldName)return{delimiter:s,locationInfo:c}}return{delimiter:a[0],locationInfo:null}}function*v(o,i,e,t=()=>Object.create(null)){const n=C(o);n.next();let a="",s="",l=0,c=t(),d=0;e:for(const y of n){const f=q(y,e);for(const p of f)if(a+=s+p,s="",l+=D(p),l%2==0){if(l>0){const h=b.exec(a);if(!h){c=t(),d=0,a="",l=0;continue e}c[i[d]]=h[1].replaceAll(E,'"'),d++}else c[i[d]]=a,d++;a="",l=0}else s=e;l===0?(yield c,c=t(),d=0):s=S}}function k(o,i){const e=N(o,i).filter(n=>n!=null),t=e.map(n=>I(n));for(let n=t.length-1;n>=0;n--)t[n]||(t.splice(n,1),e.splice(n,1));return{names:t,aliases:e}}function N(o,i){if(!o?.length)return[];const e=[];let t="",n="",a=0;const s=q(o,i);for(const l of s)if(t+=n+l,n="",a+=D(l),a%2==0){if(a>0){const c=b.exec(t);c&&e.push(c[1].replaceAll(E,'"'))}else e.push(t);t="",a=0}else n=i;return e}function D(o){let i=0,e=0;for(e=o.indexOf('"',e);e>=0;)i++,e=o.indexOf('"',e+1);return i}function ue(o,i,e,t,n){const a=[],s=v(o,e,i),l=[];for(const c of s){if(l.length===10)break;l.push(c)}for(let c=0;cp[d]))){case"integer":f="esriFieldTypeInteger";break;case"double":f="esriFieldTypeDouble";break;case"date":f="esriFieldTypeDate";break;default:f="esriFieldTypeString"}a.push({name:d,type:f,alias:y,length:J(f)})}}return a}function de(o){if(!o.length)return"string";const i=/[^+\-.,0-9]/;return o.map(e=>{if(e!==""){if(!i.test(e)){let t=w(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")&&(t=Number(e),!Number.isNaN(t)||e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t))))return"double"}return U(e)?"date":"string"}}).reduce((e,t)=>e===void 0?t:t===void 0?e:e===t?t:e==="string"||t==="string"?"string":e==="double"||t==="double"?"double":void 0)}const w=function(){const o=ie(),i=new RegExp("^"+o.regexp+"$"),e=new RegExp("["+o.group+"\\s\\xa0]","g"),t=o.factor;return n=>{const a=i.exec(n);if(o.factor=t,!a)return NaN;let s=a[1];if(!a[1]){if(!a[2])return NaN;s=a[2],o.factor*=-1}return s=s.replace(e,"").replace(o.decimal,"."),+s*o.factor}}();function me(o){return JSON.parse(JSON.stringify(o))}const fe=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(i,e){this.x=i,this.y=e}}class ft{constructor(){this._queryEngine=null,this._snapshotFeatures=async i=>{const e=await this._fetch(i);return this._createFeatures(e)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(i,e={}){this._loadOptions=i;const[t]=await Promise.all([this._fetch(e.signal),this._checkProjection(i?.parsingOptions?.spatialReference)]),n=ge(t,i);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const a=await this._createFeatures(t);this._queryEngine.featureStore.addMany(a);const{fullExtent:s,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,l){const{start:c,end:d}=l;n.layerDefinition.timeInfo.timeExtent=[c,d]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(i,e.signal)}async queryFeatureCount(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(i,e.signal)}async queryObjectIds(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(i,e.signal)}async queryExtent(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(i,e.signal)}async querySnapping(i,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(i,e.signal)}async refresh(i){this._loadOptions.customParameters=i,this._snapshotTask?.abort(),this._snapshotTask=j(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),V(n)||L.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:t}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:t}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(i){const{url:e,customParameters:t}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=P(e);return(await R(n.path,{query:{...n.query,...t},responseType:"text",signal:i})).data}_createQueryEngine(i){const{objectIdField:e,fields:t,extent:n,timeInfo:a}=i.layerDefinition,s=new X({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new te({fieldsIndex:_.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:a,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(i){const{latitudeFieldName:e,longitudeFieldName:t}=this._locationInfo,{objectIdField:n,fieldsIndex:a,spatialReference:s}=this._queryEngine;let l=[];const c=[],d=a.fields.filter(r=>r.name!==n).map(r=>r.name);let y=0;const f={};for(const r of a.fields)if(r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"){const u=$(r);u!==void 0&&(f[r.name]=u)}const p=v(i,d,this._delimiter,ne(f,n));for(const r of p){const u=this._parseCoordinateValue(r[e]),g=this._parseCoordinateValue(r[t]);if(g!=null&&u!=null&&!isNaN(u)&&!isNaN(g)){r[e]=u,r[t]=g;for(const m in r)if(m!==e&&m!==t)if(a.isDateField(m))r[m]=B(r[m]);else if(a.isNumericField(m)){const x=w(r[m]);isNaN(x)?r[m]=null:r[m]=x}else r[m]!=null&&(r[m]=me(r[m]));r[n]=y,y++,l.push(new ye(g,u)),c.push(r)}}if(!A({wkid:4326},s))if(G(s))for(const r of l)[r.x,r.y]=M(r.x,r.y,he);else l=z(H,l,Q.WGS84,s,null,null);const h=[];for(let r=0;r181)&&(e=parseFloat(i)),e}async _checkProjection(i){try{await ee(Y,i)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function ge(o,i){const e=i.parsingOptions||{},t={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=t.layerDefinition={name:Z(i.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:fe,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},a=C(o),s=a.next().value?.trim(),l=a.next().value?.trim();if(!s)throw new F("csv-layer:empty-csv","CSV is empty",{csv:o});const{delimiter:c,locationInfo:d}=ce(s,l,e);if(!c)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:l,parsingOptions:e});if(!d)throw new F("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:s,secondLine:l,parsingOptions:e});t.locationInfo=d,t.delimiter=c;const{names:y,aliases:f}=k(s,c),p=ue(o,t.delimiter,y,f,t.locationInfo);if(e.fields?.length){const r=new _(e.fields);for(const u of p){const g=r.get(u.name);g&&Object.assign(u,g)}}if(!p.some(r=>r.type==="esriFieldTypeOID"&&(n.objectIdField=r.name,!0))){const r={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=r.name,p.unshift(r)}n.fields=p;const h=new _(n.fields);if(t.locationInfo&&(t.locationInfo.latitudeFieldName=h.get(t.locationInfo.latitudeFieldName).name,t.locationInfo.longitudeFieldName=h.get(t.locationInfo.longitudeFieldName).name),n.timeInfo){const r=n.timeInfo;if(r.startTimeField){const u=h.get(r.startTimeField);u?(r.startTimeField=u.name,u.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const u=h.get(r.endTimeField);u?(r.endTimeField=u.name,u.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const u=h.get(r.trackIdField);r.trackIdField=u?u.name:null}r.startTimeField||r.endTimeField||(n.timeInfo=null)}return t}export{ft as default}; diff --git a/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-DokKfA7J.js b/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-DokKfA7J.js new file mode 100644 index 00000000..03e87916 --- /dev/null +++ b/custom-toc-separator/assets/CSVSourceWorker-Bks0IzRc-DokKfA7J.js @@ -0,0 +1,4 @@ +import{o as F,ay as j,aU as V,a1 as L,a as P,f as R,cl as T,ck as $,aC as A,dd as G,eM as M,J as Q,eS as Y,gK as Z,cp as I,gT as J}from"./story-DT1Ep1ux.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{f as ee}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{Z as te}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{N as ie}from"./number-eRKYXfX9-BO7ByyLZ.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{o as _}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` +`,le=[","," ",";","|"," "];function*O(o,i,e){let t=0;for(;t<=o.length;){const n=o.indexOf(i,t),a=o.slice(t,n>-1?n:void 0);t+=a.length+i.length,e&&!a.trim()||(yield a)}}function C(o){const i=o.includes(`\r +`)?`\r +`:S;return O(o,i,!0)}function q(o,i){return O(o,i,!1)}function ce(o,i,e){o=o.trim(),i=i?.trim();const t=[],n=Array.from(new Set([e?.delimiter,...le])).filter(s=>s!=null);for(const s of n){const l=N(o,s).length,c=N(i,s).length??l;l>1&&t.push({weight:Math.min(l,c),delimiter:s})}const a=t.sort(({weight:s},{weight:l})=>l-s).map(({delimiter:s})=>s);for(const s of a){const l=k(o,s).names,c=oe(l,e?.longitudeField,e?.latitudeField);if(c.longitudeFieldName&&c.latitudeFieldName)return{delimiter:s,locationInfo:c}}return{delimiter:a[0],locationInfo:null}}function*v(o,i,e,t=()=>Object.create(null)){const n=C(o);n.next();let a="",s="",l=0,c=t(),d=0;e:for(const y of n){const f=q(y,e);for(const p of f)if(a+=s+p,s="",l+=D(p),l%2==0){if(l>0){const h=b.exec(a);if(!h){c=t(),d=0,a="",l=0;continue e}c[i[d]]=h[1].replaceAll(E,'"'),d++}else c[i[d]]=a,d++;a="",l=0}else s=e;l===0?(yield c,c=t(),d=0):s=S}}function k(o,i){const e=N(o,i).filter(n=>n!=null),t=e.map(n=>I(n));for(let n=t.length-1;n>=0;n--)t[n]||(t.splice(n,1),e.splice(n,1));return{names:t,aliases:e}}function N(o,i){if(!o?.length)return[];const e=[];let t="",n="",a=0;const s=q(o,i);for(const l of s)if(t+=n+l,n="",a+=D(l),a%2==0){if(a>0){const c=b.exec(t);c&&e.push(c[1].replaceAll(E,'"'))}else e.push(t);t="",a=0}else n=i;return e}function D(o){let i=0,e=0;for(e=o.indexOf('"',e);e>=0;)i++,e=o.indexOf('"',e+1);return i}function ue(o,i,e,t,n){const a=[],s=v(o,e,i),l=[];for(const c of s){if(l.length===10)break;l.push(c)}for(let c=0;cp[d]))){case"integer":f="esriFieldTypeInteger";break;case"double":f="esriFieldTypeDouble";break;case"date":f="esriFieldTypeDate";break;default:f="esriFieldTypeString"}a.push({name:d,type:f,alias:y,length:J(f)})}}return a}function de(o){if(!o.length)return"string";const i=/[^+\-.,0-9]/;return o.map(e=>{if(e!==""){if(!i.test(e)){let t=w(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")&&(t=Number(e),!Number.isNaN(t)||e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t))))return"double"}return U(e)?"date":"string"}}).reduce((e,t)=>e===void 0?t:t===void 0?e:e===t?t:e==="string"||t==="string"?"string":e==="double"||t==="double"?"double":void 0)}const w=function(){const o=ie(),i=new RegExp("^"+o.regexp+"$"),e=new RegExp("["+o.group+"\\s\\xa0]","g"),t=o.factor;return n=>{const a=i.exec(n);if(o.factor=t,!a)return NaN;let s=a[1];if(!a[1]){if(!a[2])return NaN;s=a[2],o.factor*=-1}return s=s.replace(e,"").replace(o.decimal,"."),+s*o.factor}}();function me(o){return JSON.parse(JSON.stringify(o))}const fe=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(i,e){this.x=i,this.y=e}}class ft{constructor(){this._queryEngine=null,this._snapshotFeatures=async i=>{const e=await this._fetch(i);return this._createFeatures(e)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(i,e={}){this._loadOptions=i;const[t]=await Promise.all([this._fetch(e.signal),this._checkProjection(i?.parsingOptions?.spatialReference)]),n=ge(t,i);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const a=await this._createFeatures(t);this._queryEngine.featureStore.addMany(a);const{fullExtent:s,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,l){const{start:c,end:d}=l;n.layerDefinition.timeInfo.timeExtent=[c,d]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(i,e.signal)}async queryFeatureCount(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(i,e.signal)}async queryObjectIds(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(i,e.signal)}async queryExtent(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(i,e.signal)}async querySnapping(i,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(i,e.signal)}async refresh(i){this._loadOptions.customParameters=i,this._snapshotTask?.abort(),this._snapshotTask=j(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),V(n)||L.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:t}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:t}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(i){const{url:e,customParameters:t}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=P(e);return(await R(n.path,{query:{...n.query,...t},responseType:"text",signal:i})).data}_createQueryEngine(i){const{objectIdField:e,fields:t,extent:n,timeInfo:a}=i.layerDefinition,s=new X({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new te({fieldsIndex:_.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:a,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(i){const{latitudeFieldName:e,longitudeFieldName:t}=this._locationInfo,{objectIdField:n,fieldsIndex:a,spatialReference:s}=this._queryEngine;let l=[];const c=[],d=a.fields.filter(r=>r.name!==n).map(r=>r.name);let y=0;const f={};for(const r of a.fields)if(r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"){const u=$(r);u!==void 0&&(f[r.name]=u)}const p=v(i,d,this._delimiter,ne(f,n));for(const r of p){const u=this._parseCoordinateValue(r[e]),g=this._parseCoordinateValue(r[t]);if(g!=null&&u!=null&&!isNaN(u)&&!isNaN(g)){r[e]=u,r[t]=g;for(const m in r)if(m!==e&&m!==t)if(a.isDateField(m))r[m]=B(r[m]);else if(a.isNumericField(m)){const x=w(r[m]);isNaN(x)?r[m]=null:r[m]=x}else r[m]!=null&&(r[m]=me(r[m]));r[n]=y,y++,l.push(new ye(g,u)),c.push(r)}}if(!A({wkid:4326},s))if(G(s))for(const r of l)[r.x,r.y]=M(r.x,r.y,he);else l=z(H,l,Q.WGS84,s,null,null);const h=[];for(let r=0;r181)&&(e=parseFloat(i)),e}async _checkProjection(i){try{await ee(Y,i)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function ge(o,i){const e=i.parsingOptions||{},t={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=t.layerDefinition={name:Z(i.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:fe,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},a=C(o),s=a.next().value?.trim(),l=a.next().value?.trim();if(!s)throw new F("csv-layer:empty-csv","CSV is empty",{csv:o});const{delimiter:c,locationInfo:d}=ce(s,l,e);if(!c)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:l,parsingOptions:e});if(!d)throw new F("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:s,secondLine:l,parsingOptions:e});t.locationInfo=d,t.delimiter=c;const{names:y,aliases:f}=k(s,c),p=ue(o,t.delimiter,y,f,t.locationInfo);if(e.fields?.length){const r=new _(e.fields);for(const u of p){const g=r.get(u.name);g&&Object.assign(u,g)}}if(!p.some(r=>r.type==="esriFieldTypeOID"&&(n.objectIdField=r.name,!0))){const r={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=r.name,p.unshift(r)}n.fields=p;const h=new _(n.fields);if(t.locationInfo&&(t.locationInfo.latitudeFieldName=h.get(t.locationInfo.latitudeFieldName).name,t.locationInfo.longitudeFieldName=h.get(t.locationInfo.longitudeFieldName).name),n.timeInfo){const r=n.timeInfo;if(r.startTimeField){const u=h.get(r.startTimeField);u?(r.startTimeField=u.name,u.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const u=h.get(r.endTimeField);u?(r.endTimeField=u.name,u.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const u=h.get(r.trackIdField);r.trackIdField=u?u.name:null}r.startTimeField||r.endTimeField||(n.timeInfo=null)}return t}export{ft as default}; diff --git a/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BhFKg4Wm.js b/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BhFKg4Wm.js new file mode 100644 index 00000000..dd8f64ae --- /dev/null +++ b/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BhFKg4Wm.js @@ -0,0 +1 @@ +import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./story-DT1Ep1ux.js";import{X as x,Y as I}from"./LayerView-Bish-E63-B3VRdVIM.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const Be=g;export{Be as default}; diff --git a/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DMBhB-ZS.js b/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DMBhB-ZS.js deleted file mode 100644 index b57777c9..00000000 --- a/custom-toc-separator/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-DMBhB-ZS.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./story-OUarUCIt.js";import{X as x,Y as I}from"./LayerView-Bish-E63-DehQ-_Za.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const Be=g;export{Be as default}; diff --git a/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-4osTYfs5.js b/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-4osTYfs5.js deleted file mode 100644 index 999f0118..00000000 --- a/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-4osTYfs5.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,i as m,S as p}from"./story-OUarUCIt.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js";import"./main-lj2zzr_L.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./LayerView-Bish-E63-DehQ-_Za.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";import"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const ar=i;export{ar as default}; diff --git a/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-DyWxjKhB.js b/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-DyWxjKhB.js new file mode 100644 index 00000000..dd068fdd --- /dev/null +++ b/custom-toc-separator/assets/CatalogFootprintLayerView2D-C0bBWVdF-DyWxjKhB.js @@ -0,0 +1 @@ +import{v as r,i as m,S as p}from"./story-DT1Ep1ux.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js";import"./main-BTdHgocv.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./timeSupport-ohWmWReZ-CSAKuiyl.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./LayerView-Bish-E63-B3VRdVIM.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";import"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const ar=i;export{ar as default}; diff --git a/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-C57OJbI0.js b/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-C57OJbI0.js deleted file mode 100644 index 028e1c25..00000000 --- a/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-C57OJbI0.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,d$ as z}from"./story-OUarUCIt.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as h}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{b as J}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{h as K}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{o as W}from"./signal-CETehA7D-TD-k6B-y.js";import{u as I}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import{k as C}from"./utils-tNxq3jkf-CgPuWip3.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{w as he}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import ce from"./FeatureLayerSource-k4WMYop1-Czmqxz6U.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as ge}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{C as ve}from"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import{E as we}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{y as xe}from"./FeatureType-C9hJmS6_-BoBeHHAU.js";import{f as je}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{p as Ce}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import{a as Pe}from"./versionUtils-LZYZz-38-CcEiEhYk.js";import qe from"./PortalItem-CctGdnxF-DgukgleB.js";import{b as m}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./External-D_wl4XAw-BzQ8-YjD.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-BlkhMH5A.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-Cdg8UCnQ.js";import"./executeForIds-Z1gkLduF-BLtp2DWt.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./executeQueryJSON-CcHnccia-C6q0seac.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Ur=s;export{Ur as default}; diff --git a/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-zoS4CiOe.js b/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-zoS4CiOe.js new file mode 100644 index 00000000..2802800c --- /dev/null +++ b/custom-toc-separator/assets/CatalogLayer-BeO1fLsl-zoS4CiOe.js @@ -0,0 +1 @@ +import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,d$ as z}from"./story-DT1Ep1ux.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as h}from"./Layer-ChoECxvZ-ocw70508.js";import{b as J}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{h as K}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{o as W}from"./signal-CETehA7D-o0XgAOKb.js";import{u as I}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import{k as C}from"./utils-tNxq3jkf-CYo4DtRj.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{w as he}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import ce from"./FeatureLayerSource-k4WMYop1-CO3-WMru.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as ge}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{C as ve}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import{E as we}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{y as xe}from"./FeatureType-C9hJmS6_-zoljUYGr.js";import{f as je}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{p as Ce}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import{a as Pe}from"./versionUtils-LZYZz-38-esAtUime.js";import qe from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{b as m}from"./Query-BrwMGK8U-FWeI_AU8.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./External-D_wl4XAw-CF3XmPYl.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./MeshTransform-C--IG09w-DmlAOJ8b.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-C1Nc4Ce5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./clientSideDefaults-BqqayPct-B1aankCm.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-LNltUUKG.js";import"./executeForIds-Z1gkLduF-CKWTLnam.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Ur=s;export{Ur as default}; diff --git a/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DWXUhrfY.js b/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DWXUhrfY.js deleted file mode 100644 index 290c002e..00000000 --- a/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DWXUhrfY.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as a,v as i,S as o,i as m}from"./story-OUarUCIt.js";import{X as n,Y as s}from"./LayerView-Bish-E63-DehQ-_Za.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const Vt=p;export{Vt as default}; diff --git a/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DisjdVa4.js b/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DisjdVa4.js new file mode 100644 index 00000000..c439a181 --- /dev/null +++ b/custom-toc-separator/assets/CatalogLayerView2D-DaUVeBuS-DisjdVa4.js @@ -0,0 +1 @@ +import{ag as a,v as i,S as o,i as m}from"./story-DT1Ep1ux.js";import{X as n,Y as s}from"./LayerView-Bish-E63-B3VRdVIM.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const Vt=p;export{Vt as default}; diff --git a/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-D74IwI72.js b/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-D74IwI72.js deleted file mode 100644 index a553022b..00000000 --- a/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-D74IwI72.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./story-OUarUCIt.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; diff --git a/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js b/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js new file mode 100644 index 00000000..879ac96e --- /dev/null +++ b/custom-toc-separator/assets/ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js @@ -0,0 +1 @@ +import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./story-DT1Ep1ux.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; diff --git a/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-BaAeLIOQ.js b/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-BaAeLIOQ.js deleted file mode 100644 index 3a6f97b2..00000000 --- a/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-BaAeLIOQ.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as r,i as d,ag as c,dx as f,av as u}from"./story-OUarUCIt.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(f(()=>this._refresh(),u))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([d("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; diff --git a/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-CzgMTVk8.js b/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-CzgMTVk8.js new file mode 100644 index 00000000..ac6377fc --- /dev/null +++ b/custom-toc-separator/assets/CollectionFlattener-DkHuHn5E-CzgMTVk8.js @@ -0,0 +1 @@ +import{v as l,S as r,i as d,ag as c,dx as f,av as u}from"./story-DT1Ep1ux.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(f(()=>this._refresh(),u))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([d("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; diff --git a/custom-toc-separator/assets/ColorBackground-gVZldRLm-BKgsF61w.js b/custom-toc-separator/assets/ColorBackground-gVZldRLm-BKgsF61w.js deleted file mode 100644 index eac783f7..00000000 --- a/custom-toc-separator/assets/ColorBackground-gVZldRLm-BKgsF61w.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as a,ar as t,i as c,e as i,P as n}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";var r;let o=r=class extends i{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(n({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const u=o;export{u as default}; diff --git a/custom-toc-separator/assets/ColorBackground-gVZldRLm-uZSN6aFO.js b/custom-toc-separator/assets/ColorBackground-gVZldRLm-uZSN6aFO.js new file mode 100644 index 00000000..f52321b8 --- /dev/null +++ b/custom-toc-separator/assets/ColorBackground-gVZldRLm-uZSN6aFO.js @@ -0,0 +1 @@ +import{v as e,S as a,ar as t,i as c,e as i,P as n}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";var r;let o=r=class extends i{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(n({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const u=o;export{u as default}; diff --git a/custom-toc-separator/assets/ColorSet-DkIwOmgs-BSZuvnWe.js b/custom-toc-separator/assets/ColorSet-DkIwOmgs-BSZuvnWe.js deleted file mode 100644 index 4e13d6eb..00000000 --- a/custom-toc-separator/assets/ColorSet-DkIwOmgs-BSZuvnWe.js +++ /dev/null @@ -1 +0,0 @@ -import{E as c,a8 as h}from"./Theme-rblUnB2V-DrMnmN3S.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; diff --git a/custom-toc-separator/assets/ColorSet-DkIwOmgs-BsDJZ3_f.js b/custom-toc-separator/assets/ColorSet-DkIwOmgs-BsDJZ3_f.js new file mode 100644 index 00000000..c73502b5 --- /dev/null +++ b/custom-toc-separator/assets/ColorSet-DkIwOmgs-BsDJZ3_f.js @@ -0,0 +1 @@ +import{E as c,a8 as h}from"./Theme-rblUnB2V-Cwu0Sicn.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; diff --git a/custom-toc-separator/assets/Container-BcuL1ZEG-Cg9V4YKU.js b/custom-toc-separator/assets/Container-BcuL1ZEG-Cg9V4YKU.js new file mode 100644 index 00000000..cd578c6f --- /dev/null +++ b/custom-toc-separator/assets/Container-BcuL1ZEG-Cg9V4YKU.js @@ -0,0 +1 @@ +import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,cU as w,cV as g}from"./story-DT1Ep1ux.js";import{e as I}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{c as V,C as F,O as M}from"./parser-DyDJ-rlI-BVBmjSW8.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&F(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class D extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends D{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{D as T,c,B as x}; diff --git a/custom-toc-separator/assets/Container-BcuL1ZEG-DGKfmUxH.js b/custom-toc-separator/assets/Container-BcuL1ZEG-DGKfmUxH.js deleted file mode 100644 index 36db4b25..00000000 --- a/custom-toc-separator/assets/Container-BcuL1ZEG-DGKfmUxH.js +++ /dev/null @@ -1 +0,0 @@ -import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,cU as w,cV as g}from"./story-OUarUCIt.js";import{e as I}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{c as V,C as F,O as M}from"./parser-DyDJ-rlI-BZnJ9Tpt.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&F(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class D extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends D{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{D as T,c,B as x}; diff --git a/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-D2O-ilop.js b/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-D2O-ilop.js new file mode 100644 index 00000000..45e3fc52 --- /dev/null +++ b/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-D2O-ilop.js @@ -0,0 +1 @@ +import{v as r,S as o,i}from"./story-DT1Ep1ux.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; diff --git a/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-DdP_vchN.js b/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-DdP_vchN.js deleted file mode 100644 index ac48914d..00000000 --- a/custom-toc-separator/assets/CustomParametersMixin-vdKsTHer-DdP_vchN.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as o,i}from"./story-OUarUCIt.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; diff --git a/custom-toc-separator/assets/Cyclical-C_9rKUUQ-BqcUyGYR.js b/custom-toc-separator/assets/Cyclical-C_9rKUUQ-BqcUyGYR.js deleted file mode 100644 index 1ae495dd..00000000 --- a/custom-toc-separator/assets/Cyclical-C_9rKUUQ-BqcUyGYR.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as r}from"./story-OUarUCIt.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; diff --git a/custom-toc-separator/assets/Cyclical-C_9rKUUQ-DFuI-YVz.js b/custom-toc-separator/assets/Cyclical-C_9rKUUQ-DFuI-YVz.js new file mode 100644 index 00000000..dc2cb502 --- /dev/null +++ b/custom-toc-separator/assets/Cyclical-C_9rKUUQ-DFuI-YVz.js @@ -0,0 +1 @@ +import{ae as r}from"./story-DT1Ep1ux.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; diff --git a/custom-toc-separator/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js b/custom-toc-separator/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js deleted file mode 100644 index a5f4fbfd..00000000 --- a/custom-toc-separator/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js +++ /dev/null @@ -1 +0,0 @@ -import{hc as m,k4 as B,k5 as _,k6 as b,cw as g,$ as h,k7 as S,f as w,b6 as j,W as I,o as A,hU as T}from"./story-OUarUCIt.js";import{A as R,h as O}from"./Indices-DEr2HrWx-Bin5_zrY.js";import{T as l}from"./enums-DBi1-Mm2-CUS1pvQe.js";function k(e,r){d(e.typedBuffer,r.typedBuffer,e.typedBufferStride,r.typedBufferStride)}function d(e,r,f=2,n=f){const o=r.length/2;let t=0,u=0;if(m(r)||B(r)){for(let i=0;i{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; diff --git a/custom-toc-separator/assets/DefaultTheme-Bt5OI-Ht-BpAhXUxl.js b/custom-toc-separator/assets/DefaultTheme-Bt5OI-Ht-BpAhXUxl.js deleted file mode 100644 index b7a2e46e..00000000 --- a/custom-toc-separator/assets/DefaultTheme-Bt5OI-Ht-BpAhXUxl.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as R,a8 as i,as as c,at as n,U as r,Y as m,au as u}from"./Theme-rblUnB2V-DrMnmN3S.js";function a(g,s,o,d){g.set(s,o.get(d)),o.on(d,p=>{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; diff --git a/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-6lZzg0HG.js b/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-6lZzg0HG.js deleted file mode 100644 index d00a6cb3..00000000 --- a/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-6lZzg0HG.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as o,i as n,e as a,aO as m}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const l=t;export{l as default}; diff --git a/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-CheIob6U.js b/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-CheIob6U.js new file mode 100644 index 00000000..bbcc9af6 --- /dev/null +++ b/custom-toc-separator/assets/DeleteForwardEditsParameters-C-_YAZEH-CheIob6U.js @@ -0,0 +1 @@ +import{v as r,S as o,i as n,e as a,aO as m}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const l=t;export{l as default}; diff --git a/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-CPmgikK_.js b/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-CPmgikK_.js deleted file mode 100644 index cdcce32b..00000000 --- a/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-CPmgikK_.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as P,ar as d,v as t,S as n,bB as h,dN as w,es as D,i as m,w as v,ad as S,ab as z,ag as R,dA as E,ah as N,ax as j,ac as A,aP as O,am as _,n as b}from"./story-OUarUCIt.js";import{y as k}from"./Analysis-BPgJ-FCw-DzBMoBqT.js";import{c as C}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import{X as L}from"./projection-BA9M1R7d-Cytmrlsd.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as B}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{E as H}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";let r=class extends P(O){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends k{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",_(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new x)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([A("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const ee=s;export{ee as default}; diff --git a/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-YOc_PB3Q.js b/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-YOc_PB3Q.js new file mode 100644 index 00000000..7e77e1bb --- /dev/null +++ b/custom-toc-separator/assets/DimensionLayer-DFh7fPYo-YOc_PB3Q.js @@ -0,0 +1 @@ +import{bA as P,ar as d,v as t,S as n,bB as h,dN as w,es as D,i as m,w as v,ad as S,ab as z,ag as R,dA as E,ah as N,ax as j,ac as A,aP as O,am as _,n as b}from"./story-DT1Ep1ux.js";import{y as k}from"./Analysis-BPgJ-FCw-Y4Lx0iev.js";import{c as C}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import{X as L}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as B}from"./Layer-ChoECxvZ-ocw70508.js";import{E as H}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";let r=class extends P(O){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends k{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",_(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new x)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([A("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const ee=s;export{ee as default}; diff --git a/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-BMNrkZLk.js b/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-BMNrkZLk.js deleted file mode 100644 index ae05e140..00000000 --- a/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-BMNrkZLk.js +++ /dev/null @@ -1 +0,0 @@ -import{W as p}from"./InterleavedLayout-DXzw3B2n-BGmZ7EU1.js";import{W as l,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-CpFBYN4f.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import"./Indices-DEr2HrWx-Bin5_zrY.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new p(t.layout)}}class F{async extract(e){const i=o(e),r=l(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function g(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{F as default}; diff --git a/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-DoSa6d9E.js b/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-DoSa6d9E.js new file mode 100644 index 00000000..554a0ea8 --- /dev/null +++ b/custom-toc-separator/assets/EdgeProcessingWorker-DpfeS31e-DoSa6d9E.js @@ -0,0 +1 @@ +import{W as p}from"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import{W as l,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-BbULsEOo.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-UtmvndF2.js";import"./Indices-DEr2HrWx-BChBDP40.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new p(t.layout)}}class F{async extract(e){const i=o(e),r=l(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function g(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{F as default}; diff --git a/custom-toc-separator/assets/EditBusLayer-Df29OyJh-CAoDB1e-.js b/custom-toc-separator/assets/EditBusLayer-Df29OyJh-CAoDB1e-.js new file mode 100644 index 00000000..a36c8d50 --- /dev/null +++ b/custom-toc-separator/assets/EditBusLayer-Df29OyJh-CAoDB1e-.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-DhhRngbW.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./utils-9sQxfkoa-CwJW9dca.js","./DeleteForwardEditsParameters-C-_YAZEH-CheIob6U.js"])))=>i.map(i=>d[i]); +import{_ as E}from"./main-BTdHgocv.js";import{I as R,v as w,S as L,i as k,f as P,b as T,P as m}from"./story-DT1Ep1ux.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function z(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function C(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([E(()=>import("./deleteForwardEdits-BHWvOnK8-DhhRngbW.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),E(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-CheIob6U.js"),__vite__mapDeps([6,1,2,3,4]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function G(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function J(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const K=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,w([L()],d.prototype,"lastEditsEventDate",void 0),d=w([k("esri.layers.mixins.EditBusLayer")],d),d};export{J as B,K as C,$ as H,z as P,C as W,D as j,G as z}; diff --git a/custom-toc-separator/assets/EditBusLayer-Df29OyJh-DvFQsl1d.js b/custom-toc-separator/assets/EditBusLayer-Df29OyJh-DvFQsl1d.js deleted file mode 100644 index fa2926f7..00000000 --- a/custom-toc-separator/assets/EditBusLayer-Df29OyJh-DvFQsl1d.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-3yiQscxj.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./utils-9sQxfkoa-Djr5L7DU.js","./DeleteForwardEditsParameters-C-_YAZEH-6lZzg0HG.js"])))=>i.map(i=>d[i]); -import{_ as E}from"./main-lj2zzr_L.js";import{I as R,v as w,S as L,i as k,f as P,b as T,P as m}from"./story-OUarUCIt.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function z(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function C(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([E(()=>import("./deleteForwardEdits-BHWvOnK8-3yiQscxj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),E(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-6lZzg0HG.js"),__vite__mapDeps([6,1,2,3,4]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function G(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function J(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const K=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,w([L()],d.prototype,"lastEditsEventDate",void 0),d=w([k("esri.layers.mixins.EditBusLayer")],d),d};export{J as B,K as C,$ as H,z as P,C as W,D as j,G as z}; diff --git a/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-BtRqJcOf.js b/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-BtRqJcOf.js new file mode 100644 index 00000000..10f5082b --- /dev/null +++ b/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-BtRqJcOf.js @@ -0,0 +1 @@ +import{v as s,S as o,cr as m,aK as y,a0 as E,ac as v,e as l,d7 as I,i as d,a3 as w,d8 as g}from"./story-DT1Ep1ux.js";import{m as x}from"./lengthUtils-DKpMe5qR-C4JQidi_.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=m()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,c){t[h]=e.write({},c),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new a({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; diff --git a/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-CvgTP051.js b/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-CvgTP051.js deleted file mode 100644 index 150a05be..00000000 --- a/custom-toc-separator/assets/ElevationInfo-yv2-9tj6-CvgTP051.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as o,cr as m,aK as y,a0 as E,ac as v,e as l,d7 as I,i as d,a3 as w,d8 as g}from"./story-OUarUCIt.js";import{m as x}from"./lengthUtils-DKpMe5qR-BJJJQeiz.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=m()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,c){t[h]=e.write({},c),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new a({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; diff --git a/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-223z_Bn9.js b/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-223z_Bn9.js deleted file mode 100644 index a31ef728..00000000 --- a/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-223z_Bn9.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-_Kjwwki9.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); -import{_ as c}from"./main-lj2zzr_L.js";import{U as f,o as g,W as w,f as m,X as V,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./story-OUarUCIt.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import{D as E}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-CD3MqLHR.js";import{a as k}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{E as I}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as M}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{Z as O}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{q as N}from"./workers-PiCjreoO-mU03Z-E4.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js";import"./TilemapCache-CRRxws77-Buzexpoq.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>m(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-_Kjwwki9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-_Kjwwki9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await m(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const he=s;export{he as default}; diff --git a/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-BuQp_I33.js b/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-BuQp_I33.js new file mode 100644 index 00000000..d828d008 --- /dev/null +++ b/custom-toc-separator/assets/ElevationLayer-G6y-P-jo-BuQp_I33.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-Bq8iGB52.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); +import{_ as c}from"./main-BTdHgocv.js";import{U as f,o as g,W as w,f as m,X as V,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./story-DT1Ep1ux.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import{D as E}from"./Layer-ChoECxvZ-ocw70508.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-BFUuSyiK.js";import{a as k}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{E as I}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as M}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{Z as O}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{q as N}from"./workers-PiCjreoO-DrDY4oeh.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js";import"./TilemapCache-CRRxws77-CQyTs6St.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>m(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-Bq8iGB52.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-Bq8iGB52.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await m(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const he=s;export{he as default}; diff --git a/custom-toc-separator/assets/ElevationQuery-qAsmERYh-Bq8iGB52.js b/custom-toc-separator/assets/ElevationQuery-qAsmERYh-Bq8iGB52.js new file mode 100644 index 00000000..4e4ccc9d --- /dev/null +++ b/custom-toc-separator/assets/ElevationQuery-qAsmERYh-Bq8iGB52.js @@ -0,0 +1 @@ +import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,dD as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./story-DT1Ep1ux.js";import{N as z,K as M}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class Ie{async queryAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(i,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{Ie as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; diff --git a/custom-toc-separator/assets/ElevationQuery-qAsmERYh-_Kjwwki9.js b/custom-toc-separator/assets/ElevationQuery-qAsmERYh-_Kjwwki9.js deleted file mode 100644 index 6fcb16d2..00000000 --- a/custom-toc-separator/assets/ElevationQuery-qAsmERYh-_Kjwwki9.js +++ /dev/null @@ -1 +0,0 @@ -import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,dD as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./story-OUarUCIt.js";import{N as z,K as M}from"./projection-BA9M1R7d-Cytmrlsd.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class Ie{async queryAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(i,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{Ie as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; diff --git a/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-Bxa72K_6.js b/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-Bxa72K_6.js new file mode 100644 index 00000000..13cd2980 --- /dev/null +++ b/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-Bxa72K_6.js @@ -0,0 +1 @@ +import{K as f}from"./story-DT1Ep1ux.js";import{N as p}from"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import"./main-BTdHgocv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./vec3-BazNroeq-xVxXS26y.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-CEZkOwEl.js";class q{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const i=d(o),s=r!=null?await r.invoke("createIndexThread",i,{transferList:n}):this.createIndexThread(i).result;return a().fromJSON(s)}createIndexThread(o){const r=a();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(i=>new Uint32Array(i))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let i=0;i!e.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(e=>e.faces)}:null}function a(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{q as default}; diff --git a/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-SzJlWyFF.js b/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-SzJlWyFF.js deleted file mode 100644 index e53312a3..00000000 --- a/custom-toc-separator/assets/ElevationSamplerWorker-BA9k6xuc-SzJlWyFF.js +++ /dev/null @@ -1 +0,0 @@ -import{K as f}from"./story-OUarUCIt.js";import{N as p}from"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import"./main-lj2zzr_L.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./vec3-BazNroeq-C58EAHFm.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-CF_vNE3j.js";class q{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const i=d(o),s=r!=null?await r.invoke("createIndexThread",i,{transferList:n}):this.createIndexThread(i).result;return a().fromJSON(s)}createIndexThread(o){const r=a();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(i=>new Uint32Array(i))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let i=0;i!e.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(e=>e.faces)}:null}function a(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{q as default}; diff --git a/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-CAFcOOUq.js b/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-CAFcOOUq.js new file mode 100644 index 00000000..e7c72f43 --- /dev/null +++ b/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-CAFcOOUq.js @@ -0,0 +1 @@ +import{v as a,S as l,i as m,j as u,bV as c}from"./story-DT1Ep1ux.js";import{b as p}from"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; diff --git a/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-ClKzvvsE.js b/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-ClKzvvsE.js deleted file mode 100644 index d64d511c..00000000 --- a/custom-toc-separator/assets/ExportImageParameters-DxyNGQ57-ClKzvvsE.js +++ /dev/null @@ -1 +0,0 @@ -import{v as a,S as l,i as m,j as u,bV as c}from"./story-OUarUCIt.js";import{b as p}from"./scaleUtils-DxsfQwK1-rzzukPSH.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; diff --git a/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-Bei3OeVZ.js b/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-Bei3OeVZ.js deleted file mode 100644 index 26473970..00000000 --- a/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-Bei3OeVZ.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./story-OUarUCIt.js";import{V as q}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{I as B}from"./Bitmap-CcqmzvfR-BO796kOM.js";import{Q as U}from"./Tile-D75RMC64-DDmsm7e7.js";import{s as V}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; diff --git a/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-BzAy5Mad.js b/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-BzAy5Mad.js new file mode 100644 index 00000000..54f5fbfb --- /dev/null +++ b/custom-toc-separator/assets/ExportStrategy-BNE7Gp0u-BzAy5Mad.js @@ -0,0 +1 @@ +import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./story-DT1Ep1ux.js";import{V as q}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{I as B}from"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import{Q as U}from"./Tile-D75RMC64-XRkD8ADC.js";import{s as V}from"./TileKey-C5IL-JBr-Do29X9ef.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; diff --git a/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js b/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js deleted file mode 100644 index b382cc39..00000000 --- a/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as a,i as c,j as h}from"./story-OUarUCIt.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,o=e?.sublayers,l=[],i=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; diff --git a/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-DL05uTg1.js b/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-DL05uTg1.js new file mode 100644 index 00000000..d9873159 --- /dev/null +++ b/custom-toc-separator/assets/ExportWMSImageParameters-CMk80WSM-DL05uTg1.js @@ -0,0 +1 @@ +import{v as t,S as a,i as c,j as h}from"./story-DT1Ep1ux.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,o=e?.sublayers,l=[],i=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; diff --git a/custom-toc-separator/assets/External-D_wl4XAw-BzQ8-YjD.js b/custom-toc-separator/assets/External-D_wl4XAw-BzQ8-YjD.js deleted file mode 100644 index 9e1d3c2e..00000000 --- a/custom-toc-separator/assets/External-D_wl4XAw-BzQ8-YjD.js +++ /dev/null @@ -1 +0,0 @@ -import{hq as g,$ as p,f as b}from"./story-OUarUCIt.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; diff --git a/custom-toc-separator/assets/External-D_wl4XAw-CF3XmPYl.js b/custom-toc-separator/assets/External-D_wl4XAw-CF3XmPYl.js new file mode 100644 index 00000000..6b0c26c6 --- /dev/null +++ b/custom-toc-separator/assets/External-D_wl4XAw-CF3XmPYl.js @@ -0,0 +1 @@ +import{hq as g,$ as p,f as b}from"./story-DT1Ep1ux.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; diff --git a/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js b/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js new file mode 100644 index 00000000..234fbc90 --- /dev/null +++ b/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js @@ -0,0 +1,3 @@ +import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{w as gs}from"./utils-SPbpQbmm-BKynsqQg.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,et as be,b9 as Ss,hT as Kt,K as Fe,eE as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,dN as Xt}from"./story-DT1Ep1ux.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-D0v5nxXn.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-B6HwLstV.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-C4JQidi_.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} +`:`#define ${r} ${i[r]} +`;o+=u,a+=u}return o+=this.vertexShader,a+=this.fragmentShader,new xs(o,a,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const s=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:s.type,uniformArrayElementType:oi(s),uniformArrayLength:ai(s)})}for(const i in e){const s=this.options[i];if(e[i])for(const o in s){const a=s[o];t.push({uniformHydrated:null,shaderModulePath:`${i}.${o}`,uniformName:o,uniformType:a.type,uniformArrayElementType:oi(a),uniformArrayLength:ai(a)})}}return t}};const oi=e=>e.type==="array"?e.elementType?.type:void 0,ai=e=>e.type==="array"?e.size:void 0,Mo={hittestDist:n,hittestPos:v},Po={filterFlags:j,animation:j,visualVariableData:j,dataDriven0:j,dataDriven1:j,dataDriven2:j,gpgpu:j,size:n},Ao={displayViewScreenMat3:B,displayViewMat3:B,displayMat3:B,viewMat3:B,tileMat3:B,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:v,currentScale:n,currentZoom:n,metersPerSRUnit:n};let Co=class extends To{constructor(){super(...arguments),this.vertexShader=ii("materials/pie/pie.vert"),this.fragmentShader=ii("materials/pie/pie.frag"),this.required={...Po,...Ao,outlineWidth:n,colors:ne,defaultColor:S,othersColor:S,outlineColor:S,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:Mo,visualVariableSizeMinMaxValue:{minMaxValueAndSize:S},visualVariableSizeScaleStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...ne.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...ne.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:v},id:{index:1,type:A},bitset:{index:2,type:n},offset:{index:3,type:v},texCoords:{index:4,type:v},size:{index:5,type:v},referenceSize:{index:6,type:n},zoomRange:{index:7,type:v}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...ne.ofType(S,e),type:"array",elementType:S,size:e}}},Ro=class extends q{constructor(){super(...arguments),this.type=G.PieChart,this.shaders={geometry:new Co},this.symbologyPlane=we.MARKER}render(e,t){const{painter:i}=e,{instance:s,target:o}=t,a=this.shaders.geometry,r=s.getInput(),u=r.uniforms.numberOfFields,c=k(e),d=$(e,o),p=N(e);a.setNumberOfFields(u),i.setShader({shader:a,uniforms:{...J(e,t.target,r.uniforms.shader),...d.storage,...d.view,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!r.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!r.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!r.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!r.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!r.uniforms.shader.visualVariableOpacity,HITTEST:c,highlight:d.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),i.setPipelineState(H(e)),i.submitDraw(e,t)}},Io=class extends q{constructor(){super(...arguments),this.type=G.Text,this.shaders={geometry:new U},this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a=t.instance.getInput(),r={shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,isBackgroundPass:!0,isLabel:!1,textRenderPassType:W.Color},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)};s.setShader(r),s.setPipelineState(H(e)),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Halo}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Outline}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Color}}),s.submitDraw(e,t)}};const ae={fill:new ao,patternFill:new no,complexFill:new so,outlineFill:new ro,patternOutlineFill:new lo,complexOutlineFill:new oo,marker:new _o,pieChart:new Ro,line:new So,texturedLine:new Vo,text:new Io,label:new wo,heatmap:new ho,dotDensity:new io,animatedMarker:new Ys};function Ea(){for(const e in ae)ae[e].startup()}function La(e){for(const t in ae)ae[t].shutdown(e)}function it(e,t){const i=e.slice(0,t),s=t-i.length;for(let o=0;oSi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Bi(e){return e.map(t=>Fo(t)?Do(t.clone()):t)}function Fo(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function Do(e){return e.stops=ko(e.type,e.stops??[]),e}function ze(e,t,i){return(1-i)*e+i*t}function Eo(e,t){const[i,...s]=t,o=s.pop(),a=s[0].value,r=s[s.length-1].value,u=(r-a)/Li,c=[];for(let d=a;d=s[p].value;)p++;const m=s[p],f=t[p-1],x=d-f.value,h=m.value===f.value?1:x/(m.value-f.value);if(e==="color"){const y=s[p],b=t[p-1],g=y.color.clone();g.r=ze(b.color.r,g.r,h),g.g=ze(b.color.g,g.g,h),g.b=ze(b.color.b,g.b,h),g.a=ze(b.color.a,g.a,h),c.push({value:d,color:g,label:y.label})}else if(e==="size"){const y=s[p],b=t[p-1],g=Xt(y.size),P=ze(Xt(b.size),g,h);c.push({value:d,size:P,label:y.label})}else{const y=s[p],b=ze(t[p-1].opacity,y.opacity,h);c.push({value:d,opacity:b,label:y.label})}}return[i,...c,o]}function Lo(e){const[t,...i]=e,s=i.pop();for(;i.length>Li;){let o=0,a=0;for(let r=1;ra&&(a=d,o=r)}i.splice(o,1)}return[t,...i,s]}function ko(e,t){return t.length<=Qe?t:(ki().warn(`Found ${t.length} Visual Variable stops, but MapView only supports ${Qe}. Displayed stops will be simplified.`),t.length>2*Qe?Eo(e,t):Lo(t))}function Bo(){const{supportsColorBufferFloat:e,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:i}=Bt();return e&&t||i}function ka(e){if(!e)return!0;switch(e.type){case"dot-density":break;case"heatmap":if(!Bo()){const t=Bt(),i=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!t[s]).join(", ");return ki().errorOnce(new Ke("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${i}`)),!1}}return!0}const No=1.25,je=128,$o=128;function Uo(e){if(!e.stops?.length)return null;const t=e.stops.sort((a,r)=>a.value-r.value),i=it(t,8),s=i.map(({value:a})=>a),o=i.map(({color:a})=>Oo(a));return{values:s,colors:o}}function Ho(e){if(!e.stops?.length)return null;const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{opacityValues:i.map(({value:s})=>s),opacities:i.map(({opacity:s})=>s)}}function Go(e){return{rotationType:e.rotationType==="geographic"?mt.Geographic:mt.Arithmatic}}function dt(e){if(!e.stops?.length)return null;if(e.stops.some(s=>s.useMaxValue||s.useMinValue))return(s,o)=>{const a=s.statisticsByLevel.get(o.key.level),r=e.stops.map(c=>({value:c.useMaxValue?a?.get(e.field)?.maxValue??0:c.useMinValue?a?.get(e.field)?.minValue??0:c.value,size:c.size?be(c.size):Os})).sort((c,d)=>c.value-d.value),u=it(r,8);return{values:u.map(({value:c})=>c),sizes:u.map(({size:c})=>c)}};const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{values:i.map(({value:s})=>s),sizes:i.map(({size:s})=>be(s))}}function qo(e){return t=>{const{state:i}=t;return{unitValueToPixelsRatio:Ts(i.spatialReference)/Ns[e.valueUnit??"meters"]/i.resolution}}}function ri(e,t){const i=t.length;if(e{const u=a.state.scale,c=be(ri(u,s.stops)),d=be(ri(u,o.stops));return{minMaxValueAndSize:[t,i,c,d]}};if(typeof s=="object"||typeof o=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[t,i,be(s),be(o)]}}const st={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Ni(e,t=$o,i=No){if(e.visualVariableSizeMinMaxValue)return e.visualVariableSizeMinMaxValue instanceof Function?je:Math.max(e.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*i,t);if(e.visualVariableSizeScaleStops){if(e.visualVariableSizeScaleStops instanceof Function)return je;const s=e.visualVariableSizeScaleStops.sizes;return Math.max(s[s.length-1]*i,t)}if(e.visualVariableSizeStops){if(e.visualVariableSizeStops instanceof Function)return je;const s=e.visualVariableSizeStops.sizes;return Math.max(s[s.length-1]*i,t)}return e.visualVariableSizeUnitValue?2*je:0}function Ba(e){const t={...st};if(!e||!("visualVariables"in e)||!e.visualVariables)return t;for(const i of Bi(e.visualVariables))switch(i.type){case"color":t.visualVariableColor=Uo(i);break;case"opacity":t.visualVariableOpacity=Ho(i);break;case"rotation":t.visualVariableRotation=Go(i);break;case"size":switch(jo(i)){case"field-stops":t.visualVariableSizeStops=dt(i);break;case"scale-stops":i.target==="outline"?t.visualVariableSizeOutlineScaleStops=dt(i):t.visualVariableSizeScaleStops=dt(i);break;case"min-max":t.visualVariableSizeMinMaxValue=Wo(i);break;case"unit-value":t.visualVariableSizeUnitValue=qo(i)}break}return t}function jo(e){return typeof e.minDataValue=="number"&&typeof e.maxDataValue=="number"&&e.minSize!=null&&e.maxSize!=null?"min-max":e?.valueExpression==="$view.scale"&&Array.isArray(e.stops)?"scale-stops":e.field==null&&e?.valueExpression==="$view.scale"||!(Array.isArray(e.stops)||"levels"in e&&e.levels)?e.field!=null||e?.valueExpression!=="$view.scale"?"unit-value":null:"field-stops"}function Ko(e){return!!(e.visualVariableSizeMinMaxValue||e.visualVariableSizeScaleStops||e.visualVariableSizeStops||e.visualVariableSizeUnitValue||e.visualVariableSizeOutlineScaleStops)}function Na(e){return!!e.visualVariableRotation}function Xo(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function oe(e){if(e==null)return null;if(Array.isArray(e)){const[t,i,s,o]=e;return[t,i,s,255*o]}return typeof e=="string"?e:{...e,defaultValue:oe(e?.defaultValue)}}async function $a(e,t){const{cimResourceManager:i,cimAnalyzer:s,scaleExpression:o}=t.schemaOptions;await Promise.all(vs.fetchResources(e.symbol,i,[]));const a=s.analyzeSymbolReference(e,!1),r={scaleInfo:Xo(e),scaleExpression:o},u=[];for(const c of a)switch(c.type){case"marker":u.push(...Zo(c,t,r));break;case"fill":u.push(...ta(c,t,r));break;case"line":u.push(...sa(c,t,r));break;case"text":u.push(...ra(c,t,r))}return u}function Zo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,visualVariableRotation:s.visualVariableRotation};return e.animationParams?Yo(a.ensureInstance(ae.animatedMarker,{uniforms:r,optionalAttributes:{zoomRange:!0}}),e,st,i):Qo(a.ensureInstance(ae.marker,{uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s,i)}function Yo(e,t,i,s){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,sprite:t.spriteRasterizationParam,animations:t.animationParams,scaleInfo:s.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===ws.MAP,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,referenceSize:t.referenceSize,angleToLine:!!t.markerPlacement&&t.markerPlacement.placement&&"angleToLine"in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine,sizeRatio:t.sizeRatio})]:[]}function Qo(e,t,i,{scaleInfo:s,scaleExpression:o}){const a=Ko(i);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:oe(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:s,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||gs.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:o??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:a,placement:t.markerPlacement,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:Ni(i)})]}function Jo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ea(a.ensureInstance(ae.fill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function ea(e,t,{scaleInfo:i}){return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],scaleInfo:i,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function ta(e,t,i){if(!e.spriteRasterizationParam)return Jo(e,t,i);const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ia(a.ensureInstance(ae.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s.visualVariableColor!=null,i)}function ia(e,t,i,{scaleInfo:s}){if(!t.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!t.hasUnresolvedReplacementColor&&(!i||t.colorLocked),a=t.sampleAlphaOnly&&!o,r=t.spriteRasterizationParam;return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:r.resource.type==="CIMHatchFill",sprite:r,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function sa(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},u={uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}},c=!!(r.visualVariableSizeMinMaxValue||r.visualVariableSizeScaleStops||r.visualVariableSizeStops||r.visualVariableSizeUnitValue);return e.spriteRasterizationParam?aa(a.ensureInstance(ae.texturedLine,u),e,c,i):oa(a.ensureInstance(ae.line,u),e,c,i)}function $i(e,t,{scaleInfo:i}){return{color:oe(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function oa(e,t,i,s){if(t.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const o=$i(t,i,s);return[e.createMeshInfo(o)]}function aa(e,t,i,s){const{spriteRasterizationParam:o,scaleDash:a,sampleAlphaOnly:r}=t;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...$i(t,i,s),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:r,isSDF:o.resource.type!=="CIMPictureStroke",sprite:o})]}function ra(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return na(a.ensureInstance(ae.text,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableRotation:s.visualVariableRotation,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}}),e,s,i)}function na(e,t,i,{scaleInfo:s,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:oe(t.backgroundColor),boxBorderLineColor:oe(t.borderLineColor),boxBorderLineSize:t.borderLineWidth??0,color:oe(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:oe(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??"center",verticalAlignment:t.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:o??1,minPixelBuffer:Ni(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ua(e,t){return{type:"simple",filters:t,capabilities:{maxTextureSize:Bt().maxTextureSize},bindings:la(e)}}function lt(e){switch(e){case"opacity":return We.OPACITY;case"color":return We.COLOR;case"rotation":return We.ROTATION;case"size":return We.SIZE;default:return null}}function la(e){if(!e)return[];switch(e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ui(e);case"dot-density":return ua(e);case"pie-chart":return ca(e);case"heatmap":return pa(e)}}function ua(e){const t=[];for(const i of e.attributes)t.push({binding:t.length,expression:i.valueExpression,field:i.field});return t}function ca(e){const t=Ui(e);let i=4;for(const s of e.attributes)t.push({binding:i++,expression:s.valueExpression,field:s.field});return t}function pa({valueExpression:e,field:t}){return e||t?[{binding:0,expression:e,field:t}]:[]}function Ui(e){return!("visualVariables"in e)||!e.visualVariables?.length?[]:Bi(e.visualVariables).map(t=>ya(t)).filter(_s)}function da(e){return e.valueExpression==="$view.scale"?null:{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression,valueRepresentation:e.valueRepresentation}}function ma(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function fa(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function ha(e){return{binding:lt(e.type),expression:e.valueExpression,field:e.field}}function ya(e){switch(e.type){case"size":return da(e);case"color":return ma(e);case"opacity":return fa(e);case"rotation":return ha(e)}}class Ha{constructor(t){this.updateTracking=new ns({debugName:"FeatureCommandQueue"}),this._queueProcessor=new $s({concurrency:1,process:t.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(t){return Ss(this.updateTracking.addPromise(this._doPush(t)))}async _doPush(t){const i=this._queueProcessor,s=i.last();switch(t.type){case"update":case"highlight":return s?.type===t.type?void 0:i.push(t);case"edit-by-id":case"edit-by-feature":return i.push(t)}}}export{La as $,oa as J,Qo as K,js as M,Ni as N,qs as P,ka as Q,Gs as T,Ui as U,st as W,Yo as X,ia as Y,ea as Z,Ha as _,na as a,Oo as b,Ko as c,aa as e,Ua as h,Xo as j,Na as l,ae as o,Ea as q,Ba as r,Da as s,Nt as t,$a as u}; diff --git a/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js b/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js deleted file mode 100644 index 2983540b..00000000 --- a/custom-toc-separator/assets/FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js +++ /dev/null @@ -1,3 +0,0 @@ -import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{w as gs}from"./utils-SPbpQbmm-BNEY6jgo.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,et as be,b9 as Ss,hT as Kt,K as Fe,eE as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,dN as Xt}from"./story-OUarUCIt.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-DeIeQX6y.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-Bv29bzNX.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} -`:`#define ${r} ${i[r]} -`;o+=u,a+=u}return o+=this.vertexShader,a+=this.fragmentShader,new xs(o,a,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const s=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:s.type,uniformArrayElementType:oi(s),uniformArrayLength:ai(s)})}for(const i in e){const s=this.options[i];if(e[i])for(const o in s){const a=s[o];t.push({uniformHydrated:null,shaderModulePath:`${i}.${o}`,uniformName:o,uniformType:a.type,uniformArrayElementType:oi(a),uniformArrayLength:ai(a)})}}return t}};const oi=e=>e.type==="array"?e.elementType?.type:void 0,ai=e=>e.type==="array"?e.size:void 0,Mo={hittestDist:n,hittestPos:v},Po={filterFlags:j,animation:j,visualVariableData:j,dataDriven0:j,dataDriven1:j,dataDriven2:j,gpgpu:j,size:n},Ao={displayViewScreenMat3:B,displayViewMat3:B,displayMat3:B,viewMat3:B,tileMat3:B,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:v,currentScale:n,currentZoom:n,metersPerSRUnit:n};let Co=class extends To{constructor(){super(...arguments),this.vertexShader=ii("materials/pie/pie.vert"),this.fragmentShader=ii("materials/pie/pie.frag"),this.required={...Po,...Ao,outlineWidth:n,colors:ne,defaultColor:S,othersColor:S,outlineColor:S,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:Mo,visualVariableSizeMinMaxValue:{minMaxValueAndSize:S},visualVariableSizeScaleStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...ne.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...ne.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:v},id:{index:1,type:A},bitset:{index:2,type:n},offset:{index:3,type:v},texCoords:{index:4,type:v},size:{index:5,type:v},referenceSize:{index:6,type:n},zoomRange:{index:7,type:v}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...ne.ofType(S,e),type:"array",elementType:S,size:e}}},Ro=class extends q{constructor(){super(...arguments),this.type=G.PieChart,this.shaders={geometry:new Co},this.symbologyPlane=we.MARKER}render(e,t){const{painter:i}=e,{instance:s,target:o}=t,a=this.shaders.geometry,r=s.getInput(),u=r.uniforms.numberOfFields,c=k(e),d=$(e,o),p=N(e);a.setNumberOfFields(u),i.setShader({shader:a,uniforms:{...J(e,t.target,r.uniforms.shader),...d.storage,...d.view,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!r.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!r.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!r.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!r.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!r.uniforms.shader.visualVariableOpacity,HITTEST:c,highlight:d.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),i.setPipelineState(H(e)),i.submitDraw(e,t)}},Io=class extends q{constructor(){super(...arguments),this.type=G.Text,this.shaders={geometry:new U},this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a=t.instance.getInput(),r={shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,isBackgroundPass:!0,isLabel:!1,textRenderPassType:W.Color},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)};s.setShader(r),s.setPipelineState(H(e)),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Halo}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Outline}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Color}}),s.submitDraw(e,t)}};const ae={fill:new ao,patternFill:new no,complexFill:new so,outlineFill:new ro,patternOutlineFill:new lo,complexOutlineFill:new oo,marker:new _o,pieChart:new Ro,line:new So,texturedLine:new Vo,text:new Io,label:new wo,heatmap:new ho,dotDensity:new io,animatedMarker:new Ys};function Ea(){for(const e in ae)ae[e].startup()}function La(e){for(const t in ae)ae[t].shutdown(e)}function it(e,t){const i=e.slice(0,t),s=t-i.length;for(let o=0;oSi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Bi(e){return e.map(t=>Fo(t)?Do(t.clone()):t)}function Fo(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function Do(e){return e.stops=ko(e.type,e.stops??[]),e}function ze(e,t,i){return(1-i)*e+i*t}function Eo(e,t){const[i,...s]=t,o=s.pop(),a=s[0].value,r=s[s.length-1].value,u=(r-a)/Li,c=[];for(let d=a;d=s[p].value;)p++;const m=s[p],f=t[p-1],x=d-f.value,h=m.value===f.value?1:x/(m.value-f.value);if(e==="color"){const y=s[p],b=t[p-1],g=y.color.clone();g.r=ze(b.color.r,g.r,h),g.g=ze(b.color.g,g.g,h),g.b=ze(b.color.b,g.b,h),g.a=ze(b.color.a,g.a,h),c.push({value:d,color:g,label:y.label})}else if(e==="size"){const y=s[p],b=t[p-1],g=Xt(y.size),P=ze(Xt(b.size),g,h);c.push({value:d,size:P,label:y.label})}else{const y=s[p],b=ze(t[p-1].opacity,y.opacity,h);c.push({value:d,opacity:b,label:y.label})}}return[i,...c,o]}function Lo(e){const[t,...i]=e,s=i.pop();for(;i.length>Li;){let o=0,a=0;for(let r=1;ra&&(a=d,o=r)}i.splice(o,1)}return[t,...i,s]}function ko(e,t){return t.length<=Qe?t:(ki().warn(`Found ${t.length} Visual Variable stops, but MapView only supports ${Qe}. Displayed stops will be simplified.`),t.length>2*Qe?Eo(e,t):Lo(t))}function Bo(){const{supportsColorBufferFloat:e,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:i}=Bt();return e&&t||i}function ka(e){if(!e)return!0;switch(e.type){case"dot-density":break;case"heatmap":if(!Bo()){const t=Bt(),i=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!t[s]).join(", ");return ki().errorOnce(new Ke("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${i}`)),!1}}return!0}const No=1.25,je=128,$o=128;function Uo(e){if(!e.stops?.length)return null;const t=e.stops.sort((a,r)=>a.value-r.value),i=it(t,8),s=i.map(({value:a})=>a),o=i.map(({color:a})=>Oo(a));return{values:s,colors:o}}function Ho(e){if(!e.stops?.length)return null;const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{opacityValues:i.map(({value:s})=>s),opacities:i.map(({opacity:s})=>s)}}function Go(e){return{rotationType:e.rotationType==="geographic"?mt.Geographic:mt.Arithmatic}}function dt(e){if(!e.stops?.length)return null;if(e.stops.some(s=>s.useMaxValue||s.useMinValue))return(s,o)=>{const a=s.statisticsByLevel.get(o.key.level),r=e.stops.map(c=>({value:c.useMaxValue?a?.get(e.field)?.maxValue??0:c.useMinValue?a?.get(e.field)?.minValue??0:c.value,size:c.size?be(c.size):Os})).sort((c,d)=>c.value-d.value),u=it(r,8);return{values:u.map(({value:c})=>c),sizes:u.map(({size:c})=>c)}};const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{values:i.map(({value:s})=>s),sizes:i.map(({size:s})=>be(s))}}function qo(e){return t=>{const{state:i}=t;return{unitValueToPixelsRatio:Ts(i.spatialReference)/Ns[e.valueUnit??"meters"]/i.resolution}}}function ri(e,t){const i=t.length;if(e{const u=a.state.scale,c=be(ri(u,s.stops)),d=be(ri(u,o.stops));return{minMaxValueAndSize:[t,i,c,d]}};if(typeof s=="object"||typeof o=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[t,i,be(s),be(o)]}}const st={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Ni(e,t=$o,i=No){if(e.visualVariableSizeMinMaxValue)return e.visualVariableSizeMinMaxValue instanceof Function?je:Math.max(e.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*i,t);if(e.visualVariableSizeScaleStops){if(e.visualVariableSizeScaleStops instanceof Function)return je;const s=e.visualVariableSizeScaleStops.sizes;return Math.max(s[s.length-1]*i,t)}if(e.visualVariableSizeStops){if(e.visualVariableSizeStops instanceof Function)return je;const s=e.visualVariableSizeStops.sizes;return Math.max(s[s.length-1]*i,t)}return e.visualVariableSizeUnitValue?2*je:0}function Ba(e){const t={...st};if(!e||!("visualVariables"in e)||!e.visualVariables)return t;for(const i of Bi(e.visualVariables))switch(i.type){case"color":t.visualVariableColor=Uo(i);break;case"opacity":t.visualVariableOpacity=Ho(i);break;case"rotation":t.visualVariableRotation=Go(i);break;case"size":switch(jo(i)){case"field-stops":t.visualVariableSizeStops=dt(i);break;case"scale-stops":i.target==="outline"?t.visualVariableSizeOutlineScaleStops=dt(i):t.visualVariableSizeScaleStops=dt(i);break;case"min-max":t.visualVariableSizeMinMaxValue=Wo(i);break;case"unit-value":t.visualVariableSizeUnitValue=qo(i)}break}return t}function jo(e){return typeof e.minDataValue=="number"&&typeof e.maxDataValue=="number"&&e.minSize!=null&&e.maxSize!=null?"min-max":e?.valueExpression==="$view.scale"&&Array.isArray(e.stops)?"scale-stops":e.field==null&&e?.valueExpression==="$view.scale"||!(Array.isArray(e.stops)||"levels"in e&&e.levels)?e.field!=null||e?.valueExpression!=="$view.scale"?"unit-value":null:"field-stops"}function Ko(e){return!!(e.visualVariableSizeMinMaxValue||e.visualVariableSizeScaleStops||e.visualVariableSizeStops||e.visualVariableSizeUnitValue||e.visualVariableSizeOutlineScaleStops)}function Na(e){return!!e.visualVariableRotation}function Xo(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function oe(e){if(e==null)return null;if(Array.isArray(e)){const[t,i,s,o]=e;return[t,i,s,255*o]}return typeof e=="string"?e:{...e,defaultValue:oe(e?.defaultValue)}}async function $a(e,t){const{cimResourceManager:i,cimAnalyzer:s,scaleExpression:o}=t.schemaOptions;await Promise.all(vs.fetchResources(e.symbol,i,[]));const a=s.analyzeSymbolReference(e,!1),r={scaleInfo:Xo(e),scaleExpression:o},u=[];for(const c of a)switch(c.type){case"marker":u.push(...Zo(c,t,r));break;case"fill":u.push(...ta(c,t,r));break;case"line":u.push(...sa(c,t,r));break;case"text":u.push(...ra(c,t,r))}return u}function Zo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,visualVariableRotation:s.visualVariableRotation};return e.animationParams?Yo(a.ensureInstance(ae.animatedMarker,{uniforms:r,optionalAttributes:{zoomRange:!0}}),e,st,i):Qo(a.ensureInstance(ae.marker,{uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s,i)}function Yo(e,t,i,s){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,sprite:t.spriteRasterizationParam,animations:t.animationParams,scaleInfo:s.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===ws.MAP,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,referenceSize:t.referenceSize,angleToLine:!!t.markerPlacement&&t.markerPlacement.placement&&"angleToLine"in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine,sizeRatio:t.sizeRatio})]:[]}function Qo(e,t,i,{scaleInfo:s,scaleExpression:o}){const a=Ko(i);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:oe(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:s,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||gs.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:o??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:a,placement:t.markerPlacement,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:Ni(i)})]}function Jo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ea(a.ensureInstance(ae.fill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function ea(e,t,{scaleInfo:i}){return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],scaleInfo:i,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function ta(e,t,i){if(!e.spriteRasterizationParam)return Jo(e,t,i);const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ia(a.ensureInstance(ae.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s.visualVariableColor!=null,i)}function ia(e,t,i,{scaleInfo:s}){if(!t.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!t.hasUnresolvedReplacementColor&&(!i||t.colorLocked),a=t.sampleAlphaOnly&&!o,r=t.spriteRasterizationParam;return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:r.resource.type==="CIMHatchFill",sprite:r,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function sa(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},u={uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}},c=!!(r.visualVariableSizeMinMaxValue||r.visualVariableSizeScaleStops||r.visualVariableSizeStops||r.visualVariableSizeUnitValue);return e.spriteRasterizationParam?aa(a.ensureInstance(ae.texturedLine,u),e,c,i):oa(a.ensureInstance(ae.line,u),e,c,i)}function $i(e,t,{scaleInfo:i}){return{color:oe(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function oa(e,t,i,s){if(t.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const o=$i(t,i,s);return[e.createMeshInfo(o)]}function aa(e,t,i,s){const{spriteRasterizationParam:o,scaleDash:a,sampleAlphaOnly:r}=t;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...$i(t,i,s),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:r,isSDF:o.resource.type!=="CIMPictureStroke",sprite:o})]}function ra(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return na(a.ensureInstance(ae.text,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableRotation:s.visualVariableRotation,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}}),e,s,i)}function na(e,t,i,{scaleInfo:s,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:oe(t.backgroundColor),boxBorderLineColor:oe(t.borderLineColor),boxBorderLineSize:t.borderLineWidth??0,color:oe(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:oe(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??"center",verticalAlignment:t.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:o??1,minPixelBuffer:Ni(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ua(e,t){return{type:"simple",filters:t,capabilities:{maxTextureSize:Bt().maxTextureSize},bindings:la(e)}}function lt(e){switch(e){case"opacity":return We.OPACITY;case"color":return We.COLOR;case"rotation":return We.ROTATION;case"size":return We.SIZE;default:return null}}function la(e){if(!e)return[];switch(e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ui(e);case"dot-density":return ua(e);case"pie-chart":return ca(e);case"heatmap":return pa(e)}}function ua(e){const t=[];for(const i of e.attributes)t.push({binding:t.length,expression:i.valueExpression,field:i.field});return t}function ca(e){const t=Ui(e);let i=4;for(const s of e.attributes)t.push({binding:i++,expression:s.valueExpression,field:s.field});return t}function pa({valueExpression:e,field:t}){return e||t?[{binding:0,expression:e,field:t}]:[]}function Ui(e){return!("visualVariables"in e)||!e.visualVariables?.length?[]:Bi(e.visualVariables).map(t=>ya(t)).filter(_s)}function da(e){return e.valueExpression==="$view.scale"?null:{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression,valueRepresentation:e.valueRepresentation}}function ma(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function fa(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function ha(e){return{binding:lt(e.type),expression:e.valueExpression,field:e.field}}function ya(e){switch(e.type){case"size":return da(e);case"color":return ma(e);case"opacity":return fa(e);case"rotation":return ha(e)}}class Ha{constructor(t){this.updateTracking=new ns({debugName:"FeatureCommandQueue"}),this._queueProcessor=new $s({concurrency:1,process:t.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(t){return Ss(this.updateTracking.addPromise(this._doPush(t)))}async _doPush(t){const i=this._queueProcessor,s=i.last();switch(t.type){case"update":case"highlight":return s?.type===t.type?void 0:i.push(t);case"edit-by-id":case"edit-by-feature":return i.push(t)}}}export{La as $,oa as J,Qo as K,js as M,Ni as N,qs as P,ka as Q,Gs as T,Ui as U,st as W,Yo as X,ia as Y,ea as Z,Ha as _,na as a,Oo as b,Ko as c,aa as e,Ua as h,Xo as j,Na as l,ae as o,Ea as q,Ba as r,Da as s,Nt as t,$a as u}; diff --git a/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-8jhaVJv-.js b/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-8jhaVJv-.js new file mode 100644 index 00000000..f8aa912f --- /dev/null +++ b/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-8jhaVJv-.js @@ -0,0 +1 @@ +import{v as i,S as o,dK as c,i as b,e as y,o as f}from"./story-DT1Ep1ux.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-ChoaxSoX.js";import m from"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; diff --git a/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-ChIqC_0q.js b/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-ChIqC_0q.js deleted file mode 100644 index f8b9432d..00000000 --- a/custom-toc-separator/assets/FeatureEffect-CDEk9Es7-ChIqC_0q.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as o,dK as c,i as b,e as y,o as f}from"./story-OUarUCIt.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-DQMnFF3M.js";import m from"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; diff --git a/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-4oF6iinH.js b/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-4oF6iinH.js deleted file mode 100644 index 1a6cbfb1..00000000 --- a/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-4oF6iinH.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as s,i}from"./story-OUarUCIt.js";import{x as a}from"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; diff --git a/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-wxowDxbO.js b/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-wxowDxbO.js new file mode 100644 index 00000000..da08394c --- /dev/null +++ b/custom-toc-separator/assets/FeatureEffectLayer-Cro89IEC-wxowDxbO.js @@ -0,0 +1 @@ +import{v as t,S as s,i}from"./story-DT1Ep1ux.js";import{x as a}from"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; diff --git a/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-DfMwTLEM.js b/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-DfMwTLEM.js new file mode 100644 index 00000000..24119f2a --- /dev/null +++ b/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-DfMwTLEM.js @@ -0,0 +1 @@ +import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./story-DT1Ep1ux.js";import{b as v}from"./Query-BrwMGK8U-FWeI_AU8.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./main-BTdHgocv.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:o,geometry:n,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(n),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:o,units:u,distance:h,...t})}clone(){const{where:t,geometry:o,spatialRelationship:n,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(o),objectIds:r(l),spatialRelationship:n,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const _=e;export{_ as default}; diff --git a/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-Dii6VkUI.js b/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-Dii6VkUI.js deleted file mode 100644 index 823b7cf1..00000000 --- a/custom-toc-separator/assets/FeatureFilter-BCFHgLVU-Dii6VkUI.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./story-OUarUCIt.js";import{b as v}from"./Query-BrwMGK8U-gUIs0TS1.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./main-lj2zzr_L.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:o,geometry:n,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(n),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:o,units:u,distance:h,...t})}clone(){const{where:t,geometry:o,spatialRelationship:n,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(o),objectIds:r(l),spatialRelationship:n,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const _=e;export{_ as default}; diff --git a/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-DV01qpqc.js b/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-DV01qpqc.js new file mode 100644 index 00000000..a97de425 --- /dev/null +++ b/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-DV01qpqc.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DpexmTpL.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./utils-BVWK2jiA-inSV67A_.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./FeatureLayerSource-k4WMYop1-CO3-WMru.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./mat4-DX7gBViE-B27FdgMD.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./clientSideDefaults-BqqayPct-B1aankCm.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-LNltUUKG.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./executeForIds-Z1gkLduF-CKWTLnam.js","./query-DFW9-NG_-SSagAgRu.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./executeQueryPBF-o8010HS9-Bi7xykzy.js","./featureConversionUtils-D6hFQ4Af-C534NCdS.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./executeQueryJSON-CcHnccia-BAMZ5LEx.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./LRUCache-C3erQTWv-D3oKynNB.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./editsZScale-BDsX6vv--CJojmgz5.js","./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js","./BinsQuery-DjwQZqB8-BqGeRmeR.js","./queryUtils-Brxu6254-qwN-s2Og.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-BTdHgocv.js";import{aB as W,at as H,ag as j,o as m,n as K,l as z,K as Z,a1 as F,dJ as R,v as o,dz as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,W as te,b0 as re,dK as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,dL as ne,a0 as y,dM as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import{D as De}from"./Layer-ChoECxvZ-ocw70508.js";import{q as Oe}from"./workers-PiCjreoO-DrDY4oeh.js";import{c as Le}from"./editsZScale-BDsX6vv--CJojmgz5.js";import{n as A}from"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import{O as V}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as qe}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as je}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{C as Re}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{c as He,l as Ke,n as ze,r as Ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{p as k}from"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import{y as Q}from"./FeatureType-C9hJmS6_-zoljUYGr.js";import{f as ft}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import{w as wt}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{a as _t}from"./versionUtils-LZYZz-38-esAtUime.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-FWeI_AU8.js";import{g as St}from"./styleUtils-ChrJTYIw-DnWMc-4t.js";import{w as Ft}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-DpexmTpL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-CO3-WMru.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-BqGeRmeR.js"),__vite__mapDeps([81,1,2,3,4,82,11,12,32,33,34,35,83,41,42,43,44]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new m("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const si=s;export{si as default}; diff --git a/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-_MOPDF8o.js b/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-_MOPDF8o.js deleted file mode 100644 index 51bae478..00000000 --- a/custom-toc-separator/assets/FeatureLayer-BrRKw5Si-_MOPDF8o.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DxeKRxzI.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./utils-BVWK2jiA-Bnz0n_UG.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./FeatureLayerSource-k4WMYop1-Czmqxz6U.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./mat4-DX7gBViE-d6nV0_rZ.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-BlkhMH5A.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./clientSideDefaults-BqqayPct-BCK_HM0i.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-Cdg8UCnQ.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./executeForIds-Z1gkLduF-BLtp2DWt.js","./query-DFW9-NG_-CLOB0soI.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./executeQueryPBF-o8010HS9-DA2vEqjE.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./executeQueryJSON-CcHnccia-C6q0seac.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./editsZScale-BDsX6vv--D74kwHO-.js","./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js","./BinsQuery-DjwQZqB8-xSRrS-fI.js","./queryUtils-Brxu6254-BZ9oWgik.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-lj2zzr_L.js";import{aB as W,at as H,ag as j,o as m,n as K,l as z,K as Z,a1 as F,dJ as R,v as o,dz as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,W as te,b0 as re,dK as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,dL as ne,a0 as y,dM as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import{D as De}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{q as Oe}from"./workers-PiCjreoO-mU03Z-E4.js";import{c as Le}from"./editsZScale-BDsX6vv--D74kwHO-.js";import{n as A}from"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import{O as V}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as qe}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as je}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{C as Re}from"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{c as He,l as Ke,n as ze,r as Ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{p as k}from"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import{y as Q}from"./FeatureType-C9hJmS6_-BoBeHHAU.js";import{f as ft}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import{w as wt}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{a as _t}from"./versionUtils-LZYZz-38-CcEiEhYk.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-gUIs0TS1.js";import{g as St}from"./styleUtils-ChrJTYIw-CbI3fdq_.js";import{w as Ft}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-DxeKRxzI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-Czmqxz6U.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-xSRrS-fI.js"),__vite__mapDeps([81,1,2,3,4,82,11,12,32,33,34,35,83,41,42,43,44]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new m("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const si=s;export{si as default}; diff --git a/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-BYmgg8m3.js b/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-BYmgg8m3.js deleted file mode 100644 index 10546855..00000000 --- a/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-BYmgg8m3.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as p,aa as P,e as I,ad as Ie,a0 as l,ac as a,e3 as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,d7 as st,dX as Oe,e4 as Pe,e5 as Me,e6 as Re,e7 as rt,a1 as pt,cs as Ze}from"./story-OUarUCIt.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-DY7R6puO.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import{p as St}from"./Relationship-PyhUibYK-Jg399ifo.js";import{x as It}from"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";var pe;let T=pe=class extends I{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends I{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(I){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function qe(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Ie("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=qe(f),Mt=f;var le;const Rt=qe(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends I{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let q=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],q);const Dt=q;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Ue(t){return t??null}function Le(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Ue(o.max)}writeMax(t,o){o.max=Le(t)}readMin(t,o){return Ue(o.min)}writeMin(t,o){o.min=Le(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Ut=A;var ve;let H=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ve=e([p("esri.form.elements.inputs.TextAreaInput")],H);const Lt=H;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Ut,"text-area":Lt,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let U=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],U.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],U.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],U.prototype,"type",void 0),U=be=e([p("esri.form.elements.TextElement")],U);const We=U;function He(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Ie("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=He(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Se;const se=He(Qt);let v=Se=class extends I{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Se({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Ie("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Se=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(I){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const qt=j;let g=class extends P(I){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let L=class extends P(I){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],L.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],L.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],L.prototype,"units",void 0),L=e([p("esri.layers.support.GeometryFieldsInfo")],L);const Ht=L;let S=class extends P(I){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],S.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],S.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],S.prototype,"domains",void 0),e([l("domains")],S.prototype,"readDomains",null),e([a("domains")],S.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],S.prototype,"name",void 0),S=e([p("esri.layers.support.Subtype")],S);const Jt=S,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return It(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:qt})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:Ht,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[St],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; diff --git a/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-DKfYVQxG.js b/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-DKfYVQxG.js new file mode 100644 index 00000000..c14d24df --- /dev/null +++ b/custom-toc-separator/assets/FeatureLayerBase-vvYyZTfh-DKfYVQxG.js @@ -0,0 +1 @@ +import{v as e,S as i,i as p,aa as P,e as I,ad as Ie,a0 as l,ac as a,e3 as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,d7 as st,dX as Oe,e4 as Pe,e5 as Me,e6 as Re,e7 as rt,a1 as pt,cs as Ze}from"./story-DT1Ep1ux.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-aKnzhZ32.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import{p as St}from"./Relationship-PyhUibYK-Dl9eU1qo.js";import{x as It}from"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";var pe;let T=pe=class extends I{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends I{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(I){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function qe(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Ie("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=qe(f),Mt=f;var le;const Rt=qe(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends I{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let q=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],q);const Dt=q;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Ue(t){return t??null}function Le(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Ue(o.max)}writeMax(t,o){o.max=Le(t)}readMin(t,o){return Ue(o.min)}writeMin(t,o){o.min=Le(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Ut=A;var ve;let H=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ve=e([p("esri.form.elements.inputs.TextAreaInput")],H);const Lt=H;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Ut,"text-area":Lt,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let U=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],U.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],U.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],U.prototype,"type",void 0),U=be=e([p("esri.form.elements.TextElement")],U);const We=U;function He(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Ie("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=He(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Se;const se=He(Qt);let v=Se=class extends I{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Se({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Ie("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Se=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(I){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const qt=j;let g=class extends P(I){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let L=class extends P(I){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],L.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],L.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],L.prototype,"units",void 0),L=e([p("esri.layers.support.GeometryFieldsInfo")],L);const Ht=L;let S=class extends P(I){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],S.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],S.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],S.prototype,"domains",void 0),e([l("domains")],S.prototype,"readDomains",null),e([a("domains")],S.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],S.prototype,"name",void 0),S=e([p("esri.layers.support.Subtype")],S);const Jt=S,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return It(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:qt})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:Ht,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[St],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; diff --git a/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-CO3-WMru.js b/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-CO3-WMru.js new file mode 100644 index 00000000..ec032ea9 --- /dev/null +++ b/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-CO3-WMru.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-D3__089f.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./meshFeatureAttributes-BwKR5odo-BHZn4_tO.js","./convertMeshVertexSpace-BO7NR5uA-DvAU7l0w.js","./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js","./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./projection-BA9M1R7d-DTN1X2Bt.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./vec3-BazNroeq-xVxXS26y.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-CEZkOwEl.js"])))=>i.map(i=>d[i]); +import{_ as M}from"./main-BTdHgocv.js";import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as N,f,aq as v,o as S,n as V,bX as T,C,a3 as G,az as B,dK as H,W as z,a1 as x,J as K,aC as W,he as J,jd as X,bi as Z,g as Y}from"./story-DT1Ep1ux.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import{S as se}from"./External-D_wl4XAw-CF3XmPYl.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{V as oe}from"./MeshTransform-C--IG09w-DmlAOJ8b.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-C1Nc4Ce5.js";import{d as de}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{C as ce}from"./QueryTask-CwHwH2rS-LNltUUKG.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import{c as me}from"./editsZScale-BDsX6vv--CJojmgz5.js";import{b as fe}from"./Query-BrwMGK8U-FWeI_AU8.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-CKWTLnam.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=W(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await X(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new Z({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=N("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await M(()=>import("./uploadAssets-fBa6NH35-D3__089f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};N("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await M(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-DvAU7l0w.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([20,1,2,3,4,21,22,23,11,14,10,12,16,24,25,26,27,28,29,30,31,32,33,17,34]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new K(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,Vt=_;export{Vt as default}; diff --git a/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-Czmqxz6U.js b/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-Czmqxz6U.js deleted file mode 100644 index 78603191..00000000 --- a/custom-toc-separator/assets/FeatureLayerSource-k4WMYop1-Czmqxz6U.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-C9SSNhxc.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js","./convertMeshVertexSpace-BO7NR5uA-DzCRoPAY.js","./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js","./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./projection-BA9M1R7d-Cytmrlsd.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./vec3-BazNroeq-C58EAHFm.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-CF_vNE3j.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-lj2zzr_L.js";import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as N,f,aq as v,o as S,n as V,bX as T,C,a3 as G,az as B,dK as H,W as z,a1 as x,J as K,aC as W,he as J,jd as X,bi as Z,g as Y}from"./story-OUarUCIt.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import{S as se}from"./External-D_wl4XAw-BzQ8-YjD.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-Cytmrlsd.js";import{V as oe}from"./MeshTransform-C--IG09w-mx7xOTc-.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-BlkhMH5A.js";import{d as de}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{C as ce}from"./QueryTask-CwHwH2rS-Cdg8UCnQ.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-C6q0seac.js";import{c as me}from"./editsZScale-BDsX6vv--D74kwHO-.js";import{b as fe}from"./Query-BrwMGK8U-gUIs0TS1.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-BLtp2DWt.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=W(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await X(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new Z({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=N("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await M(()=>import("./uploadAssets-fBa6NH35-C9SSNhxc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};N("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await M(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-DzCRoPAY.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([20,1,2,3,4,21,22,23,11,14,10,12,16,24,25,26,27,28,29,30,31,32,33,17,34]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new K(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,Vt=_;export{Vt as default}; diff --git a/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js b/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js deleted file mode 100644 index 698aabc6..00000000 --- a/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js +++ /dev/null @@ -1,9 +0,0 @@ -import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,eK as Ue,hm as St,bh as vt,et as H,ax as _t,ai as Be,ed as Le,j3 as De,dW as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,e4 as oe,dX as ve,iJ as xt,ae as tt,d$ as it,e0 as Et,d_ as Rt}from"./story-OUarUCIt.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{c as $e}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import ee from"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import{T as Ct}from"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import{O as Ie}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{b as me}from"./Query-BrwMGK8U-gUIs0TS1.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-DehQ-_Za.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-DDmsm7e7.js";import{s as Y}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{q as Dt}from"./workers-PiCjreoO-mU03Z-E4.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import{Q as Qt}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-911d_F5-.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import"./main-lj2zzr_L.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=i?.excludedEffect,a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=i?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){x.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} - -> updateRequested ${this.updateRequested} - -> hasRenderer ${e} - -> updatingRequiredFields ${i} - -> hasPendingCommand ${t} - -> dataUpdating ${this.dataUpdating} - -> processing ${this._pipelineUpdating} - -> updatingContainer ${r} -`);for(const a of this.featureContainer.subscriptions())console.log(` -> Tile[${a.id}] Done: ${a.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(i=>e.view.stage.painter.textureManager.rasterizeItem(i))),fetchDictionary:t=>Promise.all(t.map(i=>this._fetchDictionaryRequest(i)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const i=this._lastSchema.processor.mesh.factory.symbology;if(i.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:i.scaleExpression};this._fields||(this._fields=this.layer.fields.map(n=>n.toJSON()));const s=i.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});return!a||!a.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await te(a.data,{uniforms:s,path:"renderer",schemaOptions:r})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=me.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=me.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const i=t.objectIds??[];for(const r of t.aggregateIds??[])i.push(r);return t.objectIds=i,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this._getEffectiveEdit(e);return t?this._commandsQueue.push(t).catch(Me):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Xe+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Xe+1}_getEffectiveEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some(o=>o.objectId===-1||!o.objectId),r=t&&this.availableFields.includes(t);if(i&&!r)return x.getLogger(this).error(new C("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null;const s=this.layer,a=e.historicMoment?.getTime()??null,n="layerId"in s&&e.editedFeatures?.find(o=>o.layerId===s.layerId);if(n&&this._canEditByFeature(n)){const o=Mt(this.layer.geometryType),{adds:l,deletes:u,updates:d}=n.editedFeatures,c=this.layer.objectIdField,p=l.map(m=>Qe(m,o,!1,!1)),y=d.map(m=>Qe(m.current,o,!1,!1));return{type:"edit-by-feature",added:p,removed:u.map(m=>"attributes"in m?{globalId:t?m.attributes[t]:null,objectId:c?m.attributes[c]:null}:m),updated:y,historicMoment:a}}return{type:"edit-by-id",added:e.addedFeatures,updated:e.updatedFeatures,removed:e.deletedFeatures,historicMoment:a}}_canEditByFeature(e){const{adds:t,updates:i}=e.editedFeatures;return t.every(r=>this.view.spatialReference.equals(r.geometry?.spatialReference))&&i.every(r=>this.view.spatialReference.equals(r.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},r=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,r,this._displayRefreshVersion)},a=ke(this._lastSchema?.source.mutable,s.source.mutable)||ke(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const n=Math.round(performance.now());g("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:a}),await(await this.getWorker()).pipeline.updateSchema(s,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),g("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){g("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(i){Ne(i)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=ur(this._lastAvailableFields,e);return this._lastAvailableFields=t,mt(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[cr(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const r of this._highlightCounter.ids()){const s=this._highlightCounter.getHighlightGroups(r),a=this._getHighlightBits(s);e.push({objectId:r,highlightFlags:a})}const t=await this.getWorker();if(this.destroyed)return;const i=t.pipeline.updateHighlight({highlights:e}).catch(r=>{Ne(r)||x.getLogger(this).error(r)});this._updatingHandles.addPromise(i)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function cr(e,t,i,r,s){s&&(s=s.clone());const a=s!=null?s.timeExtent:null,n=i!=null&&a!=null?i.intersection(a):i||a;n&&(s??=new ee,s.timeExtent=n),s=t.addFilters?.(s,e)??s;let o=s?.toJSON()??null;return r.size&&(o??=new ee().toJSON(),o.hiddenIds=Array.from(r)),o}h([f()],_.prototype,"_commandsQueue",void 0),h([f()],_.prototype,"_sourceRefreshVersion",void 0),h([f()],_.prototype,"_displayRefreshVersion",void 0),h([f({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),h([f({readOnly:!0})],_.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],_.prototype,"hasFullGeometries",null),h([f()],_.prototype,"featureEffectView",void 0),h([f()],_.prototype,"labelingCollisionInfos",null),h([f()],_.prototype,"layerAdapter",null),h([f({readOnly:!0})],_.prototype,"timeExtent",null),h([f()],_.prototype,"updating",void 0),_=h([Q("esri.views.2d.layers.FeatureLayerView2D")],_);const dr=_,ca=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"}));export{ca as F,b as n,dr as r}; diff --git a/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js b/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js new file mode 100644 index 00000000..8d53c9c0 --- /dev/null +++ b/custom-toc-separator/assets/FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js @@ -0,0 +1,9 @@ +import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,eK as Ue,hm as St,bh as vt,et as H,ax as _t,ai as Be,ed as Le,j3 as De,dW as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,e4 as oe,dX as ve,iJ as xt,ae as tt,d$ as it,e0 as Et,d_ as Rt}from"./story-DT1Ep1ux.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{c as $e}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import ee from"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import{T as Ct}from"./timeSupport-ohWmWReZ-CSAKuiyl.js";import{O as Ie}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{b as me}from"./Query-BrwMGK8U-FWeI_AU8.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-B3VRdVIM.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-XRkD8ADC.js";import{s as Y}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{q as Dt}from"./workers-PiCjreoO-DrDY4oeh.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-C4JQidi_.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import{Q as Qt}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-D22mGlP8.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import"./main-BTdHgocv.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=i?.excludedEffect,a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=i?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){x.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} + -> updateRequested ${this.updateRequested} + -> hasRenderer ${e} + -> updatingRequiredFields ${i} + -> hasPendingCommand ${t} + -> dataUpdating ${this.dataUpdating} + -> processing ${this._pipelineUpdating} + -> updatingContainer ${r} +`);for(const a of this.featureContainer.subscriptions())console.log(` -> Tile[${a.id}] Done: ${a.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(i=>e.view.stage.painter.textureManager.rasterizeItem(i))),fetchDictionary:t=>Promise.all(t.map(i=>this._fetchDictionaryRequest(i)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const i=this._lastSchema.processor.mesh.factory.symbology;if(i.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const r={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:i.scaleExpression};this._fields||(this._fields=this.layer.fields.map(n=>n.toJSON()));const s=i.visualVariableUniforms,a=await t.getSymbolAsync(e.feature,{fields:this._fields});return!a||!a.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await te(a.data,{uniforms:s,path:"renderer",schemaOptions:r})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=me.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=me.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const i=t.objectIds??[];for(const r of t.aggregateIds??[])i.push(r);return t.objectIds=i,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.updateSuspended)return void this._subscriptionManager.suspend();const t=this._getEffectiveEdit(e);return t?this._commandsQueue.push(t).catch(Me):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%Xe+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%Xe+1}_getEffectiveEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,i=e.deletedFeatures.some(o=>o.objectId===-1||!o.objectId),r=t&&this.availableFields.includes(t);if(i&&!r)return x.getLogger(this).error(new C("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null;const s=this.layer,a=e.historicMoment?.getTime()??null,n="layerId"in s&&e.editedFeatures?.find(o=>o.layerId===s.layerId);if(n&&this._canEditByFeature(n)){const o=Mt(this.layer.geometryType),{adds:l,deletes:u,updates:d}=n.editedFeatures,c=this.layer.objectIdField,p=l.map(m=>Qe(m,o,!1,!1)),y=d.map(m=>Qe(m.current,o,!1,!1));return{type:"edit-by-feature",added:p,removed:u.map(m=>"attributes"in m?{globalId:t?m.attributes[t]:null,objectId:c?m.attributes[c]:null}:m),updated:y,historicMoment:a}}return{type:"edit-by-id",added:e.addedFeatures,updated:e.updatedFeatures,removed:e.deletedFeatures,historicMoment:a}}_canEditByFeature(e){const{adds:t,updates:i}=e.editedFeatures;return t.every(r=>this.view.spatialReference.equals(r.geometry?.spatialReference))&&i.every(r=>this.view.spatialReference.equals(r.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},r=this._createViewSchemaConfig(),s={source:this.layerAdapter.createSourceSchema(r,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,r,this._displayRefreshVersion)},a=ke(this._lastSchema?.source.mutable,s.source.mutable)||ke(this._lastSchema?.processor,s.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=s,this._fields=null;const n=Math.round(performance.now());g("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${n}] FeatureLayerView2D._doUpdate`,{changes:a}),await(await this.getWorker()).pipeline.updateSchema(s,n),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),g("esri-2d-update-debug")&&console.debug(`Version[${n}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){g("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){const t=await this.getWorker();try{this.featureContainer.editStart(),await t.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(i){Ne(i)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=ur(this._lastAvailableFields,e);return this._lastAvailableFields=t,mt(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[cr(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlights(e,t){this._highlightCounter.addGroup(e,t),this._commandsQueue.push({type:"highlight"})}_removeHighlights(e,t){this._highlightCounter.deleteGroup(e,t),this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=[];for(const r of this._highlightCounter.ids()){const s=this._highlightCounter.getHighlightGroups(r),a=this._getHighlightBits(s);e.push({objectId:r,highlightFlags:a})}const t=await this.getWorker();if(this.destroyed)return;const i=t.pipeline.updateHighlight({highlights:e}).catch(r=>{Ne(r)||x.getLogger(this).error(r)});this._updatingHandles.addPromise(i)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function cr(e,t,i,r,s){s&&(s=s.clone());const a=s!=null?s.timeExtent:null,n=i!=null&&a!=null?i.intersection(a):i||a;n&&(s??=new ee,s.timeExtent=n),s=t.addFilters?.(s,e)??s;let o=s?.toJSON()??null;return r.size&&(o??=new ee().toJSON(),o.hiddenIds=Array.from(r)),o}h([f()],_.prototype,"_commandsQueue",void 0),h([f()],_.prototype,"_sourceRefreshVersion",void 0),h([f()],_.prototype,"_displayRefreshVersion",void 0),h([f({readOnly:!0})],_.prototype,"_pipelineUpdating",void 0),h([f({readOnly:!0})],_.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],_.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],_.prototype,"hasFullGeometries",null),h([f()],_.prototype,"featureEffectView",void 0),h([f()],_.prototype,"labelingCollisionInfos",null),h([f()],_.prototype,"layerAdapter",null),h([f({readOnly:!0})],_.prototype,"timeExtent",null),h([f()],_.prototype,"updating",void 0),_=h([Q("esri.views.2d.layers.FeatureLayerView2D")],_);const dr=_,ca=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"}));export{ca as F,b as n,dr as r}; diff --git a/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-CBumub4S.js b/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-CBumub4S.js new file mode 100644 index 00000000..8e505a0a --- /dev/null +++ b/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-CBumub4S.js @@ -0,0 +1 @@ +import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,et as Qs,cY as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,eE as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,eM as sr,p as rr,eJ as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dk as yt,a1 as cr}from"./story-DT1Ep1ux.js";import{M as it,t as lr}from"./workers-PiCjreoO-DrDY4oeh.js";import{V as hr}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-XRkD8ADC.js";import{s as nt}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-D-N28B04.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{o as de}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import{Z as as}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-SSagAgRu.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{b as os}from"./Query-BrwMGK8U-FWeI_AU8.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js";import{o as Dr}from"./pbf-D-y3_eZO-CKuZ8F1K.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-CphPkuWc.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./main-BTdHgocv.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./TurboLine-CIlsAy5m-BHDUzrZk.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-DhZ3sGff.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./geojson-CNt_qtQf-DS1EMYq7.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B1aankCm.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{to as default}; diff --git a/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-M4PRBT8L.js b/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-M4PRBT8L.js deleted file mode 100644 index 8bd29f66..00000000 --- a/custom-toc-separator/assets/FeaturePipelineWorker-7KRvCyaS-M4PRBT8L.js +++ /dev/null @@ -1 +0,0 @@ -import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,et as Qs,cY as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,eE as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,eM as sr,p as rr,eJ as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dk as yt,a1 as cr}from"./story-OUarUCIt.js";import{M as it,t as lr}from"./workers-PiCjreoO-mU03Z-E4.js";import{V as hr}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-DDmsm7e7.js";import{s as nt}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-BkUQh61q.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{o as de}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import{Z as as}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-CLOB0soI.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{b as os}from"./Query-BrwMGK8U-gUIs0TS1.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js";import{o as Dr}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-DMli8kp_.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./main-lj2zzr_L.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./TurboLine-CIlsAy5m-BIV61-kY.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-saUNiwHr.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./geojson-CNt_qtQf-DAI1_86C.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{to as default}; diff --git a/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js b/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js deleted file mode 100644 index 31c4e67f..00000000 --- a/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as K,dN as f,ac as _,a0 as x,e8 as ie,K as J,P as p,dK as O,ah as re,av as se,e0 as ne,o as oe,a1 as ae}from"./story-OUarUCIt.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{Y as X,X as D,s as pe}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{C as P}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(X)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(D)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:K(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:K(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(D)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(X)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");J.add("esri-cluster-arcade-enabled",!0);const fe=J("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; diff --git a/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js b/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js new file mode 100644 index 00000000..8f33dcec --- /dev/null +++ b/custom-toc-separator/assets/FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js @@ -0,0 +1 @@ +import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as K,dN as f,ac as _,a0 as x,e8 as ie,K as J,P as p,dK as O,ah as re,av as se,e0 as ne,o as oe,a1 as ae}from"./story-DT1Ep1ux.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{Y as X,X as D,s as pe}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{C as P}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(X)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(D)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:K(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:K(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(D)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(X)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");J.add("esri-cluster-arcade-enabled",!0);const fe=J("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; diff --git a/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js b/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js new file mode 100644 index 00000000..ebd4fd03 --- /dev/null +++ b/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js @@ -0,0 +1 @@ +import{e as p,v as r,S as o,i as n}from"./story-DT1Ep1ux.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; diff --git a/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js b/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js deleted file mode 100644 index b1a5eec1..00000000 --- a/custom-toc-separator/assets/FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js +++ /dev/null @@ -1 +0,0 @@ -import{e as p,v as r,S as o,i as n}from"./story-OUarUCIt.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; diff --git a/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CQMkTjXX.js b/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CQMkTjXX.js deleted file mode 100644 index 59c82e0f..00000000 --- a/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CQMkTjXX.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dh as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,ec as B}from"./story-OUarUCIt.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{I as _e}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{V as I}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{b as S}from"./Query-BrwMGK8U-gUIs0TS1.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import{b as te}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-CLOB0soI.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-OMiRxUp-.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-lj2zzr_L.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const _s=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{_s as default}; diff --git a/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CgT8_m38.js b/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CgT8_m38.js new file mode 100644 index 00000000..14506c37 --- /dev/null +++ b/custom-toc-separator/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CgT8_m38.js @@ -0,0 +1 @@ +import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dh as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,ec as B}from"./story-DT1Ep1ux.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{I as _e}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{V as I}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{b as S}from"./Query-BrwMGK8U-FWeI_AU8.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import{b as te}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-SSagAgRu.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-vTEQb1N7.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-BTdHgocv.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const _s=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{_s as default}; diff --git a/custom-toc-separator/assets/FeatureSet-BkVNthuN-C5Zta7rI.js b/custom-toc-separator/assets/FeatureSet-BkVNthuN-C5Zta7rI.js deleted file mode 100644 index 3231b56f..00000000 --- a/custom-toc-separator/assets/FeatureSet-BkVNthuN-C5Zta7rI.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as T,v as h,S as d,bi as S,a0 as G,ac as z,af as N,J as R,i as P,e as j,g as F,P as J,ca as x}from"./story-OUarUCIt.js";import{y as q}from"./Field-C6hA1tZj-DY7R6puO.js";var v;const w=new T({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[S],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:N,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; diff --git a/custom-toc-separator/assets/FeatureSet-BkVNthuN-CvGbjjZL.js b/custom-toc-separator/assets/FeatureSet-BkVNthuN-CvGbjjZL.js new file mode 100644 index 00000000..dfc28efe --- /dev/null +++ b/custom-toc-separator/assets/FeatureSet-BkVNthuN-CvGbjjZL.js @@ -0,0 +1 @@ +import{aK as T,v as h,S as d,bi as S,a0 as G,ac as z,af as N,J as R,i as P,e as j,g as F,P as J,ca as x}from"./story-DT1Ep1ux.js";import{y as q}from"./Field-C6hA1tZj-aKnzhZ32.js";var v;const w=new T({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[S],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:N,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; diff --git a/custom-toc-separator/assets/FeatureStore-Co2V0sVE-BIksXSjO.js b/custom-toc-separator/assets/FeatureStore-Co2V0sVE-BIksXSjO.js deleted file mode 100644 index 345e3101..00000000 --- a/custom-toc-separator/assets/FeatureStore-Co2V0sVE-BIksXSjO.js +++ /dev/null @@ -1 +0,0 @@ -import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./story-OUarUCIt.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{r as m}from"./BoundsStore--N6o1xkF-OMiRxUp-.js";import{r as y}from"./timeSupport-jPViR5jn-BLBOCVnL.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; diff --git a/custom-toc-separator/assets/FeatureStore-Co2V0sVE-IoB-sC2w.js b/custom-toc-separator/assets/FeatureStore-Co2V0sVE-IoB-sC2w.js new file mode 100644 index 00000000..109e5bc7 --- /dev/null +++ b/custom-toc-separator/assets/FeatureStore-Co2V0sVE-IoB-sC2w.js @@ -0,0 +1 @@ +import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./story-DT1Ep1ux.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{r as m}from"./BoundsStore--N6o1xkF-vTEQb1N7.js";import{r as y}from"./timeSupport-jPViR5jn-CHDjIIE2.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; diff --git a/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-B2RPXrwU.js b/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-B2RPXrwU.js deleted file mode 100644 index d31cb8f7..00000000 --- a/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-B2RPXrwU.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./story-OUarUCIt.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-Dk1o48TK.js b/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-Dk1o48TK.js new file mode 100644 index 00000000..08503f35 --- /dev/null +++ b/custom-toc-separator/assets/FeatureTemplate-SPHPD45f-Dk1o48TK.js @@ -0,0 +1 @@ +import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./story-DT1Ep1ux.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/custom-toc-separator/assets/FeatureType-C9hJmS6_-BoBeHHAU.js b/custom-toc-separator/assets/FeatureType-C9hJmS6_-BoBeHHAU.js deleted file mode 100644 index 8fd060ef..00000000 --- a/custom-toc-separator/assets/FeatureType-C9hJmS6_-BoBeHHAU.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./story-OUarUCIt.js";import{i as y}from"./Field-C6hA1tZj-DY7R6puO.js";import{p as c}from"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; diff --git a/custom-toc-separator/assets/FeatureType-C9hJmS6_-zoljUYGr.js b/custom-toc-separator/assets/FeatureType-C9hJmS6_-zoljUYGr.js new file mode 100644 index 00000000..7a4681c4 --- /dev/null +++ b/custom-toc-separator/assets/FeatureType-C9hJmS6_-zoljUYGr.js @@ -0,0 +1 @@ +import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./story-DT1Ep1ux.js";import{i as y}from"./Field-C6hA1tZj-aKnzhZ32.js";import{p as c}from"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; diff --git a/custom-toc-separator/assets/Field-C6hA1tZj-DY7R6puO.js b/custom-toc-separator/assets/Field-C6hA1tZj-DY7R6puO.js deleted file mode 100644 index 35b2f12f..00000000 --- a/custom-toc-separator/assets/Field-C6hA1tZj-DY7R6puO.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as o,i as l,aK as j,bz as u,a0 as f,bB as x,e as b,P as T}from"./story-OUarUCIt.js";import{i as D}from"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./main-lj2zzr_L.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([u(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let p=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],p.prototype,"codedValues",void 0),t([u({codedValue:"coded-value"})],p.prototype,"type",void 0),p=h=t([l("esri.layers.support.CodedValueDomain")],p);const S=p;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([u({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([u({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([u(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,q=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{q as F,S as a,P as i,B as n,s as p,F as y}; diff --git a/custom-toc-separator/assets/Field-C6hA1tZj-aKnzhZ32.js b/custom-toc-separator/assets/Field-C6hA1tZj-aKnzhZ32.js new file mode 100644 index 00000000..2df88f7f --- /dev/null +++ b/custom-toc-separator/assets/Field-C6hA1tZj-aKnzhZ32.js @@ -0,0 +1 @@ +import{v as t,S as o,i as l,aK as j,bz as u,a0 as f,bB as x,e as b,P as T}from"./story-DT1Ep1ux.js";import{i as D}from"./fieldType-CD2CL2hr-B2sVi9me.js";import"./main-BTdHgocv.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([u(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let p=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],p.prototype,"codedValues",void 0),t([u({codedValue:"coded-value"})],p.prototype,"type",void 0),p=h=t([l("esri.layers.support.CodedValueDomain")],p);const S=p;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([u({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([u({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([u(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,q=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{q as F,S as a,P as i,B as n,s as p,F as y}; diff --git a/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-Bc4ZGZOb.js b/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-Bc4ZGZOb.js deleted file mode 100644 index 88d6344d..00000000 --- a/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-Bc4ZGZOb.js +++ /dev/null @@ -1 +0,0 @@ -import{cg as N,ch as S,ci as y,cj as _,ck as b,a1 as B,o as q,cl as h,cm as u,b_ as z,an as J,c7 as O,cn as L,co as $,cp as D,cq as c}from"./story-OUarUCIt.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const j=new Map;let A=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],T(e))}static fromLayerJSON(e){return new m(e.fields??[],T(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=g(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new q("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?z.utcInstance:J(j,t,()=>O.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return L(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>$(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function g(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{A as o}; diff --git a/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-C6g_2n4m.js b/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-C6g_2n4m.js new file mode 100644 index 00000000..98fd7162 --- /dev/null +++ b/custom-toc-separator/assets/FieldsIndex-HmzMbJQG-C6g_2n4m.js @@ -0,0 +1 @@ +import{cg as N,ch as S,ci as y,cj as _,ck as b,a1 as B,o as q,cl as h,cm as u,b_ as z,an as J,c7 as O,cn as L,co as $,cp as D,cq as c}from"./story-DT1Ep1ux.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const j=new Map;let A=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],T(e))}static fromLayerJSON(e){return new m(e.fields??[],T(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=g(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new q("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?z.utcInstance:J(j,t,()=>O.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return L(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>$(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function g(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{A as o}; diff --git a/custom-toc-separator/assets/FloatingArrow-BG9llDYg-Di-yhMoZ.js b/custom-toc-separator/assets/FloatingArrow-BG9llDYg-Di-yhMoZ.js new file mode 100644 index 00000000..2ae76a32 --- /dev/null +++ b/custom-toc-separator/assets/FloatingArrow-BG9llDYg-Di-yhMoZ.js @@ -0,0 +1 @@ +import{a}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; diff --git a/custom-toc-separator/assets/FloatingArrow-BG9llDYg-ljy-TIYj.js b/custom-toc-separator/assets/FloatingArrow-BG9llDYg-ljy-TIYj.js deleted file mode 100644 index b6616ddf..00000000 --- a/custom-toc-separator/assets/FloatingArrow-BG9llDYg-ljy-TIYj.js +++ /dev/null @@ -1 +0,0 @@ -import{a}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; diff --git a/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-B_I_Y0v_.js b/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-B_I_Y0v_.js deleted file mode 100644 index eefcbdaa..00000000 --- a/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-B_I_Y0v_.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BlkhMH5A.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-lj2zzr_L.js";import{v as r,S as i,i as E,J as O,W as J,bT as y,dL as N,a as f,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as L}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{q as Q}from"./workers-PiCjreoO-mU03Z-E4.js";import{$ as G}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{O as Z}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{u as z}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{E as B}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{C as Y}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as H}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{p as le}from"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import{y as pe}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as ue}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{b as d}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as me}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>Z.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new g("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await Q("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=G(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(L))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(J).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),N(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await w(()=>import("./editingSupport-gUqP9iyf-BlkhMH5A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return me(this,e)}createQuery(){const e=new d,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const jt=o;export{jt as default}; diff --git a/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-YQWmUbSd.js b/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-YQWmUbSd.js new file mode 100644 index 00000000..6c785a3e --- /dev/null +++ b/custom-toc-separator/assets/GeoJSONLayer-BFFwDRph-YQWmUbSd.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-BTdHgocv.js";import{v as r,S as i,i as E,J as O,W as J,bT as y,dL as N,a as f,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as L}from"./Layer-ChoECxvZ-ocw70508.js";import{q as Q}from"./workers-PiCjreoO-DrDY4oeh.js";import{$ as G}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{O as Z}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{u as z}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{E as B}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{C as Y}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as H}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{p as le}from"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import{y as pe}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as ue}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{b as d}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as me}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>Z.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new g("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await Q("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=G(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(L))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(J).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),N(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await w(()=>import("./editingSupport-gUqP9iyf-C1Nc4Ce5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return me(this,e)}createQuery(){const e=new d,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const jt=o;export{jt as default}; diff --git a/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-C0nkhl7e.js b/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-C0nkhl7e.js deleted file mode 100644 index 7ff27c66..00000000 --- a/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-C0nkhl7e.js +++ /dev/null @@ -1 +0,0 @@ -import{eS as _,o as I,ck as A,gT as Z,cl as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./story-OUarUCIt.js";import{z,n as N,A as H,j as L,k as Y}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{I as B}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{f as E,h as b}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{Z as J}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-DAI1_86C.js";import{A as K,f as X,d as ee}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import{o as C}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{i as ie}from"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./main-lj2zzr_L.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class tt{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?ee(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=X(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(H([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=L(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(Y(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{tt as default}; diff --git a/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-DLJunBF3.js b/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-DLJunBF3.js new file mode 100644 index 00000000..ee2fa1bf --- /dev/null +++ b/custom-toc-separator/assets/GeoJSONSourceWorker-CLrugTuD-DLJunBF3.js @@ -0,0 +1 @@ +import{eS as _,o as I,ck as A,gT as Z,cl as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./story-DT1Ep1ux.js";import{z,n as N,A as H,j as L,k as Y}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{I as B}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{f as E,h as b}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{Z as J}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-DS1EMYq7.js";import{A as K,f as X,d as ee}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import{o as C}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{i as ie}from"./fieldType-CD2CL2hr-B2sVi9me.js";import"./main-BTdHgocv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class tt{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?ee(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=X(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(H([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=L(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(Y(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{tt as default}; diff --git a/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-Bxp1nci4.js b/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-Bxp1nci4.js deleted file mode 100644 index 44e5fac1..00000000 --- a/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-Bxp1nci4.js +++ /dev/null @@ -1 +0,0 @@ -import{gK as n,W as p,f as y,dc as m,C as u,v as o,S as i,a0 as d,n as h,i as c,dS as a,d_ as S,eB as f,e0 as g,d$ as v}from"./story-OUarUCIt.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as b}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as G}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as _}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as F}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":S},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"picture-marker":f,"simple-marker":g},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(_(F(E(C(b)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const oe=t;export{oe as default}; diff --git a/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-DsIKHjQm.js b/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-DsIKHjQm.js new file mode 100644 index 00000000..9f4d4a73 --- /dev/null +++ b/custom-toc-separator/assets/GeoRSSLayer-DgF8xnYi-DsIKHjQm.js @@ -0,0 +1 @@ +import{gK as n,W as p,f as y,dc as m,C as u,v as o,S as i,a0 as d,n as h,i as c,dS as a,d_ as S,eB as f,e0 as g,d$ as v}from"./story-DT1Ep1ux.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as b}from"./Layer-ChoECxvZ-ocw70508.js";import{u as G}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as _}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as F}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":S},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"picture-marker":f,"simple-marker":g},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(_(F(E(C(b)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const oe=t;export{oe as default}; diff --git a/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DLSQs3Mr.js b/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DLSQs3Mr.js new file mode 100644 index 00000000..86121d30 --- /dev/null +++ b/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DLSQs3Mr.js @@ -0,0 +1 @@ +import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./story-DT1Ep1ux.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{O as b}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{X as V,Y as S}from"./LayerView-Bish-E63-B3VRdVIM.js";import{d as _}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./main-BTdHgocv.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),e=r.hitTest(t);for(const m of e)m.layer=p,m.sourceLayer=p,m.popupTemplate=i;return e}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),e=new g(i.features),m=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(m.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:e,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const qi=y;export{qi as default}; diff --git a/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DVxfLFkO.js b/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DVxfLFkO.js deleted file mode 100644 index f90dd970..00000000 --- a/custom-toc-separator/assets/GeoRSSLayerView2D-BLTYupUX-DVxfLFkO.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./story-OUarUCIt.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{O as b}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{X as V,Y as S}from"./LayerView-Bish-E63-DehQ-_Za.js";import{d as _}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./main-lj2zzr_L.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),e=r.hitTest(t);for(const m of e)m.layer=p,m.sourceLayer=p,m.popupTemplate=i;return e}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),e=new g(i.features),m=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(m.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:e,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const qi=y;export{qi as default}; diff --git a/custom-toc-separator/assets/GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js b/custom-toc-separator/assets/GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js deleted file mode 100644 index 41f8283a..00000000 --- a/custom-toc-separator/assets/GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js +++ /dev/null @@ -1 +0,0 @@ -import{hS as S}from"./story-OUarUCIt.js";const z=512;var P,p;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"})(P||(P={}));let f=class R{constructor(i,s){this.x=i,this.y=s}clone(){return new R(this.x,this.y)}equals(i,s){return i===this.x&&s===this.y}isEqual(i){return i.x===this.x&&i.y===this.y}setCoords(i,s){return this.x=i,this.y=s,this}normalize(){const i=this.x,s=this.y,h=Math.sqrt(i*i+s*s);return this.x/=h,this.y/=h,this}rightPerpendicular(){const i=this.x;return this.x=this.y,this.y=-i,this}leftPerpendicular(){const i=this.x;return this.x=-this.y,this.y=i,this}move(i,s){return this.x+=i,this.y+=s,this}assign(i){return this.x=i.x,this.y=i.y,this}assignAdd(i,s){return this.x=i.x+s.x,this.y=i.y+s.y,this}assignSub(i,s){return this.x=i.x-s.x,this.y=i.y-s.y,this}rotate(i,s){const h=this.x,e=this.y;return this.x=h*i-e*s,this.y=h*s+e*i,this}scale(i){return this.x*=i,this.y*=i,this}length(){const i=this.x,s=this.y;return Math.sqrt(i*i+s*s)}sub(i){return this.x-=i.x,this.y-=i.y,this}add(i){return this.x+=i.x,this.y+=i.y,this}static distance(i,s){const h=s.x-i.x,e=s.y-i.y;return Math.sqrt(h*h+e*e)}static add(i,s){return new R(i.x+s.x,i.y+s.y)}static sub(i,s){return new R(i.x-s.x,i.y-s.y)}};class v{constructor(i,s,h){this.ratio=i,this.x=s,this.y=h}}let C=class{constructor(t,i,s,h=8,e=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=e,this._tileSize=z*h,this._dz=t,this._yPos=i,this._xPos=s}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;i>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;m>this._dz;i>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;mr.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; diff --git a/custom-toc-separator/assets/GraphicContainer-DuOHUciE-DpgZsbDS.js b/custom-toc-separator/assets/GraphicContainer-DuOHUciE-DpgZsbDS.js deleted file mode 100644 index 30586bfb..00000000 --- a/custom-toc-separator/assets/GraphicContainer-DuOHUciE-DpgZsbDS.js +++ /dev/null @@ -1 +0,0 @@ -import{E as s,R as i,h as t}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{K as h}from"./AGraphicContainer-LUCT6Gle-BEOATdol.js";let l=class extends h{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this._updateAttributeView(),this.children.some(r=>r.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; diff --git a/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-BtcJ4z0g.js b/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-BtcJ4z0g.js new file mode 100644 index 00000000..9723e447 --- /dev/null +++ b/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-BtcJ4z0g.js @@ -0,0 +1 @@ +import{v as r,S as p,i as a,dz as w,bi as l,bG as y,ag as o,dA as _,am as c}from"./story-DT1Ep1ux.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; diff --git a/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-EGgNeYwI.js b/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-EGgNeYwI.js deleted file mode 100644 index 1a2240fc..00000000 --- a/custom-toc-separator/assets/GraphicsCollection-CWTXNZOX-EGgNeYwI.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as p,i as a,dz as w,bi as l,bG as y,ag as o,dA as _,am as c}from"./story-OUarUCIt.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; diff --git a/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-CVunY75r.js b/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-CVunY75r.js deleted file mode 100644 index 8ac0b187..00000000 --- a/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-CVunY75r.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as s}from"./story-OUarUCIt.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import{D as h}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as n}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{q as d}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,p){return super.on(r,p)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([s("esri.layers.GraphicsLayer")],t);const E=t;export{E as default}; diff --git a/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-shHP2mZF.js b/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-shHP2mZF.js new file mode 100644 index 00000000..1da095a7 --- /dev/null +++ b/custom-toc-separator/assets/GraphicsLayer-DfeGaYc1-shHP2mZF.js @@ -0,0 +1 @@ +import{v as e,S as i,i as s}from"./story-DT1Ep1ux.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import{D as h}from"./Layer-ChoECxvZ-ocw70508.js";import{u as n}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{q as d}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,p){return super.on(r,p)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([s("esri.layers.GraphicsLayer")],t);const E=t;export{E as default}; diff --git a/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-BvDpAP1D.js b/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-BvDpAP1D.js deleted file mode 100644 index 188c1c88..00000000 --- a/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-BvDpAP1D.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./story-OUarUCIt.js";import{X as d,Y as u}from"./LayerView-Bish-E63-DehQ-_Za.js";import{d as w}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const yt=e;export{yt as default}; diff --git a/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-CLGoHZ51.js b/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-CLGoHZ51.js new file mode 100644 index 00000000..5b77c604 --- /dev/null +++ b/custom-toc-separator/assets/GraphicsLayerView2D-CGXlTqHO-CLGoHZ51.js @@ -0,0 +1 @@ +import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./story-DT1Ep1ux.js";import{X as d,Y as u}from"./LayerView-Bish-E63-B3VRdVIM.js";import{d as w}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const yt=e;export{yt as default}; diff --git a/custom-toc-separator/assets/GraphicsView2D-C4wYE2ut-CfB0sBaU.js b/custom-toc-separator/assets/GraphicsView2D-C4wYE2ut-CfB0sBaU.js new file mode 100644 index 00000000..d68ffb30 --- /dev/null +++ b/custom-toc-separator/assets/GraphicsView2D-C4wYE2ut-CfB0sBaU.js @@ -0,0 +1,3 @@ +import{bR as W,j as L,K as y,ah as X,aq as B,b9 as Y,$ as N,bh as g,cb as Q,iX as J,ca as K,eQ as V,iY as ee,iZ as te,bK as E,O as se,v as m,S as _,i as re,ht as ie,aG as oe,g_ as ae,et as T,i_ as ne,h0 as he,i$ as de}from"./story-DT1Ep1ux.js";import{o as ce}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{a as le,bo as ue,k as pe,bp as me,bq as z,br as q,bs as A}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{c as _e}from"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import{D as ye,t as v,h as ge,j as fe,k as be}from"./definitions-DJSdSb77-DkoRHaVx.js";import{i as we}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{o as Ie,m as ve,u as Se,P as xe,W as Re,e as Me}from"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import{_ as Te,h as Ge,j as je,a as Ce,e as ze,J as Pe,Z as Ue,Y as ke,X as $e,K as qe,W as P}from"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import{z as Ae,R as Oe,C as U}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{c as x}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{V as Ve}from"./Tile-D75RMC64-XRkD8ADC.js";import{l as Ee}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{H as De}from"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import{f as Fe,h as Ze}from"./queryUtils-Brxu6254-qwN-s2Og.js";async function He(r,e,t){const s=[],i={scaleInfo:je(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":if(o.animationParams){s.push(...$e(t.instances.animatedMarker,o,P,i));break}s.push(...qe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Pe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class G extends Me{static from(e,t,s){return new G(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new G(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1v*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=A(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?A(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const O=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} + -> attaching ${!this._attached} + -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(B)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){const e=[];for(const{objectId:t,highlightFlags:s}of r){const i=this._graphicStore.getItem(t)?.displayId;e.push({objectId:t,highlightFlags:s,displayId:i})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){Y(this._commandQueue.push({type:"update"}))}async _update(){try{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));for(const t of r.updated)this.container.restartAnimation(t.objectId);if(!r.hasAnyUpdate())return void this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).append(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)S.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)S.getOrCreate(o,e,this._metadata).append(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:e.objectIdMap}),this.container.requestRender()}}_writeMeshes(r){const e=new Re(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ye:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=ue(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(pe.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){N(this._controller.signal);const t=this.container.instanceStore,s=this.view.stage.meshWriterRegistry,i=await He(r,e,t);return Promise.all(i.map(o=>s.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},o)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new we(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=S.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:s.objectIdMap})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return Q(e)?J:K(e)||V(e)?ee:this.defaultPointSymbolEnabled?te:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=_e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);se(o);const a=new Map;for(let n=0;nv*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=A(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?A(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const O=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} - -> attaching ${!this._attached} - -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(B)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){const e=[];for(const{objectId:t,highlightFlags:s}of r){const i=this._graphicStore.getItem(t)?.displayId;e.push({objectId:t,highlightFlags:s,displayId:i})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){Y(this._commandQueue.push({type:"update"}))}async _update(){try{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));for(const t of r.updated)this.container.restartAnimation(t.objectId);if(!r.hasAnyUpdate())return void this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).append(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)S.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)S.getOrCreate(o,e,this._metadata).append(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:e.objectIdMap}),this.container.requestRender()}}_writeMeshes(r){const e=new Re(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ye:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=ue(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(pe.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){N(this._controller.signal);const t=this.container.instanceStore,s=this.view.stage.meshWriterRegistry,i=await He(r,e,t);return Promise.all(i.map(o=>s.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},o)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new we(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=S.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:s.objectIdMap})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return Q(e)?J:K(e)||V(e)?ee:this.defaultPointSymbolEnabled?te:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=_e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);se(o);const a=new Map;for(let n=0;n{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) -${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${l} ms (${r} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${r})`}for(const o of i.handles)o.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){k&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const E=1,bt=0,it=1,st=2;let ui=class{constructor(t,e,i){this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/E),a=Math.ceil(this._height/E);this._cols=s,this._rows=a,this._cells=ei.create(s*a)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{transformedX:i,transformedY:s,width:a,height:o}of t.bounds){const n=a*this._pixelRatio,l=o*this._pixelRatio,r=i*this._pixelRatio,u=s*this._pixelRatio;switch(this._collide(r,u,n,l)){case st:return st;case it:e++}}return e===t.bounds.length?it:bt}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s;if(n<0||l<0||a>this._width||o>this._height)return it;const r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);if(this.has(v))return st}return bt}_mark(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s,r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);this.set(v)}return!1}_markMetrics(t){for(const{transformedX:e,transformedY:i,width:s,height:a}of t.bounds){const o=s*this._pixelRatio,n=a*this._pixelRatio,l=e*this._pixelRatio,r=i*this._pixelRatio;this._mark(l,r,o,n)}}};const H=254,pt=255,Q=0;function B(t,e){const i=t.children.slice();i.sort((s,a)=>s.tileAge-a.tileAge),i.forEach(s=>{s.labelMetrics!=null&&s.isReady&&e(s,s.labelMetrics)})}function oe(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}class hi{run(e,i,s,a){const o=[];for(let n=e.length-1;n>=0;n--){const l=e[n];l.labelingCollisionInfos?.length&&o.push(...l.labelingCollisionInfos)}Wt("esri-2d-update-debug")&&o.length&&console.debug("CollisionEngine.run"),this._transformMetrics(o),this._runCollision(o,i,s,a);for(const n of o)n.container.requestRender()}_runCollision(e,i,s,a){const[o,n]=i.state.size,l=new ui(o,n,i.pixelRatio);for(const{container:r,deconflictionEnabled:u,visible:m}of e){const _=r.attributeView;u?m?(this._prepare(r),this._collideVisible(l,r,s,a),this._collideInvisible(l,r)):B(r,(p,g)=>{for(const v of g)_.setLabelMinZoom(v.entityTexel,pt)}):B(r,(p,g)=>{for(const v of g)oe(v,s)?(_.setLabelMinZoom(v.entityTexel,Q),m&&l.insertMetrics(v)):_.setLabelMinZoom(v.entityTexel,H)})}}_isFiltered(e,i,s){const a=i.getFilterFlags(e),o=!s.hasFilter||!!(a&We),n=s.featureEffect==null||s.featureEffect.excludedLabelsVisible||!!(a&Xe);return!(o&&n)}_prepare(e){const i=e.attributeView,s=new Set;B(e,(a,o)=>{for(const n of o){const l=n.entityTexel;if(!s.has(l)){if(s.add(l),this._isFiltered(l,i,e.layerView)){i.setLabelMinZoom(l,H);continue}i.getLabelMinZoom(l)!==Q?i.setLabelMinZoom(l,pt):i.setLabelMinZoom(l,Q)}}})}_collideVisible(e,i,s,a){const o=i.attributeView,n=new Set;B(i,(l,r)=>{for(let u=0;u{for(let l=0;l{const l=i.attributeView,r=o.transforms.labelMat2d;r[4]=Math.round(r[4]),r[5]=Math.round(r[5]);const u=s==="polyline";for(const m of n){const{entityTexel:_,anchorX:p,anchorY:g}=m;let v=m.referenceBounds?.size??0;const T=a[0];if(T!=null){const M=T(l.getVisualVariableData(_,ti.SIZE));v=isNaN(M)||M==null||M===1/0?v:M}const at=Ye+v/2,rt=m.directionX*at,Y=m.directionY*at;for(const M of m.bounds){let lt=p,ut=g;if(u){const ht=p+M.x+rt,ct=g+M.y+Y;lt=r[0]*ht+r[2]*ct+r[4],ut=r[1]*ht+r[3]*ct+r[5];const Me=lt,Ce=ut;M.transformedX=Math.floor(Me),M.transformedY=Math.floor(Ce)}else{lt=r[0]*p+r[2]*g+r[4],ut=r[1]*p+r[3]*g+r[5];const ht=lt+M.x+rt,ct=ut+M.y+Y;M.transformedX=ht,M.transformedY=ct}}}})}}const ci=32;let K=class extends W{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new hi,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return Wt("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: --> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=ci?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};c([f()],K.prototype,"updateRequested",void 0),c([f()],K.prototype,"updating",null),c([f()],K.prototype,"view",void 0),K=c([X("esri.views.2d.LabelManager")],K);const gt="esri-zoom-box",_t={container:`${gt}__container`,overlay:`${gt}__overlay`,background:`${gt}__overlay-background`,box:`${gt}__outline`},$t={zoom:"Shift",counter:"Control"};let tt=class extends W{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[$t.zoom],e=>this._handleDrag(e,1),ee.INTERNAL),t.on("drag",[$t.zoom,$t.counter],e=>this._handleDrag(e,-1),ee.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,a){const o=this.view,n=o.toMap(ke(t+.5*i,e+.5*s));let l=Math.max(i/o.width,s/o.height);a===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:n,scale:o.scale*l},{animationMode:"always",duration:pe()})}_updateBox(t,e,i,s){const a=this._boxShape;a.setAttributeNS(null,"x",""+t),a.setAttributeNS(null,"y",""+e),a.setAttributeNS(null,"width",""+i),a.setAttributeNS(null,"height",""+s),a.setAttributeNS(null,"class",_t.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=_t.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",_t.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttributeNS(null,"class",_t.overlay),a.appendChild(i),a.appendChild(s),this._container.appendChild(a),this._backgroundShape=i,this._boxShape=s,this._overlay=a}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,a,o){const n=t+i,l=e+s;return"M 0 0 L "+a+" 0 L "+a+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+l+" L "+n+" "+l+" L "+n+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,a=t.origin.x,o=t.origin.y;let n,l,r,u;switch(i>a?(n=a,r=i-a):(n=i,r=a-i),s>o?(l=o,u=s-o):(l=s,u=o-s),t.action){case"start":this._start();break;case"update":this._update(n,l,r,u);break;case"end":this._end(n,l,r,u,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};c([f()],tt.prototype,"navigation",void 0),c([f()],tt.prototype,"view",null),tt=c([X("esri.views.2d.navigation.ZoomBox")],tt);const mi=tt;let R=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}};class Ht{constructor(e,i,s){this._initialVelocity=e,this._stopVelocity=i,this._friction=s,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const s=this.value(e);return this.value(e+i)-s}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const s=1-this.friction;return e*(s**i-1)/Math.log(s)}}class di extends Ht{constructor(e,i,s,a,o){super(e,i,s),this._sceneVelocity=a,this.direction=o}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class pi{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._time=new R(.6),this._screen=[new R(.4),new R(.4)],this._scene=[new R(.6),new R(.6),new R(.6)],this._tmpDirection=ue()}add(e,i,s){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(s)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(s)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,s=e==null||i==null?0:Math.sqrt(e*e+i*i),a=this._time.filteredDelta,o=a==null||s==null?0:s/a;return Math.abs(o)0&&ge(this._tmpDirection,this._tmpDirection,1/a);const o=this._time.filteredDelta;return new di(e,i,s,o==null?0:a/o,this._tmpDirection)}}let q=class extends W{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new pi(500,6,.92),this.momentum=null,this.tmpMomentum=ue(),this.momentumFinished=!1,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this._previousDrag=null,he(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const a=this._previousDrag;i=a?a.center.x-i:-i,s=a?s-a.center.y:s,t.viewpoint=ft(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.effectiveMomentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Fe(-e,i),a=Se(-e,i,0);this.momentumEstimator.add(s,a,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(e,i)=>{const{momentum:s,animationTime:a,tmpMomentum:o}=this,n=.001*i;if(!(this.momentumFinished=!s||s.isFinished(a))){const l=s.valueDelta(a,n);ge(o,s.direction,l),ft(e,e,o),t.constraints.constrainByGeometry(e)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};c([f()],q.prototype,"momentumFinished",void 0),c([f()],q.prototype,"viewpoint",void 0),c([f()],q.prototype,"navigation",void 0),q=c([X("esri.views.2d.navigation.actions.Pan")],q);const gi=q;let ve=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new R(.8),this.time=new R(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=L(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;e=s+a}super.add(e,i)}}class yi extends Ht{constructor(e,i,s){super(e,i,s)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const s=super.value(e),a=super.value(e+i)-s;return Math.exp(a)}}class wi extends ve{constructor(e=2.5,i=.01,s=.95,a=12){super(e,i,s,a)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,s){return new yi(e,i,s)}}let U=class extends W{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _i(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new wi,this._zoomOnly=null,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(he(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,a=e.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),l=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-o>0),this._zoomOnly===null||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):u=0,this.addToZoomEstimator(e,l),this.navigation.setViewpoint([a.x,a.y],1/r,u,[this._previousCenter.x-a.x,a.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=a}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,a=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),n=.001*i;if(this._momentumFinished=a&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,n))*this._rotationDirection*180/Math.PI:0;let r=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,n)):1;const u=nt(),m=nt();if(this._previousCenter){qt(u,this._previousCenter.x,this._previousCenter.y),He(m,t.size,t.padding),ni(u,u,m);const{constraints:_,scale:p}=t,g=p*r;r<1&&!_.canZoomInTo(g)?(r=p/_.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):r>1&&!_.canZoomOutTo(g)&&(r=p/_.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Qe(e,t.viewpoint,r,l,u,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=n})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};c([f()],U.prototype,"_momentumFinished",void 0),c([f()],U.prototype,"viewpoint",void 0),c([f()],U.prototype,"navigation",void 0),U=c([X("esri.views.2d.navigation.actions.Pinch")],U);const vi=U,It=nt(),ae=nt();let et=class extends W{constructor(t){super(t),this._previousCenter=nt(),this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),qt(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;qt(It,e.center.x,e.center.y),Ke(ae,i,s),t.viewpoint=Ot(this.viewpoint,t.state.paddedViewState.viewpoint,Je(ae,this._previousCenter,It)),oi(this._previousCenter,It)}end(){this.navigation.end()}};c([f()],et.prototype,"viewpoint",void 0),c([f()],et.prototype,"navigation",void 0),et=c([X("esri.views.2d.navigation.actions.Rotate")],et);const fi=et,O=10,re=1,Pt=new St({targetGeometry:new xt}),At=[0,0],le=250;let V=class extends W{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new gi({navigation:this}),this.rotate=new fi({navigation:this}),this.pinch=new vi({navigation:this}),this.zoomBox=new mi({view:this.view,navigation:this})}destroy(){this.pan=mt(this.pan),this.rotate=mt(this.rotate),this.pinch=mt(this.pinch),this.zoomBox=mt(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(le)}async zoom(t,e=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continuousRotateClockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,-re)})}continuousRotateCounterclockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,re)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-O,0])}continuousPanRight(){this._continuousPan([O,0])}continuousPanUp(){this._continuousPan([0,O])}continuousPanDown(){this._continuousPan([0,-O])}continuousPanVector({x:t,y:e}){this._continuousPan([t*O,e*O])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager?.animateContinuous(e,i=>{ft(i,i,t),this.view.constraints.constrainByGeometry(i)})}_startTimer(t){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const e=performance.now()-(this._lastEventTimestamp??0);ea&&!u))return ie(Pt,o,t/a,0,e,n,l),s.constrainByGeometry(Pt),i.goTo(Pt,{animate:!0,animationMode:"always",duration:pe(),pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(t,e,i,s,a){const{view:o}=this,{size:n,padding:l,constraints:r,scale:u,viewpoint:m}=o,_=u*i,p=r.canZoomInTo(_),g=r.canZoomOutTo(_);return(i<1&&!p||i>1&&!g)&&(i=1),ft(m,m,a),ie(t,m,i,s,e,n,l),r.constrainByGeometry(t)}};c([f()],V.prototype,"animationManager",void 0),c([f({type:Boolean,readOnly:!0})],V.prototype,"interacting",void 0),c([f()],V.prototype,"pan",void 0),c([f()],V.prototype,"pinch",void 0),c([f()],V.prototype,"rotate",void 0),c([f()],V.prototype,"view",void 0),c([f()],V.prototype,"zoomBox",void 0),V=c([X("esri.views.2d.navigation.MapViewNavigation")],V);const Ni=V;class fe extends Ct{}c([Mt(0,S)],fe.prototype,"position",void 0);class bi extends Ft{}class z extends ot{}c([w(j)],z.prototype,"readbackTexture",void 0),c([w(j)],z.prototype,"maskTexture",void 0),c([w(j)],z.prototype,"overlayTexture",void 0),c([w(y)],z.prototype,"background",void 0),c([w(y)],z.prototype,"drawPos",void 0),c([w(h)],z.prototype,"maskEnabled",void 0),c([w(h)],z.prototype,"overlayEnabled",void 0);class Zt extends Tt{vertex(e){const i=e.position,s=e.position.subtract(new S(.5)).multiply(this.config.drawPos.zw),a=this.config.drawPos.xy.add(s);return{glPosition:new y(a,0,1),texCoord:i}}fragment(e){let i=G(this.config.readbackTexture,xi(e.texCoord));i=i.add(new h(1).subtract(i.a)).multiply(this.config.background);const s=C(D(this.config.maskEnabled,new h(1)),G(this.config.maskTexture,e.texCoord).a,new h(1));i=i.multiply(s);const a=C(D(this.config.overlayEnabled,new h(1)),G(this.config.overlayTexture,e.texCoord),new y(0)),o=new kt;return o.glFragColor=a.add(new h(1).subtract(a.a).multiply(i)),o}}function xi(t){const e=t.multiply(new S(2)).subtract(1);return C(D(e.x,new h(0)).and(D(e.y,new h(0))),new S(.5),()=>{const i=Ae(e.y,e.x),s=Ze(Be(e),new h(Ne)),a=new S(Oe(i),qe(i));return s.multiply(a).multiply(new S(.5)).add(new h(.5))})}c([w(z)],Zt.prototype,"config",void 0),c([I(0,A(fe))],Zt.prototype,"vertex",null),c([I(0,A(bi))],Zt.prototype,"fragment",null);class be extends Ct{}c([Mt(0,S)],be.prototype,"position",void 0);class Mi extends Ft{}class xe extends ot{}c([w(Ue)],xe.prototype,"dvs",void 0);class N extends ot{}c([w(h)],N.prototype,"halfWidth",void 0),c([w(h)],N.prototype,"aaWidth",void 0),c([w(h)],N.prototype,"pxPerCell",void 0),c([w(y)],N.prototype,"minorLineColor",void 0),c([w(y)],N.prototype,"majorLineColor",void 0),c([w(Bt)],N.prototype,"majorLineInterval",void 0);class yt extends Tt{vertex(e){const i=e.position.multiply(2).subtract(1);return{gridPos:this.transform.dvs.multiply(new b(i,1)).xy,glPosition:new y(i,0,1)}}fragment(e){const i=ce(e.gridPos),s=Le(i),a=F(s.x,new h(1).subtract(s.x)),o=F(s.y,new h(1).subtract(s.y)),n=new S(a,o).multiply(this.config.pxPerCell).subtract(this.config.halfWidth),l=F(n.x,n.y),r=new h(1).subtract(ze(new h(0),this.config.aaWidth,l)),u=new Bt(Jt(i.x)),m=new Bt(Jt(i.y)),_=new h(te(u,this.config.majorLineInterval)),p=new h(te(m,this.config.majorLineInterval)),g=C(de(n.x,n.y),_,p),v=Xt(Re(P(n.x,this.config.aaWidth),P(n.y,this.config.aaWidth)),new h(.5)),T=F(_,p),at=C(v,T,g),rt=$e(this.config.majorLineColor,this.config.minorLineColor,F(at,new h(1))),Y=new kt;return Y.glFragColor=rt.multiply(r),Y}}c([w(xe)],yt.prototype,"transform",void 0),c([w(N)],yt.prototype,"config",void 0),c([I(0,A(be))],yt.prototype,"vertex",null),c([I(0,A(Mi))],yt.prototype,"fragment",null);export{Zt as E,Ni as F,Rt as T,$i as a,Ii as b,Pi as c,Zi as d,K as j,Ai as m,yt as r,dt as t}; diff --git a/custom-toc-separator/assets/GridShader-75bC4UUM-DlEO67jH.js b/custom-toc-separator/assets/GridShader-75bC4UUM-DlEO67jH.js new file mode 100644 index 00000000..cdb929da --- /dev/null +++ b/custom-toc-separator/assets/GridShader-75bC4UUM-DlEO67jH.js @@ -0,0 +1,3 @@ +import{o as $}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{v as c,hF as I,K as Wt,j as W,S as f,i as X,w as xt,I as Te,as as ke,dg as ue,aF as he,aA as mt,ae as L,ih as Fe,hZ as Se}from"./story-DT1Ep1ux.js";import{t as Mt,v as w,A as De,ax as Ct,C as ot,ay as Tt,L as y,bf as Ee,a7 as G,F as C,N as D,S as h,aa as Z,a4 as b,bg as d,ab as ce,az as Nt,aL as F,au as P,a6 as me,a5 as Qt,bh as Kt,bi as Ve,ap as Xt,aw as A,ar as S,aV as Le,aB as ze,aQ as Bt,bj as Jt,bk as te,am as de,bl as Re,ak as $e,a_ as j,b9 as kt,aW as Ie,aC as Pe,bm as Ae,aX as Ze,bn as Ne,aA as Be,a3 as Oe,a2 as qe,M as Ue,bd as Ft}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{i as Ge}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{b as je}from"./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js";import{D as We,b as Xe,g as Ye}from"./definitions-DJSdSb77-DkoRHaVx.js";import{f as St,_ as ee,d as pe,k as ft,g as He,G as Qe,$ as Ke,j as Ot,p as Je,n as ie,L as ti}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{B as ei}from"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import{L as ge,_ as ii,b as si}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{m as qt,b as ni,d as oi}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as nt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";const $i={shaders:{vertexShader:$("bitBlit/bitBlit.vert"),fragmentShader:$("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])},Ii={shaders:{vertexShader:$("stencil/stencil.vert"),fragmentShader:$("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])};class _e extends Ct{}c([Mt(0,S)],_e.prototype,"position",void 0);class ai extends Ft{}class J extends ot{}c([w(j)],J.prototype,"layerTexture",void 0),c([w(j)],J.prototype,"backbufferTexture",void 0),c([w(h)],J.prototype,"opacity",void 0),c([w(h)],J.prototype,"inFadeOpacity",void 0);class dt extends Tt{vertex(e){return{uv:e.position,glPosition:new y(Ee(e.position),0,1)}}fragment(e){const i=new kt,s=G(this.config.layerTexture,e.uv),a=G(this.config.backbufferTexture,e.uv),o=C(D(s.a,new h(0)),s.rgb,s.rgb.divide(s.a)),n=C(D(a.a,new h(0)),a.rgb,a.rgb.divide(a.a)),l=this.config.opacity.multiply(s.a),r=a.a;switch(this.blendMode){case"destination-over":i.glFragColor=new y(o.multiply(l).multiply(d(r)).add(n.multiply(r)),l.add(r).subtract(l.multiply(r)));break;case"source-in":{const u=new y(o.multiply(l).multiply(r),l.multiply(r)),m=new y(n.multiply(r),r).multiply(d(this.config.opacity)).multiply(this.config.inFadeOpacity);i.glFragColor=u.add(m)}break;case"destination-in":{const u=new y(n.multiply(r).multiply(l),r.multiply(l)),m=new y(n.multiply(r),r).multiply(new y(d(this.config.opacity).multiply(this.config.inFadeOpacity)));i.glFragColor=u.add(m)}break;case"source-out":i.glFragColor=new y(o.multiply(l).multiply(d(r)),l.multiply(d(r)));break;case"destination-out":i.glFragColor=new y(n.multiply(r).multiply(d(l)),r.multiply(d(l)));break;case"source-atop":i.glFragColor=new y(o.multiply(l).multiply(r).add(n.multiply(r.multiply(d(l)))),r);break;case"destination-atop":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r).multiply(l)),l);break;case"xor":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r.multiply(d(l)))),l.multiply(d(r)).add(r.multiply(d(l))));break;case"multiply":i.glFragColor=new y(o.multiply(l).multiply(n.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"screen":i.glFragColor=new y(o.add(n).subtract(o.multiply(n)).multiply(l.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"overlay":{const u=new b(Dt(n.r,o.r),Dt(n.g,o.g),Dt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"darken":{const u=F(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"lighter":i.glFragColor=new y(o.multiply(l).add(n.multiply(r)),l.add(r));break;case"lighten":{const u=Nt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color-dodge":{const u=Z(new b(wt(n.r,o.r),wt(n.g,o.g),wt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;case"color-burn":{const u=new b(vt(n.r,o.r),vt(n.g,o.g),vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"hard-light":{const u=new b(Et(n.r,o.r),Et(n.g,o.g),Et(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"soft-light":{const u=new b(Vt(n.r,o.r),Vt(n.g,o.g),Vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"difference":{const u=ce(n.subtract(o));i.glFragColor=x(u,o,n,l,r)}break;case"exclusion":{const u=o.add(n).subtract(new h(2).multiply(o).multiply(n));i.glFragColor=x(u,o,n,l,r)}break;case"invert":i.glFragColor=new y(new b(1).subtract(n).multiply(l).multiply(r).add(n.multiply(r).multiply(d(l))),r);break;case"vivid-light":{const u=new b(Z(Lt(n.r,o.r),new h(0),new h(1)),Z(Lt(n.g,o.g),new h(0),new h(1)),Z(Lt(n.b,o.b),new h(0),new h(1)));i.glFragColor=x(u,o,n,l,r)}break;case"hue":{const u=ne(o,n,n);i.glFragColor=x(u,o,n,l,r)}break;case"saturation":{const u=ne(n,o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color":{const u=Gt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"luminosity":{const u=Gt(n,o);i.glFragColor=x(u,o,n,l,r)}break;case"plus":i.glFragColor=Z(new y(s.r.add(n.r),s.g.add(n.g),s.b.add(n.b),l.add(r)),new y(0),new y(1));break;case"minus":i.glFragColor=new y(Z(new b(n.r.subtract(s.r),n.g.subtract(s.g),n.b.subtract(s.b)),new b(0),new b(1)),r.multiply(l));break;case"average":{const u=n.add(o).divide(2);i.glFragColor=x(u,o,n,l,r)}break;case"reflect":{const u=Z(new b(zt(n.r,o.r),zt(n.g,o.g),zt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;default:i.glFragColor=s.multiply(this.config.opacity)}return i}}function x(t,e,i,s,a){return new y(t.multiply(s).multiply(a).add(e.multiply(s).multiply(d(a))).add(i.multiply(a).multiply(d(s))),s.add(a.multiply(d(s))))}function Dt(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(d(new h(2).multiply(d(e).multiply(d(t))))).add(P(new h(.5),e).multiply(new h(2).multiply(e).multiply(t)))}function wt(t,e){return C(D(t,new h(0)),new h(0),C(D(e,new h(1)),new h(1),F(new h(1),t.divide(new h(1).subtract(e)))))}function vt(t,e){return C(D(t,new h(1)),new h(1),C(D(e,new h(0)),new h(0),d(F(new h(1),d(t).divide(e)))))}function Et(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(new h(2).multiply(e).multiply(t)).add(P(new h(.5),e).multiply(d(new h(2).multiply(d(e).multiply(d(t))))))}function Vt(t,e){return me([Qt(e,new h(.5)),()=>{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) +${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${l} ms (${r} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${r})`}for(const o of i.handles)o.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){k&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const E=1,bt=0,it=1,st=2;let ui=class{constructor(t,e,i){this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/E),a=Math.ceil(this._height/E);this._cols=s,this._rows=a,this._cells=ei.create(s*a)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{transformedX:i,transformedY:s,width:a,height:o}of t.bounds){const n=a*this._pixelRatio,l=o*this._pixelRatio,r=i*this._pixelRatio,u=s*this._pixelRatio;switch(this._collide(r,u,n,l)){case st:return st;case it:e++}}return e===t.bounds.length?it:bt}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s;if(n<0||l<0||a>this._width||o>this._height)return it;const r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);if(this.has(v))return st}return bt}_mark(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s,r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);this.set(v)}return!1}_markMetrics(t){for(const{transformedX:e,transformedY:i,width:s,height:a}of t.bounds){const o=s*this._pixelRatio,n=a*this._pixelRatio,l=e*this._pixelRatio,r=i*this._pixelRatio;this._mark(l,r,o,n)}}};const H=254,pt=255,Q=0;function B(t,e){const i=t.children.slice();i.sort((s,a)=>s.tileAge-a.tileAge),i.forEach(s=>{s.labelMetrics!=null&&s.isReady&&e(s,s.labelMetrics)})}function oe(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}class hi{run(e,i,s,a){const o=[];for(let n=e.length-1;n>=0;n--){const l=e[n];l.labelingCollisionInfos?.length&&o.push(...l.labelingCollisionInfos)}Wt("esri-2d-update-debug")&&o.length&&console.debug("CollisionEngine.run"),this._transformMetrics(o),this._runCollision(o,i,s,a);for(const n of o)n.container.requestRender()}_runCollision(e,i,s,a){const[o,n]=i.state.size,l=new ui(o,n,i.pixelRatio);for(const{container:r,deconflictionEnabled:u,visible:m}of e){const _=r.attributeView;u?m?(this._prepare(r),this._collideVisible(l,r,s,a),this._collideInvisible(l,r)):B(r,(p,g)=>{for(const v of g)_.setLabelMinZoom(v.entityTexel,pt)}):B(r,(p,g)=>{for(const v of g)oe(v,s)?(_.setLabelMinZoom(v.entityTexel,Q),m&&l.insertMetrics(v)):_.setLabelMinZoom(v.entityTexel,H)})}}_isFiltered(e,i,s){const a=i.getFilterFlags(e),o=!s.hasFilter||!!(a&We),n=s.featureEffect==null||s.featureEffect.excludedLabelsVisible||!!(a&Xe);return!(o&&n)}_prepare(e){const i=e.attributeView,s=new Set;B(e,(a,o)=>{for(const n of o){const l=n.entityTexel;if(!s.has(l)){if(s.add(l),this._isFiltered(l,i,e.layerView)){i.setLabelMinZoom(l,H);continue}i.getLabelMinZoom(l)!==Q?i.setLabelMinZoom(l,pt):i.setLabelMinZoom(l,Q)}}})}_collideVisible(e,i,s,a){const o=i.attributeView,n=new Set;B(i,(l,r)=>{for(let u=0;u{for(let l=0;l{const l=i.attributeView,r=o.transforms.labelMat2d;r[4]=Math.round(r[4]),r[5]=Math.round(r[5]);const u=s==="polyline";for(const m of n){const{entityTexel:_,anchorX:p,anchorY:g}=m;let v=m.referenceBounds?.size??0;const T=a[0];if(T!=null){const M=T(l.getVisualVariableData(_,ti.SIZE));v=isNaN(M)||M==null||M===1/0?v:M}const at=Ye+v/2,rt=m.directionX*at,Y=m.directionY*at;for(const M of m.bounds){let lt=p,ut=g;if(u){const ht=p+M.x+rt,ct=g+M.y+Y;lt=r[0]*ht+r[2]*ct+r[4],ut=r[1]*ht+r[3]*ct+r[5];const Me=lt,Ce=ut;M.transformedX=Math.floor(Me),M.transformedY=Math.floor(Ce)}else{lt=r[0]*p+r[2]*g+r[4],ut=r[1]*p+r[3]*g+r[5];const ht=lt+M.x+rt,ct=ut+M.y+Y;M.transformedX=ht,M.transformedY=ct}}}})}}const ci=32;let K=class extends W{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new hi,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return Wt("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: +-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=ci?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};c([f()],K.prototype,"updateRequested",void 0),c([f()],K.prototype,"updating",null),c([f()],K.prototype,"view",void 0),K=c([X("esri.views.2d.LabelManager")],K);const gt="esri-zoom-box",_t={container:`${gt}__container`,overlay:`${gt}__overlay`,background:`${gt}__overlay-background`,box:`${gt}__outline`},$t={zoom:"Shift",counter:"Control"};let tt=class extends W{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[$t.zoom],e=>this._handleDrag(e,1),ee.INTERNAL),t.on("drag",[$t.zoom,$t.counter],e=>this._handleDrag(e,-1),ee.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,a){const o=this.view,n=o.toMap(ke(t+.5*i,e+.5*s));let l=Math.max(i/o.width,s/o.height);a===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:n,scale:o.scale*l},{animationMode:"always",duration:pe()})}_updateBox(t,e,i,s){const a=this._boxShape;a.setAttributeNS(null,"x",""+t),a.setAttributeNS(null,"y",""+e),a.setAttributeNS(null,"width",""+i),a.setAttributeNS(null,"height",""+s),a.setAttributeNS(null,"class",_t.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=_t.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",_t.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttributeNS(null,"class",_t.overlay),a.appendChild(i),a.appendChild(s),this._container.appendChild(a),this._backgroundShape=i,this._boxShape=s,this._overlay=a}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,a,o){const n=t+i,l=e+s;return"M 0 0 L "+a+" 0 L "+a+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+l+" L "+n+" "+l+" L "+n+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,a=t.origin.x,o=t.origin.y;let n,l,r,u;switch(i>a?(n=a,r=i-a):(n=i,r=a-i),s>o?(l=o,u=s-o):(l=s,u=o-s),t.action){case"start":this._start();break;case"update":this._update(n,l,r,u);break;case"end":this._end(n,l,r,u,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};c([f()],tt.prototype,"navigation",void 0),c([f()],tt.prototype,"view",null),tt=c([X("esri.views.2d.navigation.ZoomBox")],tt);const mi=tt;let R=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}};class Ht{constructor(e,i,s){this._initialVelocity=e,this._stopVelocity=i,this._friction=s,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const s=this.value(e);return this.value(e+i)-s}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const s=1-this.friction;return e*(s**i-1)/Math.log(s)}}class di extends Ht{constructor(e,i,s,a,o){super(e,i,s),this._sceneVelocity=a,this.direction=o}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class pi{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._time=new R(.6),this._screen=[new R(.4),new R(.4)],this._scene=[new R(.6),new R(.6),new R(.6)],this._tmpDirection=ue()}add(e,i,s){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(s)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(s)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,s=e==null||i==null?0:Math.sqrt(e*e+i*i),a=this._time.filteredDelta,o=a==null||s==null?0:s/a;return Math.abs(o)0&&ge(this._tmpDirection,this._tmpDirection,1/a);const o=this._time.filteredDelta;return new di(e,i,s,o==null?0:a/o,this._tmpDirection)}}let q=class extends W{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new pi(500,6,.92),this.momentum=null,this.tmpMomentum=ue(),this.momentumFinished=!1,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this._previousDrag=null,he(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const a=this._previousDrag;i=a?a.center.x-i:-i,s=a?s-a.center.y:s,t.viewpoint=ft(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.effectiveMomentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Fe(-e,i),a=Se(-e,i,0);this.momentumEstimator.add(s,a,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(e,i)=>{const{momentum:s,animationTime:a,tmpMomentum:o}=this,n=.001*i;if(!(this.momentumFinished=!s||s.isFinished(a))){const l=s.valueDelta(a,n);ge(o,s.direction,l),ft(e,e,o),t.constraints.constrainByGeometry(e)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};c([f()],q.prototype,"momentumFinished",void 0),c([f()],q.prototype,"viewpoint",void 0),c([f()],q.prototype,"navigation",void 0),q=c([X("esri.views.2d.navigation.actions.Pan")],q);const gi=q;let ve=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new R(.8),this.time=new R(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=L(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;e=s+a}super.add(e,i)}}class yi extends Ht{constructor(e,i,s){super(e,i,s)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const s=super.value(e),a=super.value(e+i)-s;return Math.exp(a)}}class wi extends ve{constructor(e=2.5,i=.01,s=.95,a=12){super(e,i,s,a)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,s){return new yi(e,i,s)}}let U=class extends W{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _i(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new wi,this._zoomOnly=null,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(he(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,a=e.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),l=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-o>0),this._zoomOnly===null||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):u=0,this.addToZoomEstimator(e,l),this.navigation.setViewpoint([a.x,a.y],1/r,u,[this._previousCenter.x-a.x,a.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=a}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,a=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),n=.001*i;if(this._momentumFinished=a&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,n))*this._rotationDirection*180/Math.PI:0;let r=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,n)):1;const u=nt(),m=nt();if(this._previousCenter){qt(u,this._previousCenter.x,this._previousCenter.y),He(m,t.size,t.padding),ni(u,u,m);const{constraints:_,scale:p}=t,g=p*r;r<1&&!_.canZoomInTo(g)?(r=p/_.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):r>1&&!_.canZoomOutTo(g)&&(r=p/_.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Qe(e,t.viewpoint,r,l,u,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=n})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};c([f()],U.prototype,"_momentumFinished",void 0),c([f()],U.prototype,"viewpoint",void 0),c([f()],U.prototype,"navigation",void 0),U=c([X("esri.views.2d.navigation.actions.Pinch")],U);const vi=U,It=nt(),ae=nt();let et=class extends W{constructor(t){super(t),this._previousCenter=nt(),this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),qt(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;qt(It,e.center.x,e.center.y),Ke(ae,i,s),t.viewpoint=Ot(this.viewpoint,t.state.paddedViewState.viewpoint,Je(ae,this._previousCenter,It)),oi(this._previousCenter,It)}end(){this.navigation.end()}};c([f()],et.prototype,"viewpoint",void 0),c([f()],et.prototype,"navigation",void 0),et=c([X("esri.views.2d.navigation.actions.Rotate")],et);const fi=et,O=10,re=1,Pt=new St({targetGeometry:new xt}),At=[0,0],le=250;let V=class extends W{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new gi({navigation:this}),this.rotate=new fi({navigation:this}),this.pinch=new vi({navigation:this}),this.zoomBox=new mi({view:this.view,navigation:this})}destroy(){this.pan=mt(this.pan),this.rotate=mt(this.rotate),this.pinch=mt(this.pinch),this.zoomBox=mt(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(le)}async zoom(t,e=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continuousRotateClockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,-re)})}continuousRotateCounterclockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,re)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-O,0])}continuousPanRight(){this._continuousPan([O,0])}continuousPanUp(){this._continuousPan([0,O])}continuousPanDown(){this._continuousPan([0,-O])}continuousPanVector({x:t,y:e}){this._continuousPan([t*O,e*O])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager?.animateContinuous(e,i=>{ft(i,i,t),this.view.constraints.constrainByGeometry(i)})}_startTimer(t){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const e=performance.now()-(this._lastEventTimestamp??0);ea&&!u))return ie(Pt,o,t/a,0,e,n,l),s.constrainByGeometry(Pt),i.goTo(Pt,{animate:!0,animationMode:"always",duration:pe(),pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(t,e,i,s,a){const{view:o}=this,{size:n,padding:l,constraints:r,scale:u,viewpoint:m}=o,_=u*i,p=r.canZoomInTo(_),g=r.canZoomOutTo(_);return(i<1&&!p||i>1&&!g)&&(i=1),ft(m,m,a),ie(t,m,i,s,e,n,l),r.constrainByGeometry(t)}};c([f()],V.prototype,"animationManager",void 0),c([f({type:Boolean,readOnly:!0})],V.prototype,"interacting",void 0),c([f()],V.prototype,"pan",void 0),c([f()],V.prototype,"pinch",void 0),c([f()],V.prototype,"rotate",void 0),c([f()],V.prototype,"view",void 0),c([f()],V.prototype,"zoomBox",void 0),V=c([X("esri.views.2d.navigation.MapViewNavigation")],V);const Ni=V;class fe extends Ct{}c([Mt(0,S)],fe.prototype,"position",void 0);class bi extends Ft{}class z extends ot{}c([w(j)],z.prototype,"readbackTexture",void 0),c([w(j)],z.prototype,"maskTexture",void 0),c([w(j)],z.prototype,"overlayTexture",void 0),c([w(y)],z.prototype,"background",void 0),c([w(y)],z.prototype,"drawPos",void 0),c([w(h)],z.prototype,"maskEnabled",void 0),c([w(h)],z.prototype,"overlayEnabled",void 0);class Zt extends Tt{vertex(e){const i=e.position,s=e.position.subtract(new S(.5)).multiply(this.config.drawPos.zw),a=this.config.drawPos.xy.add(s);return{glPosition:new y(a,0,1),texCoord:i}}fragment(e){let i=G(this.config.readbackTexture,xi(e.texCoord));i=i.add(new h(1).subtract(i.a)).multiply(this.config.background);const s=C(D(this.config.maskEnabled,new h(1)),G(this.config.maskTexture,e.texCoord).a,new h(1));i=i.multiply(s);const a=C(D(this.config.overlayEnabled,new h(1)),G(this.config.overlayTexture,e.texCoord),new y(0)),o=new kt;return o.glFragColor=a.add(new h(1).subtract(a.a).multiply(i)),o}}function xi(t){const e=t.multiply(new S(2)).subtract(1);return C(D(e.x,new h(0)).and(D(e.y,new h(0))),new S(.5),()=>{const i=Ae(e.y,e.x),s=Ze(Be(e),new h(Ne)),a=new S(Oe(i),qe(i));return s.multiply(a).multiply(new S(.5)).add(new h(.5))})}c([w(z)],Zt.prototype,"config",void 0),c([I(0,A(fe))],Zt.prototype,"vertex",null),c([I(0,A(bi))],Zt.prototype,"fragment",null);class be extends Ct{}c([Mt(0,S)],be.prototype,"position",void 0);class Mi extends Ft{}class xe extends ot{}c([w(Ue)],xe.prototype,"dvs",void 0);class N extends ot{}c([w(h)],N.prototype,"halfWidth",void 0),c([w(h)],N.prototype,"aaWidth",void 0),c([w(h)],N.prototype,"pxPerCell",void 0),c([w(y)],N.prototype,"minorLineColor",void 0),c([w(y)],N.prototype,"majorLineColor",void 0),c([w(Bt)],N.prototype,"majorLineInterval",void 0);class yt extends Tt{vertex(e){const i=e.position.multiply(2).subtract(1);return{gridPos:this.transform.dvs.multiply(new b(i,1)).xy,glPosition:new y(i,0,1)}}fragment(e){const i=ce(e.gridPos),s=Le(i),a=F(s.x,new h(1).subtract(s.x)),o=F(s.y,new h(1).subtract(s.y)),n=new S(a,o).multiply(this.config.pxPerCell).subtract(this.config.halfWidth),l=F(n.x,n.y),r=new h(1).subtract(ze(new h(0),this.config.aaWidth,l)),u=new Bt(Jt(i.x)),m=new Bt(Jt(i.y)),_=new h(te(u,this.config.majorLineInterval)),p=new h(te(m,this.config.majorLineInterval)),g=C(de(n.x,n.y),_,p),v=Xt(Re(P(n.x,this.config.aaWidth),P(n.y,this.config.aaWidth)),new h(.5)),T=F(_,p),at=C(v,T,g),rt=$e(this.config.majorLineColor,this.config.minorLineColor,F(at,new h(1))),Y=new kt;return Y.glFragColor=rt.multiply(r),Y}}c([w(xe)],yt.prototype,"transform",void 0),c([w(N)],yt.prototype,"config",void 0),c([I(0,A(be))],yt.prototype,"vertex",null),c([I(0,A(Mi))],yt.prototype,"fragment",null);export{Zt as E,Ni as F,Rt as T,$i as a,Ii as b,Pi as c,Zi as d,K as j,Ai as m,yt as r,dt as t}; diff --git a/custom-toc-separator/assets/GroupLayer-ER-XzoYr-CcG_XUkW.js b/custom-toc-separator/assets/GroupLayer-ER-XzoYr-CcG_XUkW.js new file mode 100644 index 00000000..fe7005e7 --- /dev/null +++ b/custom-toc-separator/assets/GroupLayer-ER-XzoYr-CcG_XUkW.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-2hR_Bz29.js","./utils-BVWK2jiA-inSV67A_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./resourceUtils-BmW6QqlX-DJoDGZfh.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-DwzNb5YY.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-BTdHgocv.js";import{bp as b,ah as d,bP as v,W as c,bU as f,v as s,S as l,ac as h,a0 as _,ax as w,ai as g,av as m,i as L,a1 as I}from"./story-DT1Ep1ux.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{y as S}from"./loadAll-e978YItg-EK1YwFYX.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as P}from"./Layer-ChoECxvZ-ocw70508.js";import{u as V}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as M}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{p as C}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import R from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import{y as H}from"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=b(async(i,t,o)=>{const{save:a,saveAs:n}=await u(()=>import("./groupLayerUtils-D-25JsA_-2hR_Bz29.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(g(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},w),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===v.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(c(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!f(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([_("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([L("esri.layers.GroupLayer")],r);const ue=r;export{ue as default}; diff --git a/custom-toc-separator/assets/GroupLayer-ER-XzoYr-Dd5UcbJI.js b/custom-toc-separator/assets/GroupLayer-ER-XzoYr-Dd5UcbJI.js deleted file mode 100644 index 4c961dce..00000000 --- a/custom-toc-separator/assets/GroupLayer-ER-XzoYr-Dd5UcbJI.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-CTJK_9ZN.js","./utils-BVWK2jiA-Bnz0n_UG.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./resourceUtils-BmW6QqlX-DTC51C_z.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-LGtMSbcd.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-lj2zzr_L.js";import{bp as b,ah as d,bP as v,W as c,bU as f,v as s,S as l,ac as h,a0 as _,ax as w,ai as g,av as m,i as L,a1 as I}from"./story-OUarUCIt.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{y as S}from"./loadAll-e978YItg-cyBswBq0.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as P}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as V}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as A}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as M}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{p as C}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import R from"./PortalItem-CctGdnxF-DgukgleB.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-R4uQiiTY.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import{y as H}from"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=b(async(i,t,o)=>{const{save:a,saveAs:n}=await u(()=>import("./groupLayerUtils-D-25JsA_-CTJK_9ZN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(g(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},w),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===v.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(c(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!f(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([_("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([L("esri.layers.GroupLayer")],r);const ue=r;export{ue as default}; diff --git a/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-B3xdFhH-.js b/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-B3xdFhH-.js deleted file mode 100644 index 430be095..00000000 --- a/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-B3xdFhH-.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as s,dA as n,i as h,ag as m,ah as l,av as o,am as d}from"./story-OUarUCIt.js";import{X as V,Y as w}from"./LayerView-Bish-E63-DehQ-_Za.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.creatingLayerViews||this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const fi=p;export{fi as default}; diff --git a/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-DbF51zzA.js b/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-DbF51zzA.js new file mode 100644 index 00000000..814031fb --- /dev/null +++ b/custom-toc-separator/assets/GroupLayerView2D-BR-kLeLa-DbF51zzA.js @@ -0,0 +1 @@ +import{v as t,S as s,dA as n,i as h,ag as m,ah as l,av as o,am as d}from"./story-DT1Ep1ux.js";import{X as V,Y as w}from"./LayerView-Bish-E63-B3VRdVIM.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.creatingLayerViews||this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const fi=p;export{fi as default}; diff --git a/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js b/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js new file mode 100644 index 00000000..e9971ed8 --- /dev/null +++ b/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-Cma9Z1Pt.js @@ -0,0 +1,347 @@ +import{v as m,S as v,i as K,c$ as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,cJ as br,e6 as hs,ig as ds,hb as us,dg as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dk as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,eI as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./story-DT1Ep1ux.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{b as Cr}from"./Query-BrwMGK8U-FWeI_AU8.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import{n as Hs}from"./timeSupport-jPViR5jn-CHDjIIE2.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-SSagAgRu.js";import{o as $s}from"./pbf-D-y3_eZO-CKuZ8F1K.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-BChBDP40.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-CbK4QVOn.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-B27FdgMD.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-Cw-pFVV-.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-B4r28WKg.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-CP4TXD5k.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-Dv7NCnc6.js";import{r as Fi}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-D5uXMAZI.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-B6HwLstV.js";import{l as La}from"./floatRGBA-4pIJN00G-BOmhq_GU.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-DFXrlpsW.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import"./triangle-hqU-Tc1X-XgXaXzy3.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./main-BTdHgocv.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-CZrsQx74.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CJhaINhC.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quat-BODLR7mS-Cqne66qw.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = +255.0 / 256.0 + +255.0 / 256.0 / 256.0 + +255.0 / 256.0 / 256.0 / 256.0 + +255.0 / 256.0 / 256.0 / 256.0 / 256.0; +const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); +vec4 float2rgba(const float value) { +float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); +vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); +const float toU8AsFloat = 1.0 / 255.0; +return fixedPointU8 * toU8AsFloat; +}`),e.code.add(w`const vec4 RGBA_2_FLOAT_FACTORS = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, RGBA_2_FLOAT_FACTORS); +}`),e.code.add(w`const vec4 uninterpolatedRGBAToFloatFactors = vec4( +1.0 / 256.0, +1.0 / 256.0 / 256.0, +1.0 / 256.0 / 256.0 / 256.0, +1.0 / 256.0 / 256.0 / 256.0 / 256.0 +); +float uninterpolatedRGBAToFloat(vec4 rgba) { +return (dot(round(rgba * 255.0), uninterpolatedRGBAToFloatFactors) - 0.5) * 2.0; +}`)}let ka=class extends wn{constructor(e,t){super(e,"vec4",$a.Draw,(r,i,s)=>r.setUniform4fv(e,t(i,s)))}},fe=class extends ye{constructor(e){super(e),this._removing=0,this._tiles=new Vs}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles,s=[];for(const n of r){const a=i.get(n);a!=null&&(a.abort(),i.delete(n),s.push({tileId:n}))}for(const n of t)i.has(n.id)||i.set(n.id,os(a=>this._addTile(n,a)));await this._removeTiles(s)}async _addTile(e,t){const r=await this.addTile(e,t);return ve(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};m([v()],fe.prototype,"updating",null),m([v({constructOnly:!0})],fe.prototype,"addTile",void 0),m([v({constructOnly:!0})],fe.prototype,"removeTiles",void 0),m([v()],fe.prototype,"_removing",void 0),fe=m([K("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],fe);let Zt=class{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new Wa(this._index,this._view,e)}},Wa=class extends Zt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return Hs(new kt,this._geometryOverride,e.hasZ,e.hasM)}},Ya=class{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new ar,this.featureAdapter=Kt.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(r!=null){t.delete(e);for(const i of r.pages)this._removePage(i)}}_addPage(e){const{featureCount:t}=e;if(t===0)return;const r=new js(9,s=>e.getBounds(s)),i=new Array;for(let s=0;se(new Zt(i,t)))}forEachInBounds(e,t){ze.minX=e[0],ze.minY=e[1],ze.maxX=e[2],ze.maxY=e[3];for(const[r,i]of this._pageBounds)i.search(ze,s=>t(new Zt(s,r)))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const n of this._pageBounds.values()){const{minX:a,minY:o,maxX:l,maxY:c}=n.toJSON();t=Math.min(t,a),r=Math.min(r,o),i=Math.min(i,l),s=Math.min(s,c)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}},Kt=class{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}};Kt.shared=new Kt;const ze=new Ti;let Qa=class{constructor(e,t){this.descriptor=e,this.pages=t}},Ja=class{constructor(e){const t=new $s(new Uint8Array(e),new DataView(e));this._reader=t,this._index=Xa(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(s==null)return;const n=i[e*r.fields.length+s],a=this._reader;return a.move(n),St(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return typeof r=="string"?new Date(r).getTime():typeof r=="number"||r==null?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const a of t.fields){const o=r[i+a.index];s.move(o),n[a.name]=St(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:a,translate:o}=s;i.move(n[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=A();return this.getCoordinates(e,t),new kt([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,we);const[i,s,n]=we,a=[i,s];return t&&(a[3]=n),r&&(a[t?4:3]=0),new kt([],a)}getBounds(e){this.getCoordinates(e,we);const[t,r]=we,i=new Ti;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,we);const[t,r,i]=we;return Ss(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:a,fieldsIndex:o}=i,l=o.get(n).index,c=o.fields.length;for(let d=0;dt?.release()):e?.release()}let fr=class{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach((e,t)=>{e!=null&&this._repository.release(this._material,t)})}load(e,t,r){if(!this._material.produces.get(t)?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const i=this._map.get(r);if(i!=null){if(i.ensureResources(e)===Jn.LOADED)return i;this._repository.requestRender()}return null}},Bi=class extends bn{constructor(e=A()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}};var kr,pe;(function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"})(kr||(kr={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(pe||(pe={}));let pr=class{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}};function Wr(e){const t=new Map;e.forAll(i=>t.set(i.from,i));let r=!0;for(;r;){r=!1;for(let i=0;ie||new pr,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=et(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=et(),this.drawCommandsShadowHighlightRest=et()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup(t=>this.highlightGroups.add(t)),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const i=this.drawCommandsDefault.pushNew(),s=this.holes.front();return this.vao!=null&&this.holes.length===1&&s.to===Math.floor(this.vao.byteSize/e)?(i.first=0,void(i.count=s.from)):(i.first=1/0,i.count=0,this._instances.forEach(n=>{i.first=Math.min(i.first,n.from),i.count=Math.max(i.count,n.to)}),void(i.count-=i.first))}const t=Array.from(this._instances.values()).sort((i,s)=>i.from===s.from?i.to-s.to:i.from-s.from),{drawCommandsHighlights:r}=this;for(const i of t)i.isVisible&&(Ot(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i),i.hasHighlights?i.foreachHighlightGroup(s=>{let n=r.get(s);n||(n=et(),r.set(s,n)),Ot(n,i)}):Ot(this.drawCommandsShadowHighlightRest,i))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function co(e){return e.vao!=null}function et(){return new nr({allocator:e=>e||new oo,deallocator:e=>e})}function Ot(e,t){const r=e.back();if(r==null){const i=e.pushNew();return i.first=t.from,void(i.count=t.numElements)}if(ho(r,t)){const i=t.from-r.first+t.numElements;r.count=i}else{const i=e.pushNew();i.first=t.from,i.count=t.numElements}}function ho(e,t){return e.first+e.count>=t.from}let uo=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(t=>t.instances.has(e))}},Rt=class extends zi{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new Bi,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=cs(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach((e,t)=>{this._produces.set(t,r=>!(this._dataByOrigin.size===0||!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasAnyHighlight))&&e(r))})}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.vao.usedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(r=>r.instances.forEach(({geometry:i})=>e(i))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(t==null)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const s=i.renderGeometry,n=this._dataByOrigin.get(s.localOrigin.id),a=n?.findBuffer(s.id);if(a==null)return;const o=a.instances.get(s.id);if(i.updateType&(pe.GEOMETRY|pe.TRANSFORMATION)){const l=it(t.elementCount(o.geometry.geometry.attributes)*r),c=t.vertexBufferLayout.createView(l.buffer);this._writeGeometry(s,c,0),a.vao.vertexBuffers.get("geometry").setSubData(l,o.from*r,0,o.numElements*r)}i.updateType&(pe.HIGHLIGHT|pe.OCCLUDEE|pe.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new Xn;for(const i of e){const s=i.localOrigin;if(s==null)continue;let n=r.get(s.id,null);n==null&&(n=new Qr(s.vec3),r.set(s.id,null,n)),n.changes.push(i)}for(const i of t){const s=i.localOrigin;if(s==null)continue;const n=this._dataByOrigin.get(s.id),a=n?.findBuffer(i.id);if(a==null)continue;let o=r.get(s.id,a);o==null&&(o=new Qr(s.vec3),r.set(s.id,a,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,t){if(this._bufferWriter==null||this._vaoCache==null)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach((a,o)=>{const l=a.get(null),c=l?.changes??[];n.delete(o,null);let d=i.get(o);if(a.forEach((h,u)=>{if(n.delete(o,u),u==null)return void N(!1,"No VAO for removed geometries");if(u.instances.size===h.changes.length)return this._vaoCache.deleteVao(u.vao),br(d.buffers,u),void(d.buffers.length===0&&c.length===0&&i.delete(o));const f=u.numElements,_=u.vao.byteSize/4,g=c.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),C=h.changes.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),I=Math.min((f+g-C)*s,rt),x=I>_;I>vt&&I<_/2?(h.changes.forEach(({id:O})=>u.deleteInstance(O)),u.instances.forEach(({geometry:O})=>c.push(O)),this._vaoCache.deleteVao(u.vao),br(d.buffers,u)):x?this._applyAndRebuild(u,c,h):this._applyRemoves(u,h)}),c.length>0)for(d==null&&(d=new uo(l.origin),i.set(o,d)),d.buffers.forEach(h=>this._applyAdds(h,c));c.length>0;)d.buffers.push(this._applyAndRebuild(new lo,c,null))})}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(t=>{t.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),t.hasHighlights&&hs(this._highlightGroups,t.highlightGroups),this._hasOccludees=this._hasOccludees||t.hasOccludees})})}_applyAndRebuild(e,t,r){if(r)for(const f of r.changes)e.deleteInstance(f.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,a=Math.floor(rt/n);let o=e.numElements;for(;t.length>0;){const f=t.pop(),_=i.elementCount(f.geometry.attributes);if(o+_>a&&o>0){t.push(f);break}o+=_;const g=new Yr(f,0,0);N(e.instances.get(f.id)==null),e.addInstance(f.id,g)}const l=o*n,c=it(l),d=i.vertexBufferLayout.createView(c.buffer);let h=0;e.resetInstanceSummary(),e.instances.forEach((f,_)=>{this._writeGeometry(f.geometry,d,h);const g=h;h+=i.elementCount(f.geometry.geometry.attributes),e.updateInstance(_,g,h),e.updateDrawState(f)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(er(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,h*n),e.holes.clear();const u=e.holes.pushNew();return u.from=h,u.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(t.changes.length===0||this._bufferWriter==null)return;for(const a of t.changes){const o=a.id,l=e.instances.get(o);if(!l)continue;e.deleteInstance(o);const c=ee.back();if(c){if(c.to===l.from){c.to=l.to;continue}if(c.from===l.to){c.from=l.from;continue}}const d=ee.pushNew();d.from=l.from,d.to=l.to}Wr(ee);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=ee.reduce((a,o)=>Math.max(a,o.numElements),0)*r,s=it(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");ee.forAll(a=>n.setSubData(s,a.from*r,0,a.numElements*r)),e.holes.pushArray(ee.data,ee.length),ee.forAll((a,o)=>ee.data[o]=null),ee.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(t.length===0||this._bufferWriter==null)return;if(!co(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce((C,I)=>C+r.elementCount(I.geometry.attributes),0),a=Math.min((s+n)*i,rt),o=4*a;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,t,null);Wr(e.holes);const l=new Array;for(const C of t){const I=r.elementCount(C.geometry.attributes),x=fo(e.holes,I);l.push(x)}const c=e.vao.vertexBuffers.get("geometry");let d=0,h=0,u=0;const f=it(a),_=r.vertexBufferLayout.createView(f.buffer);t.forEach((C,I)=>{const x=l[I];if(x==null)return;if(u!==x){const y=u-h;y>0&&c.setSubData(f,h*i,0,y*i),h=x,d=0}const O=r.elementCount(C.geometry.attributes);this._writeGeometry(C,_,d),d+=O,u=x+O;const M=new Yr(C,x,x+O);N(e.instances.get(C.id)==null),e.addInstance(C.id,M),e.drawCommandsDirty=!0});const g=u-h;g>0&&c.setSubData(f,h*i,0,g*i),ds(t,(C,I)=>l[I]==null)}_writeGeometry(e,t,r){this._bufferWriter!=null&&(ce(be,e.transformation),be[12]-=e.localOrigin.vec3[0],be[13]-=e.localOrigin.vec3[1],be[14]-=e.localOrigin.vec3[2],Pe(tt,be),cr(tt,tt),this._bufferWriter.write(be,tt,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e;if(!this.material.produces.get(r.slot)?.(t))return null;const{highlightGroupName:i,slot:s}=r,n=t===E.ShadowHighlight,a=t===E.Highlight,o=a||n,l=h=>o&&(this._highlightGroups.size===0||a&&!!i&&!h.has(i));if(l(this._highlightGroups))return null;const c=t===E.ShadowExcludeHighlight,d=!(o||c);for(const{buffers:h}of this._dataByOrigin.values())for(const u of h){if(l(u.highlightGroups))continue;const f=n?u.drawCommandsHighlights.size>0:o?i?u.drawCommandsHighlights.get(i):u.drawCommandsHighlights.size>0:((c&&u.needsMultipleCommands()?u.drawCommandsShadowHighlightRest:u.drawCommandsDefault)||null)?.length??!1,_=d&&u.drawCommandsOccludees||null;if(f||_?.length){const g=this._glMaterials.load(e.rctx,s,t),C=g?.beginSlot(r);if(C)return C}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlightGroupName:n}=i,a=r===E.Highlight;if(a&&!n)return;const o=r===E.ShadowHighlight,l=a||o,c=r===E.ShadowExcludeHighlight,d=!(l||c),h=s===W.OCCLUDER_MATERIAL||s===W.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:u}=e;u.runAppleAmdDriverHelper();const f=u.bindTechnique(t,i,this.material.parameters);for(const _ of this._dataByOrigin.values())for(const g of _.buffers){if(a&&(!g.hasHighlights||!g.drawCommandsHighlights.has(n))||o&&!g.hasHighlights)continue;const C=()=>{const y=[];for(const P of g.drawCommandsHighlights.values())y.push(P);return y},I=l&&!o?g.drawCommandsHighlights.get(n)??null:null,x=o?C():l?I?[I]:Xr:(c&&g.needsMultipleCommands()?[g.drawCommandsShadowHighlightRest]:[g.drawCommandsDefault])||Xr,O=x.some(y=>y.length>0),M=d&&g.drawCommandsOccludees||null;if(O||M?.length){if(this._drawParameters.origin=_.origin,f.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(g.vao),u.bindVAO(g.vao),O)for(const y of x)u.setPipelineState(t.getPipeline(!1,h)),y.forAll(P=>u.drawArrays(t.primitiveType,P.first,P.count));M?.length&&(u.setPipelineState(t.getPipeline(!0,h)),M.forAll(y=>u.drawArrays(t.primitiveType,y.first,y.count)))}}}get test(){}};m([v({constructOnly:!0})],Rt.prototype,"material",void 0),Rt=m([K("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Rt);let Qr=class{constructor(e){this.origin=e,this.changes=new Array}};function fo(e,t){const r=e.find(s=>s.numElements>=t);if(r==null)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const be=L(),tt=L(),ee=new nr({allocator:e=>e||new pr,deallocator:null}),vt=65536,At=4*vt,Jr=1024,Gi=16777216,rt=Gi/4;let Et=new Float32Array(vt);function it(e){return Et.length{this._produces.set(t,r=>!!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasHighlights)&&e(r))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e;return!t.produces.get(i.slot)?.(r)||(r===E.Highlight||r===E.ShadowHighlight)&&!this._hasHighlights?null:this._glMaterials.load(e.rctx,i.slot,r)?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(r.size===0)return;const{bind:i}=e,s=i.slot===W.OCCLUDER_MATERIAL||i.slot===W.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const a=t.program;for(const[o,l]of r)this._drawParameters.origin=l.localOrigin,a.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(l.vao),n.bindVAO(l.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,l.numElements)}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}addRenderGeometry(e,t,r){this.removeRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride,s=this._vaoCache.newVao(er(t.data.byteLength));s.vertexBuffers.get("geometry").setSubData(new Uint8Array(t.data),0,0,t.elementCount*i);const n={localOrigin:r,vao:s,numElements:t.elementCount};return this._renderGeometries.set(e,n),n}removeRenderGeometry(e){const t=this._renderGeometries.get(e);t!=null&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};m([v({constructOnly:!0})],dt.prototype,"material",void 0),dt=m([K("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],dt);function po(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}function mo(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}function go(e,t,r){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}function _o(e,t,r){return 2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}var Zr,S;(function(e){e[e.Default=0]="Default",e[e.Screenshot=1]="Screenshot",e[e.ObjectAndLayerID=2]="ObjectAndLayerID"})(Zr||(Zr={})),function(e){e[e.TOP=0]="TOP",e[e.RIGHT=1]="RIGHT",e[e.BOTTOM=2]="BOTTOM",e[e.LEFT=3]="LEFT"}(S||(S={}));var tr;let b=tr=class extends ye{constructor(e){super(e),this._ray=Di(),this._viewport=ae(0,0,1,1),this._padding=ae(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=X(1,1e3),this._viewDirty=!0,this._viewMatrix=L(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=L(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=L(),this._frustumDirty=!0,this._frustum=la(),this._fullViewport=le(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=A(),this._up=A(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return Y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){ce(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),ie(A(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),ie(A(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),ie(A(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const e=Fr(le(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&Lr(e,t)?t:e}get screenPadding(){if(this.pixelRatio===1)return this._padding;const e=Fr(le(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&Lr(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[S.LEFT],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[S.BOTTOM],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[S.RIGHT]+this._padding[S.LEFT]}set fullWidth(e){this.width=e-(this._padding[S.RIGHT]+this._padding[S.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[S.TOP]+this._padding[S.BOTTOM]}set fullHeight(e){this.height=e-(this._padding[S.TOP]+this._padding[S.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[S.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[S.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){Tt(this._padding,e)||(this._viewport[0]+=e[S.LEFT]-this._padding[S.LEFT],this._viewport[1]+=e[S.BOTTOM]-this._padding[S.BOTTOM],this._viewport[2]-=e[S.RIGHT]+e[S.LEFT]-(this._padding[S.RIGHT]+this._padding[S.LEFT]),this._viewport[3]-=e[S.TOP]+e[S.BOTTOM]-(this._padding[S.TOP]+this._padding[S.BOTTOM]),Ke(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(Jt(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return Pe(L(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||L()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return go(this._fov,this.width,this.height)}set fovX(e){this._fov=po(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return _o(this._fov,this.width,this.height)}set fovY(e){this._fov=mo(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return Mi(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(Pe(this._viewInverseTransposeMatrix,this.viewMatrix),cr(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const t=2*e-1;return 2*this.near*this.far/(this.far+this.near-t*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,s=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,o=a+n,l=-r/2+this.row*s,c=l+s,d=Zn(L(),a*(1+2*this._padding[S.LEFT]/e),o*(1+2*this._padding[S.RIGHT]/e),l*(1+2*this._padding[S.BOTTOM]/t),c*(1+2*this._padding[S.TOP]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&Kn(h,d)?h:d}copyFrom(e){j(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,Ke(this._viewport,e.viewport),this.notifyChange("_viewport"),Ke(this._padding,e.padding),this.notifyChange("_padding"),Si(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||(ce(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||(ca(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(ce(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),Ke(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return new tr().copyFrom(this)}equals(e){return Ze(this.eye,e.eye)&&Ze(this.center,e.center)&&Ze(this.up,e.up)&&Tt(this._viewport,e.viewport)&&Tt(this._padding,e.padding)&&en(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||Nr(e.screenPadding,this.screenPadding)>=t||Nr(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;Dr(B,e.eye,e.center),Dr(Mt,this.eye,this.center);const r=qe(B,Mt),i=Pr(B),s=Pr(Mt),n=5e-4;return r*r>=(1-1e-10)*i*s&&na(e.eye,this.eye)2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Dt),t)}unprojectFromRenderScreen(e,t){if(Jt(st,this.projectionMatrix,this.viewMatrix),!Pe(st,st))return null;const r=this.fullViewport;return T[0]=2*(e[0]-r[0])/r[2]-1,T[1]=2*(e[1]-r[1])/r[3]-1,T[2]=2*e[2]-1,T[3]=1,He(T,T,st),T[3]===0?null:(t[0]=T[0]/T[3],t[1]=T[1]/T[3],t[2]=T[2]/T[3],t)}constrainWindowSize(e,t,r,i){const s=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(s-r/2,0),o=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(s-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-s-r/2,0),h=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(o),Math.round(d),Math.round(h)]}computeUp(e){e===ne.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){Y(B,this.center,this.eye);const e=me(this.center);e<1?(ie(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(qe(B,this.center))>.9999*me(B)*e||($e(this._up,B,this.center),$e(this._up,this._up,B),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){aa(B,this.eye,this.center),Math.abs(B[2])<=.9999&&(Z(B,B,B[2]),ie(this._up,-B[0],-B[1],1-B[2]),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){typeof e[0]=="number"&&isFinite(e[0])&&typeof e[1]=="number"&&isFinite(e[1])&&typeof e[2]=="number"&&isFinite(e[2])?Ze(e,t)||(j(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):ps.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(ha(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(ea(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};m([v()],b.prototype,"_viewport",void 0),m([v()],b.prototype,"_padding",void 0),m([v()],b.prototype,"_fov",void 0),m([v()],b.prototype,"_nearFar",void 0),m([v()],b.prototype,"_viewDirty",void 0),m([v()],b.prototype,"_viewMatrix",void 0),m([v()],b.prototype,"_pixelRatio",void 0),m([v()],b.prototype,"pixelRatio",null),m([v()],b.prototype,"row",void 0),m([v()],b.prototype,"column",void 0),m([v()],b.prototype,"_rows",void 0),m([v()],b.prototype,"rows",null),m([v()],b.prototype,"_columns",void 0),m([v()],b.prototype,"columns",null),m([v()],b.prototype,"eye",null),m([v()],b.prototype,"center",null),m([v()],b.prototype,"_center",void 0),m([v()],b.prototype,"up",null),m([v()],b.prototype,"_up",void 0),m([v()],b.prototype,"viewMatrix",null),m([v({readOnly:!0})],b.prototype,"viewForward",null),m([v({readOnly:!0})],b.prototype,"viewUp",null),m([v({readOnly:!0})],b.prototype,"viewRight",null),m([v({readOnly:!0})],b.prototype,"nearFar",null),m([v()],b.prototype,"near",null),m([v()],b.prototype,"far",null),m([v()],b.prototype,"viewport",null),m([v({readOnly:!0})],b.prototype,"screenViewport",null),m([v({readOnly:!0})],b.prototype,"screenPadding",null),m([v()],b.prototype,"x",null),m([v()],b.prototype,"y",null),m([v()],b.prototype,"width",null),m([v()],b.prototype,"height",null),m([v()],b.prototype,"fullWidth",null),m([v()],b.prototype,"fullHeight",null),m([v({readOnly:!0})],b.prototype,"_aspect",null),m([v()],b.prototype,"padding",null),m([v({readOnly:!0})],b.prototype,"projectionMatrix",null),m([v({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null),m([v()],b.prototype,"fov",null),m([v()],b.prototype,"fovX",null),m([v()],b.prototype,"fovY",null),m([v()],b.prototype,"viewInverseTransposeMatrix",null),m([v({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null),m([v()],b.prototype,"relativeElevation",void 0),b=tr=m([K("esri.views.3d.webgl.RenderCamera")],b);const vo=b,T=le(),st=L(),B=A(),Mt=A(),Dt=ms();let yo=class{constructor(e,t,r){this._elementSize=t,this._buffer=Fi.createVertex(e,Li.STATIC_DRAW),this.resize(r)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+this._buffer.usedMemory}copyRange(e,t,r,i=0){const s=new Uint8Array(this.array,e*this.elementSize,(t-e)*this.elementSize);new Uint8Array(r.array,i*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,t){const r=e*this._elementSize,i=t*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),r,r,i)}resize(e){const t=e*this._elementSize,r=new ArrayBuffer(t);this._array&&(e>=this._capacity?new Uint8Array(r).set(new Uint8Array(this._array)):new Uint8Array(r).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=r,this._buffer.setSize(t),this._capacity=e}},wo=class{constructor(e){this.modelOriginHi=e.getField(p.INSTANCEMODELORIGINHI,jr),this.modelOriginLo=e.getField(p.INSTANCEMODELORIGINLO,jr),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.featureAttribute=e.getField(p.INSTANCEFEATUREATTRIBUTE,Pi),this.color=e.getField(p.INSTANCECOLOR,ke),this.objectAndLayerIdColor=e.getField(p.INSTANCEOBJECTANDLAYERIDCOLOR,ke)}},bo=class{constructor(e,t){this._rctx=e,this._instanceBufferLayout=t,this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,t=this._tailIndex;return e>=t?e-t:e+this._capacity-t}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){N(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){N(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(yt,Math.floor(this._capacity*wi));this._resize(e)}_shrink(){const e=Math.max(yt,Math.floor(this._capacity*Rs));this._resize(e)}_resize(e){if(N(this._updating,"not updating"),e===this._capacity)return;const t=new yo(this._rctx,this._instanceBufferLayout.stride,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const r=this.size,i=this._compactInstances(t);N(i===r,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=i,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=t,this._view=new wo(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const t=this._headIndex,r=this._tailIndex;return rt?(this._buffer.copyRange(r,this._capacity,e),t>0&&this._buffer.copyRange(0,t,e,this._capacity-r),t+(this._capacity-r)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,t){et&&(t>0&&this._buffer.transferRange(0,t),this._buffer.transferRange(e,this._capacity))}};const yt=64;var R;function xo(e){let t=hr().mat4f64(p.LOCALTRANSFORM).mat4f64(p.GLOBALTRANSFORM).vec4f64(p.BOUNDINGSPHERE).vec3f64(p.MODELORIGIN).mat3f(p.INSTANCEMODEL).mat3f(p.INSTANCEMODELNORMAL).vec2f(p.MODELSCALEFACTORS);return e.includes(p.FEATUREATTRIBUTE)&&(t=t.vec4f(p.FEATUREATTRIBUTE)),e.includes(p.COLOR)&&(t=t.vec4u8(p.COLOR)),e.includes(p.OBJECTANDLAYERIDCOLOR)&&(t=t.vec4u8(p.OBJECTANDLAYERIDCOLOR)),t=t.u8(p.STATE).u8(p.LODLEVEL),t}(function(e){e[e.ALLOCATED=1]="ALLOCATED",e[e.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",e[e.VISIBLE=4]="VISIBLE",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",e[e.REMOVE=32]="REMOVE",e[e.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",e[e.ACTIVE=18]="ACTIVE"})(R||(R={}));let Kr=class{constructor(e){this.localTransform=e.getField(p.LOCALTRANSFORM,Gr),this.globalTransform=e.getField(p.GLOBALTRANSFORM,Gr),this.modelOrigin=e.getField(p.MODELORIGIN,Ia),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.modelScaleFactors=e.getField(p.MODELSCALEFACTORS,Ca),this.boundingSphere=e.getField(p.BOUNDINGSPHERE,Ta),this.featureAttribute=e.getField(p.FEATUREATTRIBUTE,Pi),this.color=e.getField(p.COLOR,ke),this.objectAndLayerIdColor=e.getField(p.OBJECTANDLAYERIDCOLOR,ke),this.state=e.getField(p.STATE,Vr),this.lodLevel=e.getField(p.LODLEVEL,Vr)}},Ee=class extends ye{constructor(e,t){super(e),this.events=new ar,this._capacity=0,this._size=0,this._next=0,this._highlightGroupMap=new Map,this._highlightGroupMapPrev=new Map,this._layout=xo(t),this._capacity=yt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Kr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,R.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;N(e>=0&&e=0&&eda(this._instanceData.view.boundingSphere.getVec(r,this._tmpSphere)),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=t,this._tmpSphere=ua(),this._tmpMat4=L()}addInstance(e){const t=this._instanceData.view.boundingSphere,r=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);_e(fa(this._tmpSphere),this._boundingSphere.center,r),this._tmpSphere[3]=this._boundingSphere.radius*va(r),t.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},To=class{constructor(e,t){this._worldSpaceRadius=e,this._minScreenSpaceRadii=t}selectLevel(e,t,r){const i=r.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*t/i;let n=0;for(let a=1;a=this._minScreenSpaceRadii[a]&&(n=a);return n}},So=class{constructor(e){this.layerUid=e}},Oo=class extends So{constructor(e,t){super(e),this.graphicUid=t}};function Ro(e){return e?.dist!=null}let Ao=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(Z(nt,this.ray.direction,this.dist),me(nt)):null}getIntersectionPoint(e){return!!Ro(this)&&(Z(nt,this.ray.direction,this.dist),ht(e,this.ray.origin,nt),!0)}getTransformedNormal(e){return j(Be,this.normal),Be[3]=0,He(Be,Be,this.transformation),j(e,Be),he(e,e)}constructor(e){this.intersector=Fe.OBJECT,this.normal=A(),this.transformation=L(),this._ray=Di(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=Fe.OBJECT,zr(e,this._ray)}set(e,t,r,i,s,n,a){this.intersector=e,this.dist=r,j(this.normal,i??Bs),ce(this.transformation,s??sa),this.target=t,this.drapedLayerOrder=n,this.drapedLayerGraphicOrder=a}copy(e){zr(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,j(this.normal,e.normal),ce(this.transformation,e.transformation)}};function Eo(e){return new Ao(e)}const nt=A(),Be=le();let Mo=class extends Aa{},Do=class extends Oo{constructor(e,t,r,i,s,n){super(e,t),this.layerUid=e,this.graphicUid=t,this.geometryId=r,this.triangleNr=i,this.baseBoundingSphere=s,this.numLodLevels=n}};function Po(e,t,r,i=null){const s=e.createBufferWriter(),n=s.vertexBufferLayout,a=s.elementCount(t),o=n.createBuffer(a);return s.write(null,null,t,i,o,0),{material:e,vertexBufferLayout:n,buffer:o.buffer,elementCount:a,boundingInfo:r}}let Fo=class{constructor(e,t){const r=e.renderContext.rctx,i=t.geometry;let s=null;s=i instanceof pt?Po(i.material,i.attributes,i.boundingInfo):i;const n=s.material;this._materials=e.materials,n.setParameters({instancedDoublePrecision:!0}),this.geometry=i,this.material=n,this.glMaterials=new fr(n,this._materials),this.vertexBufferLayout=s.vertexBufferLayout,this.vbo=Fi.createVertex(r,Li.STATIC_DRAW,s.buffer),this.vao=new Mo(r,Qt,new Map([["geometry",xt(s.vertexBufferLayout)]]),new Map([["geometry",this.vbo]])),this.vertexCount=s.elementCount}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,t,r,i,s,n,a,o){if(!(this.geometry instanceof pt))return;const l=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,r,i,(c,d,h,u,f)=>{if(c>=0){if(t!=null&&!t(e.rayBegin,e.rayEnd,c))return;const _=new Do(n.layerUid,n.graphicUid(s),l,h,a,o);if((e.results.min.drapedLayerOrder==null||f>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||c=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||c>e.results.max.dist)&&e.results.max.set(Fe.LOD,_,c,d,e.transform.transform,f),e.options.store===Br.ALL){const g=Eo(e.results.min.ray);g.set(Fe.LOD,_,c,d,e.transform.transform,f),e.results.all.push(g)}}})}},Lo=class Vi{static async create(t,r,i){const s=await Promise.allSettled(r.components.map(a=>t.controller.schedule(()=>new Fo(t,a),i))),n=s.map(a=>a.status==="fulfilled"?a.value:null).filter(bi);if(xi(i)||n.length!==s.length){n.forEach(a=>a.destroy()),ve(i);for(const a of s)if(a.status==="rejected")throw a.reason}return new Vi(r.minScreenSpaceRadius,n)}constructor(t,r){this.minScreenSpaceRadius=t,this.components=r}destroy(){this.components.forEach(t=>t.destroy())}intersect(t,r,i,s,n,a,o){this.components.forEach(l=>l.intersect(t,r,i,s,n,a,this.boundingSphere,o))}get boundingBox(){if(this._boundingBox==null){const t=As();this.components.forEach(r=>{r.boundingInfo!=null&&(xr(t,r.boundingInfo.bbMin),xr(t,r.boundingInfo.bbMax))}),this._boundingBox=t}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const t=this.boundingBox,r=A();Es(t,r),this._boundingSphere={center:r,radius:.5*Ms(t)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((t,r)=>t+r.triangleCount,0)}};function No(e,t,r,i,s){at[0]=e.get(t,0),at[1]=e.get(t,1),at[2]=e.get(t,2),Ea(at,ue,3),r.set(s,0,ue[0]),i.set(s,0,ue[1]),r.set(s,1,ue[2]),i.set(s,1,ue[3]),r.set(s,2,ue[4]),i.set(s,2,ue[5])}const at=A(),ue=new Float32Array(6),zo=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(i=>i.minScreenSpaceRadius);return new To(t,r)};let Q=class extends no{constructor(e,t){super(e),this.type=Fe.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new vo,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[W.OPAQUE_MATERIAL,r=>this._produces(r)],[W.TRANSPARENT_MATERIAL,r=>!!this._hasTransparentLevels()&&this._produces(r)]]),this._instanceData=new Ee({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(Ma.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=Go(this.optionalFields),this._glInstanceBufferLayout=xt(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)e.push(t[1]);return e}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get hasEmissions(){return this.baseMaterial.hasEmissions}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((r,i)=>r+i.usedMemory,e),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((r,i)=>{const s=this._allRenderInstanceData[0][i].size+this._allRenderInstanceData[1][i].size,n=r.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((r,i)=>r+i.renderedInstances,0),renderedTriangles:t.reduce((r,i)=>r+i.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(r=>{e.push(new bo(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,t){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(s=>Lo.create(e,s,t))),i=r.map(s=>s.status==="fulfilled"?s.value:null).filter(bi);if(xi(t)||i.length!==r.length){i.forEach(s=>s.destroy()),ve(t);for(const s of r)if(s.status==="rejected")throw s.reason}this._levels=i,this._levelSelector=zo(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(t=>t.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(t=>t.material.produces.get(W.TRANSPARENT_MATERIAL)?.(E.Color)))}hasHighlights(){return gs(this._highlightRenderInstanceDataMap,e=>e.some(t=>t.size>0))}_produces(e){return e!==E.Highlight&&e!==E.ShadowHighlight||this.hasHighlights()}prepareRender(e){if(!Wt.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(Da),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,i=this.levels;return t.forEach(s=>i.forEach(({components:n},a)=>n.forEach(o=>r.push(this._beginComponent(e,s[a],o))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||t==null)return;let i=0;e.rctx.bindVAO();const s=this.levels;r.forEach(n=>s.forEach(({components:a},o)=>a.forEach(l=>this._renderComponent(e,t[i++],n[o],l,o))))}_getInstanceDatas(e){const{output:t,bind:r}=e,i=t===E.Highlight,s=!i&&t!==E.ShadowHighlight,n=t!==E.ShadowExcludeHighlight;if(s)return n?this._allRenderInstanceData:[this._defaultRenderInstanceData];if(n){if(i){const{highlightGroupName:o}=r;if(!o)return null;const l=this._highlightRenderInstanceDataMap.get(o);return l?[l]:null}const a=[];for(const o of this._highlightRenderInstanceDataMap)a.push(o[1]);return a}return null}intersect(e,t,r,i){if(!this.baseMaterial.visible||this._octree==null)return;const s=A();Y(s,i,r);const n=a=>{this._instanceData.getCombinedModelTransform(a,ii),e.transform.set(ii),_e(si,r,e.transform.inverse),_e(ni,i,e.transform.inverse);const o=this._instanceData.getState(a),l=this._instanceData.getLodLevel(a),c=this._levels.length;N(!!(o&R.ACTIVE),"invalid instance state"),N(l>=0&&le.forEach(t=>t.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:i}=this;this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.beginUpdate()));const s=this._instanceData,n=s.view;let a=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let d=0;d{const g=this._highlightRenderInstanceDataMap.get(_);if(!g)throw new Ut("Internal error in lodRenderer");g[f].freeTail()}),h&R.REMOVE)s.freeInstance(l);else if(h&R.VISIBLE){let _=0;t&&(n.modelOrigin.getVec(l,ri),_=i.selectLevel(ri,s.getCombinedMedianScaleFactor(l),r)),u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),_>=0&&(h&R.HIGHLIGHT?(s.foreachHighlightGroup(l,g=>{let C=this._highlightRenderInstanceDataMap.get(g);if(C||(C=this._createRenderInstanceDataArray(),C.forEach(I=>I.beginUpdate()),this._highlightRenderInstanceDataMap.set(g,C)),_>=C.length)throw new Ut(`LodRenderer internal error - missing lodLevel ${_}`);ti(C[_],n,l)}),u|=R.HIGHLIGHT_ACTIVE):(ti(this._defaultRenderInstanceData[_],n,l),u|=R.DEFAULT_ACTIVE)),n.state.set(l,u),n.lodLevel.set(l,_)}else u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),n.state.set(l,u);if(this._octreeCached!=null){const _=!!(h&R.ACTIVE),g=!!(u&R.ACTIVE);!_&&g?this._octreeCached.addInstance(l):_&&!g?this._octreeCached.removeInstance(l):_&&g&&h&R.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){return t.size===0?null:r.glMaterials.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,r,i,s){if(!t)return;const{bind:n,rctx:a}=e;a.runAppleAmdDriverHelper();const o=a.bindTechnique(t,n,i.material.parameters,Vo);a.bindVAO(i.vao),t.ensureAttributeLocations(i.vao),Wt.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===E.Color&&(o.setUniform4fv("externalColor",ai[Math.min(s,ai.length-1)]),o.setUniform1i("colorMixMode",cn.replace));const l=r.capacity,c=r.headIndex,d=r.tailIndex,h=r.firstIndex,u=this._glInstanceBufferLayout,f=(_,g)=>{Pa(a,Qt,r.buffer,u,_),a.drawArraysInstanced(t.primitiveType,0,i.vertexCount,g-_),Fa(a,Qt,r.buffer,u)};i.material.parameters.transparent&&h!=null?c>d?(N(h>=d&&h<=c,"invalid firstIndex"),f(h,c),f(d,h)):c=0&&h<=c,"invalid firstIndex"),f(h,c),f(d,l),f(0,h)):(N(h>=d&&h<=l,"invalid firstIndex"),f(h,l),f(0,c),f(d,h))):c>d?f(d,c):cs.geometry));this.numVertices=i.reduce((s,n)=>s+Ho(n),0)}},$o=class{constructor(e){this.levels=e,this.levels.sort((t,r)=>t.minScreenSpaceRadius===r.minScreenSpaceRadius?t.numVertices-r.numVertices:t.minScreenSpaceRadius-r.minScreenSpaceRadius)}};function qo(e){const t=[];return e.levels.forEach(r=>r.components.forEach(i=>t.push(i.geometry.material))),or(t)}function ko(e){const t=new Array;return e.levels.forEach(r=>r.components.forEach(i=>{i.textures!=null&&t.push(...i.textures)})),or(t)}let rr=class{constructor(e){this._optionalFields=new Array,this._instanceIndexToFeatureId=new Map,this._featureIdToInstanceIndex=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}async doLoad(e,t,r){vs("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(p.OBJECTANDLAYERIDCOLOR);const i=Wo(l=>t(l),e),s=this.view._stage,n=qo(i);s.addMany(n),this._addDisposeResource(()=>s.removeMany(n));const a=ko(i);s.addMany(a),this._addDisposeResource(()=>{a.forEach(l=>l.unload()),s.removeMany(a)}),await Promise.all(a.map(l=>this.view._stage.schedule(()=>l.load(s.renderView.renderingContext),r))),ve(r);const o=await this._createLodRenderer(i,r);this._lodRendererResources={lodRenderer:o,materials:n,textures:a}}addInstances(e){const t=this._lodRendererResources;if(t==null)return;const{featureIds:r,localTransforms:i,globalTransforms:s}=e,n=t.lodRenderer;if(n==null)return;const a=n.instanceData,o=r.length;for(let l=0;l1,notifyGraphicGeometryChanged:n=>1,notifyGraphicVisibilityChanged:n=>1},s=new Q({symbol:e,optionalFields:this._optionalFields,metadata:i,shaderTransformation:null},this.scheduler);return s.slicePlaneEnabled=!1,this._addDisposeResource(()=>{r.removeRenderPlugin(s),s.destroy()}),await r.addRenderPlugin(s,t),s}};function Wo(e,t){const r=t.levels.map(i=>{const s=i.components.map(n=>{const a=e(n.materialId);if(!Yo(a))throw new Error("LodRenderer only supports DefaultMaterial");const o=a.createBufferWriter(),l={material:a,vertexBufferLayout:o.vertexBufferLayout,buffer:n.renderGeometryBuffer.data,elementCount:n.renderGeometryBuffer.elementCount,boundingInfo:n.boundingInfo};return new jo(l)});return new Uo(s,i.minScreenSpaceRadius)});return new $o(r)}function Yo(e){return e!=null&&"materialType"in e&&e.materialType==="default"}rr=m([K("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],rr);const ji=128,De=.5;function Qo(e){return e==="cross"||e==="x"}function Jo(e,t=ji,r=t*De,i=0){const s=Xo(e,t,r,i);return new xn(s,{mipmap:!1,wrap:{s:Hr.CLAMP_TO_EDGE,t:Hr.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}function Xo(e,t=ji,r=t*De,i=0){switch(e){case"circle":default:return Zo(t,r);case"square":return Ko(t,r);case"cross":return tl(t,r,i);case"x":return rl(t,r,i);case"kite":return el(t,r);case"triangle":return il(t,r);case"arrow":return sl(t,r)}}function Zo(e,t){const r=e/2-.5;return Qe(e,$i(r,r,t/2))}function Ko(e,t){return Hi(e,t,!1)}function el(e,t){return Hi(e,t,!0)}function tl(e,t,r=0){return Ui(e,t,!1,r)}function rl(e,t,r=0){return Ui(e,t,!0,r)}function il(e,t){return Qe(e,qi(e/2,t,t/2))}function sl(e,t){const r=t,i=t/2,s=e/2,n=.8*r,a=$i(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),o=qi(s,r,i);return Qe(e,(l,c)=>Math.max(o(l,c),-a(l,c)))}function Hi(e,t,r){return r&&(t/=Math.SQRT2),Qe(e,(i,s)=>{let n=i-.5*e+.25,a=.5*e-s-.75;if(r){const o=(n+a)/Math.SQRT2;a=(a-n)/Math.SQRT2,n=o}return Math.max(Math.abs(n),Math.abs(a))-.5*t})}function Ui(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Qe(e,(n,a)=>{let o,l=n-.5*e,c=.5*e-a-1;if(r){const d=(l+c)/Math.SQRT2;c=(c-l)/Math.SQRT2,l=d}return l=Math.abs(l),c=Math.abs(c),o=l>c?l>s?Math.sqrt((l-s)*(l-s)+c*c):c:c>s?Math.sqrt(l*l+(c-s)*(c-s)):l,o-=i/2,o})}function $i(e,t,r){return(i,s)=>{const n=i-e,a=s-t;return Math.sqrt(n*n+a*a)-r}}function qi(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const a=Math.abs(s-e)-r,o=n-e+t/2+.75,l=(t*a+r*o)/i,c=-o;return Math.max(l,c)}}function Qe(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i=16}function al(e){return Array.isArray(e)&&e.length>=16}function ol(e){return nl(e)||al(e)}const ki=.5;function ll(e,t){e.include(Oi),e.attributes.add(p.POSITION,"vec3"),e.attributes.add(p.NORMAL,"vec3"),e.attributes.add(p.CENTEROFFSETANDDISTANCE,"vec4");const r=e.vertex;In(r,t),Cn(r,t),r.uniforms.add(new Me("viewport",(i,s)=>s.camera.fullViewport),new ge("polygonOffset",i=>i.shaderPolygonOffset),new ge("cameraGroundRelative",(i,s)=>s.camera.aboveGround?1:-1)),t.hasVerticalOffset&&Tn(r),r.constants.add("smallOffsetAngle","float",.984807753012208),r.code.add(w`struct ProjectHUDAux { +vec3 posModel; +vec3 posView; +vec3 vnormal; +float distanceToCamera; +float absCosAngle; +};`),r.code.add(w` + float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { + float pointGroundSign = ${t.terrainDepthTest?w.float(0):w`sign(pointGroundDistance)`}; + if (pointGroundSign == 0.0) { + pointGroundSign = cameraGroundRelative; + } + + // cameraGroundRelative is -1 if camera is below ground, 1 if above ground + // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise + float groundRelative = cameraGroundRelative * pointGroundSign; + + // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is + // dropped is instead introduced using the ground-relative position of the symbol and the camera + if (polygonOffset > .0) { + float cosAlpha = clamp(absCosAngle, 0.01, 1.0); + float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; + float factor = (1.0 - tanAlpha / viewport[2]); + + // same side of the terrain + if (groundRelative > 0.0) { + posView *= factor; + } + // opposite sides of the terrain + else { + posView /= factor; + } + } + + return groundRelative; + } + `),t.draped&&!t.hasVerticalOffset||Sn(r),t.draped||(r.uniforms.add(new ge("perDistancePixelRatio",(i,s)=>Math.tan(s.camera.fovY/2)/(s.camera.fullViewport[2]/2))),r.code.add(w` + void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { + float distanceToCamera = length(posView); + + // Compute offset in world units for a half pixel shift + float pixelOffset = distanceToCamera * perDistancePixelRatio * ${w.float(ki)}; + + // Apply offset along normal in the direction away from the ground surface + vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; + + // Apply the same offset also on the view space position + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + + posModel += modelOffset; + posView += viewOffset; + } + `)),t.screenCenterOffsetUnitsEnabled&&Ri(r),t.hasScreenSizePerspective&&Ai(r),r.code.add(w` + vec4 projectPositionHUD(out ProjectHUDAux aux) { + vec3 centerOffset = centerOffsetAndDistance.xyz; + float pointGroundDistance = centerOffsetAndDistance.w; + + aux.posModel = position; + aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; + aux.vnormal = normal; + ${t.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} + + // Screen sized offset in world space, used for example for line callouts + // Note: keep this implementation in sync with the CPU implementation, see + // - MaterialUtil.verticalOffsetAtDistance + // - HUDMaterial.applyVerticalOffsetTransformation + + aux.distanceToCamera = length(aux.posView); + + vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); + float cosAngle = dot(aux.vnormal, viewDirObjSpace); + + aux.absCosAngle = abs(cosAngle); + + ${t.hasScreenSizePerspective&&(t.hasVerticalOffset||t.screenCenterOffsetUnitsEnabled)?"vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} + + ${t.hasVerticalOffset?t.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} + + ${t.hasVerticalOffset?w` + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); + vec3 modelOffset = aux.vnormal * worldOffset; + aux.posModel += modelOffset; + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + aux.posView += viewOffset; + // Since we elevate the object, we need to take that into account + // in the distance to ground + pointGroundDistance += worldOffset;`:""} + + float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); + + ${t.screenCenterOffsetUnitsEnabled?"":w` + // Apply x/y in view space, but z in screen space (i.e. along posView direction) + aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); + + // Same material all have same z != 0.0 condition so should not lead to + // branch fragmentation and will save a normalization if it's not needed + if (centerOffset.z != 0.0) { + aux.posView -= normalize(aux.posView) * centerOffset.z; + } + `} + + vec4 posProj = proj * vec4(aux.posView, 1.0); + + ${t.screenCenterOffsetUnitsEnabled?t.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} + + ${t.screenCenterOffsetUnitsEnabled?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} + + // constant part of polygon offset emulation + posProj.z -= groundRelative * polygonOffset * posProj.w; + return posProj; + } + `)}let cl=class{constructor(){this.factor=new oi,this.factorAlignment=new oi}},oi=class{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}};function mr(e){e.uniforms.add(new On("alignPixelEnabled",(t,r)=>r.alignPixelEnabled)),e.code.add(w`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`),e.code.add(w`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`)}function hl(e,t){const{vertex:r,fragment:i}=e;e.include(Rn,t),r.include(mr),t.terrainDepthTest&&e.varyings.add("depth","float"),r.main.add(w` + vec4 posProjCenter; + if (dot(position, position) > 0.0) { + // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + posProjCenter = alignToPixelCenter(posProj, viewport.zw); + + ${t.terrainDepthTest?w`depth = projectAux.posView.z;`:""} + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + } else { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + gl_Position = posProjCenter; + gl_PointSize = 1.0; + `),i.main.add(w`fragColor = vec4(1); +if(terrainDepthTest(depth)) { +fragColor.g = 0.5; +}`)}var wt;(function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"})(wt||(wt={}));function dl(e){e.vertex.uniforms.add(new ge("renderTransparentlyOccludedHUD",(t,r)=>r.hudRenderStyle===wt.Occluded?1:r.hudRenderStyle===wt.NotOccluded?0:.75),new Me("viewport",(t,r)=>r.camera.fullViewport),new Yt("hudVisibilityTexture",(t,r)=>r.hudVisibility?.getTexture())),e.vertex.include(mr),e.vertex.code.add(w`bool testHUDVisibility(vec4 posProj) { +vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); +vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); +if (renderTransparentlyOccludedHUD > 0.5) { +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; +} +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; +}`)}const gr={occludedFadeFactor:.6};function Wi(e){const t=new hn,r=e.signedDistanceFieldEnabled;if(t.include(ll,e),t.include(dn,e),e.occlusionPass)return t.include(hl,e),t;const{vertex:i,fragment:s}=t;t.include(Oi),t.include(un,e),t.include(fn,e),t.include(dl),s.include(qa),s.include(pn),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2"),t.varyings.add("voccluded","float"),i.uniforms.add(new Me("viewport",(d,h)=>h.camera.fullViewport),new Sr("screenOffset",(d,h)=>ft(Yi,2*d.screenOffset[0]*h.camera.pixelRatio,2*d.screenOffset[1]*h.camera.pixelRatio)),new Sr("anchorPosition",d=>We(d)),new Me("materialColor",d=>d.color),new ge("materialRotation",d=>d.rotation)),Ri(i),r&&(i.uniforms.add(new Me("outlineColor",d=>d.outlineColor)),s.uniforms.add(new Me("outlineColor",d=>li(d)?d.outlineColor:Xs),new ge("outlineSize",d=>li(d)?d.outlineSize:0))),e.horizonCullingEnabled&&i.uniforms.add(new ka("pointDistanceSphere",(d,h)=>{const u=h.camera.eye,f=d.origin;return ae(f[0]-u[0],f[1]-u[1],f[2]-u[2],ys.radius)})),e.pixelSnappingEnabled&&i.include(mr),e.hasScreenSizePerspective&&(mn(i),Ai(i)),e.debugDrawLabelBorder&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(p.UV0,"vec2"),t.attributes.add(p.COLOR,"vec4"),t.attributes.add(p.SIZE,"vec2"),t.attributes.add(p.ROTATION,"float"),t.attributes.add(p.FEATUREATTRIBUTE,"vec4"),i.code.add(e.horizonCullingEnabled?w`bool behindHorizon(vec3 posModel) { +vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin; +vec3 camToPos = pointDistanceSphere.xyz + posModel; +float earthRadius = pointDistanceSphere.w; +float a = dot(camToPos, camToPos); +float b = dot(camToPos, camToEarthCenter); +float c = dot(camToEarthCenter, camToEarthCenter) - earthRadius * earthRadius; +return b > 0.0 && b < a && b * b > a * c; +}`:w`bool behindHorizon(vec3 posModel) { return false; }`),i.main.add(w` + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + forwardObjectAndLayerIdColor(); + + if (rejectBySlice(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + + if (behindHorizon(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + + vec2 inputSize; + ${z(e.hasScreenSizePerspective,w` + inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); + vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,w` + inputSize = size; + vec2 screenOffsetScaled = screenOffset;`)} + ${z(e.vvSize,w`inputSize *= vvScale(featureAttribute).xx;`)} + + vec2 combinedSize = inputSize * pixelRatio; + vec4 quadOffset = vec4(0.0); + bool visible = testHUDVisibility(posProj); + voccluded = visible ? 0.0 : 1.0; + `);const n=w` + vec2 uv01 = floor(uv0); + vec2 uv = uv0 - uv01; + quadOffset.xy = (uv01 - anchorPosition) * 2.0 * combinedSize; + + ${z(e.hasRotation,w` + float angle = radians(materialRotation + rotation); + float cosAngle = cos(angle); + float sinAngle = sin(angle); + mat2 rotate = mat2(cosAngle, -sinAngle, sinAngle, cosAngle); + + quadOffset.xy = rotate * quadOffset.xy; + `)} + + quadOffset.xy = (quadOffset.xy + screenOffsetScaled) / viewport.zw * posProj.w; + `,a=e.pixelSnappingEnabled?r?w`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:w`posProj += quadOffset; +if (inputSize.x == size.x) { +posProj = alignToPixelOrigin(posProj, viewport.zw); +}`:w`posProj += quadOffset;`;i.main.add(w` + ${z(e.occlusionTestEnabled,w` + if (!visible) { + vtc = vec2(0.0); + ${z(e.debugDrawLabelBorder,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")} + return; + }`)} + ${n} + ${e.vvColor?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} + + ${z(e.output===E.ObjectAndLayerIdColor,w`vcolor.a = 1.0;`)} + + bool alphaDiscard = vcolor.a < ${w.float(oe)}; + ${z(r,`alphaDiscard = alphaDiscard && outlineColor.a < ${w.float(oe)};`)} + if (alphaDiscard) { + // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } else { + ${a} + gl_Position = posProj; + } + + vtc = uv; + + ${z(e.debugDrawLabelBorder,w`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)} + vsize = inputSize; + `),s.uniforms.add(new Yt("tex",d=>d.texture)),e.occludedFragmentFade&&(s.uniforms.add(new Yt("depthMap",(d,h)=>h.mainDepth)),s.uniforms.add(new ge("fadeFactor",()=>gr.occludedFadeFactor)));const o=e.debugDrawLabelBorder?w`(isBorder > 0.0 ? 0.0 : ${w.float(oe)})`:w.float(oe),l=e.output===E.Highlight,c=w` + ${z(e.debugDrawLabelBorder,w`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)} + + ${z(e.sampleSignedDistanceFieldTexelCenter,w` + float txSize = float(textureSize(tex, 0).x); + float texelSize = 1.0 / txSize; + + // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel + vec2 scaleFactor = (vsize - txSize) * texelSize; + vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;`,w`vec2 samplePos = vtc;`)} + + ${r?w` + vec4 fillPixelColor = vcolor; + + // Get distance and map it into [-0.5, 0.5] + float d = rgba2float(texture(tex, samplePos)) - 0.5; + + // Distance in output units (i.e. pixels) + float dist = d * vsize.x; + + // Create smooth transition from the icon into its outline + float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); + fillPixelColor.a *= fillAlphaFactor; + + if (outlineSize > 0.25) { + vec4 outlinePixelColor = outlineColor; + float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); + + // Create smooth transition around outline + float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); + outlinePixelColor.a *= outlineAlphaFactor; + + if ( + outlineAlphaFactor + fillAlphaFactor < ${o} || + fillPixelColor.a + outlinePixelColor.a < ${w.float(oe)} + ) { + discard; + } + + // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) + float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); + vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + + vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); + + ${z(!l,w`fragColor = vec4(compositeColor, compositeAlpha);`)} + } else { + if (fillAlphaFactor < ${o}) { + discard; + } + + ${z(!l,w`fragColor = premultiplyAlpha(fillPixelColor);`)} + } + + // visualize SDF: + // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); + `:w` + vec4 texColor = texture(tex, vtc, -0.5); + if (texColor.a < ${o}) { + discard; + } + ${z(!l,w`fragColor = texColor * premultiplyAlpha(vcolor);`)} + `} + + ${z(e.occludedFragmentFade&&!l,w` + float zSample = texelFetch(depthMap, ivec2(gl_FragCoord.xy), 0).x; + if (zSample < gl_FragCoord.z) { + fragColor *= fadeFactor; + } + `)} + + ${z(!l&&e.debugDrawLabelBorder,w`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)} + `;switch(e.output){case E.Color:e.oitPass===Ue.ColorAlpha&&(t.outputs.add("fragColor","vec4",0),t.outputs.add("fragAlpha","float",1)),s.main.add(w` + ${c} + ${z(e.oitPass===Ue.FrontFace,w`fragColor.rgb /= fragColor.a;`)} + ${z(e.oitPass===Ue.ColorAlpha,w`fragAlpha = fragColor.a;`)}`);break;case E.ObjectAndLayerIdColor:s.main.add(w` + ${c} + outputObjectAndLayerIdColor();`);break;case E.Highlight:t.include(gn,e),s.main.add(w` + ${c} + outputHighlight(voccluded == 1.0);`)}return t}function li(e){return e.outlineColor[3]>0&&e.outlineSize>0}function We(e,t=Yi){return e.textureIsSignedDistanceField?ul(e.anchorPosition,e.distanceFieldBoundingBox,t):Si(t,e.anchorPosition),t}function ul(e,t,r){t!=null?ft(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):ft(r,0,0)}const Yi=lr(),fl=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));let pl=class extends qn{constructor(e,t,r){super(e,t,new kn(fl,()=>Promise.resolve().then(()=>cc)),r),this.primitiveType=t.occlusionPass?Ur.POINTS:Ur.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthTestEnabled:n}=e,a=t===Ue.NONE,o=r?ml:null,l=t===Ue.ColorAlpha,c=i||!n||l||s===E.Highlight?null:Na;return za({blending:s===E.Color?a?Ba:Wn(t):null,depthTest:n&&!i?{func:Sa.LEQUAL}:null,depthWrite:c,drawBuffers:Yn(t,s),colorWrite:Ga,polygonOffset:o})}};const ml={factor:0,units:-4};let D=class extends _n{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.textureCoordinateType=vn.None,this.emissionSource=yn.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}};m([F()],D.prototype,"screenCenterOffsetUnitsEnabled",void 0),m([F()],D.prototype,"occlusionTestEnabled",void 0),m([F()],D.prototype,"signedDistanceFieldEnabled",void 0),m([F()],D.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),m([F()],D.prototype,"vvSize",void 0),m([F()],D.prototype,"vvColor",void 0),m([F()],D.prototype,"hasVerticalOffset",void 0),m([F()],D.prototype,"hasScreenSizePerspective",void 0),m([F()],D.prototype,"hasRotation",void 0),m([F()],D.prototype,"debugDrawLabelBorder",void 0),m([F()],D.prototype,"hasSlicePlane",void 0),m([F()],D.prototype,"hasPolygonOffset",void 0),m([F()],D.prototype,"depthTestEnabled",void 0),m([F()],D.prototype,"pixelSnappingEnabled",void 0),m([F()],D.prototype,"draped",void 0),m([F()],D.prototype,"terrainDepthTest",void 0),m([F()],D.prototype,"cullAboveTerrain",void 0),m([F()],D.prototype,"occlusionPass",void 0),m([F()],D.prototype,"occludedFragmentFade",void 0),m([F()],D.prototype,"objectAndLayerIdColorInstanced",void 0),m([F()],D.prototype,"horizonCullingEnabled",void 0);class gl extends An{constructor(t,r){super(t,Sl),this.produces=new Map([[W.HUD_MATERIAL,i=>Ct(i)&&!this.parameters.drawInSecondSlot],[W.LABEL_MATERIAL,i=>Ct(i)&&this.parameters.drawInSecondSlot],[W.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[W.DRAPED_MATERIAL,i=>this.parameters.draped&&Ct(i)]]),this._visible=!0,this._configuration=new D(r)}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=r.slot===W.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.depthTestEnabled=this.parameters.depthEnabled||r.slot===W.OCCLUSION_PIXELS,t===E.Color&&(this._configuration.debugDrawLabelBorder=!!Wt.LABELS_SHOW_BORDER),this._configuration.oitPass=r.oitPass,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration}intersect(t,r,i,s,n,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:h}=i,{parameters:u}=this;if(!o||!l||c&&u.isLabel||!t.visible||!d)return;const{scaleX:f,scaleY:_}=this._getScreenScale(t,h.pixelRatio);dr(Lt,r),t.attributes.has(p.FEATUREATTRIBUTE)&&yl(Lt);const g=t.attributes.get(p.POSITION),C=t.attributes.get(p.SIZE),I=t.attributes.get(p.NORMAL),x=t.attributes.get(p.ROTATION),O=t.attributes.get(p.CENTEROFFSETANDDISTANCE);N(g.size>=3);const M=We(u),y=this.parameters.centerOffsetUnits==="screen";for(let P=0;P-1){y&&(k[0]||k[1])&&(V[0]+=k[0]*h.pixelRatio,k[1]!==0&&(V[1]+=En(k[1],Ft.factorAlignment)*h.pixelRatio),h.unapplyProjection(V,G)),V[0]+=this.parameters.screenOffset[0]*h.pixelRatio,V[1]+=this.parameters.screenOffset[1]*h.pixelRatio,V[0]=Math.floor(V[0]),V[1]=Math.floor(V[1]);const Je=P*C.size;$[0]=C.data[Je],$[1]=C.data[Je+1],Mn($,Ft.factor,$);const rs=Il*h.pixelRatio;let _r=0;u.textureIsSignedDistanceField&&(_r=Math.min(u.outlineSize,.5*$[0])*h.pixelRatio/2),$[0]*=f,$[1]*=_;const is=P*x.size,ss=u.rotation+x.data[is];if(hi(d,V[0],V[1],$,rs,_r,ss,u,M)){const vr=i.ray;if(_e(di,G,Pe(bl,h.viewMatrix)),V[0]=d[0],V[1]=d[1],h.unprojectFromRenderScreen(V,G)){const Ne=A();j(Ne,vr.direction);const yr=1/me(Ne);Z(Ne,Ne,yr),a(Mi(vr.origin,G)*yr,Ne,-1,!0,1,di)}}}}}intersectDraped(t,r,i,s,n,a){const o=t.attributes.get(p.POSITION),l=t.attributes.get(p.SIZE),c=t.attributes.get(p.ROTATION),d=this.parameters,h=We(d),{scaleX:u,scaleY:f}=this._getScreenScale(t,t.screenToWorldRatio),_=Cl*t.screenToWorldRatio;for(let g=0;g0?d:1/d),n}_applyVerticalGroundOffsetView(t,r,i,s){const n=me(t),a=i.aboveGround?1:-1,o=i.computeRenderPixelSizeAtDist(n)*ki,l=Z(G,r.normal,a*o);return ht(s,t,l),s}_applyVerticalOffsetTransformationView(t,r,i,s){const n=this.parameters;if(!n.verticalOffset?.screenLength){if(n.screenSizePerspective||n.screenSizePerspectiveAlignment){const c=me(t);this._updateScaleInfo(s,c,r.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return t}const a=me(t),o=n.screenSizePerspectiveAlignment??n.screenSizePerspective,l=Dn(i,a,n.verticalOffset,r.cosAngle,o);return this._updateScaleInfo(s,a,r.cosAngle),Z(r.normal,r.normal,l),ht(t,t,r.normal)}_applyCenterOffsetView(t,r,i){const s=this.parameters.centerOffsetUnits!=="screen";return i!==t&&j(i,t),s&&(i[0]+=r[0],i[1]+=r[1],r[2]&&(he(Ge,i),ht(i,i,Z(Ge,Ge,r[2])))),i}_applyCenterOffsetNDC(t,r,i,s){const n=this.parameters.centerOffsetUnits!=="screen";return s!==t&&j(s,t),n||(s[0]+=r[0]/i.fullWidth*2,s[1]+=r[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(t,r,i,s){const n=this.parameters.shaderPolygonOffset;if(t!==s&&j(s,t),n){const a=i.aboveGround?1:-1,o=a*Math.sign(r[3]);s[2]-=(o||a)*n}return s}set visible(t){this._visible=t}get visible(){const{color:t,outlineSize:r,outlineColor:i}=this.parameters,s=t[3]>=oe||r>=oe&&i[3]>=oe;return this._visible&&s}createGLMaterial(t){return new _l(t)}calculateRelativeScreenBounds(t,r,i=Ii()){return vl(this.parameters,t,r,i),i[2]=i[0]+t[0],i[3]=i[1]+t[1],i}_getScreenScale(t,r){const i=t.attributes.get(p.FEATUREATTRIBUTE);if(i==null)return{scaleX:r,scaleY:r};const s=Zs(i.data,xl);return Pn(Nt,this.parameters,s),{scaleX:Nt[0]*r,scaleY:Nt[1]*r}}}class _l extends Fn{constructor(t){super({...t,...t.material.parameters})}beginSlot(t){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.acquireTechnique(pl,t)}}function vl(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function ci(e,t,r,i){return ol(t)&&(t=dr(wl,t)),oa(i.normal,e,t),_e(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=qe(Qi,Tl),i}function yl(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+i*i),h=1/Math.sqrt(s*s+n*n+a*a),u=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*d,e[1]=r*d,e[2]=i*d,e[3]=s*h,e[4]=n*h,e[5]=a*h,e[6]=o*u,e[7]=l*u,e[8]=c*u,e}function hi(e,t,r,i,s,n,a,o,l){let c=t-s-i[0]*l[0],d=c+i[0]+2*s,h=r-s-i[1]*l[1],u=h+i[1]+2*s;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&f!=null&&(c+=i[0]*f[0],h+=i[1]*f[1],d-=i[0]*(1-f[2]),u-=i[1]*(1-f[3]),c-=n,d+=n,h-=n,u+=n),ft(ui,t,r),tn(Ve,e,ui,Ps(a)),Ve[0]>c&&Ve[0]h&&Ve[1]=4&&(l=o[0],c=o[1],d=o[2],h=o[3]),d=Math.min(1.99999,d+1),h=Math.min(1.99999,h+1);let u=i.get(p.POSITION).indices.length,f=a;const _=n.uv0;for(let x=0;xbs(o))]),n=a}break;default:throw new Error(`unable to create unknown material type ${e.type}`)}this._materials.set(e.materialId,n)}_getMaterial(e){return this._materials.get(e)}async _createDirectRenderer(e){const t=e.materialId,r=this._getMaterial(t);if(r==null)throw new Error(`material not found ${t}`);const{view:i}=this,s=new dt({material:r});this._directRenderers.set(t,s),i._stage.addRenderPlugin(s),i._stage.renderView.renderer.updateHasFlags()}async _addDirectRendererGeometry(e){const t=e.renderGeometryId,r=e.materialId;this._renderGeometries.get(t)!=null&&await this._removeDirectRendererGeometry({renderGeometryId:t});const i=this._directRenderers.get(r);if(i==null)return void console.error("no renderer assigned to provided material");const s=i.addRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:s,materialId:r}),this.view._stage.renderView.requestRender()}async _removeDirectRendererGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(r==null)return;const i=r.materialId,s=this._directRenderers.get(i);s!=null?s.removeRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}async _createLodRenderer(e){const t=new rr({view:this.view,layerUid:this.layerUid}),r=new AbortController,i=s=>this._getMaterial(s);await t.doLoad(e.lodRenderGeometry,i,r.signal),this._lodRenderers.set(e.lodRendererId,t)}async _addLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.addInstances(e.data)}async _removeLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(e.featureIds)}};function Xi(e,t){const r={anchorPosition:io.center,occlusionTest:!0,hasSlicePlane:!1},i=r,s=1;i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=s;const n=null;if(e!=null){const a=e.fromData("circle-icon",()=>Jo("circle"));i.textureId=a.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=Qo("circle")}return i.distanceFieldBoundingBox=Ml,[new gl(r,t),n]}function Al(e,t,r){const i={usePBR:t.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:Un,ambient:qt,diffuse:qt,hasSlicePlane:t.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:t.castShadows,offsetTransparentBackfaces:!t.isPrimitive};return El(i),i.screenSizePerspective=e.screenSizePerspectiveSettings,i.externalColor=Ks,i.isInstanced=!0,new Ei(i,{spherical:r,doublePrecisionRequiresObfuscation:!0})}function El(e){const t=e.opacity??1,r=t<1;return e.transparent=r,e.opacity=t,e.cullFace=r?Mr.None:Mr.Back,e}fi=m([K("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],fi);const Ml=[De/2,De/2,1-De/2,1-De/2];let pi=class{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e,t){const r=this._bufferWriter;let i=null;if(e.transformation&&t)ce(xe,e.transformation),xe[12]-=t[0],xe[13]-=t[1],xe[14]-=t[2],i=xe;else{if(t)throw new Error("not implemented");e.transformation&&(i=e.transformation)}let s=null;i&&(Pe(ot,xe),cr(ot,ot),s=ot);const n=e.attributes,a=r.elementCount(n),o=r.vertexBufferLayout.stride/4;a>Math.floor(Dl/o)&&console.warn("geometry with very large number of elements encountered");const l=r.vertexBufferLayout.createBuffer(a);return r.write(i,s,n,e.objectAndLayerIdColor,l,0),{data:l.buffer,elementCount:a}}};const xe=L(),ot=L(),Dl=16777216/4;let Pl=class{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(e){const t=this._context,r=t.generateId("material");switch(e){case"default":{const i=new Ei({},{spherical:this._context.globalViewingMode,doublePrecisionRequiresObfuscation:!0}),s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}break;case"hud":{const i=Xi(null,this._context.globalViewingMode)[0],s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}}return this._commands.push({id:"create-material",type:e,materialId:r}),r}createDirectRenderer(e){const t=this._context.generateId("material-renderer");return this._commands.push({id:"create-direct-renderer",materialRendererId:t,materialId:e}),t}addDirectRendererGeometry(e,t,r){const i=t.materialId,s=this._context.getRenderGeometryBufferWriter(i);if(s==null)throw new Error(`no bufferwriter found for material ${i}`);const n=s.createBuffer(t,r);this._transferables.add(n.data),this._commands.push({id:"add-direct-renderer-geometry",renderGeometryId:e,materialId:i,renderGeometryBuffer:n,localOrigin:r})}removeDirectRendererGeometry(e){this._commands.push({id:"remove-direct-renderer-geometry",renderGeometryId:e})}createLodRenderer(e){const t=this._context.generateId("lod-renderer"),r={levels:e.levels.map(i=>({components:i.components.map(s=>{const n=s.attributes.get(p.POSITION);if(!n||n.indices.length===0)throw new Error("positions attribute expected");const a=3,o=Qs(n.indices.length/a),l=new $n(o,a,n),c=this._context.getRenderGeometryBufferWriter(s.materialId);if(c==null)throw new Error("writer not found");const d=c.createBuffer(s,null);return this._transferables.add(d.data),{materialId:s.materialId,renderGeometryBuffer:d,boundingInfo:{bbMax:l.bbMax,bbMin:l.bbMin}}}),minScreenSpaceRadius:i.minScreenSpaceRadius}))};return this._commands.push({id:"create-lod-renderer",lodRendererId:t,lodRenderGeometry:r}),t}addLodInstances(e,t){this._commands.push({id:"add-lod-instances",lodRendererId:e,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer)}removeLodInstances(e,t){this._commands.push({id:"remove-lod-instances",lodRendererId:e,featureIds:t}),this._transferables.add(t.buffer)}async dispatch(){const e=this._commands,t=Array.from(this._transferables);this._clearCommandBuffer(),this._context.dispatchRenderCommands(e,t)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}},Fl=class{constructor(e){this._idCounter=0,this._bufferWriters=new Map,this._dispatchRenderCommandsCallback=async()=>{},this.globalViewingMode=!1,this.globalViewingMode=e.viewingMode===ne.Global,this._dispatchRenderCommandsCallback=e.dispatchRenderCommandsCallback}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new Pl(this)}async dispatchRenderCommands(e,t){this._dispatchRenderCommandsCallback(e,t)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}};var q;(function(e){e[e.OBJECT_ID=0]="OBJECT_ID",e[e.PARTITION_ID=1]="PARTITION_ID",e[e.GEOMETRY_MAP_COORDINATES=2]="GEOMETRY_MAP_COORDINATES",e[e.GEOMETRY_RENDER_COORDINATES=3]="GEOMETRY_RENDER_COORDINATES",e[e.TILE_CENTER_RENDER_COORDINATES=4]="TILE_CENTER_RENDER_COORDINATES"})(q||(q={}));async function Ll(e,t){const{numFeatures:r,tile:i,partitionInfo:s}=e,{pages:n}=i;if(n.length===0||r===0)return new Uint32Array;const a=new Uint32Array(r);if(s){const o=n.reduce((h,{featureCount:u})=>h+u,0),l=new Uint32Array(o);let c=0;for(const h of n)c=h.readAllObjectIds(l,c);const d=s.tileIndices;for(let h=0;hh+u,0),l=new Float64Array(3*o);let c=0;for(const h of n)c=h.readAllCoordinates(l,c);const d=s.tileIndices;for(let h=0;h=0;o--){const l=e[o];let c;const d=l!=null,h=o===0&&!n&&!d,u=r[o];l==="symbol-value"||h?c=u!==0?t[o]/u:1:d&&l!=="proportional"&&isFinite(l)&&(c=u!==0?l/u:1),c!=null&&(s[o]=c,n=c,a=Math.max(a,Math.abs(c)))}for(let o=2;o>=0;o--)s[o]==null?s[o]=n:s[o]===0&&(s[o]=.001*a)}for(let n=2;n>=0;n--)s[n]/=i;return $t(s)}function Ki(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:Js(i.indices)});return t}var mi;(function(e){function t(a,o){const l=a[o],c=a[o+1],d=a[o+2];return Math.sqrt(l*l+c*c+d*d)}function r(a,o){const l=a[o],c=a[o+1],d=a[o+2],h=1/Math.sqrt(l*l+c*c+d*d);a[o]*=h,a[o+1]*=h,a[o+2]*=h}function i(a,o,l){a[o]*=l,a[o+1]*=l,a[o+2]*=l}function s(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]+l[c],d[h+1]=a[o+1]+l[c+1],d[h+2]=a[o+2]+l[c+2]}function n(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]-l[c],d[h+1]=a[o+1]-l[c+1],d[h+2]=a[o+2]-l[c+2]}e.length=t,e.normalize=r,e.scale=i,e.add=s,e.subtract=n})(mi||(mi={}));const Vl=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)Vl[6*e+t]=e;const Ie=new Array(36);for(let e=0;e<6;e++)Ie[6*e]=0,Ie[6*e+1]=1,Ie[6*e+2]=2,Ie[6*e+3]=2,Ie[6*e+4]=3,Ie[6*e+5]=0;const Bt=re(-.5,0,-.5),Gt=re(.5,0,-.5),Vt=re(0,0,.5),jt=re(0,.5,0),Ce=Ye(),Te=Ye(),Se=Ye(),Oe=Ye(),Re=Ye();Y(Ce,Bt,jt),Y(Te,Bt,Gt),$e(Se,Ce,Te),he(Se,Se),Y(Ce,Gt,jt),Y(Te,Gt,Vt),$e(Oe,Ce,Te),he(Oe,Oe),Y(Ce,Vt,jt),Y(Te,Vt,Bt),$e(Re,Ce,Te),he(Re,Re),Se[0],Se[1],Se[2],Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2];function jl(e,t,r,i,s=!0,n=!0){let a=0;const o=t,l=e;let c=re(0,a,0),d=re(0,a+l,0),h=re(0,-1,0),u=re(0,1,0);const f=[d,c],_=[h,u],g=r+2,C=Math.sqrt(l*l+o*o);for(let y=0;y({levels:i.map(a=>{const o=Ki(s(a.tesselation));return n&&Ul(o),{components:[{attributes:o,objectAndLayerIdColor:void 0,transformation:null,materialId:t}],minScreenSpaceRadius:a.minScreenSpaceRadius}})});switch(e){case"cone":return r($l,i=>jl(1,.5,i),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Ul(e){const t=e,r=t.get(p.POSITION).data,i=t.get(p.NORMAL).data;if(i){const s=gi(e,p.NORMAL).data;for(let n=0;n{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.add(s,r)}))}async remove(t,r){const i=t.partitions;if(!i)throw new Error("partitioned featureset expected");await Promise.all(i.map(async s=>{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.remove(s,r)}))}async _provisionFeatureData(t,r){await t.provision([q.PARTITION_ID,q.OBJECT_ID],r)}async _provisionSymbol(t,r){if(t==null)return null;const i=this._symbols.get(t);return i?(i.loaded||await i.load(r),i):null}_partition(t){const{numFeatures:r,objectIds:i,partitionIds:s}=t,n=[[],[]];for(let a=0;aa.length>0).map((a,o)=>{const l=a.length,c={index:o,tileIndices:new Uint32Array(a)};return new Zi(t.tile,l,c)}),t.partitions}}function Yl(e,t,r){return!!gt(e,t,ct,r.spatialReference)&&(r.x=ct[0],r.y=ct[1],r.z=ct[2],!0)}const ct=A();function Ql(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}function Jl(e,t,r){return e.operations.setExtent(e.value,t,r.value),r}function Xl(e,t){return e.operations.getExtent(e.value,t),t}function Zl(e){return{operations:e,value:e.create()}}function es(e,t,r=Zl(e)){return r.operations=e,e.copy(t,r.value),r}function Kl(e){return es(ma,pa(0,0,0,Ci(e).radius))}const _i=2**50;function ec(){return es(Ra,Oa([0,0,0],[_i,0,0],[0,_i,0]))}function tc(e,t,r){return e.operations.axisAt(e.value,t,je.Z,r)}function rc(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}function ic(e,t,r){return e.operations.intersectRay(e.value,t,r)}function sc(e,t,r){return e.operations.intersectRayClosestSilhouette(e.value,t,r)}function nc(e,t){return e.operations.altitudeAt(e.value,t)}function ts(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function ac(e,t,r,i){return t!==i&&ce(i,t),ie(Ae,i[12],i[13],i[14]),ts(e,Ae,r,Ae),i[12]=Ae[0],i[13]=Ae[1],i[14]=Ae[2],i}function Ht(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ae=A();function vi(e){return e.type==="point"}class bt{constructor(t,r,i,s){this.viewingMode=t,this.spatialReference=r,this.unitInMeters=i,this._coordinateSystem=s,this._tmpCoordinateSystem=Ql(s),this.referenceEllipsoid=Ci(r),this.sphericalPCPF=Ha(r)}set extent(t){t&&Jl(this._coordinateSystem,t,this._coordinateSystem)}get extent(){return Xl(this._coordinateSystem,Ii())}getAltitude(t){return nc(this._coordinateSystem,t)}setAltitude(t,r,i=t){return ts(this._coordinateSystem,i,r,t)}setAltitudeOfTransformation(t,r){ac(this._coordinateSystem,r,t,r)}worldUpAtPosition(t,r){return tc(this._coordinateSystem,t,r)}worldBasisAtPosition(t,r,i){return rc(this._coordinateSystem,t,r,i)}basisMatrixAtPosition(t,r){const i=this.worldBasisAtPosition(t,je.X,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=this.worldBasisAtPosition(t,je.Z,de.get());return ia(r,i[0],i[1],i[2],0,s[0],s[1],s[2],0,n[0],n[1],n[2],0,0,0,0,1),r}headingAtPosition(t,r){const i=this.worldUpAtPosition(t,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=ya(r,s,i);return Ls(n)}intersectManifoldClosestSilhouette(t,r,i){return Ht(this._coordinateSystem,r,this._tmpCoordinateSystem),sc(this._tmpCoordinateSystem,t,i),i}intersectManifold(t,r,i){Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=de.get();return ic(this._tmpCoordinateSystem,t,s)?j(i,s):null}intersectInfiniteManifold(t,r,i){if(this.viewingMode===ne.Global)return this.intersectManifold(t,r,i);Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=this._tmpCoordinateSystem.value,n=de.get();return wa(s.plane,t,n)?j(i,n):null}toRenderCoords(t,r,i){return vi(t)?Ua(t,r,this.spatialReference):gt(t,r,i,this.spatialReference)}fromRenderCoords(t,r,i=null){return vi(r)?(i!=null&&(r.spatialReference=i),Yl(t,this.spatialReference,r)?r:null):gt(t,this.spatialReference,r,i)?r:null}static create(t,r){switch(t){case ne.Local:return new bt(ne.Local,r,Ns(r),ec());case ne.Global:return new bt(ne.Global,r,1,Kl(r))}}static renderUnitScaleFactor(t,r){return Ir(t)/Ir(r)}}class oc{constructor(t){this._tileFeatureData=new Map,this._context={viewSpatialReference:t.viewSpatialReference,renderSpatialReference:t.renderSpatialReference,renderCoordsHelper:bt.create(t.viewingMode,t.renderSpatialReference)}}async add(t,r){this._featureRenderer||(this._featureRenderer=new Wl(this._context),await this._featureRenderer.load());const i=this._addTileFeatureData(t);await this._featureRenderer.add(i,r)}async remove(t,r){const i=this._getFeatureSetFromTileId(t);i&&(this._featureRenderer&&this._featureRenderer.remove(i,r),this._removeTileFeatureData(t))}_getFeatureSetFromTileId(t){return this._tileFeatureData.get(t)}_addTileFeatureData(t){const r=t.descriptor.id,i=t.pages.reduce((n,{featureCount:a})=>n+a,0),s=new Zi(t,i);return this._tileFeatureData.set(r,s),s}_removeTileFeatureData(t){const r=this._tileFeatureData.get(t);r&&(r.dispose(),this._tileFeatureData.delete(t))}}let ut=class extends ar.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new Ya,this._tileManager=new fe({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._renderCommandContext=null,this._fetcher=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:n,capabilities:a,fieldsIndex:o,timeInfo:l}){this._renderCommandContext=new Fl({viewingMode:r,dispatchRenderCommandsCallback:(h,u)=>this.remoteClient.invoke("dispatchRenderCommands",h,{transferList:u})});const c=wr.fromJSON(e),d=wr.fromJSON(t);return this._fetcher=new ro(c,Cr.fromJSON(i),s,n,a),this._symbolizer=new oc({viewSpatialReference:c,renderSpatialReference:d,viewingMode:r}),this._queryEngine=new Gs({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n,fieldsIndex:o,availableFields:[n],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new Cr({outSpatialReference:c}).toJSON(),this.addHandles(ns(()=>this.updating,async h=>{this.emit("notify-updating",{updating:h})}),as),yi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),yi}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);ve(t),this._featureStore.addTile(r);const i=this._renderCommandContext.createEncoder();return await this._symbolizer.add(r,i),await i.dispatch(),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s.tileId),await i.remove(s.tileId,t);await t.dispatch()}_ensureQuery(e){return e??this._defaultQueryJSON}};m([v()],ut.prototype,"updating",null),ut=m([K("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],ut);const lc=ut,yi={result:void 0},Kh=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"})),ed=Object.freeze(Object.defineProperty({__proto__:null,build:sn},Symbol.toStringTag,{value:"Module"})),td=Object.freeze(Object.defineProperty({__proto__:null,build:nn,getRadius:an},Symbol.toStringTag,{value:"Module"})),rd=Object.freeze(Object.defineProperty({__proto__:null,build:on},Symbol.toStringTag,{value:"Module"})),id=Object.freeze(Object.defineProperty({__proto__:null,build:ln},Symbol.toStringTag,{value:"Module"})),cc=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));export{rd as D,Kh as F,id as R,ed as S,td as a}; diff --git a/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js b/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js deleted file mode 100644 index 0f9662f6..00000000 --- a/custom-toc-separator/assets/HUDMaterial.glsl-BLhEaLk5-JEW-lGlx.js +++ /dev/null @@ -1,347 +0,0 @@ -import{v as m,S as v,i as K,c$ as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,cJ as br,e6 as hs,ig as ds,hb as us,dg as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dk as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,eI as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./story-OUarUCIt.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{b as Cr}from"./Query-BrwMGK8U-gUIs0TS1.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import{n as Hs}from"./timeSupport-jPViR5jn-BLBOCVnL.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-CLOB0soI.js";import{o as $s}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-Bin5_zrY.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-Bq20cXL-.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-BGmZ7EU1.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-DhnIMuUV.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-CkV41Bdd.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-DlxNxa6f.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{r as Fi}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-Bv29bzNX.js";import{l as La}from"./floatRGBA-4pIJN00G-DCWbfrRi.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import"./triangle-hqU-Tc1X-DnaZZmrr.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./main-lj2zzr_L.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-BuJzHX4v.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CznIGfdF.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./quat-BODLR7mS-BrN0ZBC_.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = -255.0 / 256.0 + -255.0 / 256.0 / 256.0 + -255.0 / 256.0 / 256.0 / 256.0 + -255.0 / 256.0 / 256.0 / 256.0 / 256.0; -const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); -vec4 float2rgba(const float value) { -float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); -vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); -const float toU8AsFloat = 1.0 / 255.0; -return fixedPointU8 * toU8AsFloat; -}`),e.code.add(w`const vec4 RGBA_2_FLOAT_FACTORS = vec4( -255.0 / (256.0), -255.0 / (256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0 * 256.0) -); -float rgba2float(vec4 rgba) { -return dot(rgba, RGBA_2_FLOAT_FACTORS); -}`),e.code.add(w`const vec4 uninterpolatedRGBAToFloatFactors = vec4( -1.0 / 256.0, -1.0 / 256.0 / 256.0, -1.0 / 256.0 / 256.0 / 256.0, -1.0 / 256.0 / 256.0 / 256.0 / 256.0 -); -float uninterpolatedRGBAToFloat(vec4 rgba) { -return (dot(round(rgba * 255.0), uninterpolatedRGBAToFloatFactors) - 0.5) * 2.0; -}`)}let ka=class extends wn{constructor(e,t){super(e,"vec4",$a.Draw,(r,i,s)=>r.setUniform4fv(e,t(i,s)))}},fe=class extends ye{constructor(e){super(e),this._removing=0,this._tiles=new Vs}destroy(){for(const e of this._tiles.values())e.remove();this._tiles.clear()}get updating(){if(this._removing>0)return!0;for(const e of this._tiles.values())if(!e.finished)return!0;return!1}async onTileTreeChange(e){const{added:t,removed:r}=e,i=this._tiles,s=[];for(const n of r){const a=i.get(n);a!=null&&(a.abort(),i.delete(n),s.push({tileId:n}))}for(const n of t)i.has(n.id)||i.set(n.id,os(a=>this._addTile(n,a)));await this._removeTiles(s)}async _addTile(e,t){const r=await this.addTile(e,t);return ve(t),r}async _removeTiles(e){this._removing++,await this.removeTiles(e),this._removing--}};m([v()],fe.prototype,"updating",null),m([v({constructOnly:!0})],fe.prototype,"addTile",void 0),m([v({constructOnly:!0})],fe.prototype,"removeTiles",void 0),m([v()],fe.prototype,"_removing",void 0),fe=m([K("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],fe);let Zt=class{constructor(e,t){this._index=e,this._view=t}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new Wa(this._index,this._view,e)}},Wa=class extends Zt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return Hs(new kt,this._geometryOverride,e.hasZ,e.hasM)}},Ya=class{constructor(){this._storedTiles=new Map,this._pageBounds=new Map,this.events=new ar,this.featureAdapter=Kt.shared}addTile(e){this._storedTiles.set(e.descriptor.id,e);for(const t of e.pages)this._addPage(t)}removeTile(e){const t=this._storedTiles,r=t.get(e);if(r!=null){t.delete(e);for(const i of r.pages)this._removePage(i)}}_addPage(e){const{featureCount:t}=e;if(t===0)return;const r=new js(9,s=>e.getBounds(s)),i=new Array;for(let s=0;se(new Zt(i,t)))}forEachInBounds(e,t){ze.minX=e[0],ze.minY=e[1],ze.maxX=e[2],ze.maxY=e[3];for(const[r,i]of this._pageBounds)i.search(ze,s=>t(new Zt(s,r)))}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,s=-1/0;for(const n of this._pageBounds.values()){const{minX:a,minY:o,maxX:l,maxY:c}=n.toJSON();t=Math.min(t,a),r=Math.min(r,o),i=Math.min(i,l),s=Math.min(s,c)}return{xmin:t,ymin:r,xmax:i,ymax:s,spatialReference:e}}},Kt=class{getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}};Kt.shared=new Kt;const ze=new Ti;let Qa=class{constructor(e,t){this.descriptor=e,this.pages=t}},Ja=class{constructor(e){const t=new $s(new Uint8Array(e),new DataView(e));this._reader=t,this._index=Xa(t)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,s=r.get(t)?.index;if(s==null)return;const n=i[e*r.fields.length+s],a=this._reader;return a.move(n),St(a)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return typeof r=="string"?new Date(r).getTime():typeof r=="number"||r==null?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,s=this._reader,n={};for(const a of t.fields){const o=r[i+a.index];s.move(o),n[a.name]=St(s)}return n}getCoordinates(e,t,r=0){const i=this._reader,{transform:s,featureIndices:n}=this._index,{scale:a,translate:o}=s;i.move(n[e]),this._readCoordinates(a,o,t,r)}getOptimizedGeometry(e){const t=A();return this.getCoordinates(e,t),new kt([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,we);const[i,s,n]=we,a=[i,s];return t&&(a[3]=n),r&&(a[t?4:3]=0),new kt([],a)}getBounds(e){this.getCoordinates(e,we);const[t,r]=we,i=new Ti;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,we);const[t,r,i]=we;return Ss(t,r,i,t,r,i)}readAllObjectIds(e,t=0){const r=this._reader,{_index:i,featureCount:s}=this,{objectIdFieldName:n,attributeIndices:a,fieldsIndex:o}=i,l=o.get(n).index,c=o.fields.length;for(let d=0;dt?.release()):e?.release()}let fr=class{constructor(e,t){this._material=e,this._repository=t,this._map=new Map}dispose(){this._map.forEach((e,t)=>{e!=null&&this._repository.release(this._material,t)})}load(e,t,r){if(!this._material.produces.get(t)?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,t,r));const i=this._map.get(r);if(i!=null){if(i.ensureResources(e)===Jn.LOADED)return i;this._repository.requestRender()}return null}},Bi=class extends bn{constructor(e=A()){super(),this.origin=e}get slicePlaneLocalOrigin(){return this.origin}};var kr,pe;(function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE"})(kr||(kr={})),function(e){e[e.NONE=0]="NONE",e[e.VISIBILITY=1]="VISIBILITY",e[e.GEOMETRY=2]="GEOMETRY",e[e.TRANSFORMATION=4]="TRANSFORMATION",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.OCCLUDEE=16]="OCCLUDEE"}(pe||(pe={}));let pr=class{constructor(e=0,t=0){this.from=e,this.to=t}get numElements(){return this.to-this.from}};function Wr(e){const t=new Map;e.forAll(i=>t.set(i.from,i));let r=!0;for(;r;){r=!1;for(let i=0;ie||new pr,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightGroups=new Set,this.drawCommandsDefault=et(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=et(),this.drawCommandsShadowHighlightRest=et()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightGroups.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightGroups.clear()}updateIfDrawCommandsDirty(e){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(e)}}addInstance(e,t){this.deleteInstance(e),this._instances.set(e,t),this._numElements+=t.numElements}deleteInstance(e){const t=this._instances.get(e);t&&(this._numElements-=t.numElements,this._instances.delete(e))}updateInstance(e,t,r){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,i.from=t,i.to=r,this._numElements+=i.numElements)}updateDrawState(e){e.isVisible?(e.foreachHighlightGroup(t=>this.highlightGroups.add(t)),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlights.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const i=this.drawCommandsDefault.pushNew(),s=this.holes.front();return this.vao!=null&&this.holes.length===1&&s.to===Math.floor(this.vao.byteSize/e)?(i.first=0,void(i.count=s.from)):(i.first=1/0,i.count=0,this._instances.forEach(n=>{i.first=Math.min(i.first,n.from),i.count=Math.max(i.count,n.to)}),void(i.count-=i.first))}const t=Array.from(this._instances.values()).sort((i,s)=>i.from===s.from?i.to-s.to:i.from-s.from),{drawCommandsHighlights:r}=this;for(const i of t)i.isVisible&&(Ot(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i),i.hasHighlights?i.foreachHighlightGroup(s=>{let n=r.get(s);n||(n=et(),r.set(s,n)),Ot(n,i)}):Ot(this.drawCommandsShadowHighlightRest,i))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function co(e){return e.vao!=null}function et(){return new nr({allocator:e=>e||new oo,deallocator:e=>e})}function Ot(e,t){const r=e.back();if(r==null){const i=e.pushNew();return i.first=t.from,void(i.count=t.numElements)}if(ho(r,t)){const i=t.from-r.first+t.numElements;r.count=i}else{const i=e.pushNew();i.first=t.from,i.count=t.numElements}}function ho(e,t){return e.first+e.count>=t.from}let uo=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(t=>t.instances.has(e))}},Rt=class extends zi{get _hasAnyHighlight(){return this._highlightGroups.size>0}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new Bi,this._highlightGroups=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=cs(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this.material.produces.forEach((e,t)=>{this._produces.set(t,r=>!(this._dataByOrigin.size===0||!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasAnyHighlight))&&e(r))})}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(t=>e+=t.buffers.reduce((r,i)=>r+i.vao.usedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(t=>t.buffers.forEach(r=>r.instances.forEach(({geometry:i})=>e(i))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const t=this._bufferWriter;if(t==null)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const s=i.renderGeometry,n=this._dataByOrigin.get(s.localOrigin.id),a=n?.findBuffer(s.id);if(a==null)return;const o=a.instances.get(s.id);if(i.updateType&(pe.GEOMETRY|pe.TRANSFORMATION)){const l=it(t.elementCount(o.geometry.geometry.attributes)*r),c=t.vertexBufferLayout.createView(l.buffer);this._writeGeometry(s,c,0),a.vao.vertexBuffers.get("geometry").setSubData(l,o.from*r,0,o.numElements*r)}i.updateType&(pe.HIGHLIGHT|pe.OCCLUDEE|pe.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new Xn;for(const i of e){const s=i.localOrigin;if(s==null)continue;let n=r.get(s.id,null);n==null&&(n=new Qr(s.vec3),r.set(s.id,null,n)),n.changes.push(i)}for(const i of t){const s=i.localOrigin;if(s==null)continue;const n=this._dataByOrigin.get(s.id),a=n?.findBuffer(i.id);if(a==null)continue;let o=r.get(s.id,a);o==null&&(o=new Qr(s.vec3),r.set(s.id,a,o)),o.changes.push(i)}return r}_addAndRemoveGeometries(e,t){if(this._bufferWriter==null||this._vaoCache==null)return;const{_bufferWriter:r,_dataByOrigin:i}=this,s=r.vertexBufferLayout.stride/4,n=this._computeDeltas(e,t);n.forEach((a,o)=>{const l=a.get(null),c=l?.changes??[];n.delete(o,null);let d=i.get(o);if(a.forEach((h,u)=>{if(n.delete(o,u),u==null)return void N(!1,"No VAO for removed geometries");if(u.instances.size===h.changes.length)return this._vaoCache.deleteVao(u.vao),br(d.buffers,u),void(d.buffers.length===0&&c.length===0&&i.delete(o));const f=u.numElements,_=u.vao.byteSize/4,g=c.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),C=h.changes.reduce((O,M)=>O+r.elementCount(M.geometry.attributes),0),I=Math.min((f+g-C)*s,rt),x=I>_;I>vt&&I<_/2?(h.changes.forEach(({id:O})=>u.deleteInstance(O)),u.instances.forEach(({geometry:O})=>c.push(O)),this._vaoCache.deleteVao(u.vao),br(d.buffers,u)):x?this._applyAndRebuild(u,c,h):this._applyRemoves(u,h)}),c.length>0)for(d==null&&(d=new uo(l.origin),i.set(o,d)),d.buffers.forEach(h=>this._applyAdds(h,c));c.length>0;)d.buffers.push(this._applyAndRebuild(new lo,c,null))})}_updateDrawCommands(){this._highlightGroups.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(t=>{t.updateIfDrawCommandsDirty(this._bufferWriter.vertexBufferLayout.stride),t.hasHighlights&&hs(this._highlightGroups,t.highlightGroups),this._hasOccludees=this._hasOccludees||t.hasOccludees})})}_applyAndRebuild(e,t,r){if(r)for(const f of r.changes)e.deleteInstance(f.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,n=s/4,a=Math.floor(rt/n);let o=e.numElements;for(;t.length>0;){const f=t.pop(),_=i.elementCount(f.geometry.attributes);if(o+_>a&&o>0){t.push(f);break}o+=_;const g=new Yr(f,0,0);N(e.instances.get(f.id)==null),e.addInstance(f.id,g)}const l=o*n,c=it(l),d=i.vertexBufferLayout.createView(c.buffer);let h=0;e.resetInstanceSummary(),e.instances.forEach((f,_)=>{this._writeGeometry(f.geometry,d,h);const g=h;h+=i.elementCount(f.geometry.geometry.attributes),e.updateInstance(_,g,h),e.updateDrawState(f)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(er(l)),e.vao.vertexBuffers.get("geometry").setSubData(c,0,0,h*n),e.holes.clear();const u=e.holes.pushNew();return u.from=h,u.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,t){if(t.changes.length===0||this._bufferWriter==null)return;for(const a of t.changes){const o=a.id,l=e.instances.get(o);if(!l)continue;e.deleteInstance(o);const c=ee.back();if(c){if(c.to===l.from){c.to=l.to;continue}if(c.from===l.to){c.from=l.from;continue}}const d=ee.pushNew();d.from=l.from,d.to=l.to}Wr(ee);const r=this._bufferWriter.vertexBufferLayout.stride/4,i=ee.reduce((a,o)=>Math.max(a,o.numElements),0)*r,s=it(i);s.fill(0,0,i);const n=e.vao.vertexBuffers.get("geometry");ee.forAll(a=>n.setSubData(s,a.from*r,0,a.numElements*r)),e.holes.pushArray(ee.data,ee.length),ee.forAll((a,o)=>ee.data[o]=null),ee.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(t.length===0||this._bufferWriter==null)return;if(!co(e))return void this._applyAndRebuild(e,t,null);const r=this._bufferWriter,i=r.vertexBufferLayout.stride/4,s=e.numElements,n=t.reduce((C,I)=>C+r.elementCount(I.geometry.attributes),0),a=Math.min((s+n)*i,rt),o=4*a;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,t,null);Wr(e.holes);const l=new Array;for(const C of t){const I=r.elementCount(C.geometry.attributes),x=fo(e.holes,I);l.push(x)}const c=e.vao.vertexBuffers.get("geometry");let d=0,h=0,u=0;const f=it(a),_=r.vertexBufferLayout.createView(f.buffer);t.forEach((C,I)=>{const x=l[I];if(x==null)return;if(u!==x){const y=u-h;y>0&&c.setSubData(f,h*i,0,y*i),h=x,d=0}const O=r.elementCount(C.geometry.attributes);this._writeGeometry(C,_,d),d+=O,u=x+O;const M=new Yr(C,x,x+O);N(e.instances.get(C.id)==null),e.addInstance(C.id,M),e.drawCommandsDirty=!0});const g=u-h;g>0&&c.setSubData(f,h*i,0,g*i),ds(t,(C,I)=>l[I]==null)}_writeGeometry(e,t,r){this._bufferWriter!=null&&(ce(be,e.transformation),be[12]-=e.localOrigin.vec3[0],be[13]-=e.localOrigin.vec3[1],be[14]-=e.localOrigin.vec3[2],Pe(tt,be),cr(tt,tt),this._bufferWriter.write(be,tt,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e;if(!this.material.produces.get(r.slot)?.(t))return null;const{highlightGroupName:i,slot:s}=r,n=t===E.ShadowHighlight,a=t===E.Highlight,o=a||n,l=h=>o&&(this._highlightGroups.size===0||a&&!!i&&!h.has(i));if(l(this._highlightGroups))return null;const c=t===E.ShadowExcludeHighlight,d=!(o||c);for(const{buffers:h}of this._dataByOrigin.values())for(const u of h){if(l(u.highlightGroups))continue;const f=n?u.drawCommandsHighlights.size>0:o?i?u.drawCommandsHighlights.get(i):u.drawCommandsHighlights.size>0:((c&&u.needsMultipleCommands()?u.drawCommandsShadowHighlightRest:u.drawCommandsDefault)||null)?.length??!1,_=d&&u.drawCommandsOccludees||null;if(f||_?.length){const g=this._glMaterials.load(e.rctx,s,t),C=g?.beginSlot(r);if(C)return C}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlightGroupName:n}=i,a=r===E.Highlight;if(a&&!n)return;const o=r===E.ShadowHighlight,l=a||o,c=r===E.ShadowExcludeHighlight,d=!(l||c),h=s===W.OCCLUDER_MATERIAL||s===W.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:u}=e;u.runAppleAmdDriverHelper();const f=u.bindTechnique(t,i,this.material.parameters);for(const _ of this._dataByOrigin.values())for(const g of _.buffers){if(a&&(!g.hasHighlights||!g.drawCommandsHighlights.has(n))||o&&!g.hasHighlights)continue;const C=()=>{const y=[];for(const P of g.drawCommandsHighlights.values())y.push(P);return y},I=l&&!o?g.drawCommandsHighlights.get(n)??null:null,x=o?C():l?I?[I]:Xr:(c&&g.needsMultipleCommands()?[g.drawCommandsShadowHighlightRest]:[g.drawCommandsDefault])||Xr,O=x.some(y=>y.length>0),M=d&&g.drawCommandsOccludees||null;if(O||M?.length){if(this._drawParameters.origin=_.origin,f.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(g.vao),u.bindVAO(g.vao),O)for(const y of x)u.setPipelineState(t.getPipeline(!1,h)),y.forAll(P=>u.drawArrays(t.primitiveType,P.first,P.count));M?.length&&(u.setPipelineState(t.getPipeline(!0,h)),M.forAll(y=>u.drawArrays(t.primitiveType,y.first,y.count)))}}}get test(){}};m([v({constructOnly:!0})],Rt.prototype,"material",void 0),Rt=m([K("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],Rt);let Qr=class{constructor(e){this.origin=e,this.changes=new Array}};function fo(e,t){const r=e.find(s=>s.numElements>=t);if(r==null)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const be=L(),tt=L(),ee=new nr({allocator:e=>e||new pr,deallocator:null}),vt=65536,At=4*vt,Jr=1024,Gi=16777216,rt=Gi/4;let Et=new Float32Array(vt);function it(e){return Et.length{this._produces.set(t,r=>!!(r!==E.Highlight&&r!==E.ShadowHighlight||this._hasHighlights)&&e(r))})}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e;return!t.produces.get(i.slot)?.(r)||(r===E.Highlight||r===E.ShadowHighlight)&&!this._hasHighlights?null:this._glMaterials.load(e.rctx,i.slot,r)?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(r.size===0)return;const{bind:i}=e,s=i.slot===W.OCCLUDER_MATERIAL||i.slot===W.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const a=t.program;for(const[o,l]of r)this._drawParameters.origin=l.localOrigin,a.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(l.vao),n.bindVAO(l.vao),n.setPipelineState(t.getPipeline(!1,s)),n.drawArrays(t.primitiveType,0,l.numElements)}initializeRenderContext(e,t){this._glMaterials=new fr(this.material,e.materials);const r=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,xt(this._bufferWriter.vertexBufferLayout));this._vaoCache=r}uninitializeRenderContext(){}addRenderGeometry(e,t,r){this.removeRenderGeometry(e);const i=this._bufferWriter.vertexBufferLayout.stride,s=this._vaoCache.newVao(er(t.data.byteLength));s.vertexBuffers.get("geometry").setSubData(new Uint8Array(t.data),0,0,t.elementCount*i);const n={localOrigin:r,vao:s,numElements:t.elementCount};return this._renderGeometries.set(e,n),n}removeRenderGeometry(e){const t=this._renderGeometries.get(e);t!=null&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}};m([v({constructOnly:!0})],dt.prototype,"material",void 0),dt=m([K("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],dt);function po(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}function mo(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}function go(e,t,r){return 2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}function _o(e,t,r){return 2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r))}var Zr,S;(function(e){e[e.Default=0]="Default",e[e.Screenshot=1]="Screenshot",e[e.ObjectAndLayerID=2]="ObjectAndLayerID"})(Zr||(Zr={})),function(e){e[e.TOP=0]="TOP",e[e.RIGHT=1]="RIGHT",e[e.BOTTOM=2]="BOTTOM",e[e.LEFT=3]="LEFT"}(S||(S={}));var tr;let b=tr=class extends ye{constructor(e){super(e),this._ray=Di(),this._viewport=ae(0,0,1,1),this._padding=ae(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=X(1,1e3),this._viewDirty=!0,this._viewMatrix=L(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=L(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=L(),this._frustumDirty=!0,this._frustum=la(),this._fullViewport=le(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=A(),this._up=A(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return Y(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){ce(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),ie(A(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),ie(A(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),ie(A(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const e=Fr(le(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&Lr(e,t)?t:e}get screenPadding(){if(this.pixelRatio===1)return this._padding;const e=Fr(le(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&Lr(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[S.LEFT],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[S.BOTTOM],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[S.RIGHT]+this._padding[S.LEFT]}set fullWidth(e){this.width=e-(this._padding[S.RIGHT]+this._padding[S.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[S.TOP]+this._padding[S.BOTTOM]}set fullHeight(e){this.height=e-(this._padding[S.TOP]+this._padding[S.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[S.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[S.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){Tt(this._padding,e)||(this._viewport[0]+=e[S.LEFT]-this._padding[S.LEFT],this._viewport[1]+=e[S.BOTTOM]-this._padding[S.BOTTOM],this._viewport[2]-=e[S.RIGHT]+e[S.LEFT]-(this._padding[S.RIGHT]+this._padding[S.LEFT]),this._viewport[3]-=e[S.TOP]+e[S.BOTTOM]-(this._padding[S.TOP]+this._padding[S.BOTTOM]),Ke(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(Jt(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return Pe(L(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||L()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return go(this._fov,this.width,this.height)}set fovX(e){this._fov=po(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return _o(this._fov,this.width,this.height)}set fovY(e){this._fov=mo(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return Mi(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(Pe(this._viewInverseTransposeMatrix,this.viewMatrix),cr(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const t=2*e-1;return 2*this.near*this.far/(this.far+this.near-t*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,s=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,o=a+n,l=-r/2+this.row*s,c=l+s,d=Zn(L(),a*(1+2*this._padding[S.LEFT]/e),o*(1+2*this._padding[S.RIGHT]/e),l*(1+2*this._padding[S.BOTTOM]/t),c*(1+2*this._padding[S.TOP]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&Kn(h,d)?h:d}copyFrom(e){j(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,Ke(this._viewport,e.viewport),this.notifyChange("_viewport"),Ke(this._padding,e.padding),this.notifyChange("_padding"),Si(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||(ce(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||(ca(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(ce(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),Ke(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return new tr().copyFrom(this)}equals(e){return Ze(this.eye,e.eye)&&Ze(this.center,e.center)&&Ze(this.up,e.up)&&Tt(this._viewport,e.viewport)&&Tt(this._padding,e.padding)&&en(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||Nr(e.screenPadding,this.screenPadding)>=t||Nr(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;Dr(B,e.eye,e.center),Dr(Mt,this.eye,this.center);const r=qe(B,Mt),i=Pr(B),s=Pr(Mt),n=5e-4;return r*r>=(1-1e-10)*i*s&&na(e.eye,this.eye)2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Dt),t)}unprojectFromRenderScreen(e,t){if(Jt(st,this.projectionMatrix,this.viewMatrix),!Pe(st,st))return null;const r=this.fullViewport;return T[0]=2*(e[0]-r[0])/r[2]-1,T[1]=2*(e[1]-r[1])/r[3]-1,T[2]=2*e[2]-1,T[3]=1,He(T,T,st),T[3]===0?null:(t[0]=T[0]/T[3],t[1]=T[1]/T[3],t[2]=T[2]/T[3],t)}constrainWindowSize(e,t,r,i){const s=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(s-r/2,0),o=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(s-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-s-r/2,0),h=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(o),Math.round(d),Math.round(h)]}computeUp(e){e===ne.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){Y(B,this.center,this.eye);const e=me(this.center);e<1?(ie(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(qe(B,this.center))>.9999*me(B)*e||($e(this._up,B,this.center),$e(this._up,this._up,B),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){aa(B,this.eye,this.center),Math.abs(B[2])<=.9999&&(Z(B,B,B[2]),ie(this._up,-B[0],-B[1],1-B[2]),he(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){typeof e[0]=="number"&&isFinite(e[0])&&typeof e[1]=="number"&&isFinite(e[1])&&typeof e[2]=="number"&&isFinite(e[2])?Ze(e,t)||(j(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):ps.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(ha(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(ea(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};m([v()],b.prototype,"_viewport",void 0),m([v()],b.prototype,"_padding",void 0),m([v()],b.prototype,"_fov",void 0),m([v()],b.prototype,"_nearFar",void 0),m([v()],b.prototype,"_viewDirty",void 0),m([v()],b.prototype,"_viewMatrix",void 0),m([v()],b.prototype,"_pixelRatio",void 0),m([v()],b.prototype,"pixelRatio",null),m([v()],b.prototype,"row",void 0),m([v()],b.prototype,"column",void 0),m([v()],b.prototype,"_rows",void 0),m([v()],b.prototype,"rows",null),m([v()],b.prototype,"_columns",void 0),m([v()],b.prototype,"columns",null),m([v()],b.prototype,"eye",null),m([v()],b.prototype,"center",null),m([v()],b.prototype,"_center",void 0),m([v()],b.prototype,"up",null),m([v()],b.prototype,"_up",void 0),m([v()],b.prototype,"viewMatrix",null),m([v({readOnly:!0})],b.prototype,"viewForward",null),m([v({readOnly:!0})],b.prototype,"viewUp",null),m([v({readOnly:!0})],b.prototype,"viewRight",null),m([v({readOnly:!0})],b.prototype,"nearFar",null),m([v()],b.prototype,"near",null),m([v()],b.prototype,"far",null),m([v()],b.prototype,"viewport",null),m([v({readOnly:!0})],b.prototype,"screenViewport",null),m([v({readOnly:!0})],b.prototype,"screenPadding",null),m([v()],b.prototype,"x",null),m([v()],b.prototype,"y",null),m([v()],b.prototype,"width",null),m([v()],b.prototype,"height",null),m([v()],b.prototype,"fullWidth",null),m([v()],b.prototype,"fullHeight",null),m([v({readOnly:!0})],b.prototype,"_aspect",null),m([v()],b.prototype,"padding",null),m([v({readOnly:!0})],b.prototype,"projectionMatrix",null),m([v({readOnly:!0})],b.prototype,"inverseProjectionMatrix",null),m([v()],b.prototype,"fov",null),m([v()],b.prototype,"fovX",null),m([v()],b.prototype,"fovY",null),m([v()],b.prototype,"viewInverseTransposeMatrix",null),m([v({readOnly:!0})],b.prototype,"_projectionMatrixInternal",null),m([v()],b.prototype,"relativeElevation",void 0),b=tr=m([K("esri.views.3d.webgl.RenderCamera")],b);const vo=b,T=le(),st=L(),B=A(),Mt=A(),Dt=ms();let yo=class{constructor(e,t,r){this._elementSize=t,this._buffer=Fi.createVertex(e,Li.STATIC_DRAW),this.resize(r)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+this._buffer.usedMemory}copyRange(e,t,r,i=0){const s=new Uint8Array(this.array,e*this.elementSize,(t-e)*this.elementSize);new Uint8Array(r.array,i*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,t){const r=e*this._elementSize,i=t*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),r,r,i)}resize(e){const t=e*this._elementSize,r=new ArrayBuffer(t);this._array&&(e>=this._capacity?new Uint8Array(r).set(new Uint8Array(this._array)):new Uint8Array(r).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=r,this._buffer.setSize(t),this._capacity=e}},wo=class{constructor(e){this.modelOriginHi=e.getField(p.INSTANCEMODELORIGINHI,jr),this.modelOriginLo=e.getField(p.INSTANCEMODELORIGINLO,jr),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.featureAttribute=e.getField(p.INSTANCEFEATUREATTRIBUTE,Pi),this.color=e.getField(p.INSTANCECOLOR,ke),this.objectAndLayerIdColor=e.getField(p.INSTANCEOBJECTANDLAYERIDCOLOR,ke)}},bo=class{constructor(e,t){this._rctx=e,this._instanceBufferLayout=t,this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,t=this._tailIndex;return e>=t?e-t:e+this._capacity-t}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){return this._buffer?.usedMemory??0}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){N(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){N(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(yt,Math.floor(this._capacity*wi));this._resize(e)}_shrink(){const e=Math.max(yt,Math.floor(this._capacity*Rs));this._resize(e)}_resize(e){if(N(this._updating,"not updating"),e===this._capacity)return;const t=new yo(this._rctx,this._instanceBufferLayout.stride,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const r=this.size,i=this._compactInstances(t);N(i===r,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=i,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=t,this._view=new wo(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const t=this._headIndex,r=this._tailIndex;return rt?(this._buffer.copyRange(r,this._capacity,e),t>0&&this._buffer.copyRange(0,t,e,this._capacity-r),t+(this._capacity-r)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,t){et&&(t>0&&this._buffer.transferRange(0,t),this._buffer.transferRange(e,this._capacity))}};const yt=64;var R;function xo(e){let t=hr().mat4f64(p.LOCALTRANSFORM).mat4f64(p.GLOBALTRANSFORM).vec4f64(p.BOUNDINGSPHERE).vec3f64(p.MODELORIGIN).mat3f(p.INSTANCEMODEL).mat3f(p.INSTANCEMODELNORMAL).vec2f(p.MODELSCALEFACTORS);return e.includes(p.FEATUREATTRIBUTE)&&(t=t.vec4f(p.FEATUREATTRIBUTE)),e.includes(p.COLOR)&&(t=t.vec4u8(p.COLOR)),e.includes(p.OBJECTANDLAYERIDCOLOR)&&(t=t.vec4u8(p.OBJECTANDLAYERIDCOLOR)),t=t.u8(p.STATE).u8(p.LODLEVEL),t}(function(e){e[e.ALLOCATED=1]="ALLOCATED",e[e.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",e[e.VISIBLE=4]="VISIBLE",e[e.HIGHLIGHT=8]="HIGHLIGHT",e[e.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",e[e.REMOVE=32]="REMOVE",e[e.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",e[e.ACTIVE=18]="ACTIVE"})(R||(R={}));let Kr=class{constructor(e){this.localTransform=e.getField(p.LOCALTRANSFORM,Gr),this.globalTransform=e.getField(p.GLOBALTRANSFORM,Gr),this.modelOrigin=e.getField(p.MODELORIGIN,Ia),this.model=e.getField(p.INSTANCEMODEL,mt),this.modelNormal=e.getField(p.INSTANCEMODELNORMAL,mt),this.modelScaleFactors=e.getField(p.MODELSCALEFACTORS,Ca),this.boundingSphere=e.getField(p.BOUNDINGSPHERE,Ta),this.featureAttribute=e.getField(p.FEATUREATTRIBUTE,Pi),this.color=e.getField(p.COLOR,ke),this.objectAndLayerIdColor=e.getField(p.OBJECTANDLAYERIDCOLOR,ke),this.state=e.getField(p.STATE,Vr),this.lodLevel=e.getField(p.LODLEVEL,Vr)}},Ee=class extends ye{constructor(e,t){super(e),this.events=new ar,this._capacity=0,this._size=0,this._next=0,this._highlightGroupMap=new Map,this._highlightGroupMapPrev=new Map,this._layout=xo(t),this._capacity=yt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Kr(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,R.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;N(e>=0&&e=0&&eda(this._instanceData.view.boundingSphere.getVec(r,this._tmpSphere)),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=t,this._tmpSphere=ua(),this._tmpMat4=L()}addInstance(e){const t=this._instanceData.view.boundingSphere,r=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);_e(fa(this._tmpSphere),this._boundingSphere.center,r),this._tmpSphere[3]=this._boundingSphere.radius*va(r),t.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},To=class{constructor(e,t){this._worldSpaceRadius=e,this._minScreenSpaceRadii=t}selectLevel(e,t,r){const i=r.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*t/i;let n=0;for(let a=1;a=this._minScreenSpaceRadii[a]&&(n=a);return n}},So=class{constructor(e){this.layerUid=e}},Oo=class extends So{constructor(e,t){super(e),this.graphicUid=t}};function Ro(e){return e?.dist!=null}let Ao=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(Z(nt,this.ray.direction,this.dist),me(nt)):null}getIntersectionPoint(e){return!!Ro(this)&&(Z(nt,this.ray.direction,this.dist),ht(e,this.ray.origin,nt),!0)}getTransformedNormal(e){return j(Be,this.normal),Be[3]=0,He(Be,Be,this.transformation),j(e,Be),he(e,e)}constructor(e){this.intersector=Fe.OBJECT,this.normal=A(),this.transformation=L(),this._ray=Di(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=Fe.OBJECT,zr(e,this._ray)}set(e,t,r,i,s,n,a){this.intersector=e,this.dist=r,j(this.normal,i??Bs),ce(this.transformation,s??sa),this.target=t,this.drapedLayerOrder=n,this.drapedLayerGraphicOrder=a}copy(e){zr(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,j(this.normal,e.normal),ce(this.transformation,e.transformation)}};function Eo(e){return new Ao(e)}const nt=A(),Be=le();let Mo=class extends Aa{},Do=class extends Oo{constructor(e,t,r,i,s,n){super(e,t),this.layerUid=e,this.graphicUid=t,this.geometryId=r,this.triangleNr=i,this.baseBoundingSphere=s,this.numLodLevels=n}};function Po(e,t,r,i=null){const s=e.createBufferWriter(),n=s.vertexBufferLayout,a=s.elementCount(t),o=n.createBuffer(a);return s.write(null,null,t,i,o,0),{material:e,vertexBufferLayout:n,buffer:o.buffer,elementCount:a,boundingInfo:r}}let Fo=class{constructor(e,t){const r=e.renderContext.rctx,i=t.geometry;let s=null;s=i instanceof pt?Po(i.material,i.attributes,i.boundingInfo):i;const n=s.material;this._materials=e.materials,n.setParameters({instancedDoublePrecision:!0}),this.geometry=i,this.material=n,this.glMaterials=new fr(n,this._materials),this.vertexBufferLayout=s.vertexBufferLayout,this.vbo=Fi.createVertex(r,Li.STATIC_DRAW,s.buffer),this.vao=new Mo(r,Qt,new Map([["geometry",xt(s.vertexBufferLayout)]]),new Map([["geometry",this.vbo]])),this.vertexCount=s.elementCount}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,t,r,i,s,n,a,o){if(!(this.geometry instanceof pt))return;const l=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,r,i,(c,d,h,u,f)=>{if(c>=0){if(t!=null&&!t(e.rayBegin,e.rayEnd,c))return;const _=new Do(n.layerUid,n.graphicUid(s),l,h,a,o);if((e.results.min.drapedLayerOrder==null||f>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||c=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||c>e.results.max.dist)&&e.results.max.set(Fe.LOD,_,c,d,e.transform.transform,f),e.options.store===Br.ALL){const g=Eo(e.results.min.ray);g.set(Fe.LOD,_,c,d,e.transform.transform,f),e.results.all.push(g)}}})}},Lo=class Vi{static async create(t,r,i){const s=await Promise.allSettled(r.components.map(a=>t.controller.schedule(()=>new Fo(t,a),i))),n=s.map(a=>a.status==="fulfilled"?a.value:null).filter(bi);if(xi(i)||n.length!==s.length){n.forEach(a=>a.destroy()),ve(i);for(const a of s)if(a.status==="rejected")throw a.reason}return new Vi(r.minScreenSpaceRadius,n)}constructor(t,r){this.minScreenSpaceRadius=t,this.components=r}destroy(){this.components.forEach(t=>t.destroy())}intersect(t,r,i,s,n,a,o){this.components.forEach(l=>l.intersect(t,r,i,s,n,a,this.boundingSphere,o))}get boundingBox(){if(this._boundingBox==null){const t=As();this.components.forEach(r=>{r.boundingInfo!=null&&(xr(t,r.boundingInfo.bbMin),xr(t,r.boundingInfo.bbMax))}),this._boundingBox=t}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const t=this.boundingBox,r=A();Es(t,r),this._boundingSphere={center:r,radius:.5*Ms(t)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((t,r)=>t+r.triangleCount,0)}};function No(e,t,r,i,s){at[0]=e.get(t,0),at[1]=e.get(t,1),at[2]=e.get(t,2),Ea(at,ue,3),r.set(s,0,ue[0]),i.set(s,0,ue[1]),r.set(s,1,ue[2]),i.set(s,1,ue[3]),r.set(s,2,ue[4]),i.set(s,2,ue[5])}const at=A(),ue=new Float32Array(6),zo=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(i=>i.minScreenSpaceRadius);return new To(t,r)};let Q=class extends no{constructor(e,t){super(e),this.type=Fe.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new vo,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[W.OPAQUE_MATERIAL,r=>this._produces(r)],[W.TRANSPARENT_MATERIAL,r=>!!this._hasTransparentLevels()&&this._produces(r)]]),this._instanceData=new Ee({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(Ma.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=Go(this.optionalFields),this._glInstanceBufferLayout=xt(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)e.push(t[1]);return e}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get hasEmissions(){return this.baseMaterial.hasEmissions}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((r,i)=>r+i.usedMemory,e),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((r,i)=>{const s=this._allRenderInstanceData[0][i].size+this._allRenderInstanceData[1][i].size,n=r.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((r,i)=>r+i.renderedInstances,0),renderedTriangles:t.reduce((r,i)=>r+i.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(r=>{e.push(new bo(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,t){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(s=>Lo.create(e,s,t))),i=r.map(s=>s.status==="fulfilled"?s.value:null).filter(bi);if(xi(t)||i.length!==r.length){i.forEach(s=>s.destroy()),ve(t);for(const s of r)if(s.status==="rejected")throw s.reason}this._levels=i,this._levelSelector=zo(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(t=>t.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(t=>t.material.produces.get(W.TRANSPARENT_MATERIAL)?.(E.Color)))}hasHighlights(){return gs(this._highlightRenderInstanceDataMap,e=>e.some(t=>t.size>0))}_produces(e){return e!==E.Highlight&&e!==E.ShadowHighlight||this.hasHighlights()}prepareRender(e){if(!Wt.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(Da),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,i=this.levels;return t.forEach(s=>i.forEach(({components:n},a)=>n.forEach(o=>r.push(this._beginComponent(e,s[a],o))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||t==null)return;let i=0;e.rctx.bindVAO();const s=this.levels;r.forEach(n=>s.forEach(({components:a},o)=>a.forEach(l=>this._renderComponent(e,t[i++],n[o],l,o))))}_getInstanceDatas(e){const{output:t,bind:r}=e,i=t===E.Highlight,s=!i&&t!==E.ShadowHighlight,n=t!==E.ShadowExcludeHighlight;if(s)return n?this._allRenderInstanceData:[this._defaultRenderInstanceData];if(n){if(i){const{highlightGroupName:o}=r;if(!o)return null;const l=this._highlightRenderInstanceDataMap.get(o);return l?[l]:null}const a=[];for(const o of this._highlightRenderInstanceDataMap)a.push(o[1]);return a}return null}intersect(e,t,r,i){if(!this.baseMaterial.visible||this._octree==null)return;const s=A();Y(s,i,r);const n=a=>{this._instanceData.getCombinedModelTransform(a,ii),e.transform.set(ii),_e(si,r,e.transform.inverse),_e(ni,i,e.transform.inverse);const o=this._instanceData.getState(a),l=this._instanceData.getLodLevel(a),c=this._levels.length;N(!!(o&R.ACTIVE),"invalid instance state"),N(l>=0&&le.forEach(t=>t.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:i}=this;this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.beginUpdate()));const s=this._instanceData,n=s.view;let a=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let d=0;d{const g=this._highlightRenderInstanceDataMap.get(_);if(!g)throw new Ut("Internal error in lodRenderer");g[f].freeTail()}),h&R.REMOVE)s.freeInstance(l);else if(h&R.VISIBLE){let _=0;t&&(n.modelOrigin.getVec(l,ri),_=i.selectLevel(ri,s.getCombinedMedianScaleFactor(l),r)),u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),_>=0&&(h&R.HIGHLIGHT?(s.foreachHighlightGroup(l,g=>{let C=this._highlightRenderInstanceDataMap.get(g);if(C||(C=this._createRenderInstanceDataArray(),C.forEach(I=>I.beginUpdate()),this._highlightRenderInstanceDataMap.set(g,C)),_>=C.length)throw new Ut(`LodRenderer internal error - missing lodLevel ${_}`);ti(C[_],n,l)}),u|=R.HIGHLIGHT_ACTIVE):(ti(this._defaultRenderInstanceData[_],n,l),u|=R.DEFAULT_ACTIVE)),n.state.set(l,u),n.lodLevel.set(l,_)}else u=h&~(R.ACTIVE|R.TRANSFORM_CHANGED),n.state.set(l,u);if(this._octreeCached!=null){const _=!!(h&R.ACTIVE),g=!!(u&R.ACTIVE);!_&&g?this._octreeCached.addInstance(l):_&&!g?this._octreeCached.removeInstance(l):_&&g&&h&R.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach(d=>d.forEach(h=>h.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){return t.size===0?null:r.glMaterials.load(e.rctx,e.bind.slot,e.output)?.beginSlot(e.bind)}_renderComponent(e,t,r,i,s){if(!t)return;const{bind:n,rctx:a}=e;a.runAppleAmdDriverHelper();const o=a.bindTechnique(t,n,i.material.parameters,Vo);a.bindVAO(i.vao),t.ensureAttributeLocations(i.vao),Wt.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===E.Color&&(o.setUniform4fv("externalColor",ai[Math.min(s,ai.length-1)]),o.setUniform1i("colorMixMode",cn.replace));const l=r.capacity,c=r.headIndex,d=r.tailIndex,h=r.firstIndex,u=this._glInstanceBufferLayout,f=(_,g)=>{Pa(a,Qt,r.buffer,u,_),a.drawArraysInstanced(t.primitiveType,0,i.vertexCount,g-_),Fa(a,Qt,r.buffer,u)};i.material.parameters.transparent&&h!=null?c>d?(N(h>=d&&h<=c,"invalid firstIndex"),f(h,c),f(d,h)):c=0&&h<=c,"invalid firstIndex"),f(h,c),f(d,l),f(0,h)):(N(h>=d&&h<=l,"invalid firstIndex"),f(h,l),f(0,c),f(d,h))):c>d?f(d,c):cs.geometry));this.numVertices=i.reduce((s,n)=>s+Ho(n),0)}},$o=class{constructor(e){this.levels=e,this.levels.sort((t,r)=>t.minScreenSpaceRadius===r.minScreenSpaceRadius?t.numVertices-r.numVertices:t.minScreenSpaceRadius-r.minScreenSpaceRadius)}};function qo(e){const t=[];return e.levels.forEach(r=>r.components.forEach(i=>t.push(i.geometry.material))),or(t)}function ko(e){const t=new Array;return e.levels.forEach(r=>r.components.forEach(i=>{i.textures!=null&&t.push(...i.textures)})),or(t)}let rr=class{constructor(e){this._optionalFields=new Array,this._instanceIndexToFeatureId=new Map,this._featureIdToInstanceIndex=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}async doLoad(e,t,r){vs("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(p.OBJECTANDLAYERIDCOLOR);const i=Wo(l=>t(l),e),s=this.view._stage,n=qo(i);s.addMany(n),this._addDisposeResource(()=>s.removeMany(n));const a=ko(i);s.addMany(a),this._addDisposeResource(()=>{a.forEach(l=>l.unload()),s.removeMany(a)}),await Promise.all(a.map(l=>this.view._stage.schedule(()=>l.load(s.renderView.renderingContext),r))),ve(r);const o=await this._createLodRenderer(i,r);this._lodRendererResources={lodRenderer:o,materials:n,textures:a}}addInstances(e){const t=this._lodRendererResources;if(t==null)return;const{featureIds:r,localTransforms:i,globalTransforms:s}=e,n=t.lodRenderer;if(n==null)return;const a=n.instanceData,o=r.length;for(let l=0;l1,notifyGraphicGeometryChanged:n=>1,notifyGraphicVisibilityChanged:n=>1},s=new Q({symbol:e,optionalFields:this._optionalFields,metadata:i,shaderTransformation:null},this.scheduler);return s.slicePlaneEnabled=!1,this._addDisposeResource(()=>{r.removeRenderPlugin(s),s.destroy()}),await r.addRenderPlugin(s,t),s}};function Wo(e,t){const r=t.levels.map(i=>{const s=i.components.map(n=>{const a=e(n.materialId);if(!Yo(a))throw new Error("LodRenderer only supports DefaultMaterial");const o=a.createBufferWriter(),l={material:a,vertexBufferLayout:o.vertexBufferLayout,buffer:n.renderGeometryBuffer.data,elementCount:n.renderGeometryBuffer.elementCount,boundingInfo:n.boundingInfo};return new jo(l)});return new Uo(s,i.minScreenSpaceRadius)});return new $o(r)}function Yo(e){return e!=null&&"materialType"in e&&e.materialType==="default"}rr=m([K("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],rr);const ji=128,De=.5;function Qo(e){return e==="cross"||e==="x"}function Jo(e,t=ji,r=t*De,i=0){const s=Xo(e,t,r,i);return new xn(s,{mipmap:!1,wrap:{s:Hr.CLAMP_TO_EDGE,t:Hr.CLAMP_TO_EDGE},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0})}function Xo(e,t=ji,r=t*De,i=0){switch(e){case"circle":default:return Zo(t,r);case"square":return Ko(t,r);case"cross":return tl(t,r,i);case"x":return rl(t,r,i);case"kite":return el(t,r);case"triangle":return il(t,r);case"arrow":return sl(t,r)}}function Zo(e,t){const r=e/2-.5;return Qe(e,$i(r,r,t/2))}function Ko(e,t){return Hi(e,t,!1)}function el(e,t){return Hi(e,t,!0)}function tl(e,t,r=0){return Ui(e,t,!1,r)}function rl(e,t,r=0){return Ui(e,t,!0,r)}function il(e,t){return Qe(e,qi(e/2,t,t/2))}function sl(e,t){const r=t,i=t/2,s=e/2,n=.8*r,a=$i(s,(e-t)/2-n,Math.sqrt(n*n+i*i)),o=qi(s,r,i);return Qe(e,(l,c)=>Math.max(o(l,c),-a(l,c)))}function Hi(e,t,r){return r&&(t/=Math.SQRT2),Qe(e,(i,s)=>{let n=i-.5*e+.25,a=.5*e-s-.75;if(r){const o=(n+a)/Math.SQRT2;a=(a-n)/Math.SQRT2,n=o}return Math.max(Math.abs(n),Math.abs(a))-.5*t})}function Ui(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const s=.5*t;return Qe(e,(n,a)=>{let o,l=n-.5*e,c=.5*e-a-1;if(r){const d=(l+c)/Math.SQRT2;c=(c-l)/Math.SQRT2,l=d}return l=Math.abs(l),c=Math.abs(c),o=l>c?l>s?Math.sqrt((l-s)*(l-s)+c*c):c:c>s?Math.sqrt(l*l+(c-s)*(c-s)):l,o-=i/2,o})}function $i(e,t,r){return(i,s)=>{const n=i-e,a=s-t;return Math.sqrt(n*n+a*a)-r}}function qi(e,t,r){const i=Math.sqrt(t*t+r*r);return(s,n)=>{const a=Math.abs(s-e)-r,o=n-e+t/2+.75,l=(t*a+r*o)/i,c=-o;return Math.max(l,c)}}function Qe(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i=16}function al(e){return Array.isArray(e)&&e.length>=16}function ol(e){return nl(e)||al(e)}const ki=.5;function ll(e,t){e.include(Oi),e.attributes.add(p.POSITION,"vec3"),e.attributes.add(p.NORMAL,"vec3"),e.attributes.add(p.CENTEROFFSETANDDISTANCE,"vec4");const r=e.vertex;In(r,t),Cn(r,t),r.uniforms.add(new Me("viewport",(i,s)=>s.camera.fullViewport),new ge("polygonOffset",i=>i.shaderPolygonOffset),new ge("cameraGroundRelative",(i,s)=>s.camera.aboveGround?1:-1)),t.hasVerticalOffset&&Tn(r),r.constants.add("smallOffsetAngle","float",.984807753012208),r.code.add(w`struct ProjectHUDAux { -vec3 posModel; -vec3 posView; -vec3 vnormal; -float distanceToCamera; -float absCosAngle; -};`),r.code.add(w` - float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { - float pointGroundSign = ${t.terrainDepthTest?w.float(0):w`sign(pointGroundDistance)`}; - if (pointGroundSign == 0.0) { - pointGroundSign = cameraGroundRelative; - } - - // cameraGroundRelative is -1 if camera is below ground, 1 if above ground - // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise - float groundRelative = cameraGroundRelative * pointGroundSign; - - // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is - // dropped is instead introduced using the ground-relative position of the symbol and the camera - if (polygonOffset > .0) { - float cosAlpha = clamp(absCosAngle, 0.01, 1.0); - float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; - float factor = (1.0 - tanAlpha / viewport[2]); - - // same side of the terrain - if (groundRelative > 0.0) { - posView *= factor; - } - // opposite sides of the terrain - else { - posView /= factor; - } - } - - return groundRelative; - } - `),t.draped&&!t.hasVerticalOffset||Sn(r),t.draped||(r.uniforms.add(new ge("perDistancePixelRatio",(i,s)=>Math.tan(s.camera.fovY/2)/(s.camera.fullViewport[2]/2))),r.code.add(w` - void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { - float distanceToCamera = length(posView); - - // Compute offset in world units for a half pixel shift - float pixelOffset = distanceToCamera * perDistancePixelRatio * ${w.float(ki)}; - - // Apply offset along normal in the direction away from the ground surface - vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; - - // Apply the same offset also on the view space position - vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; - - posModel += modelOffset; - posView += viewOffset; - } - `)),t.screenCenterOffsetUnitsEnabled&&Ri(r),t.hasScreenSizePerspective&&Ai(r),r.code.add(w` - vec4 projectPositionHUD(out ProjectHUDAux aux) { - vec3 centerOffset = centerOffsetAndDistance.xyz; - float pointGroundDistance = centerOffsetAndDistance.w; - - aux.posModel = position; - aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; - aux.vnormal = normal; - ${t.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} - - // Screen sized offset in world space, used for example for line callouts - // Note: keep this implementation in sync with the CPU implementation, see - // - MaterialUtil.verticalOffsetAtDistance - // - HUDMaterial.applyVerticalOffsetTransformation - - aux.distanceToCamera = length(aux.posView); - - vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); - float cosAngle = dot(aux.vnormal, viewDirObjSpace); - - aux.absCosAngle = abs(cosAngle); - - ${t.hasScreenSizePerspective&&(t.hasVerticalOffset||t.screenCenterOffsetUnitsEnabled)?"vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} - - ${t.hasVerticalOffset?t.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} - - ${t.hasVerticalOffset?w` - float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); - vec3 modelOffset = aux.vnormal * worldOffset; - aux.posModel += modelOffset; - vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; - aux.posView += viewOffset; - // Since we elevate the object, we need to take that into account - // in the distance to ground - pointGroundDistance += worldOffset;`:""} - - float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); - - ${t.screenCenterOffsetUnitsEnabled?"":w` - // Apply x/y in view space, but z in screen space (i.e. along posView direction) - aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); - - // Same material all have same z != 0.0 condition so should not lead to - // branch fragmentation and will save a normalization if it's not needed - if (centerOffset.z != 0.0) { - aux.posView -= normalize(aux.posView) * centerOffset.z; - } - `} - - vec4 posProj = proj * vec4(aux.posView, 1.0); - - ${t.screenCenterOffsetUnitsEnabled?t.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} - - ${t.screenCenterOffsetUnitsEnabled?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} - - // constant part of polygon offset emulation - posProj.z -= groundRelative * polygonOffset * posProj.w; - return posProj; - } - `)}let cl=class{constructor(){this.factor=new oi,this.factorAlignment=new oi}},oi=class{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}};function mr(e){e.uniforms.add(new On("alignPixelEnabled",(t,r)=>r.alignPixelEnabled)),e.code.add(w`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { -if (!alignPixelEnabled) -return clipCoord; -vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; -vec2 pixelSz = vec2(1.0) / widthHeight; -vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; -vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; -return vec4(result, clipCoord.zw); -}`),e.code.add(w`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { -if (!alignPixelEnabled) -return clipCoord; -vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; -vec2 pixelSz = vec2(1.0) / widthHeight; -vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; -vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; -return vec4(result, clipCoord.zw); -}`)}function hl(e,t){const{vertex:r,fragment:i}=e;e.include(Rn,t),r.include(mr),t.terrainDepthTest&&e.varyings.add("depth","float"),r.main.add(w` - vec4 posProjCenter; - if (dot(position, position) > 0.0) { - // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color - ProjectHUDAux projectAux; - vec4 posProj = projectPositionHUD(projectAux); - posProjCenter = alignToPixelCenter(posProj, viewport.zw); - - ${t.terrainDepthTest?w`depth = projectAux.posView.z;`:""} - vec3 vpos = projectAux.posModel; - if (rejectBySlice(vpos)) { - // Project out of clip space - posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); - } - - } else { - // Project out of clip space - posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); - } - - gl_Position = posProjCenter; - gl_PointSize = 1.0; - `),i.main.add(w`fragColor = vec4(1); -if(terrainDepthTest(depth)) { -fragColor.g = 0.5; -}`)}var wt;(function(e){e[e.Occluded=0]="Occluded",e[e.NotOccluded=1]="NotOccluded",e[e.Both=2]="Both",e[e.COUNT=3]="COUNT"})(wt||(wt={}));function dl(e){e.vertex.uniforms.add(new ge("renderTransparentlyOccludedHUD",(t,r)=>r.hudRenderStyle===wt.Occluded?1:r.hudRenderStyle===wt.NotOccluded?0:.75),new Me("viewport",(t,r)=>r.camera.fullViewport),new Yt("hudVisibilityTexture",(t,r)=>r.hudVisibility?.getTexture())),e.vertex.include(mr),e.vertex.code.add(w`bool testHUDVisibility(vec4 posProj) { -vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); -vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); -if (renderTransparentlyOccludedHUD > 0.5) { -return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; -} -return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; -}`)}const gr={occludedFadeFactor:.6};function Wi(e){const t=new hn,r=e.signedDistanceFieldEnabled;if(t.include(ll,e),t.include(dn,e),e.occlusionPass)return t.include(hl,e),t;const{vertex:i,fragment:s}=t;t.include(Oi),t.include(un,e),t.include(fn,e),t.include(dl),s.include(qa),s.include(pn),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2"),t.varyings.add("voccluded","float"),i.uniforms.add(new Me("viewport",(d,h)=>h.camera.fullViewport),new Sr("screenOffset",(d,h)=>ft(Yi,2*d.screenOffset[0]*h.camera.pixelRatio,2*d.screenOffset[1]*h.camera.pixelRatio)),new Sr("anchorPosition",d=>We(d)),new Me("materialColor",d=>d.color),new ge("materialRotation",d=>d.rotation)),Ri(i),r&&(i.uniforms.add(new Me("outlineColor",d=>d.outlineColor)),s.uniforms.add(new Me("outlineColor",d=>li(d)?d.outlineColor:Xs),new ge("outlineSize",d=>li(d)?d.outlineSize:0))),e.horizonCullingEnabled&&i.uniforms.add(new ka("pointDistanceSphere",(d,h)=>{const u=h.camera.eye,f=d.origin;return ae(f[0]-u[0],f[1]-u[1],f[2]-u[2],ys.radius)})),e.pixelSnappingEnabled&&i.include(mr),e.hasScreenSizePerspective&&(mn(i),Ai(i)),e.debugDrawLabelBorder&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add(p.UV0,"vec2"),t.attributes.add(p.COLOR,"vec4"),t.attributes.add(p.SIZE,"vec2"),t.attributes.add(p.ROTATION,"float"),t.attributes.add(p.FEATUREATTRIBUTE,"vec4"),i.code.add(e.horizonCullingEnabled?w`bool behindHorizon(vec3 posModel) { -vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin; -vec3 camToPos = pointDistanceSphere.xyz + posModel; -float earthRadius = pointDistanceSphere.w; -float a = dot(camToPos, camToPos); -float b = dot(camToPos, camToEarthCenter); -float c = dot(camToEarthCenter, camToEarthCenter) - earthRadius * earthRadius; -return b > 0.0 && b < a && b * b > a * c; -}`:w`bool behindHorizon(vec3 posModel) { return false; }`),i.main.add(w` - ProjectHUDAux projectAux; - vec4 posProj = projectPositionHUD(projectAux); - forwardObjectAndLayerIdColor(); - - if (rejectBySlice(projectAux.posModel)) { - // Project outside of clip plane - gl_Position = vec4(1e038, 1e038, 1e038, 1.0); - return; - } - - if (behindHorizon(projectAux.posModel)) { - // Project outside of clip plane - gl_Position = vec4(1e038, 1e038, 1e038, 1.0); - return; - } - - vec2 inputSize; - ${z(e.hasScreenSizePerspective,w` - inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); - vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,w` - inputSize = size; - vec2 screenOffsetScaled = screenOffset;`)} - ${z(e.vvSize,w`inputSize *= vvScale(featureAttribute).xx;`)} - - vec2 combinedSize = inputSize * pixelRatio; - vec4 quadOffset = vec4(0.0); - bool visible = testHUDVisibility(posProj); - voccluded = visible ? 0.0 : 1.0; - `);const n=w` - vec2 uv01 = floor(uv0); - vec2 uv = uv0 - uv01; - quadOffset.xy = (uv01 - anchorPosition) * 2.0 * combinedSize; - - ${z(e.hasRotation,w` - float angle = radians(materialRotation + rotation); - float cosAngle = cos(angle); - float sinAngle = sin(angle); - mat2 rotate = mat2(cosAngle, -sinAngle, sinAngle, cosAngle); - - quadOffset.xy = rotate * quadOffset.xy; - `)} - - quadOffset.xy = (quadOffset.xy + screenOffsetScaled) / viewport.zw * posProj.w; - `,a=e.pixelSnappingEnabled?r?w`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:w`posProj += quadOffset; -if (inputSize.x == size.x) { -posProj = alignToPixelOrigin(posProj, viewport.zw); -}`:w`posProj += quadOffset;`;i.main.add(w` - ${z(e.occlusionTestEnabled,w` - if (!visible) { - vtc = vec2(0.0); - ${z(e.debugDrawLabelBorder,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")} - return; - }`)} - ${n} - ${e.vvColor?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} - - ${z(e.output===E.ObjectAndLayerIdColor,w`vcolor.a = 1.0;`)} - - bool alphaDiscard = vcolor.a < ${w.float(oe)}; - ${z(r,`alphaDiscard = alphaDiscard && outlineColor.a < ${w.float(oe)};`)} - if (alphaDiscard) { - // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent - gl_Position = vec4(1e38, 1e38, 1e38, 1.0); - return; - } else { - ${a} - gl_Position = posProj; - } - - vtc = uv; - - ${z(e.debugDrawLabelBorder,w`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)} - vsize = inputSize; - `),s.uniforms.add(new Yt("tex",d=>d.texture)),e.occludedFragmentFade&&(s.uniforms.add(new Yt("depthMap",(d,h)=>h.mainDepth)),s.uniforms.add(new ge("fadeFactor",()=>gr.occludedFadeFactor)));const o=e.debugDrawLabelBorder?w`(isBorder > 0.0 ? 0.0 : ${w.float(oe)})`:w.float(oe),l=e.output===E.Highlight,c=w` - ${z(e.debugDrawLabelBorder,w`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)} - - ${z(e.sampleSignedDistanceFieldTexelCenter,w` - float txSize = float(textureSize(tex, 0).x); - float texelSize = 1.0 / txSize; - - // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel - vec2 scaleFactor = (vsize - txSize) * texelSize; - vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor;`,w`vec2 samplePos = vtc;`)} - - ${r?w` - vec4 fillPixelColor = vcolor; - - // Get distance and map it into [-0.5, 0.5] - float d = rgba2float(texture(tex, samplePos)) - 0.5; - - // Distance in output units (i.e. pixels) - float dist = d * vsize.x; - - // Create smooth transition from the icon into its outline - float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); - fillPixelColor.a *= fillAlphaFactor; - - if (outlineSize > 0.25) { - vec4 outlinePixelColor = outlineColor; - float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); - - // Create smooth transition around outline - float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); - outlinePixelColor.a *= outlineAlphaFactor; - - if ( - outlineAlphaFactor + fillAlphaFactor < ${o} || - fillPixelColor.a + outlinePixelColor.a < ${w.float(oe)} - ) { - discard; - } - - // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) - float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); - vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + - vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); - - ${z(!l,w`fragColor = vec4(compositeColor, compositeAlpha);`)} - } else { - if (fillAlphaFactor < ${o}) { - discard; - } - - ${z(!l,w`fragColor = premultiplyAlpha(fillPixelColor);`)} - } - - // visualize SDF: - // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); - `:w` - vec4 texColor = texture(tex, vtc, -0.5); - if (texColor.a < ${o}) { - discard; - } - ${z(!l,w`fragColor = texColor * premultiplyAlpha(vcolor);`)} - `} - - ${z(e.occludedFragmentFade&&!l,w` - float zSample = texelFetch(depthMap, ivec2(gl_FragCoord.xy), 0).x; - if (zSample < gl_FragCoord.z) { - fragColor *= fadeFactor; - } - `)} - - ${z(!l&&e.debugDrawLabelBorder,w`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)} - `;switch(e.output){case E.Color:e.oitPass===Ue.ColorAlpha&&(t.outputs.add("fragColor","vec4",0),t.outputs.add("fragAlpha","float",1)),s.main.add(w` - ${c} - ${z(e.oitPass===Ue.FrontFace,w`fragColor.rgb /= fragColor.a;`)} - ${z(e.oitPass===Ue.ColorAlpha,w`fragAlpha = fragColor.a;`)}`);break;case E.ObjectAndLayerIdColor:s.main.add(w` - ${c} - outputObjectAndLayerIdColor();`);break;case E.Highlight:t.include(gn,e),s.main.add(w` - ${c} - outputHighlight(voccluded == 1.0);`)}return t}function li(e){return e.outlineColor[3]>0&&e.outlineSize>0}function We(e,t=Yi){return e.textureIsSignedDistanceField?ul(e.anchorPosition,e.distanceFieldBoundingBox,t):Si(t,e.anchorPosition),t}function ul(e,t,r){t!=null?ft(r,e[0]*(t[2]-t[0])+t[0],e[1]*(t[3]-t[1])+t[1]):ft(r,0,0)}const Yi=lr(),fl=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));let pl=class extends qn{constructor(e,t,r){super(e,t,new kn(fl,()=>Promise.resolve().then(()=>cc)),r),this.primitiveType=t.occlusionPass?Ur.POINTS:Ur.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:s,depthTestEnabled:n}=e,a=t===Ue.NONE,o=r?ml:null,l=t===Ue.ColorAlpha,c=i||!n||l||s===E.Highlight?null:Na;return za({blending:s===E.Color?a?Ba:Wn(t):null,depthTest:n&&!i?{func:Sa.LEQUAL}:null,depthWrite:c,drawBuffers:Yn(t,s),colorWrite:Ga,polygonOffset:o})}};const ml={factor:0,units:-4};let D=class extends _n{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.objectAndLayerIdColorInstanced=!1,this.horizonCullingEnabled=!0,this.textureCoordinateType=vn.None,this.emissionSource=yn.None,this.discardInvisibleFragments=!0,this.hasSliceInVertexProgram=!0,this.hasVvInstancing=!1}};m([F()],D.prototype,"screenCenterOffsetUnitsEnabled",void 0),m([F()],D.prototype,"occlusionTestEnabled",void 0),m([F()],D.prototype,"signedDistanceFieldEnabled",void 0),m([F()],D.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),m([F()],D.prototype,"vvSize",void 0),m([F()],D.prototype,"vvColor",void 0),m([F()],D.prototype,"hasVerticalOffset",void 0),m([F()],D.prototype,"hasScreenSizePerspective",void 0),m([F()],D.prototype,"hasRotation",void 0),m([F()],D.prototype,"debugDrawLabelBorder",void 0),m([F()],D.prototype,"hasSlicePlane",void 0),m([F()],D.prototype,"hasPolygonOffset",void 0),m([F()],D.prototype,"depthTestEnabled",void 0),m([F()],D.prototype,"pixelSnappingEnabled",void 0),m([F()],D.prototype,"draped",void 0),m([F()],D.prototype,"terrainDepthTest",void 0),m([F()],D.prototype,"cullAboveTerrain",void 0),m([F()],D.prototype,"occlusionPass",void 0),m([F()],D.prototype,"occludedFragmentFade",void 0),m([F()],D.prototype,"objectAndLayerIdColorInstanced",void 0),m([F()],D.prototype,"horizonCullingEnabled",void 0);class gl extends An{constructor(t,r){super(t,Sl),this.produces=new Map([[W.HUD_MATERIAL,i=>Ct(i)&&!this.parameters.drawInSecondSlot],[W.LABEL_MATERIAL,i=>Ct(i)&&this.parameters.drawInSecondSlot],[W.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[W.DRAPED_MATERIAL,i=>this.parameters.draped&&Ct(i)]]),this._visible=!0,this._configuration=new D(r)}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=r.slot===W.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.depthTestEnabled=this.parameters.depthEnabled||r.slot===W.OCCLUSION_PIXELS,t===E.Color&&(this._configuration.debugDrawLabelBorder=!!Wt.LABELS_SHOW_BORDER),this._configuration.oitPass=r.oitPass,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration}intersect(t,r,i,s,n,a){const{options:{selectionMode:o,hud:l,excludeLabels:c},point:d,camera:h}=i,{parameters:u}=this;if(!o||!l||c&&u.isLabel||!t.visible||!d)return;const{scaleX:f,scaleY:_}=this._getScreenScale(t,h.pixelRatio);dr(Lt,r),t.attributes.has(p.FEATUREATTRIBUTE)&&yl(Lt);const g=t.attributes.get(p.POSITION),C=t.attributes.get(p.SIZE),I=t.attributes.get(p.NORMAL),x=t.attributes.get(p.ROTATION),O=t.attributes.get(p.CENTEROFFSETANDDISTANCE);N(g.size>=3);const M=We(u),y=this.parameters.centerOffsetUnits==="screen";for(let P=0;P-1){y&&(k[0]||k[1])&&(V[0]+=k[0]*h.pixelRatio,k[1]!==0&&(V[1]+=En(k[1],Ft.factorAlignment)*h.pixelRatio),h.unapplyProjection(V,G)),V[0]+=this.parameters.screenOffset[0]*h.pixelRatio,V[1]+=this.parameters.screenOffset[1]*h.pixelRatio,V[0]=Math.floor(V[0]),V[1]=Math.floor(V[1]);const Je=P*C.size;$[0]=C.data[Je],$[1]=C.data[Je+1],Mn($,Ft.factor,$);const rs=Il*h.pixelRatio;let _r=0;u.textureIsSignedDistanceField&&(_r=Math.min(u.outlineSize,.5*$[0])*h.pixelRatio/2),$[0]*=f,$[1]*=_;const is=P*x.size,ss=u.rotation+x.data[is];if(hi(d,V[0],V[1],$,rs,_r,ss,u,M)){const vr=i.ray;if(_e(di,G,Pe(bl,h.viewMatrix)),V[0]=d[0],V[1]=d[1],h.unprojectFromRenderScreen(V,G)){const Ne=A();j(Ne,vr.direction);const yr=1/me(Ne);Z(Ne,Ne,yr),a(Mi(vr.origin,G)*yr,Ne,-1,!0,1,di)}}}}}intersectDraped(t,r,i,s,n,a){const o=t.attributes.get(p.POSITION),l=t.attributes.get(p.SIZE),c=t.attributes.get(p.ROTATION),d=this.parameters,h=We(d),{scaleX:u,scaleY:f}=this._getScreenScale(t,t.screenToWorldRatio),_=Cl*t.screenToWorldRatio;for(let g=0;g0?d:1/d),n}_applyVerticalGroundOffsetView(t,r,i,s){const n=me(t),a=i.aboveGround?1:-1,o=i.computeRenderPixelSizeAtDist(n)*ki,l=Z(G,r.normal,a*o);return ht(s,t,l),s}_applyVerticalOffsetTransformationView(t,r,i,s){const n=this.parameters;if(!n.verticalOffset?.screenLength){if(n.screenSizePerspective||n.screenSizePerspectiveAlignment){const c=me(t);this._updateScaleInfo(s,c,r.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return t}const a=me(t),o=n.screenSizePerspectiveAlignment??n.screenSizePerspective,l=Dn(i,a,n.verticalOffset,r.cosAngle,o);return this._updateScaleInfo(s,a,r.cosAngle),Z(r.normal,r.normal,l),ht(t,t,r.normal)}_applyCenterOffsetView(t,r,i){const s=this.parameters.centerOffsetUnits!=="screen";return i!==t&&j(i,t),s&&(i[0]+=r[0],i[1]+=r[1],r[2]&&(he(Ge,i),ht(i,i,Z(Ge,Ge,r[2])))),i}_applyCenterOffsetNDC(t,r,i,s){const n=this.parameters.centerOffsetUnits!=="screen";return s!==t&&j(s,t),n||(s[0]+=r[0]/i.fullWidth*2,s[1]+=r[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(t,r,i,s){const n=this.parameters.shaderPolygonOffset;if(t!==s&&j(s,t),n){const a=i.aboveGround?1:-1,o=a*Math.sign(r[3]);s[2]-=(o||a)*n}return s}set visible(t){this._visible=t}get visible(){const{color:t,outlineSize:r,outlineColor:i}=this.parameters,s=t[3]>=oe||r>=oe&&i[3]>=oe;return this._visible&&s}createGLMaterial(t){return new _l(t)}calculateRelativeScreenBounds(t,r,i=Ii()){return vl(this.parameters,t,r,i),i[2]=i[0]+t[0],i[3]=i[1]+t[1],i}_getScreenScale(t,r){const i=t.attributes.get(p.FEATUREATTRIBUTE);if(i==null)return{scaleX:r,scaleY:r};const s=Zs(i.data,xl);return Pn(Nt,this.parameters,s),{scaleX:Nt[0]*r,scaleY:Nt[1]*r}}}class _l extends Fn{constructor(t){super({...t,...t.material.parameters})}beginSlot(t){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.acquireTechnique(pl,t)}}function vl(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}function ci(e,t,r,i){return ol(t)&&(t=dr(wl,t)),oa(i.normal,e,t),_e(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=qe(Qi,Tl),i}function yl(e){const t=e[0],r=e[1],i=e[2],s=e[3],n=e[4],a=e[5],o=e[6],l=e[7],c=e[8],d=1/Math.sqrt(t*t+r*r+i*i),h=1/Math.sqrt(s*s+n*n+a*a),u=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*d,e[1]=r*d,e[2]=i*d,e[3]=s*h,e[4]=n*h,e[5]=a*h,e[6]=o*u,e[7]=l*u,e[8]=c*u,e}function hi(e,t,r,i,s,n,a,o,l){let c=t-s-i[0]*l[0],d=c+i[0]+2*s,h=r-s-i[1]*l[1],u=h+i[1]+2*s;const f=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&f!=null&&(c+=i[0]*f[0],h+=i[1]*f[1],d-=i[0]*(1-f[2]),u-=i[1]*(1-f[3]),c-=n,d+=n,h-=n,u+=n),ft(ui,t,r),tn(Ve,e,ui,Ps(a)),Ve[0]>c&&Ve[0]h&&Ve[1]=4&&(l=o[0],c=o[1],d=o[2],h=o[3]),d=Math.min(1.99999,d+1),h=Math.min(1.99999,h+1);let u=i.get(p.POSITION).indices.length,f=a;const _=n.uv0;for(let x=0;xbs(o))]),n=a}break;default:throw new Error(`unable to create unknown material type ${e.type}`)}this._materials.set(e.materialId,n)}_getMaterial(e){return this._materials.get(e)}async _createDirectRenderer(e){const t=e.materialId,r=this._getMaterial(t);if(r==null)throw new Error(`material not found ${t}`);const{view:i}=this,s=new dt({material:r});this._directRenderers.set(t,s),i._stage.addRenderPlugin(s),i._stage.renderView.renderer.updateHasFlags()}async _addDirectRendererGeometry(e){const t=e.renderGeometryId,r=e.materialId;this._renderGeometries.get(t)!=null&&await this._removeDirectRendererGeometry({renderGeometryId:t});const i=this._directRenderers.get(r);if(i==null)return void console.error("no renderer assigned to provided material");const s=i.addRenderGeometry(t,e.renderGeometryBuffer,e.localOrigin);this._renderGeometries.set(t,{renderGeometry:s,materialId:r}),this.view._stage.renderView.requestRender()}async _removeDirectRendererGeometry(e){const t=e.renderGeometryId,r=this._renderGeometries.get(t);if(r==null)return;const i=r.materialId,s=this._directRenderers.get(i);s!=null?s.removeRenderGeometry(e.renderGeometryId):console.error("no renderer assigned to provided material")}async _createLodRenderer(e){const t=new rr({view:this.view,layerUid:this.layerUid}),r=new AbortController,i=s=>this._getMaterial(s);await t.doLoad(e.lodRenderGeometry,i,r.signal),this._lodRenderers.set(e.lodRendererId,t)}async _addLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.addInstances(e.data)}async _removeLodInstances(e){const t=this._lodRenderers.get(e.lodRendererId);if(t==null)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(e.featureIds)}};function Xi(e,t){const r={anchorPosition:io.center,occlusionTest:!0,hasSlicePlane:!1},i=r,s=1;i.color=[1,0,0,1],i.outlineColor=[0,0,0,1],i.outlineSize=s;const n=null;if(e!=null){const a=e.fromData("circle-icon",()=>Jo("circle"));i.textureId=a.texture.id,i.textureIsSignedDistanceField=!0,i.sampleSignedDistanceFieldTexelCenter=Qo("circle")}return i.distanceFieldBoundingBox=Ml,[new gl(r,t),n]}function Al(e,t,r){const i={usePBR:t.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:Un,ambient:qt,diffuse:qt,hasSlicePlane:t.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:t.castShadows,offsetTransparentBackfaces:!t.isPrimitive};return El(i),i.screenSizePerspective=e.screenSizePerspectiveSettings,i.externalColor=Ks,i.isInstanced=!0,new Ei(i,{spherical:r,doublePrecisionRequiresObfuscation:!0})}function El(e){const t=e.opacity??1,r=t<1;return e.transparent=r,e.opacity=t,e.cullFace=r?Mr.None:Mr.Back,e}fi=m([K("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],fi);const Ml=[De/2,De/2,1-De/2,1-De/2];let pi=class{constructor(e){this._bufferWriter=null,this._bufferWriter=e.createBufferWriter()}createBuffer(e,t){const r=this._bufferWriter;let i=null;if(e.transformation&&t)ce(xe,e.transformation),xe[12]-=t[0],xe[13]-=t[1],xe[14]-=t[2],i=xe;else{if(t)throw new Error("not implemented");e.transformation&&(i=e.transformation)}let s=null;i&&(Pe(ot,xe),cr(ot,ot),s=ot);const n=e.attributes,a=r.elementCount(n),o=r.vertexBufferLayout.stride/4;a>Math.floor(Dl/o)&&console.warn("geometry with very large number of elements encountered");const l=r.vertexBufferLayout.createBuffer(a);return r.write(i,s,n,e.objectAndLayerIdColor,l,0),{data:l.buffer,elementCount:a}}};const xe=L(),ot=L(),Dl=16777216/4;let Pl=class{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}createMaterial(e){const t=this._context,r=t.generateId("material");switch(e){case"default":{const i=new Ei({},{spherical:this._context.globalViewingMode,doublePrecisionRequiresObfuscation:!0}),s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}break;case"hud":{const i=Xi(null,this._context.globalViewingMode)[0],s=new pi(i);t.registerRenderGeometryBufferWriter(r,s)}}return this._commands.push({id:"create-material",type:e,materialId:r}),r}createDirectRenderer(e){const t=this._context.generateId("material-renderer");return this._commands.push({id:"create-direct-renderer",materialRendererId:t,materialId:e}),t}addDirectRendererGeometry(e,t,r){const i=t.materialId,s=this._context.getRenderGeometryBufferWriter(i);if(s==null)throw new Error(`no bufferwriter found for material ${i}`);const n=s.createBuffer(t,r);this._transferables.add(n.data),this._commands.push({id:"add-direct-renderer-geometry",renderGeometryId:e,materialId:i,renderGeometryBuffer:n,localOrigin:r})}removeDirectRendererGeometry(e){this._commands.push({id:"remove-direct-renderer-geometry",renderGeometryId:e})}createLodRenderer(e){const t=this._context.generateId("lod-renderer"),r={levels:e.levels.map(i=>({components:i.components.map(s=>{const n=s.attributes.get(p.POSITION);if(!n||n.indices.length===0)throw new Error("positions attribute expected");const a=3,o=Qs(n.indices.length/a),l=new $n(o,a,n),c=this._context.getRenderGeometryBufferWriter(s.materialId);if(c==null)throw new Error("writer not found");const d=c.createBuffer(s,null);return this._transferables.add(d.data),{materialId:s.materialId,renderGeometryBuffer:d,boundingInfo:{bbMax:l.bbMax,bbMin:l.bbMin}}}),minScreenSpaceRadius:i.minScreenSpaceRadius}))};return this._commands.push({id:"create-lod-renderer",lodRendererId:t,lodRenderGeometry:r}),t}addLodInstances(e,t){this._commands.push({id:"add-lod-instances",lodRendererId:e,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer)}removeLodInstances(e,t){this._commands.push({id:"remove-lod-instances",lodRendererId:e,featureIds:t}),this._transferables.add(t.buffer)}async dispatch(){const e=this._commands,t=Array.from(this._transferables);this._clearCommandBuffer(),this._context.dispatchRenderCommands(e,t)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}},Fl=class{constructor(e){this._idCounter=0,this._bufferWriters=new Map,this._dispatchRenderCommandsCallback=async()=>{},this.globalViewingMode=!1,this.globalViewingMode=e.viewingMode===ne.Global,this._dispatchRenderCommandsCallback=e.dispatchRenderCommandsCallback}generateId(e=""){return`${e}${this._idCounter++}`}createEncoder(){return new Pl(this)}async dispatchRenderCommands(e,t){this._dispatchRenderCommandsCallback(e,t)}registerRenderGeometryBufferWriter(e,t){this._bufferWriters.set(e,t)}getRenderGeometryBufferWriter(e){return this._bufferWriters.get(e)}};var q;(function(e){e[e.OBJECT_ID=0]="OBJECT_ID",e[e.PARTITION_ID=1]="PARTITION_ID",e[e.GEOMETRY_MAP_COORDINATES=2]="GEOMETRY_MAP_COORDINATES",e[e.GEOMETRY_RENDER_COORDINATES=3]="GEOMETRY_RENDER_COORDINATES",e[e.TILE_CENTER_RENDER_COORDINATES=4]="TILE_CENTER_RENDER_COORDINATES"})(q||(q={}));async function Ll(e,t){const{numFeatures:r,tile:i,partitionInfo:s}=e,{pages:n}=i;if(n.length===0||r===0)return new Uint32Array;const a=new Uint32Array(r);if(s){const o=n.reduce((h,{featureCount:u})=>h+u,0),l=new Uint32Array(o);let c=0;for(const h of n)c=h.readAllObjectIds(l,c);const d=s.tileIndices;for(let h=0;hh+u,0),l=new Float64Array(3*o);let c=0;for(const h of n)c=h.readAllCoordinates(l,c);const d=s.tileIndices;for(let h=0;h=0;o--){const l=e[o];let c;const d=l!=null,h=o===0&&!n&&!d,u=r[o];l==="symbol-value"||h?c=u!==0?t[o]/u:1:d&&l!=="proportional"&&isFinite(l)&&(c=u!==0?l/u:1),c!=null&&(s[o]=c,n=c,a=Math.max(a,Math.abs(c)))}for(let o=2;o>=0;o--)s[o]==null?s[o]=n:s[o]===0&&(s[o]=.001*a)}for(let n=2;n>=0;n--)s[n]/=i;return $t(s)}function Ki(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:Js(i.indices)});return t}var mi;(function(e){function t(a,o){const l=a[o],c=a[o+1],d=a[o+2];return Math.sqrt(l*l+c*c+d*d)}function r(a,o){const l=a[o],c=a[o+1],d=a[o+2],h=1/Math.sqrt(l*l+c*c+d*d);a[o]*=h,a[o+1]*=h,a[o+2]*=h}function i(a,o,l){a[o]*=l,a[o+1]*=l,a[o+2]*=l}function s(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]+l[c],d[h+1]=a[o+1]+l[c+1],d[h+2]=a[o+2]+l[c+2]}function n(a,o,l,c,d,h=o){(d=d||a)[h]=a[o]-l[c],d[h+1]=a[o+1]-l[c+1],d[h+2]=a[o+2]-l[c+2]}e.length=t,e.normalize=r,e.scale=i,e.add=s,e.subtract=n})(mi||(mi={}));const Vl=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)Vl[6*e+t]=e;const Ie=new Array(36);for(let e=0;e<6;e++)Ie[6*e]=0,Ie[6*e+1]=1,Ie[6*e+2]=2,Ie[6*e+3]=2,Ie[6*e+4]=3,Ie[6*e+5]=0;const Bt=re(-.5,0,-.5),Gt=re(.5,0,-.5),Vt=re(0,0,.5),jt=re(0,.5,0),Ce=Ye(),Te=Ye(),Se=Ye(),Oe=Ye(),Re=Ye();Y(Ce,Bt,jt),Y(Te,Bt,Gt),$e(Se,Ce,Te),he(Se,Se),Y(Ce,Gt,jt),Y(Te,Gt,Vt),$e(Oe,Ce,Te),he(Oe,Oe),Y(Ce,Vt,jt),Y(Te,Vt,Bt),$e(Re,Ce,Te),he(Re,Re),Se[0],Se[1],Se[2],Oe[0],Oe[1],Oe[2],Re[0],Re[1],Re[2];function jl(e,t,r,i,s=!0,n=!0){let a=0;const o=t,l=e;let c=re(0,a,0),d=re(0,a+l,0),h=re(0,-1,0),u=re(0,1,0);const f=[d,c],_=[h,u],g=r+2,C=Math.sqrt(l*l+o*o);for(let y=0;y({levels:i.map(a=>{const o=Ki(s(a.tesselation));return n&&Ul(o),{components:[{attributes:o,objectAndLayerIdColor:void 0,transformation:null,materialId:t}],minScreenSpaceRadius:a.minScreenSpaceRadius}})});switch(e){case"cone":return r($l,i=>jl(1,.5,i),!0);case"sphere":case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Ul(e){const t=e,r=t.get(p.POSITION).data,i=t.get(p.NORMAL).data;if(i){const s=gi(e,p.NORMAL).data;for(let n=0;n{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.add(s,r)}))}async remove(t,r){const i=t.partitions;if(!i)throw new Error("partitioned featureset expected");await Promise.all(i.map(async s=>{const n=await this._provisionSymbol(s.partitionInfo?.index,r);n&&await n.remove(s,r)}))}async _provisionFeatureData(t,r){await t.provision([q.PARTITION_ID,q.OBJECT_ID],r)}async _provisionSymbol(t,r){if(t==null)return null;const i=this._symbols.get(t);return i?(i.loaded||await i.load(r),i):null}_partition(t){const{numFeatures:r,objectIds:i,partitionIds:s}=t,n=[[],[]];for(let a=0;aa.length>0).map((a,o)=>{const l=a.length,c={index:o,tileIndices:new Uint32Array(a)};return new Zi(t.tile,l,c)}),t.partitions}}function Yl(e,t,r){return!!gt(e,t,ct,r.spatialReference)&&(r.x=ct[0],r.y=ct[1],r.z=ct[2],!0)}const ct=A();function Ql(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}function Jl(e,t,r){return e.operations.setExtent(e.value,t,r.value),r}function Xl(e,t){return e.operations.getExtent(e.value,t),t}function Zl(e){return{operations:e,value:e.create()}}function es(e,t,r=Zl(e)){return r.operations=e,e.copy(t,r.value),r}function Kl(e){return es(ma,pa(0,0,0,Ci(e).radius))}const _i=2**50;function ec(){return es(Ra,Oa([0,0,0],[_i,0,0],[0,_i,0]))}function tc(e,t,r){return e.operations.axisAt(e.value,t,je.Z,r)}function rc(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}function ic(e,t,r){return e.operations.intersectRay(e.value,t,r)}function sc(e,t,r){return e.operations.intersectRayClosestSilhouette(e.value,t,r)}function nc(e,t){return e.operations.altitudeAt(e.value,t)}function ts(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function ac(e,t,r,i){return t!==i&&ce(i,t),ie(Ae,i[12],i[13],i[14]),ts(e,Ae,r,Ae),i[12]=Ae[0],i[13]=Ae[1],i[14]=Ae[2],i}function Ht(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ae=A();function vi(e){return e.type==="point"}class bt{constructor(t,r,i,s){this.viewingMode=t,this.spatialReference=r,this.unitInMeters=i,this._coordinateSystem=s,this._tmpCoordinateSystem=Ql(s),this.referenceEllipsoid=Ci(r),this.sphericalPCPF=Ha(r)}set extent(t){t&&Jl(this._coordinateSystem,t,this._coordinateSystem)}get extent(){return Xl(this._coordinateSystem,Ii())}getAltitude(t){return nc(this._coordinateSystem,t)}setAltitude(t,r,i=t){return ts(this._coordinateSystem,i,r,t)}setAltitudeOfTransformation(t,r){ac(this._coordinateSystem,r,t,r)}worldUpAtPosition(t,r){return tc(this._coordinateSystem,t,r)}worldBasisAtPosition(t,r,i){return rc(this._coordinateSystem,t,r,i)}basisMatrixAtPosition(t,r){const i=this.worldBasisAtPosition(t,je.X,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=this.worldBasisAtPosition(t,je.Z,de.get());return ia(r,i[0],i[1],i[2],0,s[0],s[1],s[2],0,n[0],n[1],n[2],0,0,0,0,1),r}headingAtPosition(t,r){const i=this.worldUpAtPosition(t,de.get()),s=this.worldBasisAtPosition(t,je.Y,de.get()),n=ya(r,s,i);return Ls(n)}intersectManifoldClosestSilhouette(t,r,i){return Ht(this._coordinateSystem,r,this._tmpCoordinateSystem),sc(this._tmpCoordinateSystem,t,i),i}intersectManifold(t,r,i){Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=de.get();return ic(this._tmpCoordinateSystem,t,s)?j(i,s):null}intersectInfiniteManifold(t,r,i){if(this.viewingMode===ne.Global)return this.intersectManifold(t,r,i);Ht(this._coordinateSystem,r,this._tmpCoordinateSystem);const s=this._tmpCoordinateSystem.value,n=de.get();return wa(s.plane,t,n)?j(i,n):null}toRenderCoords(t,r,i){return vi(t)?Ua(t,r,this.spatialReference):gt(t,r,i,this.spatialReference)}fromRenderCoords(t,r,i=null){return vi(r)?(i!=null&&(r.spatialReference=i),Yl(t,this.spatialReference,r)?r:null):gt(t,this.spatialReference,r,i)?r:null}static create(t,r){switch(t){case ne.Local:return new bt(ne.Local,r,Ns(r),ec());case ne.Global:return new bt(ne.Global,r,1,Kl(r))}}static renderUnitScaleFactor(t,r){return Ir(t)/Ir(r)}}class oc{constructor(t){this._tileFeatureData=new Map,this._context={viewSpatialReference:t.viewSpatialReference,renderSpatialReference:t.renderSpatialReference,renderCoordsHelper:bt.create(t.viewingMode,t.renderSpatialReference)}}async add(t,r){this._featureRenderer||(this._featureRenderer=new Wl(this._context),await this._featureRenderer.load());const i=this._addTileFeatureData(t);await this._featureRenderer.add(i,r)}async remove(t,r){const i=this._getFeatureSetFromTileId(t);i&&(this._featureRenderer&&this._featureRenderer.remove(i,r),this._removeTileFeatureData(t))}_getFeatureSetFromTileId(t){return this._tileFeatureData.get(t)}_addTileFeatureData(t){const r=t.descriptor.id,i=t.pages.reduce((n,{featureCount:a})=>n+a,0),s=new Zi(t,i);return this._tileFeatureData.set(r,s),s}_removeTileFeatureData(t){const r=this._tileFeatureData.get(t);r&&(r.dispose(),this._tileFeatureData.delete(t))}}let ut=class extends ar.EventedAccessor{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new Ya,this._tileManager=new fe({addTile:(e,t)=>this._addTile(e,t),removeTiles:e=>this._removeTiles(e)}),this._renderCommandContext=null,this._fetcher=null,this._symbolizer=null,this._queryEngine=null,this._defaultQueryJSON=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,baseQuery:i,url:s,objectIdField:n,capabilities:a,fieldsIndex:o,timeInfo:l}){this._renderCommandContext=new Fl({viewingMode:r,dispatchRenderCommandsCallback:(h,u)=>this.remoteClient.invoke("dispatchRenderCommands",h,{transferList:u})});const c=wr.fromJSON(e),d=wr.fromJSON(t);return this._fetcher=new ro(c,Cr.fromJSON(i),s,n,a),this._symbolizer=new oc({viewSpatialReference:c,renderSpatialReference:d,viewingMode:r}),this._queryEngine=new Gs({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",objectIdField:n,fieldsIndex:o,availableFields:[n],spatialReference:e,featureStore:this._featureStore,timeInfo:l}),this._defaultQueryJSON=new Cr({outSpatialReference:c}).toJSON(),this.addHandles(ns(()=>this.updating,async h=>{this.emit("notify-updating",{updating:h})}),as),yi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async onTileTreeChange(e){return await this._tileManager.onTileTreeChange(e),yi}async _addTile(e,t){const r=await this._fetcher.fetch(e,t);ve(t),this._featureStore.addTile(r);const i=this._renderCommandContext.createEncoder();return await this._symbolizer.add(r,i),await i.dispatch(),r}async _removeTiles(e){const t=this._renderCommandContext.createEncoder(),r=this._featureStore,i=this._symbolizer;for(const s of e)r.removeTile(s.tileId),await i.remove(s.tileId,t);await t.dispatch()}_ensureQuery(e){return e??this._defaultQueryJSON}};m([v()],ut.prototype,"updating",null),ut=m([K("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],ut);const lc=ut,yi={result:void 0},Kh=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"})),ed=Object.freeze(Object.defineProperty({__proto__:null,build:sn},Symbol.toStringTag,{value:"Module"})),td=Object.freeze(Object.defineProperty({__proto__:null,build:nn,getRadius:an},Symbol.toStringTag,{value:"Module"})),rd=Object.freeze(Object.defineProperty({__proto__:null,build:on},Symbol.toStringTag,{value:"Module"})),id=Object.freeze(Object.defineProperty({__proto__:null,build:ln},Symbol.toStringTag,{value:"Module"})),cc=Object.freeze(Object.defineProperty({__proto__:null,build:Wi,calculateAnchorPosForRendering:We,shaderSettings:gr},Symbol.toStringTag,{value:"Module"}));export{rd as D,Kh as F,id as R,ed as S,td as a}; diff --git a/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-BrMy6Kw6.js b/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-BrMy6Kw6.js deleted file mode 100644 index 7cee972f..00000000 --- a/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-BrMy6Kw6.js +++ /dev/null @@ -1 +0,0 @@ -import{cr as c,cJ as p,v as s,S as l,ac as v,a0 as a,e as y,cK as m,cL as w,b0 as g,i as S}from"./story-OUarUCIt.js";var n;const h=c()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=h.jsonValues.slice();p(u,"orthometric");const o=c()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return h.write(e,t,i)}readHeightModel(e,t,i){return h.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new g("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new g("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([l({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([l({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([l({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; diff --git a/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-Cjdad0g3.js b/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-Cjdad0g3.js new file mode 100644 index 00000000..59e13424 --- /dev/null +++ b/custom-toc-separator/assets/HeightModelInfo-C5vFqzyF-Cjdad0g3.js @@ -0,0 +1 @@ +import{cr as c,cJ as p,v as s,S as l,ac as v,a0 as a,e as y,cK as m,cL as w,b0 as g,i as S}from"./story-DT1Ep1ux.js";var n;const h=c()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=h.jsonValues.slice();p(u,"orthometric");const o=c()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return h.write(e,t,i)}readHeightModel(e,t,i){return h.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new g("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new g("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([l({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([l({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([l({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; diff --git a/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js b/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js new file mode 100644 index 00000000..8b0e3439 --- /dev/null +++ b/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js @@ -0,0 +1 @@ +import{v as i,i as s}from"./story-DT1Ep1ux.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; diff --git a/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js b/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js deleted file mode 100644 index 9c6c3f63..00000000 --- a/custom-toc-separator/assets/HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,i as s}from"./story-OUarUCIt.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-BEOATdol.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; diff --git a/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js b/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js new file mode 100644 index 00000000..e74fb209 --- /dev/null +++ b/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js @@ -0,0 +1,2 @@ +import{o as f,a1 as D,P as S}from"./story-DT1Ep1ux.js";import{T as U}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function z(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.getUint32(r+m.checksumOffset,d)}}const y={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function k(t,e){return{sizeLo:t.getUint32(e+y.sizeLo,d),sizeHi:t.getUint32(e+y.sizeHi,d),minX:t.getFloat64(e+y.minX,d),minY:t.getFloat64(e+y.minY,d),minZ:t.getFloat64(e+y.minZ,d),maxX:t.getFloat64(e+y.maxX,d),maxY:t.getFloat64(e+y.maxY,d),maxZ:t.getFloat64(e+y.maxZ,d),errorX:t.getFloat64(e+y.errorX,d),errorY:t.getFloat64(e+y.errorY,d),errorZ:t.getFloat64(e+y.errorZ,d),count:t.getUint32(e+y.count,d),reserved:t.getUint32(e+y.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function P(t){return L.hasOwnProperty(t)}function A(t){return P(t)?L[t].BYTES_PER_ELEMENT:0}export{J as $,F,K as G,q as Y}; diff --git a/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js b/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js deleted file mode 100644 index 4d5c56ce..00000000 --- a/custom-toc-separator/assets/I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js +++ /dev/null @@ -1,2 +0,0 @@ -import{o as f,a1 as D,P as S}from"./story-OUarUCIt.js";import{T as U}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function z(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.getUint32(r+m.checksumOffset,d)}}const y={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function k(t,e){return{sizeLo:t.getUint32(e+y.sizeLo,d),sizeHi:t.getUint32(e+y.sizeHi,d),minX:t.getFloat64(e+y.minX,d),minY:t.getFloat64(e+y.minY,d),minZ:t.getFloat64(e+y.minZ,d),maxX:t.getFloat64(e+y.maxX,d),maxY:t.getFloat64(e+y.maxY,d),maxZ:t.getFloat64(e+y.maxZ,d),errorX:t.getFloat64(e+y.errorX,d),errorY:t.getFloat64(e+y.errorY,d),errorZ:t.getFloat64(e+y.errorZ,d),count:t.getUint32(e+y.count,d),reserved:t.getUint32(e+y.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function P(t){return L.hasOwnProperty(t)}function A(t){return P(t)?L[t].BYTES_PER_ELEMENT:0}export{J as $,F,K as G,q as Y}; diff --git a/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js b/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js new file mode 100644 index 00000000..ab821438 --- /dev/null +++ b/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js @@ -0,0 +1 @@ +import{v as e,S as t,i,bz as l,e as p}from"./story-DT1Ep1ux.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([l({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; diff --git a/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js b/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js deleted file mode 100644 index 3c589c7f..00000000 --- a/custom-toc-separator/assets/I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as t,i,bz as l,e as p}from"./story-OUarUCIt.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([l({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; diff --git a/custom-toc-separator/assets/I3SUtil-Bq8KpP2j-CH-xwlo7.js b/custom-toc-separator/assets/I3SUtil-Bq8KpP2j-CH-xwlo7.js deleted file mode 100644 index f1485840..00000000 --- a/custom-toc-separator/assets/I3SUtil-Bq8KpP2j-CH-xwlo7.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as s,f as C,ia as y,ib as A}from"./story-OUarUCIt.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import{G as d}from"./I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js";import{e as h}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{i as g}from"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";var o;(function(t){t[t.TRANSPARENT=0]="TRANSPARENT",t[t.OPAQUE=1]="OPAQUE"})(o||(o={}));var u;(function(t){t[t.Uniform=0]="Uniform",t[t.Varying=1]="Varying",t[t.COUNT=2]="COUNT"})(u||(u={}));var f,S;(function(t){t[t.Solid=0]="Solid",t[t.Sketch=1]="Sketch",t[t.Mixed=2]="Mixed",t[t.COUNT=3]="COUNT"})(f||(f={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.SILHOUETTE=1]="SILHOUETTE"}(S||(S={}));function D(t){return{...P,...t,type:f.Solid}}const P={color:h(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:o.OPAQUE,hasSlicePlane:!1};o.OPAQUE,s();var m;async function K(t,a,n,p,I,N,U,R){const E=[];for(const r of a)if(r&&I.includes(r.name)){const i=`${t}/nodes/${n}/attributes/${r.key}/0`;E.push({url:i,storageInfo:r})}const c=await Promise.allSettled(E.map(r=>C(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;eC(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;ei.map(i=>d[i]); +import{_ as C}from"./main-BTdHgocv.js";import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as D,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V}from"./story-DT1Ep1ux.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{b as ye}from"./substitute-j49H6mVR-D_1hvId1.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>C(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dialog:()=>C(()=>import("./calcite-dialog-DAngwHC1-DxaeZrt2.js"),__vite__mapDeps([20,1,2,3,4,5,6,8,21,19,14,12,22,9,13,15,11,16,17,18,23,24,25,26,27,28]),import.meta.url),input:()=>C(()=>import("./calcite-input-BKRd7MCS-CiwokCpm.js"),__vite__mapDeps([29,30,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url),label:()=>C(()=>import("./calcite-label-DMj3M4QR-0gYoQwWb.js"),__vite__mapDeps([31,1,2,3,4,5,6,10,8,11]),import.meta.url),notice:()=>C(()=>import("./calcite-notice-DeAGopAs-kC7ujg8g.js"),__vite__mapDeps([32,1,2,3,4,5,6,33,15,8,12,13,14,16,25,11,17]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&D(s.signal,()=>{n.abort()}),D(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&D(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&D(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; diff --git a/custom-toc-separator/assets/IdentityManager-DCHYmv7j-DZ03FhVv.js b/custom-toc-separator/assets/IdentityManager-DCHYmv7j-DZ03FhVv.js deleted file mode 100644 index 77655736..00000000 --- a/custom-toc-separator/assets/IdentityManager-DCHYmv7j-DZ03FhVv.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-D0EvxauM.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-DuqBvFSD.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-Bw4n2n3w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-DyDwqoXd.js","./locale-Cn_GDVD_-CnEFMUdd.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-BCNzxmob.js","./t9n-C_hcZMZJ-DI6xkvhp.js","./icon-BXFbBbop-BKvGneFm.js","./loader-Ch7Jr16w-B4sW6aLS.js","./guid-Dls486Er-CBh637k4.js","./calcite-dialog-DAngwHC1-CTBZGPoU.js","./action-menu-DTIJuZNc-CadEd7O7.js","./action-GCQoufcz-Db81jJpr.js","./floating-ui-DKFFlLv3-elIRTcW0.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-CRyJWWhi.js","./FloatingArrow-BG9llDYg-ljy-TIYj.js","./panel-DRUEhsxp-DE_ZqRVb.js","./scrim-BscQh4v9-DzezRv_f.js","./calcite-input-BKRd7MCS-C6GuFEjN.js","./input2-eOtqu-iO-l9oxBLp5.js","./calcite-label-DMj3M4QR-BDZ8Onhu.js","./calcite-notice-DeAGopAs-SWsgCJuf.js","./conditionalSlot-DsCzytJ4-BJqhnuaV.js"])))=>i.map(i=>d[i]); -import{_ as C}from"./main-lj2zzr_L.js";import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as D,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V}from"./story-OUarUCIt.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{b as ye}from"./substitute-j49H6mVR-NuZWx4FX.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>C(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dialog:()=>C(()=>import("./calcite-dialog-DAngwHC1-CTBZGPoU.js"),__vite__mapDeps([20,1,2,3,4,5,6,8,21,19,14,12,22,9,13,15,11,16,17,18,23,24,25,26,27,28]),import.meta.url),input:()=>C(()=>import("./calcite-input-BKRd7MCS-C6GuFEjN.js"),__vite__mapDeps([29,30,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url),label:()=>C(()=>import("./calcite-label-DMj3M4QR-BDZ8Onhu.js"),__vite__mapDeps([31,1,2,3,4,5,6,10,8,11]),import.meta.url),notice:()=>C(()=>import("./calcite-notice-DeAGopAs-SWsgCJuf.js"),__vite__mapDeps([32,1,2,3,4,5,6,33,15,8,12,13,14,16,25,11,17]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&D(s.signal,()=>{n.abort()}),D(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&D(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&D(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; diff --git a/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-B4H6ifcq.js b/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-B4H6ifcq.js new file mode 100644 index 00000000..71a7df56 --- /dev/null +++ b/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-B4H6ifcq.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-igCij5M1.js","./utils-BVWK2jiA-inSV67A_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js"])))=>i.map(i=>d[i]); +import{_ as $t}from"./main-BTdHgocv.js";import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as zt,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as Ut,bp as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./story-DT1Ep1ux.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as tr}from"./Layer-ChoECxvZ-ocw70508.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-5rDIvGzY.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{y as we}from"./Field-C6hA1tZj-aKnzhZ32.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-CwJW9dca.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-FWeI_AU8.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{O as Ct}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-CKWTLnam.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import{a as Er}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as qr}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as $r}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{a as Br}from"./versionUtils-LZYZz-38-esAtUime.js";import{w as Qr}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-QfypPSGF.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";const kr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new zt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([Ut(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ht(async(t,o,e)=>{const{save:r,saveAs:n}=await $t(()=>import("./imageryUtils-6MVSqijr-igCij5M1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Pn=z;export{Pn as default}; diff --git a/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-D8ecHz6d.js b/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-D8ecHz6d.js deleted file mode 100644 index b9c53e85..00000000 --- a/custom-toc-separator/assets/ImageryLayer-B-bJb8lU-D8ecHz6d.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-Bj5kHpFp.js","./utils-BVWK2jiA-Bnz0n_UG.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js"])))=>i.map(i=>d[i]); -import{_ as $t}from"./main-lj2zzr_L.js";import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as zt,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as Ut,bp as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./story-OUarUCIt.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as tr}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-DCwX6ZId.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-D0TnSXh8.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{y as we}from"./Field-C6hA1tZj-DY7R6puO.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-Djr5L7DU.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-gUIs0TS1.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{O as Ct}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-BLtp2DWt.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-C6q0seac.js";import{a as Er}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as qr}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as $r}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{a as Br}from"./versionUtils-LZYZz-38-CcEiEhYk.js";import{w as Qr}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-DGbScRZv.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-CX4234se.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";const kr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new zt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([Ut(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ht(async(t,o,e)=>{const{save:r,saveAs:n}=await $t(()=>import("./imageryUtils-6MVSqijr-Bj5kHpFp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Pn=z;export{Pn as default}; diff --git a/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-DEdTe9_L.js b/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-DEdTe9_L.js deleted file mode 100644 index e4bb9d0f..00000000 --- a/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-DEdTe9_L.js +++ /dev/null @@ -1,4 +0,0 @@ -import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./story-OUarUCIt.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js";import{X as H,Y as G}from"./LayerView-Bish-E63-DehQ-_Za.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-kxGu4sMT.js";import{x as Z}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{d as tt}from"./Bitmap-CcqmzvfR-BO796kOM.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-Bei3OeVZ.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import{E as B}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{N as rt}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{T as st}from"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import{b as at}from"./Query-BrwMGK8U-gUIs0TS1.js";import{m as ot}from"./popupUtils-nV1O8RUO-911d_F5-.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import"./main-lj2zzr_L.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} --> subview ${!this.subview||this.subview.updating} --> higlightView ${this._highlightView?.updating} -`),t}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let e="imagery";if(t==="vector-field"?e="imageryVF":t==="flow"&&(e="flow"),this.subview){const{type:i}=this.subview;if(i===e)return this._attachSubview(this.subview),void(i==="flow"?this.subview.redrawOrRefetch():i==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=e==="imagery"?new lt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):e==="imageryVF"?new mt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new N({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}};s([o()],x.prototype,"pixelData",null),s([o()],x.prototype,"subview",void 0),x=s([w("esri.views.2d.layers.ImageryLayerView2D")],x);const vi=x;export{vi as default}; diff --git a/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-ICFSIiIH.js b/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-ICFSIiIH.js new file mode 100644 index 00000000..9b876529 --- /dev/null +++ b/custom-toc-separator/assets/ImageryLayerView2D-CVDvTIGY-ICFSIiIH.js @@ -0,0 +1,4 @@ +import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./story-DT1Ep1ux.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js";import{X as H,Y as G}from"./LayerView-Bish-E63-B3VRdVIM.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-CdhuTm0j.js";import{x as Z}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{d as tt}from"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-BzAy5Mad.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import{E as B}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{N as rt}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{T as st}from"./timeSupport-ohWmWReZ-CSAKuiyl.js";import{b as at}from"./Query-BrwMGK8U-FWeI_AU8.js";import{m as ot}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import"./main-BTdHgocv.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} +-> subview ${!this.subview||this.subview.updating} +-> higlightView ${this._highlightView?.updating} +`),t}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let e="imagery";if(t==="vector-field"?e="imageryVF":t==="flow"&&(e="flow"),this.subview){const{type:i}=this.subview;if(i===e)return this._attachSubview(this.subview),void(i==="flow"?this.subview.redrawOrRefetch():i==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=e==="imagery"?new lt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):e==="imageryVF"?new mt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new N({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}};s([o()],x.prototype,"pixelData",null),s([o()],x.prototype,"subview",void 0),x=s([w("esri.views.2d.layers.ImageryLayerView2D")],x);const vi=x;export{vi as default}; diff --git a/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-BjuvDY5X.js b/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-BjuvDY5X.js deleted file mode 100644 index 9137004b..00000000 --- a/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-BjuvDY5X.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-csWZJ4px.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BcGP1hGu.js","./imageryUtils-6MVSqijr-Bj5kHpFp.js","./utils-BVWK2jiA-Bnz0n_UG.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js"])))=>i.map(i=>d[i]); -import{_ as at}from"./main-lj2zzr_L.js";import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as ot,J as L,E as Tt,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,eC as Dt,aG as Et,jz as Bt,ar as Jt,cB as At}from"./story-OUarUCIt.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as Ht}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{a as zt}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-DCwX6ZId.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-D0TnSXh8.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-TGuQW6oN.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Bi,W as Ji,F as Ee}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import{D as Li,h as pt,E as Be,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-QGUE0RJ1.js";import{O as Ge}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{y as ce}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as ji}from"./TilemapCache-CRRxws77-Buzexpoq.js";import{w as Ui}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./utils-DPtQ14k3-DGbScRZv.js";import"./cimSymbolUtils-CKIzBgMU-CX4234se.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,B=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,J=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(J,O,O,z),{pixelBlock:G}=await this.fetchPixels(J,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ot(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let J;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:J,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});J=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),J=Ti(J,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,J=this.getPyramidPixelSize(t),{x:z,y:j}=J;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Ji(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Be(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Be(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await at(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-csWZJ4px.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Be(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return ot(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Jt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Bt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` -`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let J=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(J=new L({wkid:z}))}else J=Se(D)??L.WGS84;else x=!0,J=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=J}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Je=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await at(()=>import("./imageryUtils-6MVSqijr-Bj5kHpFp.js"),__vite__mapDeps([8,9,1,2,3,4,10,11,12,13,14,15,16,17]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${i}'`,{layer:this}))}return null}async _openRaster(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Br=E;export{Br as default}; diff --git a/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-DOM1Vp8R.js b/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-DOM1Vp8R.js new file mode 100644 index 00000000..7778c1bc --- /dev/null +++ b/custom-toc-separator/assets/ImageryTileLayer-DixyNESc-DOM1Vp8R.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-B4-kNUBs.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-Bf311639.js","./imageryUtils-6MVSqijr-igCij5M1.js","./utils-BVWK2jiA-inSV67A_.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js"])))=>i.map(i=>d[i]); +import{_ as at}from"./main-BTdHgocv.js";import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as ot,J as L,E as Tt,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,eC as Dt,aG as Et,jz as Bt,ar as Jt,cB as At}from"./story-DT1Ep1ux.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as Ht}from"./Layer-ChoECxvZ-ocw70508.js";import{a as zt}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-5rDIvGzY.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Bi,W as Ji,F as Ee}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import{D as Li,h as pt,E as Be,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-of3yQAdZ.js";import{O as Ge}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{y as ce}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as ji}from"./TilemapCache-CRRxws77-CQyTs6St.js";import{w as Ui}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./utils-DPtQ14k3-QfypPSGF.js";import"./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,B=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,J=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(J,O,O,z),{pixelBlock:G}=await this.fetchPixels(J,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ot(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let J;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:J,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});J=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),J=Ti(J,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,J=this.getPyramidPixelSize(t),{x:z,y:j}=J;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Ji(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Be(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Be(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await at(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-B4-kNUBs.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Be(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return ot(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Jt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Bt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` +`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let J=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(J=new L({wkid:z}))}else J=Se(D)??L.WGS84;else x=!0,J=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=J}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Je=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await at(()=>import("./imageryUtils-6MVSqijr-igCij5M1.js"),__vite__mapDeps([8,9,1,2,3,4,10,11,12,13,14,15,16,17]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${i}'`,{layer:this}))}return null}async _openRaster(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Br=E;export{Br as default}; diff --git a/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js b/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js deleted file mode 100644 index e2d71be6..00000000 --- a/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js +++ /dev/null @@ -1 +0,0 @@ -import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./story-OUarUCIt.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-DCwX6ZId.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-DehQ-_Za.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-BGxTS9rh.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-Bv29bzNX.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{G as Je}from"./Program-DLVwTiPA-DeIeQX6y.js";import{h as ce}from"./TileContainer-D48pXXgL-DF8HooMp.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{V as X}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-TGuQW6oN.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{i as ot}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import{m as ct}from"./popupUtils-nV1O8RUO-911d_F5-.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import"./main-lj2zzr_L.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const Di=T;export{Di as default}; diff --git a/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js b/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js new file mode 100644 index 00000000..6d866da5 --- /dev/null +++ b/custom-toc-separator/assets/ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js @@ -0,0 +1 @@ +import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./story-DT1Ep1ux.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-B3VRdVIM.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-Ce2xEM6w.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-B6HwLstV.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{G as Je}from"./Program-DLVwTiPA-D0v5nxXn.js";import{h as ce}from"./TileContainer-D48pXXgL-B6YzhmFG.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{V as X}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import{i as ot}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-CSAKuiyl.js";import{m as ct}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import"./main-BTdHgocv.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const Di=T;export{Di as default}; diff --git a/custom-toc-separator/assets/Indices-DEr2HrWx-BChBDP40.js b/custom-toc-separator/assets/Indices-DEr2HrWx-BChBDP40.js new file mode 100644 index 00000000..75088726 --- /dev/null +++ b/custom-toc-separator/assets/Indices-DEr2HrWx-BChBDP40.js @@ -0,0 +1 @@ +import{hc as u,d2 as f}from"./story-DT1Ep1ux.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; diff --git a/custom-toc-separator/assets/Indices-DEr2HrWx-Bin5_zrY.js b/custom-toc-separator/assets/Indices-DEr2HrWx-Bin5_zrY.js deleted file mode 100644 index cf930333..00000000 --- a/custom-toc-separator/assets/Indices-DEr2HrWx-Bin5_zrY.js +++ /dev/null @@ -1 +0,0 @@ -import{hc as u,d2 as f}from"./story-OUarUCIt.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; diff --git a/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-7qGXLlt7.js b/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-7qGXLlt7.js new file mode 100644 index 00000000..35f1f42c --- /dev/null +++ b/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-7qGXLlt7.js @@ -0,0 +1 @@ +import{J as g,n as A,B as _,hZ as u,dq as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dg as v}from"./story-DT1Ep1ux.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{r as z,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{n as I}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{D as U}from"./Layer-ChoECxvZ-ocw70508.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as W}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as q}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as F}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as G}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{$ as P,Z as K}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import"./main-BTdHgocv.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";let m=class extends W(q(F(G(k(C(X(U))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();z(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(P)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const xe=m;export{xe as default}; diff --git a/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-ZHb6u4tt.js b/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-ZHb6u4tt.js deleted file mode 100644 index e8dc9e74..00000000 --- a/custom-toc-separator/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-ZHb6u4tt.js +++ /dev/null @@ -1 +0,0 @@ -import{J as g,n as A,B as _,hZ as u,dq as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dg as v}from"./story-OUarUCIt.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{r as z,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{n as I}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{D as U}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as W}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as q}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as F}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as G}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{$ as P,Z as K}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import"./main-lj2zzr_L.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";let m=class extends W(q(F(G(k(C(X(U))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();z(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(P)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const xe=m;export{xe as default}; diff --git a/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-CJAaHChR.js b/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-CJAaHChR.js deleted file mode 100644 index c7192ca9..00000000 --- a/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-CJAaHChR.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./story-OUarUCIt.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{C as c}from"./persistable-C6RBwzJi-BbuVIS8Z.js";import{D as U}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as K}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as k}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as z}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-Dbvqi9tG.js";import{$ as W}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js";import{J as Q,a as X}from"./projection-BA9M1R7d-Cytmrlsd.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import"./main-lj2zzr_L.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-CYtArgCw.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const Je=o;export{Je as default}; diff --git a/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-DRMrJm3r.js b/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-DRMrJm3r.js new file mode 100644 index 00000000..0c04b8d8 --- /dev/null +++ b/custom-toc-separator/assets/IntegratedMeshLayer-C-XaBbXd-DRMrJm3r.js @@ -0,0 +1 @@ +import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./story-DT1Ep1ux.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{C as c}from"./persistable-C6RBwzJi-DSWzGhuz.js";import{D as U}from"./Layer-ChoECxvZ-ocw70508.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as K}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as k}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as z}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-CobyO2zX.js";import{$ as W}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js";import{J as Q,a as X}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import"./main-BTdHgocv.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-iZLDgXmu.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const Je=o;export{Je as default}; diff --git a/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-BGmZ7EU1.js b/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-BGmZ7EU1.js deleted file mode 100644 index 293cbcb4..00000000 --- a/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-BGmZ7EU1.js +++ /dev/null @@ -1 +0,0 @@ -import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; diff --git a/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-Bgcehm8b.js b/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-Bgcehm8b.js new file mode 100644 index 00000000..ed4329ce --- /dev/null +++ b/custom-toc-separator/assets/InterleavedLayout-DXzw3B2n-Bgcehm8b.js @@ -0,0 +1 @@ +import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-Dv7NCnc6.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; diff --git a/custom-toc-separator/assets/KMLLayer-DwQXpcMB-DgN1R0Sa.js b/custom-toc-separator/assets/KMLLayer-DwQXpcMB-DgN1R0Sa.js new file mode 100644 index 00000000..557b97ef --- /dev/null +++ b/custom-toc-separator/assets/KMLLayer-DwQXpcMB-DgN1R0Sa.js @@ -0,0 +1 @@ +import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as o,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./story-DT1Ep1ux.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as C}from"./Layer-ChoECxvZ-ocw70508.js";import{u as N}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as K}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as P}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{Z as W}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-CwR9R5MT.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([o()],a.prototype,"description",void 0),r([o({type:d})],a.prototype,"fullExtent",void 0),r([o()],a.prototype,"id",void 0),r([o({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([o({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([o({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([o({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([o({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([o()],a.prototype,"sourceJSON",void 0),r([o()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let l=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([o({readOnly:!0})],l.prototype,"allSublayers",void 0),r([o({type:g})],l.prototype,"outSpatialReference",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],l.prototype,"path",void 0),r([o({readOnly:!0,json:{read:!1,write:!1}})],l.prototype,"legendEnabled",void 0),r([o({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),r([o({type:["KML"]})],l.prototype,"operationalLayerType",void 0),r([o({})],l.prototype,"resourceInfo",void 0),r([o({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],l.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],l.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],l.prototype,"readSublayers",null),r([M("sublayers")],l.prototype,"writeSublayers",null),r([o({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),r([o({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],l.prototype,"title",null),r([o(W)],l.prototype,"url",void 0),r([o({readOnly:!0})],l.prototype,"visibleSublayers",null),r([o({type:d})],l.prototype,"extent",void 0),r([o()],l.prototype,"fullExtent",null),l=r([c("esri.layers.KMLLayer")],l);const Pt=l;export{Pt as default}; diff --git a/custom-toc-separator/assets/KMLLayer-DwQXpcMB-iNCyMt5e.js b/custom-toc-separator/assets/KMLLayer-DwQXpcMB-iNCyMt5e.js deleted file mode 100644 index d390d341..00000000 --- a/custom-toc-separator/assets/KMLLayer-DwQXpcMB-iNCyMt5e.js +++ /dev/null @@ -1 +0,0 @@ -import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as o,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./story-OUarUCIt.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as C}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as N}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as K}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as P}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{Z as W}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-DWwDrVZj.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([o()],a.prototype,"description",void 0),r([o({type:d})],a.prototype,"fullExtent",void 0),r([o()],a.prototype,"id",void 0),r([o({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([o({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([o({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([o({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([o({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([o()],a.prototype,"sourceJSON",void 0),r([o()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let l=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([o({readOnly:!0})],l.prototype,"allSublayers",void 0),r([o({type:g})],l.prototype,"outSpatialReference",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],l.prototype,"path",void 0),r([o({readOnly:!0,json:{read:!1,write:!1}})],l.prototype,"legendEnabled",void 0),r([o({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),r([o({type:["KML"]})],l.prototype,"operationalLayerType",void 0),r([o({})],l.prototype,"resourceInfo",void 0),r([o({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],l.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],l.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],l.prototype,"readSublayers",null),r([M("sublayers")],l.prototype,"writeSublayers",null),r([o({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),r([o({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],l.prototype,"title",null),r([o(W)],l.prototype,"url",void 0),r([o({readOnly:!0})],l.prototype,"visibleSublayers",null),r([o({type:d})],l.prototype,"extent",void 0),r([o()],l.prototype,"fullExtent",null),l=r([c("esri.layers.KMLLayer")],l);const Pt=l;export{Pt as default}; diff --git a/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-CxMI6C87.js b/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-CxMI6C87.js deleted file mode 100644 index 7c8be743..00000000 --- a/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-CxMI6C87.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,c8 as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./story-OUarUCIt.js";import{W as H,K as T}from"./projection-BA9M1R7d-Cytmrlsd.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-DWwDrVZj.js";import{y as Y}from"./utils-9sQxfkoa-Djr5L7DU.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-BO796kOM.js";import{d as it}from"./BitmapContainer-BC8fvmFc-kxGu4sMT.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-DehQ-_Za.js";import{d as M}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import{F as ot}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-CLtHlEj9.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-DeIeQX6y.js";import{M as ct}from"./rasterUtils-DqAu9qES-BGxTS9rh.js";import{H as j,V as dt}from"./Texture-BCt2hphT-Bv29bzNX.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-CRZNTeK3.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ee=d;export{Ee as default}; diff --git a/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-DHdqYHmK.js b/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-DHdqYHmK.js new file mode 100644 index 00000000..0c87d453 --- /dev/null +++ b/custom-toc-separator/assets/KMLLayerView2D-hWgNYT5J-DHdqYHmK.js @@ -0,0 +1 @@ +import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,c8 as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./story-DT1Ep1ux.js";import{W as H,K as T}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-CwR9R5MT.js";import{y as Y}from"./utils-9sQxfkoa-CwJW9dca.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import{d as it}from"./BitmapContainer-BC8fvmFc-CdhuTm0j.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-B3VRdVIM.js";import{d as M}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import{F as ot}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-oCO5F2l_.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-D0v5nxXn.js";import{M as ct}from"./rasterUtils-DqAu9qES-Ce2xEM6w.js";import{H as j,V as dt}from"./Texture-BCt2hphT-B6HwLstV.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-Dmz76NKn.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ee=d;export{Ee as default}; diff --git a/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DTl8aTaS.js b/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DTl8aTaS.js new file mode 100644 index 00000000..e05c5236 --- /dev/null +++ b/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DTl8aTaS.js @@ -0,0 +1 @@ +import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,dY as b,cx as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./story-DT1Ep1ux.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ-ocw70508.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js";import{a as F}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as P}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as j}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as z}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as x}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as K}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{Z as B}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-CKY-uOox.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-D8hB6lBb.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./clientSideDefaults-BqqayPct-B1aankCm.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";let r=class extends P(Y(K(F(z(x(I(j(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const Yt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{Yt as default}; diff --git a/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DaZh0NKT.js b/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DaZh0NKT.js deleted file mode 100644 index 3e2297d4..00000000 --- a/custom-toc-separator/assets/KnowledgeGraphLayer-BjNFJGLf-DaZh0NKT.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,dY as b,cx as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./story-OUarUCIt.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js";import{a as F}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as P}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as j}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as z}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as x}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as K}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{Z as B}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-BspkM59i.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-D5mx9kys.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./FeatureStore-Co2V0sVE-BIksXSjO.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";let r=class extends P(Y(K(F(z(x(I(j(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const Yt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{Yt as default}; diff --git a/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js b/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js deleted file mode 100644 index c597b81a..00000000 --- a/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as p,am as m,v as o,S as e,dA as a,i as s}from"./story-OUarUCIt.js";import{X as l,Y as n}from"./LayerView-Bish-E63-DehQ-_Za.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const ut=r;export{ut as default}; diff --git a/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js b/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js new file mode 100644 index 00000000..128d6b76 --- /dev/null +++ b/custom-toc-separator/assets/KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js @@ -0,0 +1 @@ +import{ag as p,am as m,v as o,S as e,dA as a,i as s}from"./story-DT1Ep1ux.js";import{X as l,Y as n}from"./LayerView-Bish-E63-B3VRdVIM.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const ut=r;export{ut as default}; diff --git a/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js b/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js new file mode 100644 index 00000000..031c7184 --- /dev/null +++ b/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lclayout-CcimkDVq-BWqQJHW2.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as Ve}from"./main-BTdHgocv.js";import{v as d,S as c,i as he,bW as G,bT as We,J as ze,n as ne,dL as Ze,eS as F,l as Ge,m as Ke,w as Xe,P as C,bL as et,ac as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,e9 as ge,bP as ot,g as at}from"./story-DT1Ep1ux.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-CKY-uOox.js";import{j as P}from"./Relationship-Db9GUmYx-D8hB6lBb.js";import{b as Q}from"./Query-BrwMGK8U-FWeI_AU8.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{d as yt}from"./workers-PiCjreoO-DrDY4oeh.js";import{D as ut}from"./Layer-ChoECxvZ-ocw70508.js";import{I as ct}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{f as ft}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as ee}from"./Field-C6hA1tZj-aKnzhZ32.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{w as qt}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{O as $t}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{w as Pt}from"./popupUtils-B0uZcXX0-mkpGjfro.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Ri(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Si(){return ye||(ye=Ve(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function vi(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function Ci(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function ki(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){We(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ze.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{Ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ke||i instanceof Xe?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:et,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([tt("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const Ai=f;export{O as A,Ri as B,Ce as D,Me as E,Re as I,vi as J,ve as L,ke as M,Se as N,Si as P,Ee as T,Ci as V,ki as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,Ai as t,_e as w}; diff --git a/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js b/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js deleted file mode 100644 index fc406e55..00000000 --- a/custom-toc-separator/assets/KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lclayout-CcimkDVq-BWqQJHW2.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as Ve}from"./main-lj2zzr_L.js";import{v as d,S as c,i as he,bW as G,bT as We,J as ze,n as ne,dL as Ze,eS as F,l as Ge,m as Ke,w as Xe,P as C,bL as et,ac as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,e9 as ge,bP as ot,g as at}from"./story-OUarUCIt.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-Cytmrlsd.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-BspkM59i.js";import{j as P}from"./Relationship-Db9GUmYx-D5mx9kys.js";import{b as Q}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{d as yt}from"./workers-PiCjreoO-mU03Z-E4.js";import{D as ut}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{I as ct}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{f as ft}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as ee}from"./Field-C6hA1tZj-DY7R6puO.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{w as qt}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{O as $t}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{w as Pt}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Ri(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Si(){return ye||(ye=Ve(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function vi(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function Ci(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function ki(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){We(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ze.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{Ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ke||i instanceof Xe?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:et,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([tt("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const Ai=f;export{O as A,Ri as B,Ce as D,Me as E,Re as I,vi as J,ve as L,ke as M,Se as N,Si as P,Ee as T,Ci as V,ki as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,Ai as t,_e as w}; diff --git a/custom-toc-separator/assets/LRUCache-C3erQTWv-6ABNHME-.js b/custom-toc-separator/assets/LRUCache-C3erQTWv-6ABNHME-.js deleted file mode 100644 index 9062e9dd..00000000 --- a/custom-toc-separator/assets/LRUCache-C3erQTWv-6ABNHME-.js +++ /dev/null @@ -1 +0,0 @@ -import{c$ as d}from"./story-OUarUCIt.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; diff --git a/custom-toc-separator/assets/LRUCache-C3erQTWv-D3oKynNB.js b/custom-toc-separator/assets/LRUCache-C3erQTWv-D3oKynNB.js new file mode 100644 index 00000000..0f2565ba --- /dev/null +++ b/custom-toc-separator/assets/LRUCache-C3erQTWv-D3oKynNB.js @@ -0,0 +1 @@ +import{c$ as d}from"./story-DT1Ep1ux.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; diff --git a/custom-toc-separator/assets/LabelMetric-BeluzH3o-D5oryYiP.js b/custom-toc-separator/assets/LabelMetric-BeluzH3o-D5oryYiP.js deleted file mode 100644 index 55db6bfa..00000000 --- a/custom-toc-separator/assets/LabelMetric-BeluzH3o-D5oryYiP.js +++ /dev/null @@ -1 +0,0 @@ -import{o as g,a1 as U,hm as b}from"./story-OUarUCIt.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as Y,H as L,V as B}from"./Texture-BCt2hphT-Bv29bzNX.js";import{F as f,I as c}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import{n as P}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{e as R,o as k}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";let m=class p{constructor(t,e,n,i,r,o,a){this.instanceId=t,this.textureKey=e,this.indexStart=n,this.indexCount=i,this.vertexStart=r,this.vertexCount=o,this.overlaps=a}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new p(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,n,i,r,o,a,h){t.push(e),t.push(n),t.push(i),t.push(r),t.push(o),t.push(a),t.push(h)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(t){const e=t.readInt32(),n=t.readInt32(),i=t.readInt32(),r=t.readInt32(),o=t.readInt32(),a=t.readInt32(),h=t.readInt32();return new p(e,n,i,r,o,a,h)}};m.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT;function I(s,t){if(t!==null){s.push(t.length);for(const e of t)e.serialize(s);return s}s.push(0)}function M(s,t,e){const n=s.readInt32(),i=new Array(n);for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;ri.map(i=>d[i]); -import{_ as p}from"./main-lj2zzr_L.js";import{I as h,bR as b,n as y,J as l,aU as m,a1 as d,a as f,f as v,o as g,v as r,C as E,S as i,i as w,aB as I}from"./story-OUarUCIt.js";import{k as _}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await p(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-DRZYQiud.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await p(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-CvMogBoG.js");return{fromUrl:n}},__vite__mapDeps([12,2,3,1,4,6,5,7,8]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return f(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await v(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:y})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const V=e;export{V as D}; diff --git a/custom-toc-separator/assets/Layer-ChoECxvZ-ocw70508.js b/custom-toc-separator/assets/Layer-ChoECxvZ-ocw70508.js new file mode 100644 index 00000000..dd657630 --- /dev/null +++ b/custom-toc-separator/assets/Layer-ChoECxvZ-ocw70508.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./portalLayers-Bh9bAhk4-iIxSwWC_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./arcgisLayers-CL8_MH7S-BtJ2TJ5e.js"])))=>i.map(i=>d[i]); +import{_ as p}from"./main-BTdHgocv.js";import{I as h,bR as b,n as y,J as l,aU as m,a1 as d,a as f,f as v,o as g,v as r,C as E,S as i,i as w,aB as I}from"./story-DT1Ep1ux.js";import{k as _}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await p(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-iIxSwWC_.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await p(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-BtJ2TJ5e.js");return{fromUrl:n}},__vite__mapDeps([12,2,3,1,4,6,5,7,8]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return f(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await v(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:y})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const V=e;export{V as D}; diff --git a/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js b/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js new file mode 100644 index 00000000..48d7dd05 --- /dev/null +++ b/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js @@ -0,0 +1 @@ +import{v as l,S as o,i as t,e as s,ag as v}from"./story-DT1Ep1ux.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; diff --git a/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-InRheW3z.js b/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-InRheW3z.js deleted file mode 100644 index 08865c6c..00000000 --- a/custom-toc-separator/assets/LayerFloorInfo-DRJ8wfwx-InRheW3z.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as o,i as t,e as s,ag as v}from"./story-OUarUCIt.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; diff --git a/custom-toc-separator/assets/LayerView-Bish-E63-B3VRdVIM.js b/custom-toc-separator/assets/LayerView-Bish-E63-B3VRdVIM.js new file mode 100644 index 00000000..278107ed --- /dev/null +++ b/custom-toc-separator/assets/LayerView-Bish-E63-B3VRdVIM.js @@ -0,0 +1 @@ +import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./story-DT1Ep1ux.js";import{x as V}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-1iVHX8OF.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; diff --git a/custom-toc-separator/assets/LayerView-Bish-E63-DehQ-_Za.js b/custom-toc-separator/assets/LayerView-Bish-E63-DehQ-_Za.js deleted file mode 100644 index 6b9d341c..00000000 --- a/custom-toc-separator/assets/LayerView-Bish-E63-DehQ-_Za.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./story-OUarUCIt.js";import{x as V}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-XPLsaos3.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; diff --git a/custom-toc-separator/assets/LercWorker-C1_0ReXV-Db3Rzk_s.js b/custom-toc-separator/assets/LercWorker-C1_0ReXV-Db3Rzk_s.js deleted file mode 100644 index b5511ebc..00000000 --- a/custom-toc-separator/assets/LercWorker-C1_0ReXV-Db3Rzk_s.js +++ /dev/null @@ -1 +0,0 @@ -import{hA as P}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";var b={};b.defaultNoDataValue=P(-1/0),b.decode=function(i,t){var s=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,s),c=t.noDataValue!=null?P(t.noDataValue):b.defaultNoDataValue,a=Y(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),r={width:e.width,height:e.height,pixelData:a.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return a.resultMask&&(r.maskData=a.resultMask),t.returnEncodedMask&&e.mask&&(r.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(r.fileInfo=X(e,c),t.computeUsedBitDepths&&(r.fileInfo.bitDepths=F(e))),r};var Y=function(i,t,s,e,c){var a,r,d=0,m=i.pixels.numBlocksX,k=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/k),p=2*i.maxZError;s=s||(i.mask?i.mask.bitset:null),a=new t(i.width*i.height),c&&s&&(r=new Uint8Array(i.width*i.height));for(var g,h,x=new Float32Array(y*v),U=0;U<=k;U++){var V=U!==k?v:i.height%k;if(V!==0)for(var M=0;M<=m;M++){var o=M!==m?y:i.width%m;if(o!==0){var D,l,f,w,n=U*i.width*v+M*y,B=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?D=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,x,i.pixels.maxValue),D=x),l=0):f=u.encoding===2?0:u.offset,s)for(h=0;h>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=m>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=mthis._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>Y(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=X(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:A,z:S}=u.geometry;F(v,[z,A,S])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(D(M)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Rt=s;export{Rt as default}; diff --git a/custom-toc-separator/assets/LineOfSightLayer-D6sUQaEP-DEHxgqol.js b/custom-toc-separator/assets/LineOfSightLayer-D6sUQaEP-DEHxgqol.js deleted file mode 100644 index e0e53ad9..00000000 --- a/custom-toc-separator/assets/LineOfSightLayer-D6sUQaEP-DEHxgqol.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as x,aa as _,d8 as y,v as e,S as i,w as b,i as h,ag as g,dA as P,ah as w,ax as O,am as j,j as T,aP as $,ip as C,it as F,jn as H}from"./story-OUarUCIt.js";import{y as N}from"./Analysis-BPgJ-FCw-DzBMoBqT.js";import{n as q,u as L}from"./featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js";import{C as m}from"./persistable-C6RBwzJi-BbuVIS8Z.js";import{q as R}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import{V as X}from"./projection-BA9M1R7d-Cytmrlsd.js";import{l as Y}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as M}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{E as U}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./main-lj2zzr_L.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import"./lineSegment-CcqvCARM-CznIGfdF.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-CYtArgCw.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";let a=class extends x(_(T)){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b,json:{write:{isRequired:!0}}})],a.prototype,"position",void 0),e([i({type:R}),m()],a.prototype,"elevationInfo",void 0),e([i(L)],a.prototype,"feature",void 0),a=e([h("esri.analysis.LineOfSightAnalysisObserver")],a);const E=a;let l=class extends x($){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b}),m()],l.prototype,"position",void 0),e([i({type:R}),m()],l.prototype,"elevationInfo",void 0),e([i(L)],l.prototype,"feature",void 0),l=e([h("esri.analysis.LineOfSightAnalysisTarget")],l);const I=l,f=g.ofType(I);let o=class extends N{constructor(t){super(t),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(w(()=>this._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>Y(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=X(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:A,z:S}=u.geometry;F(v,[z,A,S])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(D(M)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Rt=s;export{Rt as default}; diff --git a/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-CEFjNwIG.js b/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-CEFjNwIG.js deleted file mode 100644 index 6a738e31..00000000 --- a/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-CEFjNwIG.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./story-OUarUCIt.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as xe}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js";import{u as ze}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as We}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-BspkM59i.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-D5mx9kys.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./FeatureStore-Co2V0sVE-BIksXSjO.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Pa=f;export{Pa as default}; diff --git a/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-Cj8gdSBT.js b/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-Cj8gdSBT.js new file mode 100644 index 00000000..bcd699ab --- /dev/null +++ b/custom-toc-separator/assets/LinkChartLayer-KcYDvLxD-Cj8gdSBT.js @@ -0,0 +1 @@ +import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./story-DT1Ep1ux.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as xe}from"./Layer-ChoECxvZ-ocw70508.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js";import{u as ze}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as We}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-CKY-uOox.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-D8hB6lBb.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./clientSideDefaults-BqqayPct-B1aankCm.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Pa=f;export{Pa as default}; diff --git a/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif--LxOSVI5.js b/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif--LxOSVI5.js deleted file mode 100644 index d11ae71d..00000000 --- a/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif--LxOSVI5.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lyr3DWorker-Cx6akEQX-Bxt_snw4.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-lj2zzr_L.js";import{bw as T}from"./story-OUarUCIt.js";var p,N,f,g,m,d,S,b,I,U,L,D,h,R,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(f||(f={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(g||(g={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(o=>o.l).then(({default:o})=>{const n=o({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function w(t){if(await P(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const o={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),o.ptrs.push(u),o.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,o,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,c=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{A as destroyWasm,P as initialize,w as process}; diff --git a/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif-BZ1gIj3E.js b/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif-BZ1gIj3E.js new file mode 100644 index 00000000..34c29dad --- /dev/null +++ b/custom-toc-separator/assets/Lyr3DWorker-K2Vldrif-BZ1gIj3E.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lyr3DWorker-Cx6akEQX-Bxt_snw4.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as M}from"./main-BTdHgocv.js";import{bw as T}from"./story-DT1Ep1ux.js";var p,N,f,g,m,d,S,b,I,U,L,D,h,R,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(f||(f={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(g||(g={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(o=>o.l).then(({default:o})=>{const n=o({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function w(t){if(await P(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const o={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),o.ptrs.push(u),o.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,o,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,c=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{A as destroyWasm,P as initialize,w as process}; diff --git a/custom-toc-separator/assets/Map-1zd11DKO-BRm_14ZF.js b/custom-toc-separator/assets/Map-1zd11DKO-BRm_14ZF.js new file mode 100644 index 00000000..3b117beb --- /dev/null +++ b/custom-toc-separator/assets/Map-1zd11DKO-BRm_14ZF.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-Bq8iGB52.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-DnJXdOOq.js","./portalLayers-Bh9bAhk4-iIxSwWC_.js","./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./styleUtils-ChrJTYIw-DnWMc-4t.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-BTdHgocv.js";import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,$ as w,P as E,S as i,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./story-DT1Ep1ux.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-1Mix6R1G.js";import{o as ee}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{y as te}from"./loadAll-e978YItg-EK1YwFYX.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)f(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",U(e,this._get("layers")))}writeLayers(e,t,a,r){const n=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&n.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=n}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-Bq8iGB52.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.queryAll(n,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-Bq8iGB52.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.createSamplerAll(n,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",n=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-DnJXdOOq.js");return{populateOperationalLayers:v}},__vite__mapDeps([8,1,2,3,4,9,10,11,12,13,14,5,6,15]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([i({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([i({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([i({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([i({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ie(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ne(e){return!(!ie(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,n=!r&&e.includes("/");if(!r&&!n){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ne}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([i({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([i({readOnly:!0})],o.prototype,"allTables",void 0),s([i({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([i({readOnly:!0})],o.prototype,"editableLayers",void 0),s([i({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([i()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Te=o;export{Te as default}; diff --git a/custom-toc-separator/assets/Map-1zd11DKO-DZlipvJg.js b/custom-toc-separator/assets/Map-1zd11DKO-DZlipvJg.js deleted file mode 100644 index e47afcb2..00000000 --- a/custom-toc-separator/assets/Map-1zd11DKO-DZlipvJg.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-_Kjwwki9.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-BV4FNk7k.js","./portalLayers-Bh9bAhk4-DRZYQiud.js","./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./PortalItem-CctGdnxF-DgukgleB.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./styleUtils-ChrJTYIw-CbI3fdq_.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-lj2zzr_L.js";import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,$ as w,P as E,S as i,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./story-OUarUCIt.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-6qmF8bsX.js";import{o as ee}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{y as te}from"./loadAll-e978YItg-cyBswBq0.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)f(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",U(e,this._get("layers")))}writeLayers(e,t,a,r){const n=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&n.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=n}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-_Kjwwki9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.queryAll(n,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-_Kjwwki9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.createSamplerAll(n,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",n=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-BV4FNk7k.js");return{populateOperationalLayers:v}},__vite__mapDeps([8,1,2,3,4,9,10,11,12,13,14,5,6,15]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([i({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([i({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([i({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([i({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ie(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ne(e){return!(!ie(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,n=!r&&e.includes("/");if(!r&&!n){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ne}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([i({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([i({readOnly:!0})],o.prototype,"allTables",void 0),s([i({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([i({readOnly:!0})],o.prototype,"editableLayers",void 0),s([i({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([i()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Te=o;export{Te as default}; diff --git a/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-BLOVllPr.js b/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-BLOVllPr.js deleted file mode 100644 index 17d9944b..00000000 --- a/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-BLOVllPr.js +++ /dev/null @@ -1 +0,0 @@ -import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./story-OUarUCIt.js";import{y as L}from"./loadAll-e978YItg-cyBswBq0.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{c as R}from"./scaleUtils-DxsfQwK1-rzzukPSH.js";import{D as U}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-DEkAA9m8.js";import{a as J}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as k}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as A}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as V}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{Z as z}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-ClKzvvsE.js";import{i as C}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import{f as x}from"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";import{a as G}from"./versionUtils-LZYZz-38-CcEiEhYk.js";import{k as H}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./main-lj2zzr_L.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./QueryTask-CwHwH2rS-Cdg8UCnQ.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./executeForIds-Z1gkLduF-BLtp2DWt.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./executeQueryJSON-CcHnccia-C6q0seac.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Re=e;export{Re as default}; diff --git a/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-CtcDOdqG.js b/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-CtcDOdqG.js new file mode 100644 index 00000000..ad2f5f47 --- /dev/null +++ b/custom-toc-separator/assets/MapImageLayer-B_rP0PhA-CtcDOdqG.js @@ -0,0 +1 @@ +import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./story-DT1Ep1ux.js";import{y as L}from"./loadAll-e978YItg-EK1YwFYX.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{c as R}from"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import{D as U}from"./Layer-ChoECxvZ-ocw70508.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-BYFVn9A8.js";import{a as J}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as k}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as V}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{Z as z}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-CAFcOOUq.js";import{i as C}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import{f as x}from"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";import{a as G}from"./versionUtils-LZYZz-38-esAtUime.js";import{k as H}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./main-BTdHgocv.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./QueryTask-CwHwH2rS-LNltUUKG.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./executeForIds-Z1gkLduF-CKWTLnam.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Re=e;export{Re as default}; diff --git a/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-C5TAguXQ.js b/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-C5TAguXQ.js deleted file mode 100644 index 655865dc..00000000 --- a/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-C5TAguXQ.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./story-OUarUCIt.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import{d as c}from"./BitmapContainer-BC8fvmFc-kxGu4sMT.js";import{X as y,Y as f}from"./LayerView-Bish-E63-DehQ-_Za.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-Bei3OeVZ.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-ClKzvvsE.js";import{T as H}from"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js";import{x as V}from"./drapedUtils-BZ1SGPtE-2iUYAy9z.js";import"./main-lj2zzr_L.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./Bitmap-CcqmzvfR-BO796kOM.js";import"./scaleUtils-DxsfQwK1-rzzukPSH.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";import"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Bi=m;export{Bi as default}; diff --git a/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-CaxOQl48.js b/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-CaxOQl48.js new file mode 100644 index 00000000..26877363 --- /dev/null +++ b/custom-toc-separator/assets/MapImageLayerView2D-LI7T-1xm-CaxOQl48.js @@ -0,0 +1 @@ +import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./story-DT1Ep1ux.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import{d as c}from"./BitmapContainer-BC8fvmFc-CdhuTm0j.js";import{X as y,Y as f}from"./LayerView-Bish-E63-B3VRdVIM.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-BzAy5Mad.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-CAFcOOUq.js";import{T as H}from"./timeSupport-ohWmWReZ-CSAKuiyl.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js";import{x as V}from"./drapedUtils-BZ1SGPtE-Da6Q2jMK.js";import"./main-BTdHgocv.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";import"./languageUtils-BYxF9hRA-5dy33zDL.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Bi=m;export{Bi as default}; diff --git a/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-BR58wdZ7.js b/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-BR58wdZ7.js deleted file mode 100644 index 69e199e1..00000000 --- a/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-BR58wdZ7.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as a,i as T,d$ as F,d_ as G,e0 as v,jI as B,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,dK as K,aC as W,b0 as C,a0 as d,ac as A,n as V,jL as D}from"./story-OUarUCIt.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-Cytmrlsd.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import Y from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import ee from"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import{D as te}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as le}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{y as E}from"./Field-C6hA1tZj-DY7R6puO.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new G().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new B().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new O(J.map(e=>new m({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:$,popupInfo:P})=>z.fromJSON({attributes:$,geometry:S,symbol:_,popupTemplate:P}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const At=l;export{At as default}; diff --git a/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-Cx3vRzxv.js b/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-Cx3vRzxv.js new file mode 100644 index 00000000..2523b6ec --- /dev/null +++ b/custom-toc-separator/assets/MapNotesLayer-DauvjDLM-Cx3vRzxv.js @@ -0,0 +1 @@ +import{v as o,S as a,i as T,d$ as F,d_ as G,e0 as v,jI as B,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,dK as K,aC as W,b0 as C,a0 as d,ac as A,n as V,jL as D}from"./story-DT1Ep1ux.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import Y from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import ee from"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import{D as te}from"./Layer-ChoECxvZ-ocw70508.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as le}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{y as E}from"./Field-C6hA1tZj-aKnzhZ32.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new G().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new B().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new O(J.map(e=>new m({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:$,popupInfo:P})=>z.fromJSON({attributes:$,geometry:S,symbol:_,popupTemplate:P}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const At=l;export{At as default}; diff --git a/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-CXXkXeNB.js b/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-CXXkXeNB.js deleted file mode 100644 index e4ffe85f..00000000 --- a/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-CXXkXeNB.js +++ /dev/null @@ -1 +0,0 @@ -import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./story-OUarUCIt.js";import{X as v,Y as C}from"./LayerView-Bish-E63-DehQ-_Za.js";import{d as g}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const vt=n;export{vt as default}; diff --git a/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-DyebBMmH.js b/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-DyebBMmH.js new file mode 100644 index 00000000..fccb94c4 --- /dev/null +++ b/custom-toc-separator/assets/MapNotesLayerView2D-EusnP8A_-DyebBMmH.js @@ -0,0 +1 @@ +import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./story-DT1Ep1ux.js";import{X as v,Y as C}from"./LayerView-Bish-E63-B3VRdVIM.js";import{d as g}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const vt=n;export{vt as default}; diff --git a/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js b/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js deleted file mode 100644 index f1f29e1a..00000000 --- a/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); -import{_ as X}from"./main-lj2zzr_L.js";import{v as a,S as p,af as Y,g as ee,ac as U,n as J,J as te,i as I,bi as Q,a0 as re,e as B,aO as ie,dJ as se,j as oe,bp as ne,ai as ae,o as A,ag as le,aq as T,a2 as z,e0 as M,an as pe,p as ue,K as ye,$ as L,e4 as ce,bV as k,dW as he,f as de,bK as fe,bM as me}from"./story-OUarUCIt.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-rzzukPSH.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-2iUYAy9z.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-Djr5L7DU.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";import{k as je}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-911d_F5-.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),D=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=D?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=k(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return ie(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:Y,json:{read:ee,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:te,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const q=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=se.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([re("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=q.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=z();let _=null;function We(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends oe{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ne(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ae(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:le.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),z(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await X(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-BSOWzUJi.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new q({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=k(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,We as _}; diff --git a/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js b/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js new file mode 100644 index 00000000..1129009a --- /dev/null +++ b/custom-toc-separator/assets/MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); +import{_ as X}from"./main-BTdHgocv.js";import{v as a,S as p,af as Y,g as ee,ac as U,n as J,J as te,i as I,bi as Q,a0 as re,e as B,aO as ie,dJ as se,j as oe,bp as ne,ai as ae,o as A,ag as le,aq as T,a2 as z,e0 as M,an as pe,p as ue,K as ye,$ as L,e4 as ce,bV as k,dW as he,f as de,bK as fe,bM as me}from"./story-DT1Ep1ux.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-Da6Q2jMK.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-CwJW9dca.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";import{k as je}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),D=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=D?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=k(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return ie(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:Y,json:{read:ee,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:te,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const q=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=se.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([re("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=q.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=z();let _=null;function We(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends oe{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ne(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ae(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:le.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),z(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await X(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-DAfTVTEf.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new q({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=k(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,We as _}; diff --git a/custom-toc-separator/assets/MapView-BGOJJ8ch-Dabu63Ao.js b/custom-toc-separator/assets/MapView-BGOJJ8ch-Dabu63Ao.js new file mode 100644 index 00000000..867eb1a9 --- /dev/null +++ b/custom-toc-separator/assets/MapView-BGOJJ8ch-Dabu63Ao.js @@ -0,0 +1,14 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-CHjAOlyP.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./substitute-j49H6mVR-D_1hvId1.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-C2vgvXwY.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-DFuI-YVz.js","./AttachmentInfo-D9RFO8W2-B1dXzA4o.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./utils-DyydRFHu-C4YRMtgK.js","./Basemap-BEqqSTw9-1Mix6R1G.js","./loadAll-e978YItg-EK1YwFYX.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./writeUtils-D5qlLkwk-BD0oSm_9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./utils-DPtQ14k3-QfypPSGF.js","./parser-DyDJ-rlI-BVBmjSW8.js","./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-D3oKynNB.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./executeQueryJSON-CcHnccia-BAMZ5LEx.js","./utils-9sQxfkoa-CwJW9dca.js","./query-DFW9-NG_-SSagAgRu.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-Bq23Xwmj-Csxw19qV.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./shared-D1w-26bA-BBBcUeQg.js","./TimeOnly-DSMefxKy-52VbaSQ6.js","./FeatureLayer-BrRKw5Si-DV01qpqc.js","./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js","./commonProperties-BtIqvFU_-BAaMjACd.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js","./Relationship-PyhUibYK-Dl9eU1qo.js","./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js","./Layer-ChoECxvZ-ocw70508.js","./workers-PiCjreoO-DrDY4oeh.js","./editsZScale-BDsX6vv--CJojmgz5.js","./APIKeyMixin-BUMSx9ny-WDHyZfLR.js","./ArcGISService-BYA-y6X6-BWJQc6nI.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./CustomParametersMixin-vdKsTHer-D2O-ilop.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./FeatureEffectLayer-Cro89IEC-wxowDxbO.js","./FeatureEffect-CDEk9Es7-8jhaVJv-.js","./FeatureFilter-BCFHgLVU-DfMwTLEM.js","./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js","./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js","./labelingInfo-DGVNul26-DxpYAQDw.js","./labelUtils-BW14kBqX-B_97vWvS.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DbKLfNnN.js","./OrderedLayer-6Qsmrd_l-BekPpQJS.js","./OrderByInfo-GD2XnU8e-BH2q29Gm.js","./PortalLayer-CElnYuSQ-CcA75vOb.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./TemporalLayer-CpOrN_w9-B2VZ6x81.js","./TimeInfo-w_HB2CsF-CygrHAJu.js","./FeatureTemplate-SPHPD45f-Dk1o48TK.js","./FeatureType-C9hJmS6_-zoljUYGr.js","./fieldProperties-Bq26w7gt-c4nyNJP6.js","./versionUtils-LZYZz-38-esAtUime.js","./styleUtils-ChrJTYIw-DnWMc-4t.js","./popupUtils-B0uZcXX0-mkpGjfro.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-DUyzE86P.js","./Tile-D75RMC64-XRkD8ADC.js","./TileKey-C5IL-JBr-Do29X9ef.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-Cd63xfTl.js","./signal-CETehA7D-o0XgAOKb.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-1iVHX8OF.js","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./TileInfo-CWIRDhZl-C54e75zw.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-CobdaRul.js","./Map-1zd11DKO-BRm_14ZF.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-xYmcMbo2.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-B6HwLstV.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-uZSN6aFO.js","./geometryServiceUtils-nsujb7BH-BYj7eUAa.js","./project-DQKhruav-C6Tnpe-k.js","./webglDeps-Bgavuh0h-Dmz76NKn.js","./BufferObject-BM_7mcDb-D5jPRgIi.js","./Program-DLVwTiPA-D0v5nxXn.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-BId56203.js","./VertexArrayObject-M4iRGGoi-C6eC7r1-.js","./mapViewDeps-CUVU8gUp-DCOylsgg.js","./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-wKRDKh4R.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-CgyWo1Fc.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-Cg9V4YKU.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-C534NCdS.js","./SDFHelper-B6k8Ig6R-Df5Aqi8X.js","./floatRGBA-4pIJN00G-BOmhq_GU.js","./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js","./TurboLine-CIlsAy5m-BHDUzrZk.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-DlEO67jH.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js","./AttributeStore-DjyP9U7y-C9jFBUTt.js","./timeSupport-jPViR5jn-CHDjIIE2.js","./queryUtils-Brxu6254-qwN-s2Og.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-oCO5F2l_.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-CKukuAVJ.js","./utils-Dcs650Ic-DV1FVDdT.js","./grouping-RwmXkHDc-DhZ3sGff.js","./MeshWriterRegistry-CIC9Yk_f-D-N28B04.js","./GraphicsView2D-C4wYE2ut-CfB0sBaU.js","./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js","./GraphicContainer-DuOHUciE-CTSNq0lD.js","./AGraphicContainer-LUCT6Gle-1jMRt52t.js","./TechniqueInstance-DGTKoOL6-0VdCfDO3.js","./TileContainer-D48pXXgL-B6YzhmFG.js","./requestImageUtils-Ut4YcoNU-CZrsQx74.js","./scaleUtils-DxsfQwK1-BDJMc0pY.js","./geodesicUtils-B8mFUfTk-CbCbq6vS.js","./TileLayerView2D-CT-Yu10P-Bld-zHRh.js","./imageUtils-Co-ELErj-DEpR3hKq.js","./Bitmap-CcqmzvfR-ppkuK-SZ.js","./LayerView-Bish-E63-B3VRdVIM.js","./HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js","./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js","./MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js","./languageUtils-BYxF9hRA-5dy33zDL.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-BO7ByyLZ.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-Da6Q2jMK.js","./sublayerUtils-CyM0QC5B-CIwWTPAs.js","./popupUtils-nV1O8RUO-BOsTLw9-.js","./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js","./timeSupport-ohWmWReZ-CSAKuiyl.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-DEkPHEPx.js","./BitmapContainer-BC8fvmFc-CdhuTm0j.js","./ExportStrategy-BNE7Gp0u-BzAy5Mad.js","./CatalogLayerView2D-DaUVeBuS-DisjdVa4.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-BhFKg4Wm.js","./CatalogFootprintLayerView2D-C0bBWVdF-DyWxjKhB.js","./GeoRSSLayerView2D-BLTYupUX-DLSQs3Mr.js","./GraphicsLayerView2D-CGXlTqHO-CLGoHZ51.js","./GroupLayerView2D-BR-kLeLa-DbF51zzA.js","./ImageryLayerView2D-CVDvTIGY-ICFSIiIH.js","./RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js","./dataUtils-BkPy4R3C-CjC6pTlj.js","./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js","./ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js","./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js","./rasterUtils-DqAu9qES-Ce2xEM6w.js","./RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js","./KMLLayerView2D-hWgNYT5J-DHdqYHmK.js","./kmlUtils-C5oIEoOy-CwR9R5MT.js","./KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js","./MapImageLayerView2D-LI7T-1xm-CaxOQl48.js","./ExportImageParameters-DxyNGQ57-CAFcOOUq.js","./MapNotesLayerView2D-EusnP8A_-DyebBMmH.js","./MediaLayerView2D-COWFkA3m-DFOVIf2u.js","./perspectiveUtils-Bu88xlbg-3834DwlL.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-CdVlAClg.js","./OGCFeatureLayerView2D-CpSy5D2s-CXNVm2mS.js","./RouteLayerView2D-Bpui7Ggx-BtSAtlez.js","./Stop-he5xSAJJ-Cm3NmLQL.js","./StreamLayerView2D-Bh_aEalU-BBcyEYP-.js","./SubtypeGroupLayerView2D-Byn0xzbb-BGjNrWaa.js","./VectorTileLayerView2D-B9OYHbL4-Axm5-Bu1.js","./PooledRBush-DbfAmeLn-BhVBo5wc.js","./SourceLayerData-BT_Ywuvg-B8-206Wc.js","./StyleRepository-D3WuVprR-DmkdyZGe.js","./VideoLayerView2D-CLcxq4ZA-CHXecHV8.js","./GraphicsLayer-DfeGaYc1-shHP2mZF.js","./TelemetryDisplay-Bq2PXfI8-C3u5XocC.js","./WMSLayerView2D-Dz-z-fa9-DBRyUp6L.js","./ExportWMSImageParameters-CMk80WSM-DL05uTg1.js","./WMTSLayerView2D-Bl5FUDUu-BP_v6RMY.js","./calcite-button-Cm9_TJei-C4rXHwXx.js","./form-CRSw616T-DM6mxOFq.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-C3lhdKPd.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-BTu-x4Jk.js","./locale-Cn_GDVD_-Dy9CelfZ.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-C0_AGNdr.js","./t9n-C_hcZMZJ-BBqL2zVj.js","./icon-BXFbBbop-CoY6CcfD.js","./loader-Ch7Jr16w-DWxaqSJX.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-BPD9clRe.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-BTdHgocv.js";import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./story-DT1Ep1ux.js";import{c as mr}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-DrDY4oeh.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{o as Mr}from"./signal-CETehA7D-o0XgAOKb.js";import xr from"./Map-1zd11DKO-BRm_14ZF.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{v as Mi}from"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{b as Un}from"./Query-BrwMGK8U-FWeI_AU8.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-XRkD8ADC.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import{s as Kr}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{L as Yr}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-B6HwLstV.js";import{y as nl}from"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-CGLbrkRD.js";import al from"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-CHjAOlyP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-CHjAOlyP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-BYj7eUAa.js"),__vite__mapDeps([139,3,1,2,4,140,51,55]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function xu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),Pu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.state==="finished"&&(this._transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... + - shorter than ${fs/1e3/a}s, or + - shorter than ${h/1e3}s and the destination is close enough to the starting screen, or + - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-Dmz76NKn.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-DCOylsgg.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-Bld-zHRh.js"),__vite__mapDeps([195,3,1,2,4,125,45,46,24,47,29,30,166,133,148,149,58,150,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,44,48,160,27,22,23,158,146,145,128,132,159,161,162,163,164,59,169,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,57,156,157,39,137,167,168,178,179,180,186,187,196,197,191,198,118,199,189,190,200,201,202,203,64,204,193,205,206,207,208,131,10,119,120,121,6,7,123,18,19,20,21,38,124,77,71,72,126,130,136,41,138]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js"),__vite__mapDeps([209,3,1,2,4,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-DEkPHEPx.js"),__vite__mapDeps([212,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-DisjdVa4.js"),__vite__mapDeps([215,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-BhFKg4Wm.js"),__vite__mapDeps([216,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-DyWxjKhB.js"),__vite__mapDeps([217,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-DLSQs3Mr.js"),__vite__mapDeps([218,3,1,2,4,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,198,160,27,22,23,118,122,188,189,190,133,148,149,58,150,112,113,114,115,78,111,116,117,13,16,129,151,152,135,134,143,142,153,154,155,127,191,158,146,145,128,132,159,161,162,163,164,59,156,157,137,53,54,51,55,186,173,65,174,175,61,62,176,92,187,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,131,136,138]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO-CLGoHZ51.js"),__vite__mapDeps([219,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,211,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-DbF51zzA.js"),__vite__mapDeps([220,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-ICFSIiIH.js"),__vite__mapDeps([221,3,1,2,4,125,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,213,197,214,120,121,224,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-DHdqYHmK.js"),__vite__mapDeps([229,3,1,2,4,61,62,230,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,51,125,197,128,129,160,27,22,23,134,135,213,158,133,152,143,142,153,146,145,112,113,114,115,78,111,116,117,13,16,132,159,161,162,163,127,164,58,59,198,118,122,188,189,190,148,149,150,151,154,155,191,156,157,137,53,54,55,186,173,65,174,175,176,92,187,224,177,141,144,178,179,180,172,166,181,227,10,119,120,121,6,7,123,18,19,20,21,124,77,71,72,126,130,131,136,138]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-iGqn0dJ7.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-CaxOQl48.js"),__vite__mapDeps([232,3,1,2,4,125,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,214,120,121,197,233,193,205,207,210,200,201,202,203,64,204,206,208,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-DyebBMmH.js"),__vite__mapDeps([234,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-DFOVIf2u.js"),__vite__mapDeps([235,1,2,3,4,33,25,34,35,36,37,38,39,40,32,31,41,42,43,44,45,46,24,47,29,30,48,49,236,61,62,187,54,128,237,114,132,166,133,148,149,58,150,112,113,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,160,27,22,23,158,146,145,159,161,162,163,164,59,169,170,171,172,173,65,174,175,53,51,55,176,92,57,156,157,137,167,168,178,179,180,186,183,184,238,198,118,131,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,136,138]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-CXNVm2mS.js"),__vite__mapDeps([239,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-BtSAtlez.js"),__vite__mapDeps([240,3,1,2,4,119,241,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-BBcyEYP-.js"),__vite__mapDeps([242,3,1,2,4,63,14,15,209,38,160,27,22,23,24,164,58,59,88,13,16,210,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-BGjNrWaa.js"),__vite__mapDeps([243,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-Axm5-Bu1.js"),__vite__mapDeps([244,3,1,2,4,34,169,78,151,134,135,57,182,166,157,113,31,112,24,114,115,111,116,117,13,14,15,16,128,150,142,146,162,158,133,152,30,143,153,129,145,132,159,160,27,22,23,161,163,127,164,58,59,120,121,191,245,246,247,45,46,47,130,198,118,122,200,131,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,136,137,41,138]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-CHXecHV8.js"),__vite__mapDeps([248,3,1,2,4,249,125,77,16,82,83,27,22,23,24,100,69,39,250,238,128,129,159,53,54,51,55,158,133,152,30,135,134,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,132,160,161,162,163,127,164,58,59,156,148,149,150,29,151,154,155,46,47,122,157,137,61,62,198,118,188,189,190,191,186,42,43,44,45,48,173,65,174,175,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,71,72,126,130,131,136,41,138]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-LOdFT3-o.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-DBRyUp6L.js"),__vite__mapDeps([251,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,252,210,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-BP_v6RMY.js"),__vite__mapDeps([253,3,1,2,4,196,197,128,24,129,160,27,22,23,134,135,158,133,152,30,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,16,132,159,161,162,163,127,164,58,59,191,198,118,122,200,131,10,119,61,62,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,137,41,138]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",a=>this._handlePointerDown(a)),this.registerIncoming("pointer-up",a=>this._handlePointerLoss(a,"pointer-up")),this.registerIncoming("pointer-capture-lost",a=>this._handlePointerLoss(a,"pointer-capture-lost")),this.registerIncoming("pointer-cancel",a=>this._handlePointerLoss(a,"pointer-cancel")),this._moveHandle=this.registerIncoming("pointer-move",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Su=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],ku=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function Eu(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Cu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Iu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Du(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Ru(t){return Ip.toJSON(t)}function Lu(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Vu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Ou=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([268,265,6,3,1,2,4,7,256,263]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-Dmz76NKn.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-DCOylsgg.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} +-> Null LayerViewManager: ${!this.layerViewManager} +-> Null LabelManager: ${!this.labelManager} +-> Null GraphicsView: ${!this.graphicsView} +-> layerViewManager.updating: ${this.layerViewManager?.updating} +-> labelManager.updating: ${this.labelManager?.updating} +-> graphicsView.updating: ${this.graphicsView?.updating} +-> allLayerViews: ${JSON.stringify(i)} +-> updatingMagnifier: ${t} +`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}get visibleArea(){const t=this.stateManager.visibleArea;return t&&new Xs({rings:[t.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(t){this.stateManager.zoom=t}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(t,e){return this.goToManager.goTo(t,e)}async hitTest(t,e){return Op(this,t,e)}async takeScreenshot(t){return Wp(this._getScreenshotView(t),t)}toMap(t){if(!this.ready)return null;const e=vo(t)?fo(this,t):t;return this.stateManager.toMap(e)}toScreen(t,e){return this.stateManager.toScreen(t,e)}on(t,e,i,n){return this.inputManager&&this.viewEvents.on(t,e,i,n)||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){this.graphicsView&&this.graphicsView.graphicUpdateHandler(t)}whenReady(){return new Promise(t=>{this.ready?t(this):this._resolveWhenReady.push(t)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Ui(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Ui(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(t){return ws.hasLayerViewModule(t)}importLayerView(t){return ws.importLayerView(t)}pixelSizeAt(){return this.ready?this.resolution:(D.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(t){const e=this.toMap(t),i=await this.hitTest(t),n=this.allLayerViews.toArray().filter(c=>c.clips.every(p=>Xo(this,p,t,e))).reverse(),s=new globalThis.Map(n.map(c=>[c.layer.uid,c])),o=[];let a=0,h=0;for(;athis._updateStageChildren()),e.on("webgl-error",a=>this.fatalError=a.error),w(()=>this.stationary,a=>e.stationary=a,ct),w(()=>this.background,a=>{e.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},ct),w(()=>this.magnifier,a=>this._magnifierView.magnifier=a,ct),w(()=>this.grid,a=>this._gridView.grid=a,ct),w(()=>this.renderingOptions,a=>e.renderingOptions=a,ct),w(()=>this.highlights.items.map(a=>({name:a.name,options:{fillColor:a.options.color,haloColor:a.options.haloColor,fillOpacity:a.options.fillOpacity,haloOpacity:a.options.haloOpacity,haloWidth:a.options.haloWidth,haloBlur:a.options.haloBlur}})),()=>{e.highlightGradient=Dp(e.highlightGradient,this.highlights.items)},ct),w(()=>this.state.id,()=>e.state=this.state,ct)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const t=this.graphicsView;this.stage.addChild(t.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const t=new Ar(fr.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",t);const e=new fa({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new va(t)});this._set("graphicsView",e)}_destroySpatialReferenceDependentProperties(){const t=this.graphicsView;this._set("graphicsView",null),t.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(t){const{allLayerViews:e,padding:i,size:n,stage:s}=this;return{allLayerViews:e,backgroundColor:t?.ignoreBackground?null:this.background?.color,padding:i,size:n,stage:s}}_spatialReferenceChanged(t){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(t),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};v.type="2d",r([l({readOnly:!0})],v.prototype,"animationManager",void 0),r([l({constructOnly:!0})],v.prototype,"deactivatedWebGLExtensions",void 0),r([l({constructOnly:!0})],v.prototype,"debugWebGLExtensions",void 0),r([l({readOnly:!0})],v.prototype,"featuresTilingScheme",void 0),r([l({readOnly:!0})],v.prototype,"fullOpacity",void 0),r([l()],v.prototype,"goToManager",void 0),r([l({readOnly:!0})],v.prototype,"graphicsTileStore",null),r([l()],v.prototype,"graphicsView",void 0),r([l()],v.prototype,"stateManager",void 0),r([l()],v.prototype,"constraintsInfo",null),r([l({readOnly:!0})],v.prototype,"state",null),r([l()],v.prototype,"initialExtentRequired",null),r([l()],v.prototype,"labelManager",void 0),r([l({readOnly:!0})],v.prototype,"mapViewNavigation",void 0),r([l({constructOnly:!0})],v.prototype,"renderCanvas",void 0),r([l()],v.prototype,"renderingOptions",void 0),r([l({constructOnly:!0})],v.prototype,"supersampleScreenshotsEnabled",void 0),r([l({readOnly:!0})],v.prototype,"supportsGround",void 0),r([l()],v.prototype,"defaultsFromMapSettings",null),r([l({readOnly:!0})],v.prototype,"typeSpecificPreconditionsReady",null),r([l()],v.prototype,"animation",null),r([l({type:al})],v.prototype,"background",null),r([l()],v.prototype,"center",null),r([l({type:Go})],v.prototype,"constraints",null),r([l()],v.prototype,"extent",null),r([l()],v.prototype,"floors",void 0),r([l()],v.prototype,"grid",void 0),r([l({type:Yt})],v.prototype,"highlightOptions",null),r([l({type:L.ofType(pe)})],v.prototype,"highlights",void 0),r([l({readOnly:!0})],v.prototype,"inputManager",void 0),r([l()],v.prototype,"map",void 0),r([l()],v.prototype,"padding",null),r([l({readOnly:!0})],v.prototype,"rendering",null),r([l()],v.prototype,"resizeAlign",null),r([l({readOnly:!0})],v.prototype,"resolution",null),r([l()],v.prototype,"rotation",null),r([l()],v.prototype,"scale",null),r([l({constructOnly:!0})],v.prototype,"spatialReferenceLocked",void 0),r([l()],v.prototype,"stationary",null),r([l({readOnly:!0})],v.prototype,"tileInfo",null),r([l({type:ha,readOnly:!0})],v.prototype,"timeline",void 0),r([l({readOnly:!0})],v.prototype,"type",void 0),r([l({readOnly:!0})],v.prototype,"updating",null),r([l({readOnly:!0})],v.prototype,"view2dType",void 0),r([l()],v.prototype,"viewpoint",null),r([l({readOnly:!0})],v.prototype,"visibleArea",null),r([l()],v.prototype,"zoom",null),r([l({readOnly:!0})],v.prototype,"navigating",null),r([l(),Bt(t=>t instanceof ga?t:Ga(ya,t))],v.prototype,"ui",void 0),v=r([_("esri.views.View2D")],v);const bd=v;let ii=class extends bd{constructor(t){super(t),this.view2dType="map"}};r([l({readOnly:!0})],ii.prototype,"view2dType",void 0),ii=r([_("esri.views.MapView")],ii);const Td=ii,Au=Object.freeze(Object.defineProperty({__proto__:null,default:Td},Symbol.toStringTag,{value:"Module"}));export{xh as $,Ds as A,Cu as B,Iu as C,Ko as D,Es as E,Sp as F,Vo as G,Du as H,pt as I,wo as J,dd as K,Cs as L,Cp as M,Ls as N,_h as O,gl as P,Ie as Q,li as R,Vs as S,rt as T,Ou as U,Au as V,At as _,Dp as a,Vp as b,Nh as c,cd as d,Ye as e,nt as f,Do as g,Vu as h,pe as i,xu as j,vi as k,Yt as l,Lo as m,Pu as n,Yo as o,Lh as p,Rp as q,Lp as r,Ru as s,Lu as t,xt as u,Su as v,ku as w,up as x,ha as y,Eu as z}; diff --git a/custom-toc-separator/assets/MapView-BGOJJ8ch-MH2z-up5.js b/custom-toc-separator/assets/MapView-BGOJJ8ch-MH2z-up5.js deleted file mode 100644 index de4ad43f..00000000 --- a/custom-toc-separator/assets/MapView-BGOJJ8ch-MH2z-up5.js +++ /dev/null @@ -1,14 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-Bu082Sf4.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./substitute-j49H6mVR-NuZWx4FX.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-lQMKFlS3.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-BqcUyGYR.js","./AttachmentInfo-D9RFO8W2-qR5MPnw_.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./utils-DyydRFHu-uR3F5VAW.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./loadAll-e978YItg-cyBswBq0.js","./PortalItem-CctGdnxF-DgukgleB.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./utils-DPtQ14k3-DGbScRZv.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./cimSymbolUtils-CKIzBgMU-CX4234se.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-6ABNHME-.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./executeQueryJSON-CcHnccia-C6q0seac.js","./utils-9sQxfkoa-Djr5L7DU.js","./query-DFW9-NG_-CLOB0soI.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-Bq23Xwmj-CIl5z47y.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./shared-D1w-26bA-BhDdbtTQ.js","./TimeOnly-DSMefxKy-C9JclgbM.js","./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./Layer-ChoECxvZ-DxWUU3pP.js","./workers-PiCjreoO-mU03Z-E4.js","./editsZScale-BDsX6vv--D74kwHO-.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./Tile-D75RMC64-DDmsm7e7.js","./TileKey-C5IL-JBr-Cy7bNm0k.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-2ansCCcJ.js","./signal-CETehA7D-TD-k6B-y.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-XPLsaos3.js","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./TileInfo-CWIRDhZl-561xzxdP.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js","./Map-1zd11DKO-DZlipvJg.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./GraphicsCollection-CWTXNZOX-EGgNeYwI.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Bv29bzNX.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-BKgsF61w.js","./geometryServiceUtils-nsujb7BH-DHlTWeVi.js","./project-DQKhruav-BOvaUqEJ.js","./webglDeps-Bgavuh0h-CRZNTeK3.js","./BufferObject-BM_7mcDb-Pn3dvEnK.js","./Program-DLVwTiPA-DeIeQX6y.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-5xKhv4ig.js","./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js","./mapViewDeps-CUVU8gUp-CuHQHwu6.js","./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-D5oryYiP.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-DR17gokR.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-DGKfmUxH.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./SDFHelper-B6k8Ig6R-D3_atHyF.js","./floatRGBA-4pIJN00G-DCWbfrRi.js","./PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js","./TurboLine-CIlsAy5m-BIV61-kY.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-C70OrCUT.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js","./AttributeStore-DjyP9U7y-r_lH0yBG.js","./timeSupport-jPViR5jn-BLBOCVnL.js","./queryUtils-Brxu6254-BZ9oWgik.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-CLtHlEj9.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js","./utils-Dcs650Ic-BN6ELyDC.js","./grouping-RwmXkHDc-saUNiwHr.js","./MeshWriterRegistry-CIC9Yk_f-BkUQh61q.js","./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js","./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js","./GraphicContainer-DuOHUciE-DpgZsbDS.js","./AGraphicContainer-LUCT6Gle-BEOATdol.js","./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js","./TileContainer-D48pXXgL-DF8HooMp.js","./requestImageUtils-Ut4YcoNU-BuJzHX4v.js","./scaleUtils-DxsfQwK1-rzzukPSH.js","./geodesicUtils-B8mFUfTk-vCqdY65r.js","./TileLayerView2D-CT-Yu10P-D6qmdXwB.js","./imageUtils-Co-ELErj-CYao57HT.js","./Bitmap-CcqmzvfR-BO796kOM.js","./LayerView-Bish-E63-DehQ-_Za.js","./HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js","./RefreshableLayerView-BdQpGYly-B9bwJvtU.js","./MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js","./languageUtils-BYxF9hRA-Dxi5SK_d.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-DRLtE8-p.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-2iUYAy9z.js","./sublayerUtils-CyM0QC5B-CJNrSXfS.js","./popupUtils-nV1O8RUO-911d_F5-.js","./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js","./timeSupport-ohWmWReZ-Cgf7mpSC.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-BQr431UR.js","./BitmapContainer-BC8fvmFc-kxGu4sMT.js","./ExportStrategy-BNE7Gp0u-Bei3OeVZ.js","./CatalogLayerView2D-DaUVeBuS-DWXUhrfY.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-DMBhB-ZS.js","./CatalogFootprintLayerView2D-C0bBWVdF-4osTYfs5.js","./GeoRSSLayerView2D-BLTYupUX-DVxfLFkO.js","./GraphicsLayerView2D-CGXlTqHO-BvDpAP1D.js","./GroupLayerView2D-BR-kLeLa-B3xdFhH-.js","./ImageryLayerView2D-CVDvTIGY-DEdTe9_L.js","./RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js","./dataUtils-BkPy4R3C-YDmCFwfE.js","./rasterProjectionHelper-Calp0o_1-C6XacwGz.js","./ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js","./multidimensionalUtils-BwTugeu7-DCwX6ZId.js","./rasterUtils-DqAu9qES-BGxTS9rh.js","./RawBlockCache-Cj_tmHDm-TGuQW6oN.js","./KMLLayerView2D-hWgNYT5J-CxMI6C87.js","./kmlUtils-C5oIEoOy-DWwDrVZj.js","./KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js","./MapImageLayerView2D-LI7T-1xm-C5TAguXQ.js","./ExportImageParameters-DxyNGQ57-ClKzvvsE.js","./MapNotesLayerView2D-EusnP8A_-CXXkXeNB.js","./MediaLayerView2D-COWFkA3m-CcYomojC.js","./perspectiveUtils-Bu88xlbg-DDSQwPJw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-GxFD4tE3.js","./OGCFeatureLayerView2D-CpSy5D2s-DZwA89R5.js","./RouteLayerView2D-Bpui7Ggx-v-fxrPaX.js","./Stop-he5xSAJJ-Bv9OY5sh.js","./StreamLayerView2D-Bh_aEalU-CCV-pdDA.js","./SubtypeGroupLayerView2D-Byn0xzbb-CM05Li9N.js","./VectorTileLayerView2D-B9OYHbL4-D2L4mIEx.js","./PooledRBush-DbfAmeLn-D1-Igyfv.js","./SourceLayerData-BT_Ywuvg-C3HNN94j.js","./StyleRepository-D3WuVprR-D1hVbbHk.js","./VideoLayerView2D-CLcxq4ZA-DFhz_K4x.js","./GraphicsLayer-DfeGaYc1-CVunY75r.js","./TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js","./WMSLayerView2D-Dz-z-fa9-BVoi86GG.js","./ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js","./WMTSLayerView2D-Bl5FUDUu-CVIfYQAH.js","./calcite-button-Cm9_TJei-D0EvxauM.js","./form-CRSw616T-DuqBvFSD.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-Bw4n2n3w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-DyDwqoXd.js","./locale-Cn_GDVD_-CnEFMUdd.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-BCNzxmob.js","./t9n-C_hcZMZJ-DI6xkvhp.js","./icon-BXFbBbop-BKvGneFm.js","./loader-Ch7Jr16w-B4sW6aLS.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Eh4JVIZU.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-lj2zzr_L.js";import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./story-OUarUCIt.js";import{c as mr}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-mU03Z-E4.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-Cytmrlsd.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{o as Mr}from"./signal-CETehA7D-TD-k6B-y.js";import xr from"./Map-1zd11DKO-DZlipvJg.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{v as Mi}from"./TablesMixin-C8RojhYs-R4uQiiTY.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{b as Un}from"./Query-BrwMGK8U-gUIs0TS1.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-DDmsm7e7.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import{s as Kr}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{L as Yr}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-Bv29bzNX.js";import{y as nl}from"./imageUtils-BA2D6Uf1-rtvarRV-.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-5qCYzF4G.js";import al from"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-Bu082Sf4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-Bu082Sf4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0?this._stopDrag=!0:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-DHlTWeVi.js"),__vite__mapDeps([139,3,1,2,4,140,51,55]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function xu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),Pu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.state==="finished"&&(this._transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... - - shorter than ${fs/1e3/a}s, or - - shorter than ${h/1e3}s and the destination is close enough to the starting screen, or - - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-CRZNTeK3.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CuHQHwu6.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-D6qmdXwB.js"),__vite__mapDeps([195,3,1,2,4,125,45,46,24,47,29,30,166,133,148,149,58,150,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,44,48,160,27,22,23,158,146,145,128,132,159,161,162,163,164,59,169,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,57,156,157,39,137,167,168,178,179,180,186,187,196,197,191,198,118,199,189,190,200,201,202,203,64,204,193,205,206,207,208,131,10,119,120,121,6,7,123,18,19,20,21,38,124,77,71,72,126,130,136,41,138]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js"),__vite__mapDeps([209,3,1,2,4,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-BQr431UR.js"),__vite__mapDeps([212,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-DWXUhrfY.js"),__vite__mapDeps([215,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-DMBhB-ZS.js"),__vite__mapDeps([216,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-4osTYfs5.js"),__vite__mapDeps([217,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-DVxfLFkO.js"),__vite__mapDeps([218,3,1,2,4,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,198,160,27,22,23,118,122,188,189,190,133,148,149,58,150,112,113,114,115,78,111,116,117,13,16,129,151,152,135,134,143,142,153,154,155,127,191,158,146,145,128,132,159,161,162,163,164,59,156,157,137,53,54,51,55,186,173,65,174,175,61,62,176,92,187,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,131,136,138]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO-BvDpAP1D.js"),__vite__mapDeps([219,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,211,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-B3xdFhH-.js"),__vite__mapDeps([220,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-DEdTe9_L.js"),__vite__mapDeps([221,3,1,2,4,125,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,213,197,214,120,121,224,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-CxMI6C87.js"),__vite__mapDeps([229,3,1,2,4,61,62,230,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,51,125,197,128,129,160,27,22,23,134,135,213,158,133,152,143,142,153,146,145,112,113,114,115,78,111,116,117,13,16,132,159,161,162,163,127,164,58,59,198,118,122,188,189,190,148,149,150,151,154,155,191,156,157,137,53,54,55,186,173,65,174,175,176,92,187,224,177,141,144,178,179,180,172,166,181,227,10,119,120,121,6,7,123,18,19,20,21,124,77,71,72,126,130,131,136,138]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-CHFh4e6R.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-C5TAguXQ.js"),__vite__mapDeps([232,3,1,2,4,125,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,214,120,121,197,233,193,205,207,210,200,201,202,203,64,204,206,208,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-CXXkXeNB.js"),__vite__mapDeps([234,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-CcYomojC.js"),__vite__mapDeps([235,1,2,3,4,33,25,34,35,36,37,38,39,40,32,31,41,42,43,44,45,46,24,47,29,30,48,49,236,61,62,187,54,128,237,114,132,166,133,148,149,58,150,112,113,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,160,27,22,23,158,146,145,159,161,162,163,164,59,169,170,171,172,173,65,174,175,53,51,55,176,92,57,156,157,137,167,168,178,179,180,186,183,184,238,198,118,131,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,136,138]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-DZwA89R5.js"),__vite__mapDeps([239,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-v-fxrPaX.js"),__vite__mapDeps([240,3,1,2,4,119,241,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-CCV-pdDA.js"),__vite__mapDeps([242,3,1,2,4,63,14,15,209,38,160,27,22,23,24,164,58,59,88,13,16,210,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-CM05Li9N.js"),__vite__mapDeps([243,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-D2L4mIEx.js"),__vite__mapDeps([244,3,1,2,4,34,169,78,151,134,135,57,182,166,157,113,31,112,24,114,115,111,116,117,13,14,15,16,128,150,142,146,162,158,133,152,30,143,153,129,145,132,159,160,27,22,23,161,163,127,164,58,59,120,121,191,245,246,247,45,46,47,130,198,118,122,200,131,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,136,137,41,138]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-DFhz_K4x.js"),__vite__mapDeps([248,3,1,2,4,249,125,77,16,82,83,27,22,23,24,100,69,39,250,238,128,129,159,53,54,51,55,158,133,152,30,135,134,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,132,160,161,162,163,127,164,58,59,156,148,149,150,29,151,154,155,46,47,122,157,137,61,62,198,118,188,189,190,191,186,42,43,44,45,48,173,65,174,175,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,71,72,126,130,131,136,41,138]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-B9U9if11.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-BVoi86GG.js"),__vite__mapDeps([251,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,252,210,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-CVIfYQAH.js"),__vite__mapDeps([253,3,1,2,4,196,197,128,24,129,160,27,22,23,134,135,158,133,152,30,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,16,132,159,161,162,163,127,164,58,59,191,198,118,122,200,131,10,119,61,62,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,137,41,138]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",a=>this._handlePointerDown(a)),this.registerIncoming("pointer-up",a=>this._handlePointerLoss(a,"pointer-up")),this.registerIncoming("pointer-capture-lost",a=>this._handlePointerLoss(a,"pointer-capture-lost")),this.registerIncoming("pointer-cancel",a=>this._handlePointerLoss(a,"pointer-cancel")),this._moveHandle=this.registerIncoming("pointer-move",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Su=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],ku=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function Eu(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Cu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Iu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Du(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Ru(t){return Ip.toJSON(t)}function Lu(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Vu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Ou=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([268,265,6,3,1,2,4,7,256,263]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-CRZNTeK3.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CuHQHwu6.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} --> Null LayerViewManager: ${!this.layerViewManager} --> Null LabelManager: ${!this.labelManager} --> Null GraphicsView: ${!this.graphicsView} --> layerViewManager.updating: ${this.layerViewManager?.updating} --> labelManager.updating: ${this.labelManager?.updating} --> graphicsView.updating: ${this.graphicsView?.updating} --> allLayerViews: ${JSON.stringify(i)} --> updatingMagnifier: ${t} -`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}get visibleArea(){const t=this.stateManager.visibleArea;return t&&new Xs({rings:[t.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference})}get zoom(){return this.stateManager.zoom??-1}set zoom(t){this.stateManager.zoom=t}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(t,e){return this.goToManager.goTo(t,e)}async hitTest(t,e){return Op(this,t,e)}async takeScreenshot(t){return Wp(this._getScreenshotView(t),t)}toMap(t){if(!this.ready)return null;const e=vo(t)?fo(this,t):t;return this.stateManager.toMap(e)}toScreen(t,e){return this.stateManager.toScreen(t,e)}on(t,e,i,n){return this.inputManager&&this.viewEvents.on(t,e,i,n)||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){this.graphicsView&&this.graphicsView.graphicUpdateHandler(t)}whenReady(){return new Promise(t=>{this.ready?t(this):this._resolveWhenReady.push(t)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Ui(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Ui(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(t){return ws.hasLayerViewModule(t)}importLayerView(t){return ws.importLayerView(t)}pixelSizeAt(){return this.ready?this.resolution:(D.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(t){const e=this.toMap(t),i=await this.hitTest(t),n=this.allLayerViews.toArray().filter(c=>c.clips.every(p=>Xo(this,p,t,e))).reverse(),s=new globalThis.Map(n.map(c=>[c.layer.uid,c])),o=[];let a=0,h=0;for(;athis._updateStageChildren()),e.on("webgl-error",a=>this.fatalError=a.error),w(()=>this.stationary,a=>e.stationary=a,ct),w(()=>this.background,a=>{e.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},ct),w(()=>this.magnifier,a=>this._magnifierView.magnifier=a,ct),w(()=>this.grid,a=>this._gridView.grid=a,ct),w(()=>this.renderingOptions,a=>e.renderingOptions=a,ct),w(()=>this.highlights.items.map(a=>({name:a.name,options:{fillColor:a.options.color,haloColor:a.options.haloColor,fillOpacity:a.options.fillOpacity,haloOpacity:a.options.haloOpacity,haloWidth:a.options.haloWidth,haloBlur:a.options.haloBlur}})),()=>{e.highlightGradient=Dp(e.highlightGradient,this.highlights.items)},ct),w(()=>this.state.id,()=>e.state=this.state,ct)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const t=this.graphicsView;this.stage.addChild(t.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const t=new Ar(fr.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",t);const e=new fa({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new va(t)});this._set("graphicsView",e)}_destroySpatialReferenceDependentProperties(){const t=this.graphicsView;this._set("graphicsView",null),t.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(t){const{allLayerViews:e,padding:i,size:n,stage:s}=this;return{allLayerViews:e,backgroundColor:t?.ignoreBackground?null:this.background?.color,padding:i,size:n,stage:s}}_spatialReferenceChanged(t){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(t),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};v.type="2d",r([l({readOnly:!0})],v.prototype,"animationManager",void 0),r([l({constructOnly:!0})],v.prototype,"deactivatedWebGLExtensions",void 0),r([l({constructOnly:!0})],v.prototype,"debugWebGLExtensions",void 0),r([l({readOnly:!0})],v.prototype,"featuresTilingScheme",void 0),r([l({readOnly:!0})],v.prototype,"fullOpacity",void 0),r([l()],v.prototype,"goToManager",void 0),r([l({readOnly:!0})],v.prototype,"graphicsTileStore",null),r([l()],v.prototype,"graphicsView",void 0),r([l()],v.prototype,"stateManager",void 0),r([l()],v.prototype,"constraintsInfo",null),r([l({readOnly:!0})],v.prototype,"state",null),r([l()],v.prototype,"initialExtentRequired",null),r([l()],v.prototype,"labelManager",void 0),r([l({readOnly:!0})],v.prototype,"mapViewNavigation",void 0),r([l({constructOnly:!0})],v.prototype,"renderCanvas",void 0),r([l()],v.prototype,"renderingOptions",void 0),r([l({constructOnly:!0})],v.prototype,"supersampleScreenshotsEnabled",void 0),r([l({readOnly:!0})],v.prototype,"supportsGround",void 0),r([l()],v.prototype,"defaultsFromMapSettings",null),r([l({readOnly:!0})],v.prototype,"typeSpecificPreconditionsReady",null),r([l()],v.prototype,"animation",null),r([l({type:al})],v.prototype,"background",null),r([l()],v.prototype,"center",null),r([l({type:Go})],v.prototype,"constraints",null),r([l()],v.prototype,"extent",null),r([l()],v.prototype,"floors",void 0),r([l()],v.prototype,"grid",void 0),r([l({type:Yt})],v.prototype,"highlightOptions",null),r([l({type:L.ofType(pe)})],v.prototype,"highlights",void 0),r([l({readOnly:!0})],v.prototype,"inputManager",void 0),r([l()],v.prototype,"map",void 0),r([l()],v.prototype,"padding",null),r([l({readOnly:!0})],v.prototype,"rendering",null),r([l()],v.prototype,"resizeAlign",null),r([l({readOnly:!0})],v.prototype,"resolution",null),r([l()],v.prototype,"rotation",null),r([l()],v.prototype,"scale",null),r([l({constructOnly:!0})],v.prototype,"spatialReferenceLocked",void 0),r([l()],v.prototype,"stationary",null),r([l({readOnly:!0})],v.prototype,"tileInfo",null),r([l({type:ha,readOnly:!0})],v.prototype,"timeline",void 0),r([l({readOnly:!0})],v.prototype,"type",void 0),r([l({readOnly:!0})],v.prototype,"updating",null),r([l({readOnly:!0})],v.prototype,"view2dType",void 0),r([l()],v.prototype,"viewpoint",null),r([l({readOnly:!0})],v.prototype,"visibleArea",null),r([l()],v.prototype,"zoom",null),r([l({readOnly:!0})],v.prototype,"navigating",null),r([l(),Bt(t=>t instanceof ga?t:Ga(ya,t))],v.prototype,"ui",void 0),v=r([_("esri.views.View2D")],v);const bd=v;let ii=class extends bd{constructor(t){super(t),this.view2dType="map"}};r([l({readOnly:!0})],ii.prototype,"view2dType",void 0),ii=r([_("esri.views.MapView")],ii);const Td=ii,Au=Object.freeze(Object.defineProperty({__proto__:null,default:Td},Symbol.toStringTag,{value:"Module"}));export{xh as $,Ds as A,Cu as B,Iu as C,Ko as D,Es as E,Sp as F,Vo as G,Du as H,pt as I,wo as J,dd as K,Cs as L,Cp as M,Ls as N,_h as O,gl as P,Ie as Q,li as R,Vs as S,rt as T,Ou as U,Au as V,At as _,Dp as a,Vp as b,Nh as c,cd as d,Ye as e,nt as f,Do as g,Vu as h,pe as i,xu as j,vi as k,Yt as l,Lo as m,Pu as n,Yo as o,Lh as p,Rp as q,Lp as r,Ru as s,Lu as t,xt as u,Su as v,ku as w,up as x,ha as y,Eu as z}; diff --git a/custom-toc-separator/assets/MediaLayer-DiCs97gD-DULxKfbY.js b/custom-toc-separator/assets/MediaLayer-DiCs97gD-DULxKfbY.js deleted file mode 100644 index 30284b7e..00000000 --- a/custom-toc-separator/assets/MediaLayer-DiCs97gD-DULxKfbY.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-CELfFdQZ.js","./utils-BVWK2jiA-Bnz0n_UG.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./resourceUtils-BmW6QqlX-DTC51C_z.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-LGtMSbcd.js"])))=>i.map(i=>d[i]); -import{_ as Ve}from"./main-lj2zzr_L.js";import{v as i,i as R,S as l,w as d,bA as Ae,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as We,ag as ne,aB as Re,at as Be,I as Ge,ah as ze,$ as Ue,am as De,aC as Je,gH as ke,jb as Fe,bp as Ke,bP as F,ad as qe,aP as _e,e as Ye,B as Xe,jM as fe,bO as Ze,a4 as Qe,dY as ye,jD as be,jC as et,cx as Ie,cw as pe,cO as de,jN as tt,f as Oe,bX as nt,Y as ot,A as rt,bZ as ge,jO as it}from"./story-OUarUCIt.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as st}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as lt}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as at}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as ct}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-DDSQwPJw.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-Cytmrlsd.js";import{T as yt}from"./imageUtils-BA2D6Uf1-rtvarRV-.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-CYtArgCw.js";import{r as wt}from"./BoundsStore--N6o1xkF-OMiRxUp-.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const Y=se,re=oe(),p=b();let J=class extends Ye{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ae(Y){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const X=v,U=b();let T=class extends Y{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends Y{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ze(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new X({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:Y,typeMap:{"control-points":X,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:Y,typeMap:{"control-points":X}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends We(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return X.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Qe(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},et.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?tt(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${nt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=ot(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(rt(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=it(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(Be(Ge.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=ze(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(Ue(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",De(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=Je(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(ke(s),({normalizedCoords:a,element:c})=>{a!=null&&Fe(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Ke(async(t,n,o)=>{const{save:r,saveAs:s}=await Ve(()=>import("./mediaLayerUtils-CasWezAG-CELfFdQZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:X}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([qe("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const wn=m;export{wn as default}; diff --git a/custom-toc-separator/assets/MediaLayer-DiCs97gD-D_Q6ZKgd.js b/custom-toc-separator/assets/MediaLayer-DiCs97gD-D_Q6ZKgd.js new file mode 100644 index 00000000..a194e0f0 --- /dev/null +++ b/custom-toc-separator/assets/MediaLayer-DiCs97gD-D_Q6ZKgd.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-DyuMgcxq.js","./utils-BVWK2jiA-inSV67A_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./resourceUtils-BmW6QqlX-DJoDGZfh.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-DwzNb5YY.js"])))=>i.map(i=>d[i]); +import{_ as Ve}from"./main-BTdHgocv.js";import{v as i,i as R,S as l,w as d,bA as Ae,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as We,ag as ne,aB as Re,at as Be,I as Ge,ah as ze,$ as Ue,am as De,aC as Je,gH as ke,jb as Fe,bp as Ke,bP as F,ad as qe,aP as _e,e as Ye,B as Xe,jM as fe,bO as Ze,a4 as Qe,dY as ye,jD as be,jC as et,cx as Ie,cw as pe,cO as de,jN as tt,f as Oe,bX as nt,Y as ot,A as rt,bZ as ge,jO as it}from"./story-DT1Ep1ux.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as st}from"./Layer-ChoECxvZ-ocw70508.js";import{u as lt}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as at}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as ct}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-3834DwlL.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{T as yt}from"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-iZLDgXmu.js";import{r as wt}from"./BoundsStore--N6o1xkF-vTEQb1N7.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const Y=se,re=oe(),p=b();let J=class extends Ye{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ae(Y){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const X=v,U=b();let T=class extends Y{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends Y{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ze(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new X({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:Y,typeMap:{"control-points":X,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:Y,typeMap:{"control-points":X}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends We(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return X.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Qe(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},et.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?tt(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${nt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=ot(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(rt(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=it(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(Be(Ge.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=ze(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(Ue(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",De(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=Je(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(ke(s),({normalizedCoords:a,element:c})=>{a!=null&&Fe(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Ke(async(t,n,o)=>{const{save:r,saveAs:s}=await Ve(()=>import("./mediaLayerUtils-CasWezAG-DyuMgcxq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:X}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([qe("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const wn=m;export{wn as default}; diff --git a/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-DrlM61ik.js b/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-DrlM61ik.js deleted file mode 100644 index a9ee5928..00000000 --- a/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-DrlM61ik.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-Cimue3-F.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-CdnDHDm4.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./projection-BA9M1R7d-Cytmrlsd.js","./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js","./GraphicsLayer-DfeGaYc1-CVunY75r.js","./GraphicsCollection-CWTXNZOX-EGgNeYwI.js","./Layer-ChoECxvZ-DxWUU3pP.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./geodesicUtils-B8mFUfTk-vCqdY65r.js","./geometryEngine-CdPoFSE4-csWZJ4px.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BcGP1hGu.js","./Tile-D75RMC64-DDmsm7e7.js","./TileKey-C5IL-JBr-Cy7bNm0k.js","./QueueProcessor-DbfV9fLy-2ansCCcJ.js","./workers-PiCjreoO-mU03Z-E4.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./signal-CETehA7D-TD-k6B-y.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./MapView-BGOJJ8ch-MH2z-up5.js","./Cyclical-C_9rKUUQ-BqcUyGYR.js","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./TileInfo-CWIRDhZl-561xzxdP.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-DZlipvJg.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./loadAll-e978YItg-cyBswBq0.js","./PortalItem-CctGdnxF-DgukgleB.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Bv29bzNX.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-5qCYzF4G.js","./ColorBackground-gVZldRLm-BKgsF61w.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-lQMKFlS3.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-DlxNxa6f.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-CkV41Bdd.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-DnaZZmrr.js","./lineSegment-CcqvCARM-CznIGfdF.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./cimSymbolUtils-CKIzBgMU-CX4234se.js","./utils-SPbpQbmm-BNEY6jgo.js","./drapedUtils-BZ1SGPtE-2iUYAy9z.js","./colorUtils-Cthpxcks-DchH3ayn.js","./boundedPlane-DlvE0eNx-DGqkTDRl.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-lj2zzr_L.js";import{j as v,bp as y,a2 as a,k1 as g,aL as l,k2 as f,v as r,S as n,i as T}from"./story-OUarUCIt.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{_ as d}from"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends v{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=y(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(g(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(f(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await u(()=>import("./editingTools-BZ3yVmXf-Cimue3-F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([T("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-KjWPW9ki.js b/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-KjWPW9ki.js new file mode 100644 index 00000000..b4ac86f6 --- /dev/null +++ b/custom-toc-separator/assets/MediaLayerInteraction-BecfG-sO-KjWPW9ki.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-DEwlvZF_.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-DFXrlpsW.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./projection-BA9M1R7d-DTN1X2Bt.js","./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./UpdatingHandles-CUu3u1ms-CobdaRul.js","./GraphicsLayer-DfeGaYc1-shHP2mZF.js","./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js","./Layer-ChoECxvZ-ocw70508.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./parser-DyDJ-rlI-BVBmjSW8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./geodesicUtils-B8mFUfTk-CbCbq6vS.js","./geometryEngine-CdPoFSE4-B4-kNUBs.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-Bf311639.js","./Tile-D75RMC64-XRkD8ADC.js","./TileKey-C5IL-JBr-Do29X9ef.js","./QueueProcessor-DbfV9fLy-Cd63xfTl.js","./workers-PiCjreoO-DrDY4oeh.js","./ReactiveMap-CFk6jPfN-DUyzE86P.js","./signal-CETehA7D-o0XgAOKb.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./MapView-BGOJJ8ch-Dabu63Ao.js","./Cyclical-C_9rKUUQ-DFuI-YVz.js","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./TileInfo-CWIRDhZl-C54e75zw.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-BRm_14ZF.js","./Basemap-BEqqSTw9-1Mix6R1G.js","./loadAll-e978YItg-EK1YwFYX.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./writeUtils-D5qlLkwk-BD0oSm_9.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-xYmcMbo2.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-B6HwLstV.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-CGLbrkRD.js","./ColorBackground-gVZldRLm-uZSN6aFO.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-C2vgvXwY.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-CP4TXD5k.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-B4r28WKg.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-XgXaXzy3.js","./lineSegment-CcqvCARM-CJhaINhC.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js","./utils-SPbpQbmm-BKynsqQg.js","./drapedUtils-BZ1SGPtE-Da6Q2jMK.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./boundedPlane-DlvE0eNx-D5uXMAZI.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-BTdHgocv.js";import{j as v,bp as y,a2 as a,k1 as g,aL as l,k2 as f,v as r,S as n,i as T}from"./story-DT1Ep1ux.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{_ as d}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends v{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=y(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(g(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(f(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await u(()=>import("./editingTools-BZ3yVmXf-DEwlvZF_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([T("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-CcYomojC.js b/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-CcYomojC.js deleted file mode 100644 index ebe22337..00000000 --- a/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-CcYomojC.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-DrlM61ik.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js","./MapView-BGOJJ8ch-MH2z-up5.js","./Cyclical-C_9rKUUQ-BqcUyGYR.js","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./workers-PiCjreoO-mU03Z-E4.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./TileInfo-CWIRDhZl-561xzxdP.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-TD-k6B-y.js","./Map-1zd11DKO-DZlipvJg.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./loadAll-e978YItg-cyBswBq0.js","./PortalItem-CctGdnxF-DgukgleB.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./Layer-ChoECxvZ-DxWUU3pP.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./GraphicsCollection-CWTXNZOX-EGgNeYwI.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-DDmsm7e7.js","./TileKey-C5IL-JBr-Cy7bNm0k.js","./QueueProcessor-DbfV9fLy-2ansCCcJ.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Bv29bzNX.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-5qCYzF4G.js","./ColorBackground-gVZldRLm-BKgsF61w.js"])))=>i.map(i=>d[i]); -import{_ as D}from"./main-lj2zzr_L.js";import{v as l,S as p,i as b,ag as I,ah as h,ax as E,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-DDSQwPJw.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import{T as K}from"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import{H as ee,V as H}from"./Texture-BCt2hphT-Bv29bzNX.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-C70OrCUT.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js";import"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{$ as ie,a as re}from"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic-BN6ELyDC.js";import{A as le}from"./OverlayContainer-BEHcBpu0-GxFD4tE3.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-DehQ-_Za.js";import{i as he}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-BIV61-kY.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-saUNiwHr.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new I}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await D(()=>import("./MediaLayerInteraction-BecfG-sO-DrlM61ik.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Hi=y;export{Hi as default}; diff --git a/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-DFOVIf2u.js b/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-DFOVIf2u.js new file mode 100644 index 00000000..e088696c --- /dev/null +++ b/custom-toc-separator/assets/MediaLayerView2D-COWFkA3m-DFOVIf2u.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-KjWPW9ki.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./UpdatingHandles-CUu3u1ms-CobdaRul.js","./MapView-BGOJJ8ch-Dabu63Ao.js","./Cyclical-C_9rKUUQ-DFuI-YVz.js","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./workers-PiCjreoO-DrDY4oeh.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./TileInfo-CWIRDhZl-C54e75zw.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-o0XgAOKb.js","./Map-1zd11DKO-BRm_14ZF.js","./Basemap-BEqqSTw9-1Mix6R1G.js","./loadAll-e978YItg-EK1YwFYX.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./writeUtils-D5qlLkwk-BD0oSm_9.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./Layer-ChoECxvZ-ocw70508.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./ReactiveMap-CFk6jPfN-DUyzE86P.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-XRkD8ADC.js","./TileKey-C5IL-JBr-Do29X9ef.js","./QueueProcessor-DbfV9fLy-Cd63xfTl.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-xYmcMbo2.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-B6HwLstV.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-CGLbrkRD.js","./ColorBackground-gVZldRLm-uZSN6aFO.js"])))=>i.map(i=>d[i]); +import{_ as D}from"./main-BTdHgocv.js";import{v as l,S as p,i as b,ag as I,ah as h,ax as E,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-3834DwlL.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./utils-SPbpQbmm-BKynsqQg.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import{T as K}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{H as ee,V as H}from"./Texture-BCt2hphT-B6HwLstV.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-DlEO67jH.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js";import"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{$ as ie,a as re}from"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic-DV1FVDdT.js";import{A as le}from"./OverlayContainer-BEHcBpu0-CdVlAClg.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-B3VRdVIM.js";import{i as he}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-BHDUzrZk.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-DhZ3sGff.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new I}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await D(()=>import("./MediaLayerInteraction-BecfG-sO-KjWPW9ki.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Hi=y;export{Hi as default}; diff --git a/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-CJEYnztV.js b/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-CJEYnztV.js new file mode 100644 index 00000000..9166d548 --- /dev/null +++ b/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-CJEYnztV.js @@ -0,0 +1 @@ +import{o as I,gT as Z,ck as $,cl as Q,bK as b,eS as S,c9 as v}from"./story-DT1Ep1ux.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{f as E,h as _}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{Z as W}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{G as U,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import{o as D}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{i as Y}from"./fieldType-CD2CL2hr-B2sVi9me.js";import"./main-BTdHgocv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Je{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,c=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,f=e.geometryType||n.geometryType,o=!f;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!f))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!Y.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(f),templates:L(F),extent:y,geometryType:f,objectIdField:t,fields:l,hasZ:c,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:f,hasM:d,hasZ:c,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:f,hasM:d,hasZ:c}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const M=P(t,a);return this._nextObjectId=M+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([U(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,c=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",f=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||f})&&(c=p.name)}return{geometryType:l,spatialReference:d,objectIdField:c,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,c)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:f,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=f,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:c}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:c,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:c,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,f=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[c];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}f.push(o),a.push(j(o.attributes[c]))}}u.addMany(O([],f,n,d,l,c))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:f,geometry:o}=y,t=f?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??c;s.geometry=_(w(o,m),m,c)}if(f){const m=T(u,s.attributes,f);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Je as default}; diff --git a/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-DDSpsXMf.js b/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-DDSpsXMf.js deleted file mode 100644 index 1b800fcf..00000000 --- a/custom-toc-separator/assets/MemorySourceWorker-C9E3Klf8-DDSpsXMf.js +++ /dev/null @@ -1 +0,0 @@ -import{o as I,gT as Z,ck as $,cl as Q,bK as b,eS as S,c9 as v}from"./story-OUarUCIt.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{f as E,h as _}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{Z as W}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{G as U,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import{o as D}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{i as Y}from"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./main-lj2zzr_L.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Je{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,c=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,f=e.geometryType||n.geometryType,o=!f;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!f))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!Y.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(f),templates:L(F),extent:y,geometryType:f,objectIdField:t,fields:l,hasZ:c,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:f,hasM:d,hasZ:c,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:f,hasM:d,hasZ:c}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const M=P(t,a);return this._nextObjectId=M+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([U(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,c=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",f=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||f})&&(c=p.name)}return{geometryType:l,spatialReference:d,objectIdField:c,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,c)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:f,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=f,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:c}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:c,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:c,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,f=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[c];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}f.push(o),a.push(j(o.attributes[c]))}}u.addMany(O([],f,n,d,l,c))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:f,geometry:o}=y,t=f?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??c;s.geometry=_(w(o,m),m,c)}if(f){const m=T(u,s.attributes,f);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Je as default}; diff --git a/custom-toc-separator/assets/Mesh-DLzjDUIO-BGFhxEuV.js b/custom-toc-separator/assets/Mesh-DLzjDUIO-BGFhxEuV.js new file mode 100644 index 00000000..9f81bee4 --- /dev/null +++ b/custom-toc-separator/assets/Mesh-DLzjDUIO-BGFhxEuV.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-D5LO2jIx.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-xVxXS26y.js","./vec4-DWDdg1fj-CEZkOwEl.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-CzV-xLxU.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-CGLbrkRD.js","./mat4-DX7gBViE-B27FdgMD.js","./quat-BODLR7mS-Cqne66qw.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-C_KiPREG.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-nxYNdxWd.js","./Indices-DEr2HrWx-BChBDP40.js","./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./projection-BA9M1R7d-DTN1X2Bt.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-CP4TXD5k.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-UtmvndF2.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-BtL3V2y-.js"])))=>i.map(i=>d[i]); +import{_ as Se}from"./main-BTdHgocv.js";import{v as u,S as f,cS as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as Ht,ah as zt,gU as Vt,ji as kt,jj as Re,w as O,hZ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,dY as We,aO as _e,a1 as se,P as Te,jk as Yt,jl as qt,D as ae,i9 as L,dg as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,cy as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,eI as ir,h_ as we,d as ar,bj as lr,p as cr,dh as ur,hl as pr}from"./story-DT1Ep1ux.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-DmlAOJ8b.js";import{g as fr}from"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-BChBDP40.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-CP4TXD5k.js";import{v as Be}from"./deduplicate-D2d-E5Pw-UtmvndF2.js";import{p as I}from"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{b as He,P as Lr}from"./vec3-BazNroeq-xVxXS26y.js";import{B as ze,T as $r,M as Cr}from"./External-D_wl4XAw-CF3XmPYl.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as jr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-B27FdgMD.js";import{A as Or}from"./quat-BODLR7mS-Cqne66qw.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,j=k=class extends ve{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=ke(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return ke(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function zr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const Ye=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=Yt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=qt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function Yr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?qr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function qr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Me(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Me(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-D5LO2jIx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,jt(o,r))}function _t(e){return ge.fromBlob(e,jt(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class Ct{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new Ct(r,()=>URL.revokeObjectURL(r),void 0,n)}};function jt(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!ze(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>Cr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(ze)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const H=1,z=2,V=3,X={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[V,H,z],west:[-V,-H,z],north:[-H,V,z],south:[H,-V,z],up:[H,z,V],down:[H,-z,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),jr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(q(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(q(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(q(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}q(e.vertexAttributes.position,t,3,r),q(e.vertexAttributes.normal,t,3),q(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function q(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Y;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(Y,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(zt(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Re(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Me(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Se(()=>import("./gltfexport-Dj6nF2RN-BtL3V2y-.js"),__vite__mapDeps([44,1,2,3,4,24,7,25,6,11,15,30,5,23,20,31,32,33,34,35,10,12,16,13,14,17,21,26,27,36,37,9,38,29,39,40,8,41,42,43]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return C().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(C().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(C().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return C().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return C().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Se(()=>import("./loadGLTFMesh-C3-0Tu0H-D5LO2jIx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),no=S;export{no as F,ee as G,te as V,Pr as m,K as z}; diff --git a/custom-toc-separator/assets/Mesh-DLzjDUIO-BlTrUdFo.js b/custom-toc-separator/assets/Mesh-DLzjDUIO-BlTrUdFo.js deleted file mode 100644 index e665ae68..00000000 --- a/custom-toc-separator/assets/Mesh-DLzjDUIO-BlTrUdFo.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-C58EAHFm.js","./vec4-DWDdg1fj-CF_vNE3j.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-C05zTnsA.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-5qCYzF4G.js","./mat4-DX7gBViE-d6nV0_rZ.js","./quat-BODLR7mS-BrN0ZBC_.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-CrS2VhCe.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js","./Indices-DEr2HrWx-Bin5_zrY.js","./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./projection-BA9M1R7d-Cytmrlsd.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-DlxNxa6f.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-DsVnH-8X.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-Se_mmrc-.js"])))=>i.map(i=>d[i]); -import{_ as Se}from"./main-lj2zzr_L.js";import{v as u,S as f,cS as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as Ht,ah as zt,gU as Vt,ji as kt,jj as Re,w as O,hZ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,dY as We,aO as _e,a1 as se,P as Te,jk as Yt,jl as qt,D as ae,i9 as L,dg as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,cy as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,eI as ir,h_ as we,d as ar,bj as lr,p as cr,dh as ur,hl as pr}from"./story-OUarUCIt.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-mx7xOTc-.js";import{g as fr}from"./imageUtils-BA2D6Uf1-rtvarRV-.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-Bin5_zrY.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-DlxNxa6f.js";import{v as Be}from"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import{p as I}from"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-Cytmrlsd.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{b as He,P as Lr}from"./vec3-BazNroeq-C58EAHFm.js";import{B as ze,T as $r,M as Cr}from"./External-D_wl4XAw-BzQ8-YjD.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as jr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{A as Or}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,j=k=class extends ve{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=ke(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return ke(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function zr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const Ye=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=Yt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=qt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function Yr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?qr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function qr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Me(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Me(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,jt(o,r))}function _t(e){return ge.fromBlob(e,jt(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class Ct{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new Ct(r,()=>URL.revokeObjectURL(r),void 0,n)}};function jt(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!ze(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>Cr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(ze)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const H=1,z=2,V=3,X={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[V,H,z],west:[-V,-H,z],north:[-H,V,z],south:[H,-V,z],up:[H,z,V],down:[H,-z,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),jr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(q(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(q(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(q(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}q(e.vertexAttributes.position,t,3,r),q(e.vertexAttributes.normal,t,3),q(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function q(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Y;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(Y,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(zt(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Re(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Me(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Se(()=>import("./gltfexport-Dj6nF2RN-Se_mmrc-.js"),__vite__mapDeps([44,1,2,3,4,24,7,25,6,11,15,30,5,23,20,31,32,33,34,35,10,12,16,13,14,17,21,26,27,36,37,9,38,29,39,40,8,41,42,43]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return C().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(C().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(C().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return C().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return C().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Se(()=>import("./loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),no=S;export{no as F,ee as G,te as V,Pr as m,K as z}; diff --git a/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js b/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js new file mode 100644 index 00000000..97640726 --- /dev/null +++ b/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js @@ -0,0 +1 @@ +import{aa as n,v as o,bz as p,S as i,i as a,dg as c,e as l}from"./story-DT1Ep1ux.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; diff --git a/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js b/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js deleted file mode 100644 index f7a0da00..00000000 --- a/custom-toc-separator/assets/MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as n,v as o,bz as p,S as i,i as a,dg as c,e as l}from"./story-OUarUCIt.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; diff --git a/custom-toc-separator/assets/MeshTransform-C--IG09w-DmlAOJ8b.js b/custom-toc-separator/assets/MeshTransform-C--IG09w-DmlAOJ8b.js new file mode 100644 index 00000000..189959ac --- /dev/null +++ b/custom-toc-separator/assets/MeshTransform-C--IG09w-DmlAOJ8b.js @@ -0,0 +1 @@ +import{v as i,S as e,i as w,e as I,dg as S,il as q,hZ as z,i8 as l,B as M,je as B,jf as E,i1 as Q,bj as R}from"./story-DT1Ep1ux.js";import{o as T,z as U,u as V,s as Z}from"./mat4-DX7gBViE-B27FdgMD.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-Cqne66qw.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(B,t,u),c(E,o,y),c(Q,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return R(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=q(d),this.rotationAngle=0,this.scale=z(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),T(t,v,this.translation,this.scale),t}get localMatrixInverse(){return U(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; diff --git a/custom-toc-separator/assets/MeshTransform-C--IG09w-mx7xOTc-.js b/custom-toc-separator/assets/MeshTransform-C--IG09w-mx7xOTc-.js deleted file mode 100644 index 05c1a81f..00000000 --- a/custom-toc-separator/assets/MeshTransform-C--IG09w-mx7xOTc-.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as e,i as w,e as I,dg as S,il as q,hZ as z,i8 as l,B as M,je as B,jf as E,i1 as Q,bj as R}from"./story-OUarUCIt.js";import{o as T,z as U,u as V,s as Z}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-iWg2zFa3.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(B,t,u),c(E,o,y),c(Q,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return R(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=q(d),this.rotationAngle=0,this.scale=z(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),T(t,v,this.translation,this.scale),t}get localMatrixInverse(){return U(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; diff --git a/custom-toc-separator/assets/MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js b/custom-toc-separator/assets/MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js deleted file mode 100644 index 7e88839c..00000000 --- a/custom-toc-separator/assets/MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js +++ /dev/null @@ -1 +0,0 @@ -import{v as n,S as u,ad as c,i as v,e as A,a1 as l,P as i}from"./story-OUarUCIt.js";function m(t,o,e,g){const{loggerTag:a,stride:s}=o;return t.length%s!=0?(g.error(a,`Invalid array length, expected a multiple of ${s}`),new e([])):t}function p(t,o,e,g,a){if(!t)return t;if(t instanceof o)return m(t,g,o,a);for(const s of e)if(t instanceof s)return m(new o(t),g,o,a);if(Array.isArray(t))return m(new o(t),g,o,a);{const s=e.map(d=>`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; diff --git a/custom-toc-separator/assets/MeshWriterRegistry-CIC9Yk_f-D-N28B04.js b/custom-toc-separator/assets/MeshWriterRegistry-CIC9Yk_f-D-N28B04.js new file mode 100644 index 00000000..8ea37156 --- /dev/null +++ b/custom-toc-separator/assets/MeshWriterRegistry-CIC9Yk_f-D-N28B04.js @@ -0,0 +1 @@ +import{D as P,K as xe,J as ve,Z as te,u as D,G as z,_ as Pe}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{et as R,aq as B,P as Me,o as be,hE as we,a1 as Ie,ar as Se}from"./story-DT1Ep1ux.js";import{K as $}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as ke,O as Ae,y as Le,F as de,$ as ze,Q as De,b as Ee,M as Re,k as Te,X as Be,a as Fe,m as Ge,c as Oe,R as me,J as N,g as Ce,d as We,C as E}from"./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js";import{I as S}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{s as je,l as Z,i as se}from"./Tile-D75RMC64-XRkD8ADC.js";import{m as k,T as ie,j as q,b as Ve,v as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as re}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{o as A}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{R as Ne,n as ae}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{c as Y}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{T as oe,h as Ze}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{e as F}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{r as fe,i as qe}from"./grouping-RwmXkHDc-DhZ3sGff.js";import{T as Ye}from"./AttributeStore-DjyP9U7y-C9jFBUTt.js";let Qe=class extends We{};function Xe(n){const{sprite:e,isMapAligned:t,colorLocked:i,scaleSymbolsProportionally:s,isStroke:r}=n;let a=0;return t&&(a|=E(D.bitset.isMapAligned)),i&&(a|=E(D.bitset.colorLocked)),e.sdf&&(a|=E(D.bitset.isSDF)),s&&(a|=E(D.bitset.scaleSymbolsProportionally)),r&&(a|=E(D.bitset.isStroke)),a}let $e=class extends Qe{get vertexSpec(){return{createComputedParams:n=>{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; diff --git a/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js b/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js deleted file mode 100644 index f4f6076f..00000000 --- a/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js +++ /dev/null @@ -1 +0,0 @@ -import{v as g,i as l,bU as c,cF as N,cG as w,bO as h,bY as J,j as M,cH as _,bP as u,P as v,cI as m,aR as I}from"./story-OUarUCIt.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,v(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,v(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=c(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=c(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return c(a).store}let d=class extends E(M){};d=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],d);const U=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){c(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=I(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=g([l("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return c(a).store}const x=a=>{let e=class extends U(E(a)){constructor(...t){super(...t)}};return e=g([l("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends x(M){};y=g([l("esri.core.MultiOriginJSONSupport")],y);export{y as _,x as m}; diff --git a/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js b/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js new file mode 100644 index 00000000..014c669e --- /dev/null +++ b/custom-toc-separator/assets/MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js @@ -0,0 +1 @@ +import{v as g,i as l,bU as c,cF as N,cG as w,bO as h,bY as J,j as M,cH as _,bP as u,P as v,cI as m,aR as I}from"./story-DT1Ep1ux.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,v(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,v(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=c(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=c(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return c(a).store}let d=class extends E(M){};d=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],d);const U=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){c(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=I(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=g([l("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return c(a).store}const x=a=>{let e=class extends U(E(a)){constructor(...t){super(...t)}};return e=g([l("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends x(M){};y=g([l("esri.core.MultiOriginJSONSupport")],y);export{y as _,x as m}; diff --git a/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-BZHIleWw.js b/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-BZHIleWw.js new file mode 100644 index 00000000..e75f950b --- /dev/null +++ b/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-BZHIleWw.js @@ -0,0 +1,11 @@ +import"./story-DT1Ep1ux.js";import{t as u}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { +float z = 1.0 - abs(normal.x) - abs(normal.y); +return vec3(normal + sign(normal) * min(z, 0.0), z); +} +vec3 normalModel() { +return decompressNormal(normalCompressed); +}`);break;case t.Attribute:e.attributes.add(a.NORMAL,"vec3"),e.vertex.code.add(n`vec3 normalModel() { +return normal; +}`);break;case t.ScreenDerivative:e.fragment.code.add(n`vec3 screenDerivativeNormal(vec3 positionView) { +return normalize(cross(dFdx(positionView), dFdy(positionView))); +}`);break;default:u(i.normalType);case t.COUNT:}}var t;(function(e){e[e.Attribute=0]="Attribute",e[e.Compressed=1]="Compressed",e[e.ScreenDerivative=2]="ScreenDerivative",e[e.COUNT=3]="COUNT"})(t||(t={}));export{T as S,s as c,b as f,O as g,g as h,r as i,o,N as p,h as s,t}; diff --git a/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js b/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js deleted file mode 100644 index 05a2abce..00000000 --- a/custom-toc-separator/assets/NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js +++ /dev/null @@ -1,11 +0,0 @@ -import"./story-OUarUCIt.js";import{t as u}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { -float z = 1.0 - abs(normal.x) - abs(normal.y); -return vec3(normal + sign(normal) * min(z, 0.0), z); -} -vec3 normalModel() { -return decompressNormal(normalCompressed); -}`);break;case t.Attribute:e.attributes.add(a.NORMAL,"vec3"),e.vertex.code.add(n`vec3 normalModel() { -return normal; -}`);break;case t.ScreenDerivative:e.fragment.code.add(n`vec3 screenDerivativeNormal(vec3 positionView) { -return normalize(cross(dFdx(positionView), dFdy(positionView))); -}`);break;default:u(i.normalType);case t.COUNT:}}var t;(function(e){e[e.Attribute=0]="Attribute",e[e.Compressed=1]="Compressed",e[e.ScreenDerivative=2]="ScreenDerivative",e[e.COUNT=3]="COUNT"})(t||(t={}));export{T as S,s as c,b as f,O as g,g as h,r as i,o,N as p,h as s,t}; diff --git a/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-Ctex3rAt.js b/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-Ctex3rAt.js deleted file mode 100644 index 11346864..00000000 --- a/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-Ctex3rAt.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as o,i as D,bT as w,dL as $,n as H,bW as b,bL as J,J as g,aB as N,c6 as x,dJ as Z,o as R}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as W}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{T as k,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{u as pe}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{C as ce}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as be}from"./FeatureType-C9hJmS6_-BoBeHHAU.js";import{y as xe}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as Re}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{b as T}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as Te}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./main-lj2zzr_L.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-DAI1_86C.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";let d=class extends N{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>k(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),L=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace(L,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(U(W)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Xt=r;export{Xt as default}; diff --git a/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-wTuiwEzX.js b/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-wTuiwEzX.js new file mode 100644 index 00000000..f06112e0 --- /dev/null +++ b/custom-toc-separator/assets/OGCFeatureLayer-DPXQjO1S-wTuiwEzX.js @@ -0,0 +1 @@ +import{v as t,S as o,i as D,bT as w,dL as $,n as H,bW as b,bL as J,J as g,aB as N,c6 as x,dJ as Z,o as R}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as W}from"./Layer-ChoECxvZ-ocw70508.js";import{T as k,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{u as pe}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{C as ce}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as be}from"./FeatureType-C9hJmS6_-zoljUYGr.js";import{y as xe}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as Re}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{b as T}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as Te}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./main-BTdHgocv.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-DS1EMYq7.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B1aankCm.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";let d=class extends N{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>k(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),L=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace(L,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(U(W)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Xt=r;export{Xt as default}; diff --git a/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-CXNVm2mS.js b/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-CXNVm2mS.js new file mode 100644 index 00000000..48428e8f --- /dev/null +++ b/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-CXNVm2mS.js @@ -0,0 +1 @@ +import{v as t,i as m,S as o}from"./story-DT1Ep1ux.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js";import"./main-BTdHgocv.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./timeSupport-ohWmWReZ-CSAKuiyl.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./LayerView-Bish-E63-B3VRdVIM.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";import"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const st=p;export{st as default}; diff --git a/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-DZwA89R5.js b/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-DZwA89R5.js deleted file mode 100644 index 2e728008..00000000 --- a/custom-toc-separator/assets/OGCFeatureLayerView2D-CpSy5D2s-DZwA89R5.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,i as m,S as o}from"./story-OUarUCIt.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js";import"./main-lj2zzr_L.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./LayerView-Bish-E63-DehQ-_Za.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";import"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const st=p;export{st as default}; diff --git a/custom-toc-separator/assets/Octree-CJNwbhg4-Cw-pFVV-.js b/custom-toc-separator/assets/Octree-CJNwbhg4-Cw-pFVV-.js new file mode 100644 index 00000000..8bf8ac0f --- /dev/null +++ b/custom-toc-separator/assets/Octree-CJNwbhg4-Cw-pFVV-.js @@ -0,0 +1 @@ +import{dB as mt,c$ as $,dg as F,hZ as m}from"./story-DT1Ep1ux.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-B4r28WKg.js";import{B as pt,z as At}from"./mat4-DX7gBViE-B27FdgMD.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as B}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-CP4TXD5k.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var M,i;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(M||(M={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Mt=8,St=[B(-1,-1,-1,1),B(1,-1,-1,1),B(1,1,-1,1),B(-1,1,-1,1),B(-1,-1,1,1),B(1,-1,1,1),B(1,1,1,1),B(-1,1,1,1)];new ht(lt);const xt=gt();class I{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!v(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!v(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!v(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),C[h].min=d,C[h].max=O}for(let h=0;h<3;h++){let c=C[h].min,f=C[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new $({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(I||(I={}));const ct=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],rt=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new $,$t=z(),N=z(),V=z(),W=z(),C=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new $,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; diff --git a/custom-toc-separator/assets/Octree-CJNwbhg4-DhnIMuUV.js b/custom-toc-separator/assets/Octree-CJNwbhg4-DhnIMuUV.js deleted file mode 100644 index 85c74f24..00000000 --- a/custom-toc-separator/assets/Octree-CJNwbhg4-DhnIMuUV.js +++ /dev/null @@ -1 +0,0 @@ -import{dB as mt,c$ as $,dg as F,hZ as m}from"./story-OUarUCIt.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-CkV41Bdd.js";import{B as pt,z as At}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as B}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-DlxNxa6f.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var M,i;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(M||(M={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Mt=8,St=[B(-1,-1,-1,1),B(1,-1,-1,1),B(1,1,-1,1),B(-1,1,-1,1),B(-1,-1,1,1),B(1,-1,1,1),B(1,1,1,1),B(-1,1,1,1)];new ht(lt);const xt=gt();class I{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!v(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!v(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!v(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),C[h].min=d,C[h].max=O}for(let h=0;h<3;h++){let c=C[h].min,f=C[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new $({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(I||(I={}));const ct=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],rt=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new $,$t=z(),N=z(),V=z(),W=z(),C=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new $,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; diff --git a/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-BXPORwQJ.js b/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-BXPORwQJ.js new file mode 100644 index 00000000..e9bb5b29 --- /dev/null +++ b/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-BXPORwQJ.js @@ -0,0 +1 @@ +import{v as t,S as r,i as s,w as p,J as l,n as a}from"./story-DT1Ep1ux.js";import{I as m}from"./WebTileLayer-CUoicUjK-BgSZQGkL.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-C54e75zw.js";import w from"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./main-BTdHgocv.js";import"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const J=o;export{J as default}; diff --git a/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-DQy5tSBL.js b/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-DQy5tSBL.js deleted file mode 100644 index 99f83cbc..00000000 --- a/custom-toc-separator/assets/OpenStreetMapLayer-Bx4EhJij-DQy5tSBL.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as s,w as p,J as l,n as a}from"./story-OUarUCIt.js";import{I as m}from"./WebTileLayer-CUoicUjK-DzBqU6HL.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-561xzxdP.js";import w from"./PortalItem-CctGdnxF-DgukgleB.js";import"./main-lj2zzr_L.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const J=o;export{J as default}; diff --git a/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-DbKLfNnN.js b/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-DbKLfNnN.js new file mode 100644 index 00000000..95ccde30 --- /dev/null +++ b/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-DbKLfNnN.js @@ -0,0 +1 @@ +import{v as i,S as y,a0 as S,ac as l,bB as b,cM as I,i as v,b$ as T,o as s,cN as w,cO as G}from"./story-DT1Ep1ux.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{k as L}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; diff --git a/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-Dgb3Hr2c.js b/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-Dgb3Hr2c.js deleted file mode 100644 index 917d0c43..00000000 --- a/custom-toc-separator/assets/OperationalLayer-B5IXiMa2-Dgb3Hr2c.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,S as y,a0 as S,ac as l,bB as b,cM as I,i as v,b$ as T,o as s,cN as w,cO as G}from"./story-OUarUCIt.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{k as L}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; diff --git a/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-BH2q29Gm.js b/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-BH2q29Gm.js new file mode 100644 index 00000000..f62f6b5f --- /dev/null +++ b/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-BH2q29Gm.js @@ -0,0 +1 @@ +import{aK as n,v as r,S as i,i as d,e as p}from"./story-DT1Ep1ux.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; diff --git a/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-Qxq3kQ53.js b/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-Qxq3kQ53.js deleted file mode 100644 index b0c36b17..00000000 --- a/custom-toc-separator/assets/OrderByInfo-GD2XnU8e-Qxq3kQ53.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as n,v as r,S as i,i as d,e as p}from"./story-OUarUCIt.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; diff --git a/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-BekPpQJS.js b/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-BekPpQJS.js new file mode 100644 index 00000000..3c68a7f8 --- /dev/null +++ b/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-BekPpQJS.js @@ -0,0 +1 @@ +import{v as s,S as a,i as l,dK as f}from"./story-DT1Ep1ux.js";import{p as d}from"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([a(p)],r.prototype,"orderBy",void 0),r=s([l("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; diff --git a/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-DORD-Yg0.js b/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-DORD-Yg0.js deleted file mode 100644 index 5bab35c6..00000000 --- a/custom-toc-separator/assets/OrderedLayer-6Qsmrd_l-DORD-Yg0.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as a,i as l,dK as f}from"./story-OUarUCIt.js";import{p as d}from"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([a(p)],r.prototype,"orderBy",void 0),r=s([l("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; diff --git a/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-DbfQeoad.js b/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-DbfQeoad.js deleted file mode 100644 index 40d83963..00000000 --- a/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-DbfQeoad.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,dK as tt}from"./story-OUarUCIt.js";import et from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{m as it}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./main-lj2zzr_L.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Ge=a;export{Ge as default}; diff --git a/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-ft75Mdw_.js b/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-ft75Mdw_.js new file mode 100644 index 00000000..f91105ee --- /dev/null +++ b/custom-toc-separator/assets/OrientedImageryLayer-CwG5o4Di-ft75Mdw_.js @@ -0,0 +1 @@ +import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,dK as tt}from"./story-DT1Ep1ux.js";import et from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import{m as it}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./main-BTdHgocv.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Ge=a;export{Ge as default}; diff --git a/custom-toc-separator/assets/OverlayContainer-BEHcBpu0-CdVlAClg.js b/custom-toc-separator/assets/OverlayContainer-BEHcBpu0-CdVlAClg.js new file mode 100644 index 00000000..4dcce6a1 --- /dev/null +++ b/custom-toc-separator/assets/OverlayContainer-BEHcBpu0-CdVlAClg.js @@ -0,0 +1 @@ +import{r as I}from"./common-CYWrYyJl-E8-sukrT.js";import{R as Q,E as Z,C as V,G as J,D as X}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Y,E as tt,m as et}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{e as st}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as ot}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as it}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{v as o,hF as L,aG as rt,aA as nt}from"./story-DT1Ep1ux.js";import{N as at}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{T as pt,s as N,P as dt}from"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import{t as F,v as p,aw as B,ax as lt,ar as y,C as W,M as ht,S as R,a_ as ct,ay as ut,aC as ft,a4 as vt,L as mt,a7 as xt,bd as yt,b9 as gt,D as wt}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{L as _t,D,I as U,T as Mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";class O extends lt{}o([F(0,y)],O.prototype,"pos",void 0),o([F(1,y)],O.prototype,"uv",void 0);class St extends yt{}class k extends W{}o([p(ht)],k.prototype,"dvs",void 0);class v extends W{}o([p(y)],v.prototype,"perspective",void 0),o([p(y)],v.prototype,"texSize",void 0),o([p(R)],v.prototype,"wrapAroundShift",void 0),o([p(R)],v.prototype,"opacity",void 0),o([p(ct)],v.prototype,"texture",void 0);class x extends ut{vertex(t){const s=t.uv.divide(this.config.texSize),e=new R(1).add(ft(s,this.config.perspective)),a=new vt(t.pos.add(new y(this.config.wrapAroundShift,0)),1),i=this.transform.dvs.multiply(a);return{uv:s,glPosition:new mt(i.xy.multiply(e),0,e)}}fragment(t){const s=xt(this.config.texture,t.uv).multiply(this.config.opacity),e=new gt;return e.glFragColor=s,e}}o([p(k)],x.prototype,"transform",void 0),o([p(v)],x.prototype,"config",void 0),o([L(0,B(O))],x.prototype,"vertex",null),o([L(0,B(St))],x.prototype,"fragment",null);let bt=class extends pt{constructor(){super(...arguments),this.type=wt.Overlay,this._mesh=null,this.shaders={overlay:new x}}render(n,t){const{context:s,painter:e}=n,a=this._getMesh(n,t);e.setPipelineState(N);const{isWrapAround:i,wrapAroundShift:d}=t.config,l={...t.config,wrapAroundShift:0},u={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:l},defines:null,optionalAttributes:null,useComputeBuffer:!1};e.setPipelineState({...N,stencil:{write:!1,test:{compare:_t.EQUAL,op:{fail:D.KEEP,zFail:D.KEEP,zPass:D.REPLACE},ref:0,mask:255}}}),e.submitDrawMeshUntyped(s,u,a),i&&(l.wrapAroundShift=d,e.submitDrawMeshUntyped(s,u,a))}shutdown(){nt(this._mesh)}_getMesh(n,t){const{context:s}=n;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(t.position)}else{const e=t.index!=null?t.index.length:t.position.length/2;this._mesh=new dt(s,{vertex:{positions:t.position,uvs:t.tex},index:t.index!=null?{index:t.index}:void 0,groups:[{attributes:[{name:"pos",count:2,type:U.FLOAT,location:0,vertex:"positions",stride:8,offset:0},{name:"tex",count:2,type:U.UNSIGNED_SHORT,location:1,vertex:"uvs",stride:4,offset:0}],index:t.index!=null?"index":void 0,primitive:Mt.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}};class It extends at{constructor(){super(...arguments),this._viewStateId=-1,this._dvsMat3=Y(),this._overlayTechnique=new bt}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const s of this.children)s.beforeRender(t)}doRender(t){if(t.drawPhase!==tt.MAP||!this.visible)return;super.doRender(t);const s=this._overlayTechnique;for(const e of this.children)e.draw(t,s)}onDetach(){this._overlayTechnique.shutdown()}_updateMatrices(t){const{state:s}=t,{id:e,size:a,pixelRatio:i,resolution:d,rotation:l,viewpoint:u,displayMat3:M}=s;if(this._viewStateId===e)return;const g=I(l),h=i*a[0],f=i*a[1];this._localOrigin=u.targetGeometry.clone();const{x:m,y:S}=this._localOrigin,w=it(m,s.spatialReference);this._localOrigin.x=w,this._localOrigin.y=S;const b=d*h,A=d*f,r=Q(this._dvsMat3);Z(r,r,M),V(r,r,st(h/2,f/2)),J(r,r,ot(h/b,-f/A,1)),X(r,r,-g),this._viewStateId=e}_updateOverlays(t,s){const{state:e}=t,{rotation:a,spatialReference:i,worldScreenWidth:d,size:l,viewpoint:u}=e,M=this._localOrigin;let g,h=0;const f=rt(i);if(f&&i.isWrappable){const m=l[0],S=l[1],w=I(a),b=Math.abs(Math.cos(w)),A=Math.abs(Math.sin(w)),r=Math.round(m*b+S*A),[C,$]=f.valid,c=et(i),{x:z,y:q}=u.targetGeometry,K=[z,q],E=[0,0];e.toScreen(E,K);const _=[0,0];let P;P=r>d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; diff --git a/custom-toc-separator/assets/OverrideHelper-DWRbVlj1-CsyvnxCE.js b/custom-toc-separator/assets/OverrideHelper-DWRbVlj1-CsyvnxCE.js deleted file mode 100644 index ead92890..00000000 --- a/custom-toc-separator/assets/OverrideHelper-DWRbVlj1-CsyvnxCE.js +++ /dev/null @@ -1 +0,0 @@ -import{P as d,er as M,ar as C,a1 as b,o as I}from"./story-OUarUCIt.js";import{x}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{b as k,S as v,k as O,d as h,K as S,Z as g,x as N}from"./utils-SPbpQbmm-BNEY6jgo.js";import{q as P,T as w,F as T,v as G}from"./quantizationUtils-bJy1cRwp-Ds815HQE.js";function E(c,e,r,t,s){if(c==null)return null;const i=c.referencesGeometry()&&s?L(e,t,s):e,a=c.repurposeFeature(i);try{return c.evaluate({...r,$feature:a},c.services)}catch(o){return b.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const m=new Map;function L(c,e,r){const{transform:t,hasZ:s,hasM:i}=r;m.has(e)||m.set(e,A(e));const a=m.get(e)(c.geometry,t,s,i);return{...c,geometry:a}}function A(c){const e={};switch(c){case"esriGeometryPoint":return(r,t,s,i)=>G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; diff --git a/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CFEtE6Gs.js b/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CFEtE6Gs.js new file mode 100644 index 00000000..a1076648 --- /dev/null +++ b/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CFEtE6Gs.js @@ -0,0 +1 @@ +import{t as d}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{J as c,hB as p}from"./story-DT1Ep1ux.js";import{o as m}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{y as f}from"./Field-C6hA1tZj-aKnzhZ32.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=m(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(f.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function j(){return new R}export{j as default}; diff --git a/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CQyE5GsH.js b/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CQyE5GsH.js deleted file mode 100644 index b6a8c52a..00000000 --- a/custom-toc-separator/assets/PBFDecoderWorker-J6PBo4mo-CQyE5GsH.js +++ /dev/null @@ -1 +0,0 @@ -import{t as d}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{J as c,hB as p}from"./story-OUarUCIt.js";import{o as m}from"./projection-BA9M1R7d-Cytmrlsd.js";import{y as f}from"./Field-C6hA1tZj-DY7R6puO.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=m(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(f.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function j(){return new R}export{j as default}; diff --git a/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js b/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js deleted file mode 100644 index ce9f943b..00000000 --- a/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as te}from"./main-lj2zzr_L.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{K as ee,et as m,ar as se,o as ie,a1 as re,hJ as oe,ae as gt}from"./story-OUarUCIt.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-BIV61-kY.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{I as Bt}from"./utils-SPbpQbmm-BNEY6jgo.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-DDmsm7e7.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>re.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=ee("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let oi=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let ni=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ai=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ci extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ui=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class li extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class hi extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class di extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{di as $,W as C,li as F,ui as I,Es as J,ci as M,hi as O,pi as Q,Z as R,xs as X,Re as Y,ni as a,ai as b,Zt as c,O as d,g,Kt as k,oi as m,Jt as y}; diff --git a/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js b/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js new file mode 100644 index 00000000..f934e2e3 --- /dev/null +++ b/custom-toc-separator/assets/PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{_ as te}from"./main-BTdHgocv.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{K as ee,et as m,ar as se,o as ie,a1 as re,hJ as oe,ae as gt}from"./story-DT1Ep1ux.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-BHDUzrZk.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{I as Bt}from"./utils-SPbpQbmm-BKynsqQg.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-XRkD8ADC.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>re.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=ee("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let oi=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let ni=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ai=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ci extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ui=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class li extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class hi extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class di extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{di as $,W as C,li as F,ui as I,Es as J,ci as M,hi as O,pi as Q,Z as R,xs as X,Re as Y,ni as a,ai as b,Zt as c,O as d,g,Kt as k,oi as m,Jt as y}; diff --git a/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-BPrbn2Rt.js b/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-BPrbn2Rt.js deleted file mode 100644 index 501947f4..00000000 --- a/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-BPrbn2Rt.js +++ /dev/null @@ -1,11 +0,0 @@ -import{v as r,S as i,i as y,bB as C,bz as h,P as u,dK as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./story-OUarUCIt.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as K}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as G}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as U}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as z}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-Dbvqi9tG.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as g}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as Y}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-C21BHqCP.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import{w as oe}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";let c=class extends A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` - var returnValue = $feature.${t.name}; - return (returnValue % 16) + " / " + Floor(returnValue / 16); - `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` - var rgb = $feature.${t.name}; - var red = Floor(rgb / 65536, 0); - var green = Floor((rgb - (red * 65536)) / 256,0); - var blue = rgb - (red * 65536) - (green * 256); - - return "rgb(" + red + "," + green + "," + blue + ")"; - `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=L(this.parsedUrl?.path??"",`./statistics/${s.key}`);return N(a,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then($=>$.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(P.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;T(F.getLogger(this),re("Point cloud layers","absolute-height",e)),T(F.getLogger(this),ie("Point cloud layers",e))}};r([i({type:["PointCloudLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(H)],o.prototype,"popupEnabled",void 0),r([i({type:E,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),r([i({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],o.prototype,"opacity",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({types:[le],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],o.prototype,"filters",void 0),r([i({type:[g]})],o.prototype,"fields",void 0),r([i(j.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([V("service","fields",["fields","attributeStorageInfo"])],o.prototype,"readServiceFields",null),r([i(j.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),r([i(J)],o.prototype,"elevationInfo",null),r([i({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([i(Q)],o.prototype,"legendEnabled",void 0),r([i({types:R,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:R},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],o.prototype,"renderer",void 0),r([O("renderer")],o.prototype,"writeRenderer",null),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),o=r([y("esri.layers.PointCloudLayer")],o);const We=o;export{We as default}; diff --git a/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-D-1Av7eh.js b/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-D-1Av7eh.js new file mode 100644 index 00000000..b940465a --- /dev/null +++ b/custom-toc-separator/assets/PointCloudLayer-CkxImr5P-D-1Av7eh.js @@ -0,0 +1,11 @@ +import{v as r,S as i,i as y,bB as C,bz as h,P as u,dK as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./story-DT1Ep1ux.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as K}from"./Layer-ChoECxvZ-ocw70508.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as G}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as U}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as z}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-CobyO2zX.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as g}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as Y}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import{w as oe}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";let c=class extends A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` + var returnValue = $feature.${t.name}; + return (returnValue % 16) + " / " + Floor(returnValue / 16); + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` + var rgb = $feature.${t.name}; + var red = Floor(rgb / 65536, 0); + var green = Floor((rgb - (red * 65536)) / 256,0); + var blue = rgb - (red * 65536) - (green * 256); + + return "rgb(" + red + "," + green + "," + blue + ")"; + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=L(this.parsedUrl?.path??"",`./statistics/${s.key}`);return N(a,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then($=>$.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(P.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;T(F.getLogger(this),re("Point cloud layers","absolute-height",e)),T(F.getLogger(this),ie("Point cloud layers",e))}};r([i({type:["PointCloudLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(H)],o.prototype,"popupEnabled",void 0),r([i({type:E,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),r([i({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],o.prototype,"opacity",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({types:[le],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],o.prototype,"filters",void 0),r([i({type:[g]})],o.prototype,"fields",void 0),r([i(j.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([V("service","fields",["fields","attributeStorageInfo"])],o.prototype,"readServiceFields",null),r([i(j.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),r([i(J)],o.prototype,"elevationInfo",null),r([i({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([i(Q)],o.prototype,"legendEnabled",void 0),r([i({types:R,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:R},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],o.prototype,"renderer",void 0),r([O("renderer")],o.prototype,"writeRenderer",null),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),o=r([y("esri.layers.PointCloudLayer")],o);const We=o;export{We as default}; diff --git a/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-C21BHqCP.js b/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-C21BHqCP.js deleted file mode 100644 index 790b8d79..00000000 --- a/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-C21BHqCP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as t,i,aK as I,bz as f,cr as B,ar as N,bB as O,e as m,P as o}from"./story-OUarUCIt.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-CotdYMFm.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([i("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([f({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([i("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([f({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; diff --git a/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js b/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js new file mode 100644 index 00000000..1d14cad3 --- /dev/null +++ b/custom-toc-separator/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js @@ -0,0 +1 @@ +import{v as e,S as t,i,aK as I,bz as f,cr as B,ar as N,bB as O,e as m,P as o}from"./story-DT1Ep1ux.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([i("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([f({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([i("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([f({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; diff --git a/custom-toc-separator/assets/PointCloudWorker-DB5ewy0Y-CQapDx3R.js b/custom-toc-separator/assets/PointCloudWorker-DB5ewy0Y-CQapDx3R.js new file mode 100644 index 00000000..293cecce --- /dev/null +++ b/custom-toc-separator/assets/PointCloudWorker-DB5ewy0Y-CQapDx3R.js @@ -0,0 +1 @@ +import{hY as F,aq as C,J as I}from"./story-DT1Ep1ux.js";import{v as x}from"./quat-BODLR7mS-Cqne66qw.js";import{e as O}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{w as k}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{u as A,o as w}from"./vec3f32-BS0cezmI-B_madU1n.js";import{n as R}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{G as U,U as J,F as B}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js";import{$ as N,F as V,Y as q,G as T}from"./I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js";import{i as Y}from"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import"./main-BTdHgocv.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function E(u,t,a,n){const{rendererJSON:c,isRGBRenderer:b}=u;let o=null,s=null;if(t&&b)o=t;else if(t&&c?.type==="pointCloudUniqueValueRenderer"){s=U.fromJSON(c);const r=s.colorUniqueValueInfos;o=new Uint8Array(3*n);const i=g(s.fieldTransformType);for(let e=0;e=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let m=1;m=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=m*o[3*l],o[3*l+1]=m*o[3*l+1],o[3*l+2]=m*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,b=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=m>1,S=f===1,y=f===m;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),m={attributeInfo:l.attributeInfo,values:f};return b.push(m),m});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);b.push({attributeInfo:e.attributeInfo,values:l})}3*n=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let m=1;m=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=m*o[3*l],o[3*l+1]=m*o[3*l+1],o[3*l+2]=m*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,b=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=m>1,S=f===1,y=f===m;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),m={attributeInfo:l.attributeInfo,values:f};return b.push(m),m});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);b.push({attributeInfo:e.attributeInfo,values:l})}3*ni.map(i=>d[i]); -import{_ as $s}from"./main-lj2zzr_L.js";import{l as Ye}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as Hs,g as qs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,n as le,p as Qe}from"./story-OUarUCIt.js";import{D as A,g as W,e as Ts,c as oe,l as Ks,n as kt,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-D0TnSXh8.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-D0XKNTvx.js";import{y as nt}from"./Field-C6hA1tZj-DY7R6puO.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:Hs,json:{read:qs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Qe(t.spatialReference),s=Qe(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Ni(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await $s(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-csWZJ4px.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ci(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ri=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ii=q;export{Lr as B,pi as D,Ni as E,Ci as h,Ws as q,Ii as v,Ri as x}; diff --git a/custom-toc-separator/assets/PolynomialTransform-C3nWCu0l-of3yQAdZ.js b/custom-toc-separator/assets/PolynomialTransform-C3nWCu0l-of3yQAdZ.js new file mode 100644 index 00000000..bf1f8d74 --- /dev/null +++ b/custom-toc-separator/assets/PolynomialTransform-C3nWCu0l-of3yQAdZ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-B4-kNUBs.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-Bf311639.js"])))=>i.map(i=>d[i]); +import{_ as $s}from"./main-BTdHgocv.js";import{l as Ye}from"./colorUtils-Cthpxcks-DXg8vX2o.js";import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as Hs,g as qs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,n as le,p as Qe}from"./story-DT1Ep1ux.js";import{D as A,g as W,e as Ts,c as oe,l as Ks,n as kt,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-5rDIvGzY.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-Yy2GlotV.js";import{y as nt}from"./Field-C6hA1tZj-aKnzhZ32.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:Hs,json:{read:qs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Qe(t.spatialReference),s=Qe(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Ni(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await $s(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-B4-kNUBs.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ci(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ri=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ii=q;export{Lr as B,pi as D,Ni as E,Ci as h,Ws as q,Ii as v,Ri as x}; diff --git a/custom-toc-separator/assets/PooledRBush-DbfAmeLn-BhVBo5wc.js b/custom-toc-separator/assets/PooledRBush-DbfAmeLn-BhVBo5wc.js new file mode 100644 index 00000000..7a014a97 --- /dev/null +++ b/custom-toc-separator/assets/PooledRBush-DbfAmeLn-BhVBo5wc.js @@ -0,0 +1 @@ +import{c$ as w,gZ as F,h2 as v}from"./story-DT1Ep1ux.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class z{constructor(t=9,n){this._compareMinX=A,this._compareMinY=D,this._toBBox=i=>i,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){y(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=F(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(F(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{z as N,Z as R}; diff --git a/custom-toc-separator/assets/PooledRBush-DbfAmeLn-D1-Igyfv.js b/custom-toc-separator/assets/PooledRBush-DbfAmeLn-D1-Igyfv.js deleted file mode 100644 index b7abb729..00000000 --- a/custom-toc-separator/assets/PooledRBush-DbfAmeLn-D1-Igyfv.js +++ /dev/null @@ -1 +0,0 @@ -import{c$ as w,gZ as F,h2 as v}from"./story-OUarUCIt.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class z{constructor(t=9,n){this._compareMinX=A,this._compareMinY=D,this._toBBox=i=>i,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){y(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=F(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(F(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{z as N,Z as R}; diff --git a/custom-toc-separator/assets/Popup-DFFZHG5j-Bu082Sf4.js b/custom-toc-separator/assets/Popup-DFFZHG5j-Bu082Sf4.js deleted file mode 100644 index 10f378e2..00000000 --- a/custom-toc-separator/assets/Popup-DFFZHG5j-Bu082Sf4.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-Eh4JVIZU.js","./icon-BXFbBbop-BKvGneFm.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-BCNzxmob.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-DRqSEqV9.js","./Theme-rblUnB2V-DrMnmN3S.js","./Tooltip-B0HefZ7r-BDGW0IFP.js","./DefaultTheme-Bt5OI-Ht-BpAhXUxl.js","./chartCommon-rWfJsTPl-ZXAmXzgK.js","./Button-MQvwxOnj-bFRWo4ou.js","./ColorSet-DkIwOmgs-BSZuvnWe.js","./pieChart-qcxaoQkv-BaGPkv1X.js","./Tick-DUHqbpyB-iDoSp0SS.js","./xyChart-Ch-p5aUf-Bj4dKA_D.js","./arcade-CaGqU4sP-Baf0eYO3.js","./TimeOnly-DSMefxKy-C9JclgbM.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./Query-BrwMGK8U-gUIs0TS1.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./Layer-ChoECxvZ-DxWUU3pP.js","./workers-PiCjreoO-mU03Z-E4.js","./editsZScale-BDsX6vv--D74kwHO-.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--ijLDTpyP.js","./loader-Ch7Jr16w-B4sW6aLS.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-CnEFMUdd.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-Vo-4M19I.js","./interactive-DqhNilgd-Bw4n2n3w.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-B_MyJQVY.js","./loadable-DbNDKH4r-DyDwqoXd.js","./t9n-C_hcZMZJ-DI6xkvhp.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-l9oxBLp5.js","./form-CRSw616T-DuqBvFSD.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-DzezRv_f.js","./calcite-list-item-VYBhSMxV-BsaXyU3v.js","./action-GCQoufcz-Db81jJpr.js","./calcite-notice-DeAGopAs-SWsgCJuf.js","./conditionalSlot-DsCzytJ4-BJqhnuaV.js","./openCloseComponent-BGQ6h7vg-CRyJWWhi.js","./calcite-chip-DE_c-1hr-FcnmBI6s.js","./calcite-input-BKRd7MCS-C6GuFEjN.js","./calcite-tooltip-63c9fmIw-CcXqKF5v.js","./floating-ui-DKFFlLv3-elIRTcW0.js","./FloatingArrow-BG9llDYg-ljy-TIYj.js","./calcite-action-2fclGKoO-DLPue49J.js","./calcite-action-bar-ugh74qU5-DaGQpW5M.js","./action-group-DhwU7QZv-DKlcERk4.js","./action-menu-DTIJuZNc-CadEd7O7.js","./calcite-action-group-qlkUfh_o-Cnd8KdSj.js","./calcite-flow-item-uRuGc3ks-CeWzu-0a.js","./panel-DRUEhsxp-DE_ZqRVb.js","./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js","./calcite-button-Cm9_TJei-D0EvxauM.js","./calcite-flow-CAdorlph-ubsODTb7.js","./calcite-list-item-group-CuQ2MPLW-s3QAS6n5.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-lj2zzr_L.js";import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,ej as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ke,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as K,iE as go,ai as dt,aw as yo,iF as qe,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,d$ as cn,av as un,b7 as pn,o as N,c3 as Be,bx as vo,c2 as ct,gO as hn,c4 as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,en as vn,iM as Ei,aA as wo,az as $t,e as bo,dW as Io,bt as wn,eC as gt,cn as bn,bw as In,ae as An,iw as ui,ch as Fn,f as Mn,el as Ti,iN as Tt,an as Cn}from"./story-OUarUCIt.js";import{b as pe}from"./substitute-j49H6mVR-NuZWx4FX.js";import{_ as Y,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-lQMKFlS3.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-qR5MPnw_.js";import{d as Kt,c as Li}from"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-uR3F5VAW.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-MH2z-up5.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-DGbScRZv.js";import{l as qn}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-C6q0seac.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-gUIs0TS1.js";import{j as jn}from"./shared-D1w-26bA-BhDdbtTQ.js";import Mo from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{L as xt}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-Cytmrlsd.js";import{D as Pi}from"./Layer-ChoECxvZ-DxWUU3pP.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./Tile-D75RMC64-DDmsm7e7.js";import{a as Ni}from"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./cimSymbolUtils-CKIzBgMU-CX4234se.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Yt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>K.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Kn=/(\n)/gi,Yn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Yn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Kn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function Es(e){const t=In("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(i||e):this._renderAttachmentContainer()}_renderLoading(){return u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),Y("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),Y("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),Y("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-BSOWzUJi.js");return{getColor:m}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-BSOWzUJi.js");return{getOpacity:s}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>K.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ks(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ys(e,t,i,o){const n=new Kt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ys(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-DRqSEqV9.js"),__vite__mapDeps([14,4,5,3,6,15,16,17]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-ZXAmXzgK.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-BaGPkv1X.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([21,3,4,5,6,22,15,20,17]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% - ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-Bj4dKA_D.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-Bj4dKA_D.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-ZXAmXzgK.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-Bj4dKA_D.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-Bj4dKA_D.js"),__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>K.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-Baf0eYO3.js"),__vite__mapDeps([24,3,4,5,6,25,26,27,28,29,30,31,32,13,10,11,12,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,7,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ke(this._queryController,Gt),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ke(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Kt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Kt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-Vo-4M19I.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-BsaXyU3v.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-SWsgCJuf.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ye=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ye({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ye({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ye,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ye,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Ki=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ke(this._queryController,Ki),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Ki)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-FcnmBI6s.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-C6GuFEjN.js"),__vite__mapDeps([127,116,2,3,4,5,6,7,8,117,110,108,118,119,113,107,9,114,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-Vo-4M19I.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-BsaXyU3v.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-CcXqKF5v.js"),__vite__mapDeps([128,2,3,4,5,6,7,8,129,115,106,125,130]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-FcnmBI6s.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-SWsgCJuf.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-Vo-4M19I.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-BsaXyU3v.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Yi="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&!!i.attachmentsContent||t.type==="custom"&&!!i.customContent||t.type==="fields"&&!!i.fieldsContent||t.type==="media"&&!!i.mediaContent||t.type==="text"&&!!i.textContent||t.type==="expression"&&!!i.expressionContent||t.type==="relationship"&&!!i.relationshipContent||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Et(i)||(this._error=i,K.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Yi),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Yi),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ks(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-SWsgCJuf.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:u("div",{class:this.classes(D.contentNode,D.contentNodeText),key:`${t}-content`},i.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),Y("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DLPue49J.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-DaGQpW5M.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-Cnd8KdSj.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-CeWzu-0a.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-BSOWzUJi.js"),__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>K.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Yo(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Ko(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Yo(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Ko(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=Ke(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js"),__vite__mapDeps([138,3,4,5,6,63]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||K.getLogger(this).error(s)}else this.location=Yt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Ko(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):K.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):K.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Yt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||K.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:i?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Yo(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DLPue49J.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-DaGQpW5M.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-Cnd8KdSj.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([139,2,3,4,5,6,7,117,8,110,118,119,113,107,108,9,114,1,105,106]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-ubsODTb7.js"),__vite__mapDeps([140,2,3,4,5,6,7,9,113]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-CeWzu-0a.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-Vo-4M19I.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-BsaXyU3v.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-s3QAS6n5.js"),__vite__mapDeps([141,2,3,4,5,6,7,110,111]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--ijLDTpyP.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():K.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):K.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Yt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),Y("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),Y("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Md=k;export{Md as default}; diff --git a/custom-toc-separator/assets/Popup-DFFZHG5j-CHjAOlyP.js b/custom-toc-separator/assets/Popup-DFFZHG5j-CHjAOlyP.js new file mode 100644 index 00000000..24589007 --- /dev/null +++ b/custom-toc-separator/assets/Popup-DFFZHG5j-CHjAOlyP.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-BPD9clRe.js","./icon-BXFbBbop-CoY6CcfD.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-C0_AGNdr.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-DrkEg-ah.js","./Theme-rblUnB2V-Cwu0Sicn.js","./Tooltip-B0HefZ7r-CIb4Q87H.js","./DefaultTheme-Bt5OI-Ht-BJrIQ0SQ.js","./chartCommon-rWfJsTPl-BGwi4Jd-.js","./Button-MQvwxOnj-K6z9w3ks.js","./ColorSet-DkIwOmgs-BsDJZ3_f.js","./pieChart-qcxaoQkv-D3YMGvQS.js","./Tick-DUHqbpyB-RP-X2t6b.js","./xyChart-Ch-p5aUf-CbB-eH6p.js","./arcade-CaGqU4sP-DEhIUP7F.js","./TimeOnly-DSMefxKy-52VbaSQ6.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-DV01qpqc.js","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./LRUCache-C3erQTWv-D3oKynNB.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js","./commonProperties-BtIqvFU_-BAaMjACd.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./Query-BrwMGK8U-FWeI_AU8.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js","./Relationship-PyhUibYK-Dl9eU1qo.js","./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js","./Layer-ChoECxvZ-ocw70508.js","./workers-PiCjreoO-DrDY4oeh.js","./editsZScale-BDsX6vv--CJojmgz5.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./APIKeyMixin-BUMSx9ny-WDHyZfLR.js","./ArcGISService-BYA-y6X6-BWJQc6nI.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./parser-DyDJ-rlI-BVBmjSW8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./CustomParametersMixin-vdKsTHer-D2O-ilop.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./FeatureEffectLayer-Cro89IEC-wxowDxbO.js","./FeatureEffect-CDEk9Es7-8jhaVJv-.js","./FeatureFilter-BCFHgLVU-DfMwTLEM.js","./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js","./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js","./labelingInfo-DGVNul26-DxpYAQDw.js","./labelUtils-BW14kBqX-B_97vWvS.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DbKLfNnN.js","./OrderedLayer-6Qsmrd_l-BekPpQJS.js","./OrderByInfo-GD2XnU8e-BH2q29Gm.js","./PortalLayer-CElnYuSQ-CcA75vOb.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./TemporalLayer-CpOrN_w9-B2VZ6x81.js","./TimeInfo-w_HB2CsF-CygrHAJu.js","./FeatureTemplate-SPHPD45f-Dk1o48TK.js","./FeatureType-C9hJmS6_-zoljUYGr.js","./fieldProperties-Bq26w7gt-c4nyNJP6.js","./versionUtils-LZYZz-38-esAtUime.js","./styleUtils-ChrJTYIw-DnWMc-4t.js","./popupUtils-B0uZcXX0-mkpGjfro.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--C7VzgnNq.js","./loader-Ch7Jr16w-DWxaqSJX.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-Dy9CelfZ.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-6bVX6Odb.js","./interactive-DqhNilgd-C3lhdKPd.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-BZhnQqr6.js","./loadable-DbNDKH4r-BTu-x4Jk.js","./t9n-C_hcZMZJ-BBqL2zVj.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-rjNm5YCZ.js","./form-CRSw616T-DM6mxOFq.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-BkfQZEPV.js","./calcite-list-item-VYBhSMxV-DE-BKmax.js","./action-GCQoufcz-CMRVbhl9.js","./calcite-notice-DeAGopAs-kC7ujg8g.js","./conditionalSlot-DsCzytJ4-C2Pw5SgP.js","./openCloseComponent-BGQ6h7vg-DBDPUlOe.js","./calcite-chip-DE_c-1hr-Do6ZMXLv.js","./calcite-input-BKRd7MCS-CiwokCpm.js","./calcite-tooltip-63c9fmIw-B48bXaVz.js","./floating-ui-DKFFlLv3-Bi8PSsgj.js","./FloatingArrow-BG9llDYg-Di-yhMoZ.js","./calcite-action-2fclGKoO-DqFhtAAB.js","./calcite-action-bar-ugh74qU5-96QZwsBg.js","./action-group-DhwU7QZv-C03omEu_.js","./action-menu-DTIJuZNc-JfgVVBLH.js","./calcite-action-group-qlkUfh_o-Y0Ai_24B.js","./calcite-flow-item-uRuGc3ks-DUNxbO8N.js","./panel-DRUEhsxp-Gud9To6U.js","./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js","./calcite-button-Cm9_TJei-C4rXHwXx.js","./calcite-flow-CAdorlph-CWHUt4uF.js","./calcite-list-item-group-CuQ2MPLW-gyJma6DH.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-BTdHgocv.js";import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,ej as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ke,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as K,iE as go,ai as dt,aw as yo,iF as qe,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,d$ as cn,av as un,b7 as pn,o as N,c3 as Be,bx as vo,c2 as ct,gO as hn,c4 as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,en as vn,iM as Ei,aA as wo,az as $t,e as bo,dW as Io,bt as wn,eC as gt,cn as bn,bw as In,ae as An,iw as ui,ch as Fn,f as Mn,el as Ti,iN as Tt,an as Cn}from"./story-DT1Ep1ux.js";import{b as pe}from"./substitute-j49H6mVR-D_1hvId1.js";import{_ as Y,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-C2vgvXwY.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-B1dXzA4o.js";import{d as Kt,c as Li}from"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-C4YRMtgK.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-QfypPSGF.js";import{l as qn}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-FWeI_AU8.js";import{j as jn}from"./shared-D1w-26bA-BBBcUeQg.js";import Mo from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{L as xt}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{D as Pi}from"./Layer-ChoECxvZ-ocw70508.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./Tile-D75RMC64-XRkD8ADC.js";import{a as Ni}from"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Yt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>K.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Kn=/(\n)/gi,Yn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Yn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Kn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function Es(e){const t=In("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new N("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(i||e):this._renderAttachmentContainer()}_renderLoading(){return u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),Y("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),Y("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),Y("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-DAfTVTEf.js");return{getColor:m}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-DAfTVTEf.js");return{getOpacity:s}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>K.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ks(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ys(e,t,i,o){const n=new Kt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ys(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-DrkEg-ah.js"),__vite__mapDeps([14,4,5,3,6,15,16,17]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-BGwi4Jd-.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-D3YMGvQS.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([21,3,4,5,6,22,15,20,17]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-CbB-eH6p.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-CbB-eH6p.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BGwi4Jd-.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-CbB-eH6p.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-CbB-eH6p.js"),__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>K.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-DEhIUP7F.js"),__vite__mapDeps([24,3,4,5,6,25,26,27,28,29,30,31,32,13,10,11,12,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,7,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ke(this._queryController,Gt),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ke(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Kt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Kt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-6bVX6Odb.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DE-BKmax.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-kC7ujg8g.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ye=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ye({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ye({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ye,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ye,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Ki=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ke(this._queryController,Ki),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Ki)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-Do6ZMXLv.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-CiwokCpm.js"),__vite__mapDeps([127,116,2,3,4,5,6,7,8,117,110,108,118,119,113,107,9,114,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-6bVX6Odb.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DE-BKmax.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-B48bXaVz.js"),__vite__mapDeps([128,2,3,4,5,6,7,8,129,115,106,125,130]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-Do6ZMXLv.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-kC7ujg8g.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-6bVX6Odb.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DE-BKmax.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Yi="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&!!i.attachmentsContent||t.type==="custom"&&!!i.customContent||t.type==="fields"&&!!i.fieldsContent||t.type==="media"&&!!i.mediaContent||t.type==="text"&&!!i.textContent||t.type==="expression"&&!!i.expressionContent||t.type==="relationship"&&!!i.relationshipContent||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Et(i)||(this._error=i,K.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Yi),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Yi),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ks(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-kC7ujg8g.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:u("div",{class:this.classes(D.contentNode,D.contentNodeText),key:`${t}-content`},i.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),Y("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DqFhtAAB.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-96QZwsBg.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-Y0Ai_24B.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-DUNxbO8N.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-DAfTVTEf.js"),__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>K.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Yo(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Ko(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Yo(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Ko(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=Ke(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js"),__vite__mapDeps([138,3,4,5,6,63]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||K.getLogger(this).error(s)}else this.location=Yt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Ko(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):K.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):K.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Yt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||K.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:i?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Yo(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DqFhtAAB.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-96QZwsBg.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-Y0Ai_24B.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([139,2,3,4,5,6,7,117,8,110,118,119,113,107,108,9,114,1,105,106]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-CWHUt4uF.js"),__vite__mapDeps([140,2,3,4,5,6,7,9,113]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-DUNxbO8N.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-6bVX6Odb.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-DE-BKmax.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-gyJma6DH.js"),__vite__mapDeps([141,2,3,4,5,6,7,110,111]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--C7VzgnNq.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():K.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):K.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Yt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),Y("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),Y("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Md=k;export{Md as default}; diff --git a/custom-toc-separator/assets/PortalItem-CctGdnxF-C39Ug2k8.js b/custom-toc-separator/assets/PortalItem-CctGdnxF-C39Ug2k8.js new file mode 100644 index 00000000..ae5cdf47 --- /dev/null +++ b/custom-toc-separator/assets/PortalItem-CctGdnxF-C39Ug2k8.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-DwzNb5YY.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_ as m}from"./main-BTdHgocv.js";import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,cv as q,r as R,P as l,o as g,cw as C,Y as D,M as F,S as o,a0 as N,i as b,j as U,cx as P,a1 as E,cy as $,aB as J}from"./story-DT1Ep1ux.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new g("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new g("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await m(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await m(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new g("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await m(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const z=s;export{z as default}; diff --git a/custom-toc-separator/assets/PortalItem-CctGdnxF-DgukgleB.js b/custom-toc-separator/assets/PortalItem-CctGdnxF-DgukgleB.js deleted file mode 100644 index 95c653bd..00000000 --- a/custom-toc-separator/assets/PortalItem-CctGdnxF-DgukgleB.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-LGtMSbcd.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_ as m}from"./main-lj2zzr_L.js";import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,cv as q,r as R,P as l,o as g,cw as C,Y as D,M as F,S as o,a0 as N,i as b,j as U,cx as P,a1 as E,cy as $,aB as J}from"./story-OUarUCIt.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new g("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new g("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await m(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await m(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new g("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await m(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const z=s;export{z as default}; diff --git a/custom-toc-separator/assets/PortalLayer-CElnYuSQ-B2e-CURI.js b/custom-toc-separator/assets/PortalLayer-CElnYuSQ-B2e-CURI.js deleted file mode 100644 index a0968053..00000000 --- a/custom-toc-separator/assets/PortalLayer-CElnYuSQ-B2e-CURI.js +++ /dev/null @@ -1,3 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-DjOMrTof.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./portalLayers-Bh9bAhk4-DRZYQiud.js","./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./layersCreator-CW56kDKc-BV4FNk7k.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./jsonContext-BA8GHqVk-CN6VxGdq.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-lj2zzr_L.js";import{v as l,S as d,a0 as _,ac as U,i as E,aA as H,$ as b,aU as $,a1 as F,W as n,C as L,cP as T,cQ as k,V as m,r as y,k as I,b6 as x,f as D,cR as O,Q as R,o as S}from"./story-OUarUCIt.js";import f from"./PortalItem-CctGdnxF-DgukgleB.js";import{m as v}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";const A=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=H(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await w(()=>import("./layersLoader-CYI-LpLl-DjOMrTof.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) - ${t}`),t}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(e=>(n(e),!0)))}async setUserPrivileges(r,e){if(!L.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:t,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(r,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){n(t)}}async _fetchUserPrivileges(r,e){let t=this.portalItem;if(!r||!t||!t.loaded||t.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=r===t.id;if(i&&t.portal.user)return v(t);let s,p;if(i)s=t.portal.url;else try{s=await T(this.url,e)}catch(o){n(o)}if(!s||!k(s,t.portal.url))return this._fetchFallbackUserPrivileges(e);try{const o=e!=null?e.signal:null;p=await m?.getCredential(`${s}/sharing`,{prompt:!1,signal:o})}catch(o){n(o)}const c=!0,u=!1,g=!1;if(!p)return{features:{edit:c,fullEdit:u},content:{updateItem:g}};try{if(i?await t.reload():(t=new f({id:r,portal:{url:s}}),await t.load(e)),t.portal.user)return v(t)}catch(o){n(o)}return{features:{edit:c,fullEdit:u},content:{updateItem:g}}}async _fetchFallbackUserPrivileges(r){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(r)}catch(t){n(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){const e=this.url?m?.findCredential(this.url):null;if(!e)return!0;const t=h.credential===e?h.user:await this._fetchEditingUser(r);return h.credential=e,h.user=t,t?.privileges==null||t.privileges.includes("features:user:edit")}async _fetchEditingUser(r){const e=this.portalItem?.portal?.user;if(e)return e;const t=m?.findServerInfo(this.url??"");if(!t?.owningSystemUrl)return null;const i=`${t.owningSystemUrl}/sharing/rest`,s=y.getDefault();if(s&&s.loaded&&I(s.restUrl)===I(i))return s.user;const p=`${i}/community/self`,c=r!=null?r.signal:null,u=await x(D(p,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?O.fromJSON(u.value.data):null}read(r,e){e&&(e.layer=this),super.read(r,e)}write(r,e){const t=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||y.getDefault());return t&&i&&!R(i.restUrl,t.restUrl)?(e.messages&&e.messages.push(new S("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(r,{...e,layer:this})}};return l([d({type:f})],a.prototype,"portalItem",null),l([_("web-document","portalItem",["itemId"])],a.prototype,"readPortalItem",null),l([U("web-document","portalItem",{itemId:{type:String}})],a.prototype,"writePortalItem",null),l([d({clonable:!1})],a.prototype,"resourceReferences",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasFullEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",void 0),a=l([E("esri.layers.mixins.PortalLayer")],a),a},h={credential:null,user:null};export{A as C}; diff --git a/custom-toc-separator/assets/PortalLayer-CElnYuSQ-CcA75vOb.js b/custom-toc-separator/assets/PortalLayer-CElnYuSQ-CcA75vOb.js new file mode 100644 index 00000000..35c36513 --- /dev/null +++ b/custom-toc-separator/assets/PortalLayer-CElnYuSQ-CcA75vOb.js @@ -0,0 +1,3 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-DGf4-gq6.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./portalLayers-Bh9bAhk4-iIxSwWC_.js","./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./layersCreator-CW56kDKc-DnJXdOOq.js","./styleUtils-ChrJTYIw-DnWMc-4t.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-BTdHgocv.js";import{v as l,S as d,a0 as _,ac as U,i as E,aA as H,$ as b,aU as $,a1 as F,W as n,C as L,cP as T,cQ as k,V as m,r as y,k as I,b6 as x,f as D,cR as O,Q as R,o as S}from"./story-DT1Ep1ux.js";import f from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{m as v}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";const A=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=H(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await w(()=>import("./layersLoader-CYI-LpLl-DGf4-gq6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${t}`),t}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(e=>(n(e),!0)))}async setUserPrivileges(r,e){if(!L.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:t,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(r,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){n(t)}}async _fetchUserPrivileges(r,e){let t=this.portalItem;if(!r||!t||!t.loaded||t.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=r===t.id;if(i&&t.portal.user)return v(t);let s,p;if(i)s=t.portal.url;else try{s=await T(this.url,e)}catch(o){n(o)}if(!s||!k(s,t.portal.url))return this._fetchFallbackUserPrivileges(e);try{const o=e!=null?e.signal:null;p=await m?.getCredential(`${s}/sharing`,{prompt:!1,signal:o})}catch(o){n(o)}const c=!0,u=!1,g=!1;if(!p)return{features:{edit:c,fullEdit:u},content:{updateItem:g}};try{if(i?await t.reload():(t=new f({id:r,portal:{url:s}}),await t.load(e)),t.portal.user)return v(t)}catch(o){n(o)}return{features:{edit:c,fullEdit:u},content:{updateItem:g}}}async _fetchFallbackUserPrivileges(r){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(r)}catch(t){n(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){const e=this.url?m?.findCredential(this.url):null;if(!e)return!0;const t=h.credential===e?h.user:await this._fetchEditingUser(r);return h.credential=e,h.user=t,t?.privileges==null||t.privileges.includes("features:user:edit")}async _fetchEditingUser(r){const e=this.portalItem?.portal?.user;if(e)return e;const t=m?.findServerInfo(this.url??"");if(!t?.owningSystemUrl)return null;const i=`${t.owningSystemUrl}/sharing/rest`,s=y.getDefault();if(s&&s.loaded&&I(s.restUrl)===I(i))return s.user;const p=`${i}/community/self`,c=r!=null?r.signal:null,u=await x(D(p,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?O.fromJSON(u.value.data):null}read(r,e){e&&(e.layer=this),super.read(r,e)}write(r,e){const t=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||y.getDefault());return t&&i&&!R(i.restUrl,t.restUrl)?(e.messages&&e.messages.push(new S("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(r,{...e,layer:this})}};return l([d({type:f})],a.prototype,"portalItem",null),l([_("web-document","portalItem",["itemId"])],a.prototype,"readPortalItem",null),l([U("web-document","portalItem",{itemId:{type:String}})],a.prototype,"writePortalItem",null),l([d({clonable:!1})],a.prototype,"resourceReferences",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasFullEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",void 0),a=l([E("esri.layers.mixins.PortalLayer")],a),a},h={credential:null,user:null};export{A as C}; diff --git a/custom-toc-separator/assets/Program-DLVwTiPA-D0v5nxXn.js b/custom-toc-separator/assets/Program-DLVwTiPA-D0v5nxXn.js new file mode 100644 index 00000000..2fa203e1 --- /dev/null +++ b/custom-toc-separator/assets/Program-DLVwTiPA-D0v5nxXn.js @@ -0,0 +1,9 @@ +import{hT as j,a1 as J}from"./story-DT1Ep1ux.js";import{r as ut}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{P as y,V as M,F as dt,t as O,X as mt}from"./Texture-BCt2hphT-B6HwLstV.js";import{V as p,X as x,U as I,F as _t,s as X,Y as C,P as b,n as gt,S as pt,H as A,E as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";let Qt=class{constructor(i,t,e=t){this.internalFormat=i,this.width=t,this.height=e,this.multisampled=!1,this.samples=1}};function Tt(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*mt(i.internalFormat)}let xt=class{constructor(i,t){this._context=i,this._descriptor=t,this.type=y.RenderBuffer,this._context.instanceCounter.increment(p.Renderbuffer,this);const e=this._context.gl;this.glName=e.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:o,multisampled:a}=t;a?e.renderbufferStorageMultisample(e.RENDERBUFFER,this.samples,o,r,n):e.renderbufferStorage(e.RENDERBUFFER,o,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const i=this._descriptor.samples,t=this._context.parameters.maxSamples;return i?Math.min(i,t):t}get usedMemory(){return Tt(this._descriptor)}resize(i,t){const e=this._descriptor;if(e.width===i&&e.height===t)return;e.width=i,e.height=t;const r=this._context.gl;this._context.bindRenderbuffer(this),e.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,e.internalFormat,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,e.internalFormat,e.width,e.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.Renderbuffer,this),this._context=null)}};const Et=()=>J.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"],Mt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` +`):f):rt()};function d(f){f.length&&h.push({type:vt[o],data:f,position:l,line:s,column:c})}function et(f){var S;for(r=0,e=(m+=f).length;i=m[r],r0)continue;D=f.slice(0,1).join("")}return d(D),l+=D.length,(a=a.slice(D.length)).length}}function ht(){return/[^a-fA-F0-9]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function lt(){return i==="."||/[eE]/.test(i)?(a.push(i),o=v,t=i,r+1):i==="x"&&a.length===1&&a[0]==="0"?(o=W,a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ct(){return i==="f"&&(a.push(i),t=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(t)?(a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ft(){if(/[^\d\w_]/.test(i)){var f=a.join("");return o=Mt.indexOf(f)>-1?yt:Ct.indexOf(f)>-1?Ut:Ft,d(a.join("")),o=g,r}return a.push(i),t=i,r+1}}function Pt(i){var t=wt(),e=[];return e=(e=e.concat(t(i))).concat(t(null))}function Lt(i){return Pt(i)}function Nt(i){return i.map(t=>t.type!=="eof"?t.data:"").join("")}const B=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function Bt(i,t="100",e="300 es"){const r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const o=r.exec(n.data);if(o){const a=o[1].replaceAll(/\s{2,}/g," ");if(a===e)return a;if(a===t)return n.data="#version "+e,t;throw new Error("unknown glsl version: "+a)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+e},{type:"whitespace",data:` +`}),null}function Ot(i,t){for(let e=t-1;e>=0;e--){const r=i[e];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function U(i,t,e,r){r=r||e;for(const n of i)if(n.type==="ident"&&n.data===e)return r in t?t[r]++:t[r]=0,U(i,t,r+"_"+t[r],r);return e}function tt(i,t,e="afterVersion"){function r(s,c){for(let l=c;ls=0;--h){const s=e[h];if(s.type==="preprocessor"){const c=s.data.match(/#extension\s+(.*):/);if(c?.[1]&&B.has(c[1].trim())){const _=e[h+1];e.splice(h,_&&_.type==="whitespace"?2:1)}const l=s.data.match(/#ifdef\s+(.*)/);l?.[1]&&B.has(l[1].trim())&&(s.data="#if 1");const u=s.data.match(/#ifndef\s+(.*)/);u?.[1]&&B.has(u[1].trim())&&(s.data="#if 0")}}return It(i,Nt(e))}function It(i,t){return t}const Xt=4294967295;class Wt{constructor(t,e,r,n,o=new Map,a=[]){this._context=t,this._locations=n,this._uniformBlockBindings=o,this._transformFeedbackVaryings=a,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,t||console.error("RenderingContext isn't initialized!"),e.length===0&&console.error("Shaders source should not be empty!"),e=Y(e,T.VERTEX_SHADER),r=Y(r,T.FRAGMENT_SHADER),this._vShader=Z(this._context,T.VERTEX_SHADER,e),this._fShader=Z(this._context,T.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(p.Shader,this),O()&&(this.vertexShader=e,this.fragmentShader=r),this.usedMemory=e.length+r.length;const h=this._context.gl,s=h.createProgram();h.attachShader(s,this._vShader),h.attachShader(s,this._fShader),this._locations.forEach((c,l)=>h.bindAttribLocation(s,c,l)),this._transformFeedbackVaryings?.length&&h.transformFeedbackVaryings(s,this._transformFeedbackVaryings,h.SEPARATE_ATTRIBS),h.linkProgram(s),O()&&!h.getProgramParameter(s,h.LINK_STATUS)&&console.error(`Could not link shader +validated: ${h.getProgramParameter(s,h.VALIDATE_STATUS)}, gl error ${h.getError()}, vertex: ${h.getShaderParameter(this._vShader,h.COMPILE_STATUS)}, fragment: ${h.getShaderParameter(this._fShader,h.COMPILE_STATUS)}, info log: ${h.getProgramInfoLog(s)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[c,l]of this._uniformBlockBindings){const u=h.getUniformBlockIndex(s,c);u0)return;const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&e.decrement(p.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(p.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(p.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(p.Program,this))}ref(){++this._refCount}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(e!==void 0)return e;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,r),r&&this._context.instanceCounter.increment(p.Uniform,r),r}return null}hasUniform(t){return this._getUniformLocation(t)!=null}setUniform1i(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e){E(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e){E(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,r){const n=this._nameToUniform2.get(t);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),this._nameToUniform2.set(t,[e,r])):e===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),n[0]=e,n[1]=r)}setUniform2fv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,r,n){const o=this._nameToUniform3.get(t);o===void 0?(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),this._nameToUniform3.set(t,[e,r,n])):e===o[0]&&r===o[1]&&n===o[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),o[0]=e,o[1]=r,o[2]=n)}setUniform3fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(r,e)}setUniform4f(t,e,r,n,o){const a=this._nameToUniform4.get(t);a===void 0?(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),this._nameToUniform4.set(t,[e,r,n,o])):a!==void 0&&e===a[0]&&r===a[1]&&n===a[2]&&o===a[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),a[0]=e,a[1]=r,a[2]=n,a[3]=o)}setUniform4fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(r,e)}setUniformMatrix3fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,r,e)}setUniformMatrix4fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,r,e)}stop(){}}function Z(i,t,e){const r=i.gl,n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),O()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(t===T.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(zt(e))),n}function zt(i){let t=2;return i.replaceAll(` +`,()=>` +`+Vt(t++)+":")}function Vt(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function E(i,t,e){const r=i.get(t);if(!r)return i.set(t,Array.from(e)),!0;const n=e.length;if(r.length!==n)return i.set(t,Array.from(e)),!0;for(let o=0;oJ.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"],Mt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` -`):f):rt()};function d(f){f.length&&h.push({type:vt[o],data:f,position:l,line:s,column:c})}function et(f){var S;for(r=0,e=(m+=f).length;i=m[r],r0)continue;D=f.slice(0,1).join("")}return d(D),l+=D.length,(a=a.slice(D.length)).length}}function ht(){return/[^a-fA-F0-9]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function lt(){return i==="."||/[eE]/.test(i)?(a.push(i),o=v,t=i,r+1):i==="x"&&a.length===1&&a[0]==="0"?(o=W,a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ct(){return i==="f"&&(a.push(i),t=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(t)?(a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ft(){if(/[^\d\w_]/.test(i)){var f=a.join("");return o=Mt.indexOf(f)>-1?yt:Ct.indexOf(f)>-1?Ut:Ft,d(a.join("")),o=g,r}return a.push(i),t=i,r+1}}function Pt(i){var t=wt(),e=[];return e=(e=e.concat(t(i))).concat(t(null))}function Lt(i){return Pt(i)}function Nt(i){return i.map(t=>t.type!=="eof"?t.data:"").join("")}const B=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function Bt(i,t="100",e="300 es"){const r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const o=r.exec(n.data);if(o){const a=o[1].replaceAll(/\s{2,}/g," ");if(a===e)return a;if(a===t)return n.data="#version "+e,t;throw new Error("unknown glsl version: "+a)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+e},{type:"whitespace",data:` -`}),null}function Ot(i,t){for(let e=t-1;e>=0;e--){const r=i[e];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function U(i,t,e,r){r=r||e;for(const n of i)if(n.type==="ident"&&n.data===e)return r in t?t[r]++:t[r]=0,U(i,t,r+"_"+t[r],r);return e}function tt(i,t,e="afterVersion"){function r(s,c){for(let l=c;ls=0;--h){const s=e[h];if(s.type==="preprocessor"){const c=s.data.match(/#extension\s+(.*):/);if(c?.[1]&&B.has(c[1].trim())){const _=e[h+1];e.splice(h,_&&_.type==="whitespace"?2:1)}const l=s.data.match(/#ifdef\s+(.*)/);l?.[1]&&B.has(l[1].trim())&&(s.data="#if 1");const u=s.data.match(/#ifndef\s+(.*)/);u?.[1]&&B.has(u[1].trim())&&(s.data="#if 0")}}return It(i,Nt(e))}function It(i,t){return t}const Xt=4294967295;class Wt{constructor(t,e,r,n,o=new Map,a=[]){this._context=t,this._locations=n,this._uniformBlockBindings=o,this._transformFeedbackVaryings=a,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,t||console.error("RenderingContext isn't initialized!"),e.length===0&&console.error("Shaders source should not be empty!"),e=Y(e,T.VERTEX_SHADER),r=Y(r,T.FRAGMENT_SHADER),this._vShader=Z(this._context,T.VERTEX_SHADER,e),this._fShader=Z(this._context,T.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(p.Shader,this),O()&&(this.vertexShader=e,this.fragmentShader=r),this.usedMemory=e.length+r.length;const h=this._context.gl,s=h.createProgram();h.attachShader(s,this._vShader),h.attachShader(s,this._fShader),this._locations.forEach((c,l)=>h.bindAttribLocation(s,c,l)),this._transformFeedbackVaryings?.length&&h.transformFeedbackVaryings(s,this._transformFeedbackVaryings,h.SEPARATE_ATTRIBS),h.linkProgram(s),O()&&!h.getProgramParameter(s,h.LINK_STATUS)&&console.error(`Could not link shader -validated: ${h.getProgramParameter(s,h.VALIDATE_STATUS)}, gl error ${h.getError()}, vertex: ${h.getShaderParameter(this._vShader,h.COMPILE_STATUS)}, fragment: ${h.getShaderParameter(this._fShader,h.COMPILE_STATUS)}, info log: ${h.getProgramInfoLog(s)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[c,l]of this._uniformBlockBindings){const u=h.getUniformBlockIndex(s,c);u0)return;const t=this._context.gl,e=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&e.decrement(p.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(e.decrement(p.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),t.deleteShader(this._vShader),this._vShader=null,e.decrement(p.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,e.decrement(p.Program,this))}ref(){++this._refCount}_getUniformLocation(t){const e=this._nameToUniformLocation.get(t);if(e!==void 0)return e;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,t);return this._nameToUniformLocation.set(t,r),r&&this._context.instanceCounter.increment(p.Uniform,r),r}return null}hasUniform(t){return this._getUniformLocation(t)!=null}setUniform1i(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1i(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1iv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1iv(this._getUniformLocation(t),e)}setUniform2iv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2iv(this._getUniformLocation(t),e)}setUniform3iv(t,e){E(this._nameToUniform3,t,e)&&this._context.gl.uniform3iv(this._getUniformLocation(t),e)}setUniform4iv(t,e){E(this._nameToUniform4,t,e)&&this._context.gl.uniform4iv(this._getUniformLocation(t),e)}setUniform1f(t,e){const r=this._nameToUniform1.get(t);r!==void 0&&e===r||(this._context.gl.uniform1f(this._getUniformLocation(t),e),this._nameToUniform1.set(t,e))}setUniform1fv(t,e){E(this._nameToUniform1v,t,e)&&this._context.gl.uniform1fv(this._getUniformLocation(t),e)}setUniform2f(t,e,r){const n=this._nameToUniform2.get(t);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),this._nameToUniform2.set(t,[e,r])):e===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(t),e,r),n[0]=e,n[1]=r)}setUniform2fv(t,e){E(this._nameToUniform2,t,e)&&this._context.gl.uniform2fv(this._getUniformLocation(t),e)}setUniform3f(t,e,r,n){const o=this._nameToUniform3.get(t);o===void 0?(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),this._nameToUniform3.set(t,[e,r,n])):e===o[0]&&r===o[1]&&n===o[2]||(this._context.gl.uniform3f(this._getUniformLocation(t),e,r,n),o[0]=e,o[1]=r,o[2]=n)}setUniform3fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform3,t,e)&&this._context.gl.uniform3fv(r,e)}setUniform4f(t,e,r,n,o){const a=this._nameToUniform4.get(t);a===void 0?(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),this._nameToUniform4.set(t,[e,r,n,o])):a!==void 0&&e===a[0]&&r===a[1]&&n===a[2]&&o===a[3]||(this._context.gl.uniform4f(this._getUniformLocation(t),e,r,n,o),a[0]=e,a[1]=r,a[2]=n,a[3]=o)}setUniform4fv(t,e){const r=this._getUniformLocation(t);r!=null&&E(this._nameToUniform4,t,e)&&this._context.gl.uniform4fv(r,e)}setUniformMatrix3fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix3,t,e)&&this._context.gl.uniformMatrix3fv(n,r,e)}setUniformMatrix4fv(t,e,r=!1){const n=this._getUniformLocation(t);n!=null&&E(this._nameToUniformMatrix4,t,e)&&this._context.gl.uniformMatrix4fv(n,r,e)}stop(){}}function Z(i,t,e){const r=i.gl,n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),O()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(t===T.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(zt(e))),n}function zt(i){let t=2;return i.replaceAll(` -`,()=>` -`+Vt(t++)+":")}function Vt(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function E(i,t,e){const r=i.get(t);if(!r)return i.set(t,Array.from(e)),!0;const n=e.length;if(r.length!==n)return i.set(t,Array.from(e)),!0;for(let o=0;o[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; diff --git a/custom-toc-separator/assets/ProgramTemplate-DQOm6Omy-BId56203.js b/custom-toc-separator/assets/ProgramTemplate-DQOm6Omy-BId56203.js new file mode 100644 index 00000000..24b05dea --- /dev/null +++ b/custom-toc-separator/assets/ProgramTemplate-DQOm6Omy-BId56203.js @@ -0,0 +1 @@ +import{V as o}from"./Program-DLVwTiPA-D0v5nxXn.js";let d=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const a=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; diff --git a/custom-toc-separator/assets/Query-BrwMGK8U-FWeI_AU8.js b/custom-toc-separator/assets/Query-BrwMGK8U-FWeI_AU8.js new file mode 100644 index 00000000..37d764fa --- /dev/null +++ b/custom-toc-separator/assets/Query-BrwMGK8U-FWeI_AU8.js @@ -0,0 +1 @@ +import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,cr as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,cs as A,ct as Z,P as T,aO as Y}from"./story-DT1Ep1ux.js";import{y as ee}from"./Field-C6hA1tZj-aKnzhZ32.js";import{k as te}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./main-BTdHgocv.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let n=B=class extends u{constructor(r){super(r),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,me as Q,se as a,pe as b,b as c,ne as m,ae as s}; diff --git a/custom-toc-separator/assets/Query-BrwMGK8U-gUIs0TS1.js b/custom-toc-separator/assets/Query-BrwMGK8U-gUIs0TS1.js deleted file mode 100644 index dd7f275b..00000000 --- a/custom-toc-separator/assets/Query-BrwMGK8U-gUIs0TS1.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,cr as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,cs as A,ct as Z,P as T,aO as Y}from"./story-OUarUCIt.js";import{y as ee}from"./Field-C6hA1tZj-DY7R6puO.js";import{k as te}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./main-lj2zzr_L.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let n=B=class extends u{constructor(r){super(r),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,me as Q,se as a,pe as b,b as c,ne as m,ae as s}; diff --git a/custom-toc-separator/assets/QueryEngine-CH5uUhZK-B7KHLDgB.js b/custom-toc-separator/assets/QueryEngine-CH5uUhZK-B7KHLDgB.js deleted file mode 100644 index 59089214..00000000 --- a/custom-toc-separator/assets/QueryEngine-CH5uUhZK-B7KHLDgB.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as Ze}from"./main-lj2zzr_L.js";import{co as je,al as ce,aA as $e,by as E,P as J,aC as V,g as he,o as A,$ as Be,gW as ke,gX as He,gU as Le,gY as Je,p as W,aY as U,gZ as Ue,eQ as Ye,cf as de,ca as Ke,g_ as We,bh as Xe,cg as fe,gM as ie,gN as ae,ea as X,cn as be,g$ as et,eP as me,h0 as tt,h1 as st,dW as Ee,h2 as it}from"./story-OUarUCIt.js";import{Y as at}from"./projection-BA9M1R7d-Cytmrlsd.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{b as ye}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{Z as nt}from"./WhereClause-DxwoyBMS-D_DBEuLt.js";import{i as ge}from"./fieldType-CD2CL2hr-D-1zqE7t.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-BLBOCVnL.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import{C as dt}from"./utils-HtkT8Fn3-CjrLkz9Y.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-CgPuWip3.js";import{o as It}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{p as Se}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Ze(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class as{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,this.fieldsIndex=je(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),$e(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return Be(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=ke(Le(),He);await this.featureStore.forEachBounds(e,o=>Je(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Ue(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ye(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ke(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[We(Xe(),n)]}export{as as Z}; diff --git a/custom-toc-separator/assets/QueryEngine-CH5uUhZK-CYBqfWM0.js b/custom-toc-separator/assets/QueryEngine-CH5uUhZK-CYBqfWM0.js new file mode 100644 index 00000000..f8b3f264 --- /dev/null +++ b/custom-toc-separator/assets/QueryEngine-CH5uUhZK-CYBqfWM0.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{_ as Ze}from"./main-BTdHgocv.js";import{co as je,al as ce,aA as $e,by as E,P as J,aC as V,g as he,o as A,$ as Be,gW as ke,gX as He,gU as Le,gY as Je,p as W,aY as U,gZ as Ue,eQ as Ye,cf as de,ca as Ke,g_ as We,bh as Xe,cg as fe,gM as ie,gN as ae,ea as X,cn as be,g$ as et,eP as me,h0 as tt,h1 as st,dW as Ee,h2 as it}from"./story-DT1Ep1ux.js";import{Y as at}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{b as ye}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{Z as nt}from"./WhereClause-DxwoyBMS-Daxq3yaK.js";import{i as ge}from"./fieldType-CD2CL2hr-B2sVi9me.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-CHDjIIE2.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import{C as dt}from"./utils-HtkT8Fn3-CoByYob7.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-CYo4DtRj.js";import{o as It}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{p as Se}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Ze(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class as{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,this.fieldsIndex=je(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),$e(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return Be(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=ke(Le(),He);await this.featureStore.forEachBounds(e,o=>Je(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Ue(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ye(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ke(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[We(Xe(),n)]}export{as as Z}; diff --git a/custom-toc-separator/assets/QueryTask-CwHwH2rS-Cdg8UCnQ.js b/custom-toc-separator/assets/QueryTask-CwHwH2rS-Cdg8UCnQ.js deleted file mode 100644 index ae3fa040..00000000 --- a/custom-toc-separator/assets/QueryTask-CwHwH2rS-Cdg8UCnQ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-Cv4LZ_Ov.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./Mesh-DLzjDUIO-BlTrUdFo.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Bin5_zrY.js","./plane-Dt8R0KeE-DlxNxa6f.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-DsVnH-8X.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js","./vec3-BazNroeq-C58EAHFm.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-CF_vNE3j.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./Query-BrwMGK8U-gUIs0TS1.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./executeRelationshipQuery-BlX9_g4g-BPTwePaV.js","./utils-9sQxfkoa-Djr5L7DU.js","./query-DFW9-NG_-CLOB0soI.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-Bq23Xwmj-CIl5z47y.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./queryAttachments-Bgvu3RnK-CMM4llsO.js","./AttachmentInfo-D9RFO8W2-qR5MPnw_.js","./executeBinsQuery-26-59HNS-DM7KQ_00.js","./BinsQuery-DjwQZqB8-xSRrS-fI.js","./queryUtils-Brxu6254-BZ9oWgik.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js","./queryTopFeatures-IbhAPJlP-B2OySQ6g.js","./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js","./executeForTopIds-BWxBZygF-U3ALYew8.js","./executeForTopExtents-3NOTiZTn-D9Zdubzg.js","./executeForTopCount-Dx1gCDe1-Dh8nZiiP.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-lj2zzr_L.js";import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,o as d,aC as I}from"./story-OUarUCIt.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-gUIs0TS1.js";import{y as Q}from"./utils-9sQxfkoa-Djr5L7DU.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-BLtp2DWt.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import{s as C}from"./executeQueryJSON-CcHnccia-C6q0seac.js";import{O as z}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-Cv4LZ_Ov.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-CjRN9GkI.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-BPTwePaV.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-CjRN9GkI.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-BPTwePaV.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-CMM4llsO.js"),__vite__mapDeps([56,1,2,3,4,47,48,49,46,50,51,52,53,54,55,26,27,57]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-DM7KQ_00.js"),__vite__mapDeps([58,46,1,2,3,4,48,49,50,47,51,52,53,54,55,26,27,59,60,61,43,39,40,44,38]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js"),__vite__mapDeps([62,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,38,39,40,64,44]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-U3ALYew8.js"),__vite__mapDeps([65,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-D9Zdubzg.js"),__vite__mapDeps([66,1,2,3,4,46,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-Dh8nZiiP.js"),__vite__mapDeps([67,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const K=i;export{K as C}; diff --git a/custom-toc-separator/assets/QueryTask-CwHwH2rS-LNltUUKG.js b/custom-toc-separator/assets/QueryTask-CwHwH2rS-LNltUUKG.js new file mode 100644 index 00000000..bb62e019 --- /dev/null +++ b/custom-toc-separator/assets/QueryTask-CwHwH2rS-LNltUUKG.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-Cwvie_FU.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./Mesh-DLzjDUIO-BGFhxEuV.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-BChBDP40.js","./plane-Dt8R0KeE-CP4TXD5k.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-UtmvndF2.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js","./vec3-BazNroeq-xVxXS26y.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-CEZkOwEl.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./meshFeatureAttributes-BwKR5odo-BHZn4_tO.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./Query-BrwMGK8U-FWeI_AU8.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js","./utils-9sQxfkoa-CwJW9dca.js","./query-DFW9-NG_-SSagAgRu.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-Bq23Xwmj-Csxw19qV.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./queryAttachments-Bgvu3RnK-knzGTJg_.js","./AttachmentInfo-D9RFO8W2-B1dXzA4o.js","./executeBinsQuery-26-59HNS-CAw0ShUR.js","./BinsQuery-DjwQZqB8-BqGeRmeR.js","./queryUtils-Brxu6254-qwN-s2Og.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js","./queryTopFeatures-IbhAPJlP-ChckWHgQ.js","./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js","./executeForTopIds-BWxBZygF-BPk9RKm-.js","./executeForTopExtents-3NOTiZTn-CDRqhE8I.js","./executeForTopCount-Dx1gCDe1-Bt3EwZwA.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-BTdHgocv.js";import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,o as d,aC as I}from"./story-DT1Ep1ux.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-FWeI_AU8.js";import{y as Q}from"./utils-9sQxfkoa-CwJW9dca.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-CKWTLnam.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import{s as C}from"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import{O as z}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-Cwvie_FU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-ueD2VMB6.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-ueD2VMB6.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-knzGTJg_.js"),__vite__mapDeps([56,1,2,3,4,47,48,49,46,50,51,52,53,54,55,26,27,57]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-CAw0ShUR.js"),__vite__mapDeps([58,46,1,2,3,4,48,49,50,47,51,52,53,54,55,26,27,59,60,61,43,39,40,44,38]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js"),__vite__mapDeps([62,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,38,39,40,64,44]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-BPk9RKm-.js"),__vite__mapDeps([65,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-CDRqhE8I.js"),__vite__mapDeps([66,1,2,3,4,46,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-Bt3EwZwA.js"),__vite__mapDeps([67,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const K=i;export{K as C}; diff --git a/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-2ansCCcJ.js b/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-2ansCCcJ.js deleted file mode 100644 index cb65d687..00000000 --- a/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-2ansCCcJ.js +++ /dev/null @@ -1 +0,0 @@ -import{al as l,E as d,cW as g,b as m,aS as u,aQ as f,t as I}from"./story-OUarUCIt.js";import{B as q}from"./workers-PiCjreoO-mU03Z-E4.js";import{h as c}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{o as v}from"./signal-CETehA7D-TD-k6B-y.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new c,this._controllers=new c,this._processingItems=new c,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const n=this._processingItems.get(e);n&&n.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; diff --git a/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-Cd63xfTl.js b/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-Cd63xfTl.js new file mode 100644 index 00000000..a67993f8 --- /dev/null +++ b/custom-toc-separator/assets/QueueProcessor-DbfV9fLy-Cd63xfTl.js @@ -0,0 +1 @@ +import{al as l,E as d,cW as g,b as m,aS as u,aQ as f,t as I}from"./story-DT1Ep1ux.js";import{B as q}from"./workers-PiCjreoO-DrDY4oeh.js";import{h as c}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{o as v}from"./signal-CETehA7D-o0XgAOKb.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new c,this._controllers=new c,this._processingItems=new c,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const n=this._processingItems.get(e);n&&n.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; diff --git a/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js b/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js new file mode 100644 index 00000000..bb643b1a --- /dev/null +++ b/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js @@ -0,0 +1 @@ +import{aK as le,ar as b,v as a,S as n,dN as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,e0 as vt,d_ as St,eB as Ie,cr as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,eC as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,d$ as Oe,f as O,J as Ht,o as j}from"./story-DT1Ep1ux.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js";import{q as kt}from"./workers-PiCjreoO-DrDY4oeh.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{y as Pt}from"./Field-C6hA1tZj-aKnzhZ32.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-5rDIvGzY.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-Yy2GlotV.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-CwJW9dca.js";import{O as $t}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-QfypPSGF.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Ue({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new ue(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(o=>5*o),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; diff --git a/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js b/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js deleted file mode 100644 index 0d305d37..00000000 --- a/custom-toc-separator/assets/RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as le,ar as b,v as a,S as n,dN as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,e0 as vt,d_ as St,eB as Ie,cr as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,eC as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,d$ as Oe,f as O,J as Ht,o as j}from"./story-OUarUCIt.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-DCwX6ZId.js";import{q as kt}from"./workers-PiCjreoO-mU03Z-E4.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{y as Pt}from"./Field-C6hA1tZj-DY7R6puO.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-D0TnSXh8.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-D0XKNTvx.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-Djr5L7DU.js";import{O as $t}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-DGbScRZv.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Ue({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new ue(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(o=>5*o),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Ie.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; diff --git a/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-5rDIvGzY.js b/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-5rDIvGzY.js new file mode 100644 index 00000000..b61fd38f --- /dev/null +++ b/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-5rDIvGzY.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lerc-wasm-p5Heunzu-CsUnIe3C.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as cr}from"./main-BTdHgocv.js";import{aK as _t,v as D,S as N,i as Me,a0 as hr,ac as fr,w as dr,n as vt,J as pr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,co as mr,x as gr,aS as yr,ar as Tt,bw as Cr}from"./story-DT1Ep1ux.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-DXg8vX2o.js";const Ko=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Yo(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Zo=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([hr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([fr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:dr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),l=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),f=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),gr(o))return void u(yr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Kr=(()=>{const e=mt.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Yr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],qr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function He(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Xr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function en(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function rn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function an(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function ln(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function un(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!jt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const cn=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{un as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,qo as K,Jr as L,Je as N,Le as P,ln as Q,Go as S,lr as T,Qo as V,Gr as W,sn as X,Zo as Y,an as Z,tn as _,$o as a,Xo as b,Mr as c,on as d,Ko as e,Yo as f,et as g,Oo as h,Et as i,rn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,nn as s,cn as t,gt as u,so as v,Ro as w,No as x,Eo as y,en as z}; diff --git a/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-D0TnSXh8.js b/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-D0TnSXh8.js deleted file mode 100644 index ac1e3fdc..00000000 --- a/custom-toc-separator/assets/RasterSymbolizer-BVys6HkM-D0TnSXh8.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lerc-wasm-p5Heunzu-CsUnIe3C.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as cr}from"./main-lj2zzr_L.js";import{aK as _t,v as D,S as N,i as Me,a0 as hr,ac as fr,w as dr,n as vt,J as pr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,co as mr,x as gr,aS as yr,ar as Tt,bw as Cr}from"./story-OUarUCIt.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-DchH3ayn.js";const Ko=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Yo(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Zo=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([hr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([fr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:dr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),l=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),f=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),gr(o))return void u(yr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Kr=(()=>{const e=mt.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Yr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],qr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function He(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Xr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function en(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function rn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function an(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function ln(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function un(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!jt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const cn=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{un as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,qo as K,Jr as L,Je as N,Le as P,ln as Q,Go as S,lr as T,Qo as V,Gr as W,sn as X,Zo as Y,an as Z,tn as _,$o as a,Xo as b,Mr as c,on as d,Ko as e,Yo as f,et as g,Oo as h,Et as i,rn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,nn as s,cn as t,gt as u,so as v,Ro as w,No as x,Eo as y,en as z}; diff --git a/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js b/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js deleted file mode 100644 index 32100d78..00000000 --- a/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-1f-kbtUw.js +++ /dev/null @@ -1 +0,0 @@ -import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,et as V,$ as W}from"./story-OUarUCIt.js";import{r as D}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-Bv29bzNX.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-D5oryYiP.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function G(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Nt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(Lt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Wt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(qt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void at.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; diff --git a/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js b/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js new file mode 100644 index 00000000..2e645fe6 --- /dev/null +++ b/custom-toc-separator/assets/RasterVFDisplayObject-CnriTVT9-CqC3KhAk.js @@ -0,0 +1 @@ +import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,et as V,$ as W}from"./story-DT1Ep1ux.js";import{r as D}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-B6HwLstV.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function G(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Nt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(Lt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Wt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=a.painter.materialManager.getProgram(qt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void at.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; diff --git a/custom-toc-separator/assets/RasterWorker-CzIELPA8-BIU5L9vJ.js b/custom-toc-separator/assets/RasterWorker-CzIELPA8-BIU5L9vJ.js new file mode 100644 index 00000000..fe2aad99 --- /dev/null +++ b/custom-toc-separator/assets/RasterWorker-CzIELPA8-BIU5L9vJ.js @@ -0,0 +1 @@ +import{v as f,bz as p,i as u,n as a,w as S}from"./story-DT1Ep1ux.js";import{s as d}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-CjC6pTlj.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-5rDIvGzY.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-of3yQAdZ.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";import"./main-BTdHgocv.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class rr{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{rr as default}; diff --git a/custom-toc-separator/assets/RasterWorker-CzIELPA8-CrGjzWsP.js b/custom-toc-separator/assets/RasterWorker-CzIELPA8-CrGjzWsP.js deleted file mode 100644 index 87b8c8ef..00000000 --- a/custom-toc-separator/assets/RasterWorker-CzIELPA8-CrGjzWsP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as f,bz as p,i as u,n as a,w as S}from"./story-OUarUCIt.js";import{s as d}from"./projection-BA9M1R7d-Cytmrlsd.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-YDmCFwfE.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-D0TnSXh8.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-QGUE0RJ1.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";import"./main-lj2zzr_L.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class rr{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{rr as default}; diff --git a/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js b/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js new file mode 100644 index 00000000..b206cb71 --- /dev/null +++ b/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js @@ -0,0 +1 @@ +import{w as Q}from"./story-DT1Ep1ux.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; diff --git a/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-TGuQW6oN.js b/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-TGuQW6oN.js deleted file mode 100644 index 6dfe44fd..00000000 --- a/custom-toc-separator/assets/RawBlockCache-Cj_tmHDm-TGuQW6oN.js +++ /dev/null @@ -1 +0,0 @@ -import{w as Q}from"./story-OUarUCIt.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-C6XacwGz.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; diff --git a/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DLjzYieQ.js b/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DLjzYieQ.js deleted file mode 100644 index 897290e4..00000000 --- a/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DLjzYieQ.js +++ /dev/null @@ -1 +0,0 @@ -import{cU as i,cV as e}from"./story-OUarUCIt.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; diff --git a/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DUyzE86P.js b/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DUyzE86P.js new file mode 100644 index 00000000..36bb8222 --- /dev/null +++ b/custom-toc-separator/assets/ReactiveMap-CFk6jPfN-DUyzE86P.js @@ -0,0 +1 @@ +import{cU as i,cV as e}from"./story-DT1Ep1ux.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; diff --git a/custom-toc-separator/assets/ReactiveSet-QxEZenFW-C2vgvXwY.js b/custom-toc-separator/assets/ReactiveSet-QxEZenFW-C2vgvXwY.js new file mode 100644 index 00000000..198cb588 --- /dev/null +++ b/custom-toc-separator/assets/ReactiveSet-QxEZenFW-C2vgvXwY.js @@ -0,0 +1 @@ +import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import{iO as b,cU as T,cV as a,di as o,c3 as l,c2 as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as V,iU as M}from"./story-DT1Ep1ux.js";function $(r,t){return{type:b(t),value:r,unit:t}}function Z(r){return{value:r}}function w(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function q(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):$(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const K=w(0,"meters"),P=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=V(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{H as A,W as C,w as D,O as F,tt as G,et as H,A as J,q as K,K as L,P as N,Y as P,J as Q,Q as R,G as S,Z as U,rt as W,R as Y,X as Z,m as b,h as c,C as j,D as m,j as q,it as s,nt as t,u,N as x}; diff --git a/custom-toc-separator/assets/ReactiveSet-QxEZenFW-lQMKFlS3.js b/custom-toc-separator/assets/ReactiveSet-QxEZenFW-lQMKFlS3.js deleted file mode 100644 index 4c0ac2f8..00000000 --- a/custom-toc-separator/assets/ReactiveSet-QxEZenFW-lQMKFlS3.js +++ /dev/null @@ -1 +0,0 @@ -import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import{iO as b,cU as T,cV as a,di as o,c3 as l,c2 as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as V,iU as M}from"./story-OUarUCIt.js";function $(r,t){return{type:b(t),value:r,unit:t}}function Z(r){return{value:r}}function w(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function q(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):$(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const K=w(0,"meters"),P=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=V(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{H as A,W as C,w as D,O as F,tt as G,et as H,A as J,q as K,K as L,P as N,Y as P,J as Q,Q as R,G as S,Z as U,rt as W,R as Y,X as Z,m as b,h as c,C as j,D as m,j as q,it as s,nt as t,u,N as x}; diff --git a/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-BK6RT4lC.js b/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-BK6RT4lC.js deleted file mode 100644 index 9185e5b7..00000000 --- a/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-BK6RT4lC.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as u,dx as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./story-OUarUCIt.js";import{s as I}from"./commonProperties-BtIqvFU_-CGeXCscf.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,L=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{L as T}; diff --git a/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-_sKw2yv4.js b/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-_sKw2yv4.js new file mode 100644 index 00000000..35c4e25b --- /dev/null +++ b/custom-toc-separator/assets/RefreshableLayer-a8BQ58Xh-_sKw2yv4.js @@ -0,0 +1 @@ +import{ag as u,dx as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./story-DT1Ep1ux.js";import{s as I}from"./commonProperties-BtIqvFU_-BAaMjACd.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,L=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{L as T}; diff --git a/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B4aMLSjJ.js b/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B4aMLSjJ.js new file mode 100644 index 00000000..fe36ef9c --- /dev/null +++ b/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B4aMLSjJ.js @@ -0,0 +1 @@ +import{v as i,i as t,ai as h,aU as l,a1 as d}from"./story-DT1Ep1ux.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; diff --git a/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B9bwJvtU.js b/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B9bwJvtU.js deleted file mode 100644 index 71c4aa13..00000000 --- a/custom-toc-separator/assets/RefreshableLayerView-BdQpGYly-B9bwJvtU.js +++ /dev/null @@ -1 +0,0 @@ -import{v as i,i as t,ai as h,aU as l,a1 as d}from"./story-OUarUCIt.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; diff --git a/custom-toc-separator/assets/Relationship-Db9GUmYx-D5mx9kys.js b/custom-toc-separator/assets/Relationship-Db9GUmYx-D5mx9kys.js deleted file mode 100644 index 71655b15..00000000 --- a/custom-toc-separator/assets/Relationship-Db9GUmYx-D5mx9kys.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./story-OUarUCIt.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; diff --git a/custom-toc-separator/assets/Relationship-Db9GUmYx-D8hB6lBb.js b/custom-toc-separator/assets/Relationship-Db9GUmYx-D8hB6lBb.js new file mode 100644 index 00000000..5ae72b52 --- /dev/null +++ b/custom-toc-separator/assets/Relationship-Db9GUmYx-D8hB6lBb.js @@ -0,0 +1 @@ +import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./story-DT1Ep1ux.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; diff --git a/custom-toc-separator/assets/Relationship-PyhUibYK-Dl9eU1qo.js b/custom-toc-separator/assets/Relationship-PyhUibYK-Dl9eU1qo.js new file mode 100644 index 00000000..f7feddbe --- /dev/null +++ b/custom-toc-separator/assets/Relationship-PyhUibYK-Dl9eU1qo.js @@ -0,0 +1 @@ +import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./story-DT1Ep1ux.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; diff --git a/custom-toc-separator/assets/Relationship-PyhUibYK-Jg399ifo.js b/custom-toc-separator/assets/Relationship-PyhUibYK-Jg399ifo.js deleted file mode 100644 index b9f31746..00000000 --- a/custom-toc-separator/assets/Relationship-PyhUibYK-Jg399ifo.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./story-OUarUCIt.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; diff --git a/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-CjRN9GkI.js b/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-CjRN9GkI.js deleted file mode 100644 index 85b702cc..00000000 --- a/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-CjRN9GkI.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./story-OUarUCIt.js";import{K as y}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./main-lj2zzr_L.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";var a;let r=a=class extends l{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const S=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,M=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{M as R,S as c,m as d}; diff --git a/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-ueD2VMB6.js b/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-ueD2VMB6.js new file mode 100644 index 00000000..79736acc --- /dev/null +++ b/custom-toc-separator/assets/RelationshipQuery-DJsz3K0U-ueD2VMB6.js @@ -0,0 +1 @@ +import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./story-DT1Ep1ux.js";import{K as y}from"./Query-BrwMGK8U-FWeI_AU8.js";import"./main-BTdHgocv.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";var a;let r=a=class extends l{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const S=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,M=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{M as R,S as c,m as d}; diff --git a/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-CotdYMFm.js b/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-CotdYMFm.js deleted file mode 100644 index 96730b5a..00000000 --- a/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-CotdYMFm.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as o,ar as p,bB as c,ac as d,i as n,cr as v,aa as y,e as i,bz as h}from"./story-OUarUCIt.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; diff --git a/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-DkzIw6pB.js b/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-DkzIw6pB.js new file mode 100644 index 00000000..6b89ce5a --- /dev/null +++ b/custom-toc-separator/assets/RendererLegendOptions-K3md58-X-DkzIw6pB.js @@ -0,0 +1 @@ +import{v as e,S as o,ar as p,bB as c,ac as d,i as n,cr as v,aa as y,e as i,bz as h}from"./story-DT1Ep1ux.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; diff --git a/custom-toc-separator/assets/RenderingContext-DbCVbtGZ-CLtHlEj9.js b/custom-toc-separator/assets/RenderingContext-DbCVbtGZ-CLtHlEj9.js deleted file mode 100644 index 759ad736..00000000 --- a/custom-toc-separator/assets/RenderingContext-DbCVbtGZ-CLtHlEj9.js +++ /dev/null @@ -1,137 +0,0 @@ -import{o as W}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{ProgramCache as te,glslifyDefineMap as se}from"./webglDeps-Bgavuh0h-CRZNTeK3.js";import{hT as w,az as ie,aN as re,K as N,hZ as V}from"./story-OUarUCIt.js";import{V as ae,F as p,N as U,y as ne,H as I}from"./Texture-BCt2hphT-Bv29bzNX.js";import{f as g,X as M,S as a,C as F,r as v,R as b,Y as d,M as C,a as le,V as R,o as z,A as m,N as D,O as j,L as x,D as B,P as A,T as E,G as y,n as S,I as O,U as Z,F as k,B as oe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as he,K as fe,A as ue}from"./renderState-Dap0WV9P-D4IHxyei.js";import{e as K}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{r as P}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{G}from"./Program-DLVwTiPA-DeIeQX6y.js";import{L as _e,b as ce,c as L}from"./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js";import{f as de}from"./floatRGBA-4pIJN00G-DCWbfrRi.js";import{f as Y}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{c as Q}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{n as J}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const Ee=e=>{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: -`;for(let s=0;s0&&(e+=`${R[s]}: ${t} -`)}}return e+=this._allocations?.resetLog(),e}},be=class{constructor(e,s,t){const i=s.textureFilterAnisotropic,r=t.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES),this.maxDrawBuffers=e.getParameter(e.MAX_DRAW_BUFFERS)}};class X{constructor(s){this._rctx=s,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es - precision highp float; - - void main(void) { - gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); - }`,fragment:`#version 300 es - precision highp float; - - out vec4 fragColor; - - void main(void) { - fragColor = vec4(0.0, 0.0, 0.0, 1.0); - }`}}_createHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}_createIndexbuffer(){return P.createIndex(this._rctx,S.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,a.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(E.POINTS,1,O.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){}}class Fe extends L{constructor(s){super(),this._rctx=s,this._helperProgram=null,N("mac")&&N("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose(),this._helperProgram?.dispose(),this._helperProgram=null}_test(s){const t=this._rctx,i=t.getBoundFramebufferObject(),{x:r,y:n,width:l,height:u}=t.getViewport();t.resetState();const o=new I(1);o.wrapMode=y.CLAMP_TO_EDGE,o.samplingMode=C.NEAREST;const h=new G(t,o),_=P.createIndex(this._rctx,S.STATIC_DRAW,new Uint8Array([0]));t.bindFramebuffer(h),t.setViewport(0,0,1,1),t.useProgram(this._helperProgram),t.bindBuffer(_,a.ELEMENT_ARRAY_BUFFER),t.drawElements(E.POINTS,1,O.UNSIGNED_BYTE,0),t.useProgram(s),t.bindVAO(null),t.drawArrays(E.TRIANGLES,0,258);const c=new Uint8Array(4);return h.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,c),t.setViewport(r,n,l,u),t.bindFramebuffer(i),h.dispose(),_.dispose(),c[0]===255}_prepareProgram(){const s=`#version 300 es - precision highp float; - - out float triangleId; - - const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); - - void main(void) { - triangleId = floor(float(gl_VertexID)/3.0); - - vec3 position = triangleVertices[gl_VertexID % 3]; - float offset = triangleId / ${K.float(85)}; - position.z = 0.5 - offset; - - gl_Position = vec4(position, 1.0); - } - `,t=`#version 300 es - precision highp float; - - in float triangleId; - - out vec4 fragColor; - - void main(void) { - fragColor = triangleId == ${K.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); - } - `;return this._rctx.programCache.acquire(s,t,new Map([]))}_prepareHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}}let Re=class extends L{constructor(e){super(),this._rctx=e,this._program=H(this._rctx,!1),this._obfuscated=H(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=w(this._obfuscated)}_test(e){if(N("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const s=this._rctx,t=s.getBoundFramebufferObject(),{x:i,y:r,width:n,height:l}=s.getViewport(),u=this._runProgram(e),o=this._runProgram(this._obfuscated);return s.setViewport(i,r,n,l),s.bindFramebuffer(t),u!==0&&(o===0||u/o>5)}_runProgram(e){const s=this._rctx;s.resetState();const t=new I(1);t.wrapMode=y.CLAMP_TO_EDGE,t.samplingMode=C.NEAREST;const i=new G(s,t),r=P.createVertex(s,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),n=new Q(s,new Map([["position",0]]),new Map([["geometry",[new J("position",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",r]])),l=V(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),u=V(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),o=new Float32Array(6);Y(l,o,3);const h=new Float32Array(6);Y(u,h,3),s.useProgram(e),e.setUniform3f("u_highA",o[0],o[2],o[4]),e.setUniform3f("u_lowA",o[1],o[3],o[5]),e.setUniform3f("u_highB",h[0],h[2],h[4]),e.setUniform3f("u_lowB",h[1],h[3],h[5]),s.bindFramebuffer(i),s.setViewport(0,0,1,1),s.bindVAO(n),s.drawArrays(E.TRIANGLE_STRIP,0,4);const _=new Uint8Array(4);i.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,_),n.dispose(),i.dispose();const c=(l[2]-u[2])/25,T=de(_);return Math.abs(c-T)}};function H(e,s){const t=` - - precision highp float; - - attribute vec2 position; - - uniform vec3 u_highA; - uniform vec3 u_lowA; - uniform vec3 u_highB; - uniform vec3 u_lowB; - - varying vec4 v_color; - - ${s?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} - - #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION - - vec3 dpPlusFrc(vec3 a, vec3 b) { - return mix(a, a + b, vec3(notEqual(b, vec3(0)))); - } - - vec3 dpMinusFrc(vec3 a, vec3 b) { - return mix(vec3(0), a - b, vec3(notEqual(a, b))); - } - - vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { - vec3 t1 = dpPlusFrc(hiA, hiB); - vec3 e = dpMinusFrc(t1, hiA); - vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; - return t1 + t2; - } - - #else - - vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { - vec3 t1 = hiA + hiB; - vec3 e = t1 - hiA; - vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; - return t1 + t2; - } - - #endif - - const float MAX_RGBA_FLOAT = - 255.0 / 256.0 + - 255.0 / 256.0 / 256.0 + - 255.0 / 256.0 / 256.0 / 256.0 + - 255.0 / 256.0 / 256.0 / 256.0 / 256.0; - - const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); - - vec4 float2rgba(const float value) { - // Make sure value is in the domain we can represent - float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); - - // Decompose value in 32bit fixed point parts represented as - // uint8 rgba components. Decomposition uses the fractional part after multiplying - // by a power of 256 (this removes the bits that are represented in the previous - // component) and then converts the fractional part to 8bits. - vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); - - // Convert uint8 values (from 0 to 255) to floating point representation for - // the shader - const float toU8AsFloat = 1.0 / 255.0; - - return fixedPointU8 * toU8AsFloat; - } - - void main() { - vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); - - v_color = float2rgba(val.z / 25.0); - - gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); - } - `;return e.programCache.acquire(t,` - precision highp float; - - varying vec4 v_color; - - void main() { - gl_FragColor = v_color; - } - `,new Map([["position",0]]))}class me extends L{constructor(s){if(super(),this._rctx=s,!s.gl||!(s.capabilities.colorBufferFloat?.textureFloat&&s.capabilities.colorBufferFloat?.floatBlend))return;const t=` - precision highp float; - attribute vec2 a_pos; - - void main() { - gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); - } - `,i=` - precision highp float; - - void main() { - gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); - } - `;this._program=s.programCache.acquire(t,i,new Map([["a_pos",0]]))}_test(s){const t=this._rctx,i=new I(1);i.wrapMode=y.CLAMP_TO_EDGE,i.dataType=k.FLOAT,i.internalFormat=oe.RGBA32F,i.samplingMode=C.NEAREST;const r=new G(t,i),n=P.createVertex(t,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),l=new Q(t,new Map([["a_pos",0]]),new Map([["geometry",[new J("a_pos",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",n]]));t.gl.getError(),t.useProgram(s);const u=t.getBoundFramebufferObject(),{x:o,y:h,width:_,height:c}=t.getViewport();t.bindFramebuffer(r),t.setViewport(0,0,1,1),t.bindVAO(l),t.drawArrays(E.TRIANGLE_STRIP,0,4);const T=fe({blending:ue});t.setPipelineState(T),t.drawArrays(E.TRIANGLE_STRIP,0,4);const ee=t.gl.getError();return t.setViewport(o,h,_,c),t.bindFramebuffer(u),l.dispose(),r.dispose(),ee!==t.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}class Be{constructor(s){this.rctx=s,this.floatBufferBlend=new me(s),this.svgPremultipliesAlpha=new _e(s),this.doublePrecisionRequiresObfuscation=new Re(s),this.drawArraysRequiresIndicesTypeReset=new Fe(s)}dispose(){this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}}function Te(e,s){if(s.compressedTextureETC)return null;const t=e.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function Ae(e,s){if(s.compressedTextureS3TC)return null;const t=e.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function xe(e,s){if(s.textureFilterAnisotropic)return null;const t=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function Ce(e,s){const t=!s.colorBufferHalfFloat&&e.getExtension("EXT_color_buffer_half_float")||!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),i=!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),r=!s.floatBlend&&!s.colorBufferFloat&&e.getExtension("EXT_float_blend");return t||i||r?{textureFloat:!!i,textureHalfFloat:!!t,floatBlend:!!r,R16F:e.R16F,RG16F:e.RG16F,RGBA16F:e.RGBA16F,R32F:e.R32F,RG32F:e.RG32F,RGBA32F:e.RGBA32F,R11F_G11F_B10F:e.R11F_G11F_B10F,RGB16F:e.RGB16F}:null}function Se(e,s,t,i,r){if(s[t])return!1;for(const n of r)if(e.getExtension(n))return!0;return!1}function Oe(e,s){if(s.textureNorm16)return null;const t=e.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Pe(e,s){const t=s.loseContext&&e.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}class Ue{constructor(s,t){this._gl=s,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=Te(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=Ae(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=xe(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=ce(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=Ce(this._gl,this._disabledExtensions),this._colorBufferFloat}get loseContext(){return this._loseContext??=Pe(this._gl,this._debugWebGLExtensions),this._loseContext}get textureNorm16(){return this._textureNorm16??=Oe(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=Se(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}enable(s){return this[s]}}let Ye=class{constructor(e,s){this.gl=e,this.instanceCounter=new pe,this.programCache=new te(this),this._transformFeedbackRequestInfo=null,this._state=new q,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(s)}configure(e){this._capabilities=new Ue(this.gl,e),this._parameters=new be(this.gl,this._capabilities,e),ae.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new q,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new he({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const i=t.color;this.setBlendColor(i.r,i.g,i.b,i.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const i=t.function;this.setStencilFunction(i.func,i.ref,i.mask);const r=t.operation;this.setStencilOp(r.fail,r.zFail,r.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:i}=this._state;i===null?this.setDrawBuffers([g.BACK]):i.colorAttachments.length===0?this.setDrawBuffers([g.NONE]):this.setDrawBuffers([M.COLOR_ATTACHMENT0])}}}),this.enforceState(),w(this._driverTest),this._driverTest=new Be(this)}dispose(){w(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(a.ARRAY_BUFFER),this.unbindBuffer(a.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(a.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(a.PIXEL_PACK_BUFFER),this.unbindBuffer(a.PIXEL_UNPACK_BUFFER),this.unbindBuffer(a.COPY_READ_BUFFER),this.unbindBuffer(a.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,p()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,s){for(let t=0;t=0&&(this._state.activeTexture=s)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,s,t,i){e===this._state.blendColor.r&&s===this._state.blendColor.g&&t===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(e,s,t,i),this._state.blendColor.r=e,this._state.blendColor.g=s,this._state.blendColor.b=t,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(e,s){e===this._state.blendFunction.srcRGB&&s===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,s),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=s,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,s,t,i){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===t&&this._state.blendFunction.dstRGB===s&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(e,s,t,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,s){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===s||(this.gl.blendEquationSeparate(e,s),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=s,this._stateTracker.invalidateBlending())}setColorMask(e,s,t,i){this._state.colorMask.r===e&&this._state.colorMask.g===s&&this._state.colorMask.b===t&&this._state.colorMask.a===i||(this.gl.colorMask(e,s,t,i),this._state.colorMask.r=e,this._state.colorMask.g=s,this._state.colorMask.b=t,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(e,s,t,i){this._state.clearColor.r===e&&this._state.clearColor.g===s&&this._state.clearColor.b===t&&this._state.clearColor.a===i||(this.gl.clearColor(e,s,t,i),this._state.clearColor.r=e,this._state.clearColor.g=s,this._state.clearColor.b=t,this._state.clearColor.a=i)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,s){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===s||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=s,this.gl.polygonOffset(e,s),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,s,t,i){this._state.scissorRect.x===e&&this._state.scissorRect.y===s&&this._state.scissorRect.width===t&&this._state.scissorRect.height===i||(this.gl.scissor(e,s,t,i),this._state.scissorRect.x=e,this._state.scissorRect.y=s,this._state.scissorRect.width=t,this._state.scissorRect.height=i)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,s){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===s||(this.gl.depthRange(e,s),this._state.depthRange.zNear=e,this._state.depthRange.zFar=s,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,s,t){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===t||(this.gl.stencilFunc(e,s,t),this._state.stencilFunction.face=F.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=t,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,s,t,i){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===s&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(e,s,t,i),this._state.stencilFunction.face=e,this._state.stencilFunction.func=s,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,s,t){this._state.stencilOperation.face===F.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===t||(this.gl.stencilOp(e,s,t),this._state.stencilOperation.face=F.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=t,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,s,t,i){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===s&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(e,s,t,i),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=s,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,s=!1){const t=this._state.activeTexture;return e>=0&&(s||e!==this._state.activeTexture)&&(this.gl.activeTexture(v+e),this._state.activeTexture=e),t}setDrawBuffers(e){const{drawFramebuffer:s}=this._state,t=s===null,i=t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(s);if(i?.length!==e.length||!i.every((r,n)=>r===e[n]))if(e.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(t){if(e.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(e[0]!==g.BACK&&e[0]!==g.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}t||!e.includes(g.BACK)?(this.gl.drawBuffers(e),t?this._state.drawBuffers.defaultFramebuffer=e:this._state.drawBuffers.fbos.set(s,e),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(e,s=255){if(e){if(e&b.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}e&b.DEPTH&&this.setDepthWriteEnabled(!0),e&b.STENCIL&&this.setStencilWriteMask(s),this.gl.clear(e)}}clearFramebuffer(e,s=!1,t=!1){let i=0;if(e){const r=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],r),i|=b.COLOR}s&&(i|=b.DEPTH),t===!1?t=0:(t===!0&&(t=255),i|=b.STENCIL),i&&this.clear(i,t)}drawArrays(e,s,t){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(p()){this._numOfDrawCalls++,this._numOfTriangles+=$(e,t);const i=this._state.textureUnitMap;for(let r=0;r=this.parameters.maxTextureImageUnits||s<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[s];return e?.glName==null?(i!=null&&(this.setActiveTexture(s,t),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[s]=null,i):t||i!==e?(this.setActiveTexture(s,t),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[s]=e,i):(e.isDirty&&(this.setActiveTexture(s,t),e.applyChanges()),i)}unbindTexture(e){if(e!=null)for(let s=0;s=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const t=e===a.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=t[s];return i==null&&(i={buffer:null,offset:0,size:0},t[s]=i),i}bindBufferBase(e,s,t){const i=this._getBufferBinding(e,s);i!=null&&(i.buffer===t&&i.offset===0&&i.size===0||(this.gl.bindBufferBase(e,s,t?t.glName:null),i.buffer=t,i.offset=0,i.size=0))}bindBufferRange(e,s,t,i,r){const n=this._getBufferBinding(e,s);n!=null&&(n.buffer===t&&n.offset===i&&n.size===r||(i%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,s,t.glName,i,r),n.buffer=t,n.offset=i,n.size=r):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,s,t,i){s!=null?(p()&&(i??s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),t!==void 0&&i!==void 0?this.bindBufferRange(a.UNIFORM_BUFFER,e,s.buffer,t,i):this.bindBufferBase(a.UNIFORM_BUFFER,e,s.buffer)):this.bindBufferBase(a.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let s=0,t=this._state.uniformBufferBindingPoints.length;s{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: +`;for(let s=0;s0&&(e+=`${R[s]}: ${t} +`)}}return e+=this._allocations?.resetLog(),e}},be=class{constructor(e,s,t){const i=s.textureFilterAnisotropic,r=t.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES),this.maxDrawBuffers=e.getParameter(e.MAX_DRAW_BUFFERS)}};class X{constructor(s){this._rctx=s,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es + precision highp float; + + void main(void) { + gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); + }`,fragment:`#version 300 es + precision highp float; + + out vec4 fragColor; + + void main(void) { + fragColor = vec4(0.0, 0.0, 0.0, 1.0); + }`}}_createHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}_createIndexbuffer(){return P.createIndex(this._rctx,S.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,a.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(E.POINTS,1,O.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){}}class Fe extends L{constructor(s){super(),this._rctx=s,this._helperProgram=null,N("mac")&&N("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose(),this._helperProgram?.dispose(),this._helperProgram=null}_test(s){const t=this._rctx,i=t.getBoundFramebufferObject(),{x:r,y:n,width:l,height:u}=t.getViewport();t.resetState();const o=new I(1);o.wrapMode=y.CLAMP_TO_EDGE,o.samplingMode=C.NEAREST;const h=new G(t,o),_=P.createIndex(this._rctx,S.STATIC_DRAW,new Uint8Array([0]));t.bindFramebuffer(h),t.setViewport(0,0,1,1),t.useProgram(this._helperProgram),t.bindBuffer(_,a.ELEMENT_ARRAY_BUFFER),t.drawElements(E.POINTS,1,O.UNSIGNED_BYTE,0),t.useProgram(s),t.bindVAO(null),t.drawArrays(E.TRIANGLES,0,258);const c=new Uint8Array(4);return h.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,c),t.setViewport(r,n,l,u),t.bindFramebuffer(i),h.dispose(),_.dispose(),c[0]===255}_prepareProgram(){const s=`#version 300 es + precision highp float; + + out float triangleId; + + const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); + + void main(void) { + triangleId = floor(float(gl_VertexID)/3.0); + + vec3 position = triangleVertices[gl_VertexID % 3]; + float offset = triangleId / ${K.float(85)}; + position.z = 0.5 - offset; + + gl_Position = vec4(position, 1.0); + } + `,t=`#version 300 es + precision highp float; + + in float triangleId; + + out vec4 fragColor; + + void main(void) { + fragColor = triangleId == ${K.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); + } + `;return this._rctx.programCache.acquire(s,t,new Map([]))}_prepareHelperProgram(){const s=X.getShaderSources();return this._rctx.programCache.acquire(s.vertex,s.fragment,new Map([]))}}let Re=class extends L{constructor(e){super(),this._rctx=e,this._program=H(this._rctx,!1),this._obfuscated=H(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=w(this._obfuscated)}_test(e){if(N("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const s=this._rctx,t=s.getBoundFramebufferObject(),{x:i,y:r,width:n,height:l}=s.getViewport(),u=this._runProgram(e),o=this._runProgram(this._obfuscated);return s.setViewport(i,r,n,l),s.bindFramebuffer(t),u!==0&&(o===0||u/o>5)}_runProgram(e){const s=this._rctx;s.resetState();const t=new I(1);t.wrapMode=y.CLAMP_TO_EDGE,t.samplingMode=C.NEAREST;const i=new G(s,t),r=P.createVertex(s,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),n=new Q(s,new Map([["position",0]]),new Map([["geometry",[new J("position",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",r]])),l=V(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),u=V(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),o=new Float32Array(6);Y(l,o,3);const h=new Float32Array(6);Y(u,h,3),s.useProgram(e),e.setUniform3f("u_highA",o[0],o[2],o[4]),e.setUniform3f("u_lowA",o[1],o[3],o[5]),e.setUniform3f("u_highB",h[0],h[2],h[4]),e.setUniform3f("u_lowB",h[1],h[3],h[5]),s.bindFramebuffer(i),s.setViewport(0,0,1,1),s.bindVAO(n),s.drawArrays(E.TRIANGLE_STRIP,0,4);const _=new Uint8Array(4);i.readPixels(0,0,1,1,Z.RGBA,k.UNSIGNED_BYTE,_),n.dispose(),i.dispose();const c=(l[2]-u[2])/25,T=de(_);return Math.abs(c-T)}};function H(e,s){const t=` + + precision highp float; + + attribute vec2 position; + + uniform vec3 u_highA; + uniform vec3 u_lowA; + uniform vec3 u_highB; + uniform vec3 u_lowB; + + varying vec4 v_color; + + ${s?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} + + #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION + + vec3 dpPlusFrc(vec3 a, vec3 b) { + return mix(a, a + b, vec3(notEqual(b, vec3(0)))); + } + + vec3 dpMinusFrc(vec3 a, vec3 b) { + return mix(vec3(0), a - b, vec3(notEqual(a, b))); + } + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = dpPlusFrc(hiA, hiB); + vec3 e = dpMinusFrc(t1, hiA); + vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; + return t1 + t2; + } + + #else + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = hiA + hiB; + vec3 e = t1 - hiA; + vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; + return t1 + t2; + } + + #endif + + const float MAX_RGBA_FLOAT = + 255.0 / 256.0 + + 255.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 / 256.0; + + const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); + + vec4 float2rgba(const float value) { + // Make sure value is in the domain we can represent + float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); + + // Decompose value in 32bit fixed point parts represented as + // uint8 rgba components. Decomposition uses the fractional part after multiplying + // by a power of 256 (this removes the bits that are represented in the previous + // component) and then converts the fractional part to 8bits. + vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); + + // Convert uint8 values (from 0 to 255) to floating point representation for + // the shader + const float toU8AsFloat = 1.0 / 255.0; + + return fixedPointU8 * toU8AsFloat; + } + + void main() { + vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); + + v_color = float2rgba(val.z / 25.0); + + gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); + } + `;return e.programCache.acquire(t,` + precision highp float; + + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `,new Map([["position",0]]))}class me extends L{constructor(s){if(super(),this._rctx=s,!s.gl||!(s.capabilities.colorBufferFloat?.textureFloat&&s.capabilities.colorBufferFloat?.floatBlend))return;const t=` + precision highp float; + attribute vec2 a_pos; + + void main() { + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,i=` + precision highp float; + + void main() { + gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); + } + `;this._program=s.programCache.acquire(t,i,new Map([["a_pos",0]]))}_test(s){const t=this._rctx,i=new I(1);i.wrapMode=y.CLAMP_TO_EDGE,i.dataType=k.FLOAT,i.internalFormat=oe.RGBA32F,i.samplingMode=C.NEAREST;const r=new G(t,i),n=P.createVertex(t,S.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),l=new Q(t,new Map([["a_pos",0]]),new Map([["geometry",[new J("a_pos",2,O.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",n]]));t.gl.getError(),t.useProgram(s);const u=t.getBoundFramebufferObject(),{x:o,y:h,width:_,height:c}=t.getViewport();t.bindFramebuffer(r),t.setViewport(0,0,1,1),t.bindVAO(l),t.drawArrays(E.TRIANGLE_STRIP,0,4);const T=fe({blending:ue});t.setPipelineState(T),t.drawArrays(E.TRIANGLE_STRIP,0,4);const ee=t.gl.getError();return t.setViewport(o,h,_,c),t.bindFramebuffer(u),l.dispose(),r.dispose(),ee!==t.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}class Be{constructor(s){this.rctx=s,this.floatBufferBlend=new me(s),this.svgPremultipliesAlpha=new _e(s),this.doublePrecisionRequiresObfuscation=new Re(s),this.drawArraysRequiresIndicesTypeReset=new Fe(s)}dispose(){this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}}function Te(e,s){if(s.compressedTextureETC)return null;const t=e.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function Ae(e,s){if(s.compressedTextureS3TC)return null;const t=e.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function xe(e,s){if(s.textureFilterAnisotropic)return null;const t=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function Ce(e,s){const t=!s.colorBufferHalfFloat&&e.getExtension("EXT_color_buffer_half_float")||!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),i=!s.colorBufferFloat&&e.getExtension("EXT_color_buffer_float"),r=!s.floatBlend&&!s.colorBufferFloat&&e.getExtension("EXT_float_blend");return t||i||r?{textureFloat:!!i,textureHalfFloat:!!t,floatBlend:!!r,R16F:e.R16F,RG16F:e.RG16F,RGBA16F:e.RGBA16F,R32F:e.R32F,RG32F:e.RG32F,RGBA32F:e.RGBA32F,R11F_G11F_B10F:e.R11F_G11F_B10F,RGB16F:e.RGB16F}:null}function Se(e,s,t,i,r){if(s[t])return!1;for(const n of r)if(e.getExtension(n))return!0;return!1}function Oe(e,s){if(s.textureNorm16)return null;const t=e.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Pe(e,s){const t=s.loseContext&&e.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}class Ue{constructor(s,t){this._gl=s,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=Te(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=Ae(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=xe(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=ce(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=Ce(this._gl,this._disabledExtensions),this._colorBufferFloat}get loseContext(){return this._loseContext??=Pe(this._gl,this._debugWebGLExtensions),this._loseContext}get textureNorm16(){return this._textureNorm16??=Oe(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=Se(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}enable(s){return this[s]}}let Ye=class{constructor(e,s){this.gl=e,this.instanceCounter=new pe,this.programCache=new te(this),this._transformFeedbackRequestInfo=null,this._state=new q,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(s)}configure(e){this._capabilities=new Ue(this.gl,e),this._parameters=new be(this.gl,this._capabilities,e),ae.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new q,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new he({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const i=t.color;this.setBlendColor(i.r,i.g,i.b,i.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const i=t.function;this.setStencilFunction(i.func,i.ref,i.mask);const r=t.operation;this.setStencilOp(r.fail,r.zFail,r.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:i}=this._state;i===null?this.setDrawBuffers([g.BACK]):i.colorAttachments.length===0?this.setDrawBuffers([g.NONE]):this.setDrawBuffers([M.COLOR_ATTACHMENT0])}}}),this.enforceState(),w(this._driverTest),this._driverTest=new Be(this)}dispose(){w(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(a.ARRAY_BUFFER),this.unbindBuffer(a.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(a.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(a.PIXEL_PACK_BUFFER),this.unbindBuffer(a.PIXEL_UNPACK_BUFFER),this.unbindBuffer(a.COPY_READ_BUFFER),this.unbindBuffer(a.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,p()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,s){for(let t=0;t=0&&(this._state.activeTexture=s)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,s,t,i){e===this._state.blendColor.r&&s===this._state.blendColor.g&&t===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(e,s,t,i),this._state.blendColor.r=e,this._state.blendColor.g=s,this._state.blendColor.b=t,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(e,s){e===this._state.blendFunction.srcRGB&&s===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,s),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=s,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,s,t,i){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===t&&this._state.blendFunction.dstRGB===s&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(e,s,t,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=s,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,s){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===s||(this.gl.blendEquationSeparate(e,s),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=s,this._stateTracker.invalidateBlending())}setColorMask(e,s,t,i){this._state.colorMask.r===e&&this._state.colorMask.g===s&&this._state.colorMask.b===t&&this._state.colorMask.a===i||(this.gl.colorMask(e,s,t,i),this._state.colorMask.r=e,this._state.colorMask.g=s,this._state.colorMask.b=t,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(e,s,t,i){this._state.clearColor.r===e&&this._state.clearColor.g===s&&this._state.clearColor.b===t&&this._state.clearColor.a===i||(this.gl.clearColor(e,s,t,i),this._state.clearColor.r=e,this._state.clearColor.g=s,this._state.clearColor.b=t,this._state.clearColor.a=i)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,s){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===s||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=s,this.gl.polygonOffset(e,s),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,s,t,i){this._state.scissorRect.x===e&&this._state.scissorRect.y===s&&this._state.scissorRect.width===t&&this._state.scissorRect.height===i||(this.gl.scissor(e,s,t,i),this._state.scissorRect.x=e,this._state.scissorRect.y=s,this._state.scissorRect.width=t,this._state.scissorRect.height=i)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,s){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===s||(this.gl.depthRange(e,s),this._state.depthRange.zNear=e,this._state.depthRange.zFar=s,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,s,t){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===t||(this.gl.stencilFunc(e,s,t),this._state.stencilFunction.face=F.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=t,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,s,t,i){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===s&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(e,s,t,i),this._state.stencilFunction.face=e,this._state.stencilFunction.func=s,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,s,t){this._state.stencilOperation.face===F.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===t||(this.gl.stencilOp(e,s,t),this._state.stencilOperation.face=F.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=t,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,s,t,i){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===s&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(e,s,t,i),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=s,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,s=!1){const t=this._state.activeTexture;return e>=0&&(s||e!==this._state.activeTexture)&&(this.gl.activeTexture(v+e),this._state.activeTexture=e),t}setDrawBuffers(e){const{drawFramebuffer:s}=this._state,t=s===null,i=t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(s);if(i?.length!==e.length||!i.every((r,n)=>r===e[n]))if(e.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(t){if(e.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(e[0]!==g.BACK&&e[0]!==g.NONE)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}t||!e.includes(g.BACK)?(this.gl.drawBuffers(e),t?this._state.drawBuffers.defaultFramebuffer=e:this._state.drawBuffers.fbos.set(s,e),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(e,s=255){if(e){if(e&b.COLOR){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}e&b.DEPTH&&this.setDepthWriteEnabled(!0),e&b.STENCIL&&this.setStencilWriteMask(s),this.gl.clear(e)}}clearFramebuffer(e,s=!1,t=!1){let i=0;if(e){const r=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],r),i|=b.COLOR}s&&(i|=b.DEPTH),t===!1?t=0:(t===!0&&(t=255),i|=b.STENCIL),i&&this.clear(i,t)}drawArrays(e,s,t){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(p()){this._numOfDrawCalls++,this._numOfTriangles+=$(e,t);const i=this._state.textureUnitMap;for(let r=0;r=this.parameters.maxTextureImageUnits||s<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[s];return e?.glName==null?(i!=null&&(this.setActiveTexture(s,t),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[s]=null,i):t||i!==e?(this.setActiveTexture(s,t),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[s]=e,i):(e.isDirty&&(this.setActiveTexture(s,t),e.applyChanges()),i)}unbindTexture(e){if(e!=null)for(let s=0;s=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const t=e===a.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=t[s];return i==null&&(i={buffer:null,offset:0,size:0},t[s]=i),i}bindBufferBase(e,s,t){const i=this._getBufferBinding(e,s);i!=null&&(i.buffer===t&&i.offset===0&&i.size===0||(this.gl.bindBufferBase(e,s,t?t.glName:null),i.buffer=t,i.offset=0,i.size=0))}bindBufferRange(e,s,t,i,r){const n=this._getBufferBinding(e,s);n!=null&&(n.buffer===t&&n.offset===i&&n.size===r||(i%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,s,t.glName,i,r),n.buffer=t,n.offset=i,n.size=r):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,s,t,i){s!=null?(p()&&(i??s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),t!==void 0&&i!==void 0?this.bindBufferRange(a.UNIFORM_BUFFER,e,s.buffer,t,i):this.bindBufferBase(a.UNIFORM_BUFFER,e,s.buffer)):this.bindBufferBase(a.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let s=0,t=this._state.uniformBufferBindingPoints.length;sH.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;o=10.4?Kt(e,r,o):zt(e,o),{defaultTravelMode:u,supportedTravelModes:d}=await y;return a.defaultTravelMode=u,a.supportedTravelModes=d,Wt.fromJSON(a)}async function zt(e,r){const o=fe({f:"json"},r),{data:s}=await Y(e.replace(/\/rest\/.*$/i,"/info"),o);if(!s?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:a}=s,y=Be(a)+"/sharing/rest/portals/self",{data:u}=await Y(y,o),d=ct("helperServices.routingUtilities.url",u);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const g=qe(a),h=/\/solve$/i.test(g.path)?"Route":/\/solveclosestfacility$/i.test(g.path)?"ClosestFacility":"ServiceAreas",n=fe({f:"json",serviceName:h},r),b=Be(d)+"/GetTravelModes/execute",P=await Y(b,n),B=[];let m=null;if(P?.data?.results?.length){const f=P.data.results;for(const w of f)if(w.paramName==="supportedTravelModes"){if(w.value?.features){for(const{attributes:l}of w.value.features)if(l){const T=JSON.parse(l.TravelMode);B.push(T)}}}else w.paramName==="defaultTravelMode"&&(m=w.value)}return{supportedTravelModes:B,defaultTravelMode:m}}async function Kt(e,r,o){try{const s=fe({f:"json",token:r},o),a=Be(e)+"/retrieveTravelModes",{data:{supportedTravelModes:y,defaultTravelMode:u}}=await Y(a,s);return{supportedTravelModes:y,defaultTravelMode:u}}catch(s){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:s})}}const Ce=new Fe({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let X=class extends D{constructor(e){super(e),this.description=null,this.type=null}};t([i({type:String,json:{write:!0}})],X.prototype,"description",void 0),t([i({type:String,json:{read:Ce.read,write:Ce.write}})],X.prototype,"type",void 0),X=t([O("esri.rest.support.GPMessage")],X);const Qt=X,Me=new Fe({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ce=class extends Qt{constructor(e){super(e),this.type=null}};t([i({type:String,json:{read:Me.read,write:Me.write}})],ce.prototype,"type",void 0),ce=t([O("esri.rest.support.NAMessage")],ce);const Ht=ce;let ee=class extends D{constructor(e){super(e)}};t([i({json:{read:{source:"string"}}})],ee.prototype,"text",void 0),t([A(jt,{name:"stringType"})],ee.prototype,"type",void 0),ee=t([O("esri.rest.support.DirectionsString")],ee);const Qe=ee;let U=class extends D{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return xt(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return Ge.fromJSON(r.point)}};t([i({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),t([i()],U.prototype,"arriveTimeOffset",void 0),t([N("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),t([i({type:Ge})],U.prototype,"geometry",void 0),t([N("geometry",["point"])],U.prototype,"readGeometry",null),t([i({type:[Qe]})],U.prototype,"strings",void 0),U=t([O("esri.rest.support.DirectionsEvent")],U);const Yt=U;function Xt(e){if(e==null||e==="")return null;let r=0,o=0,s=0,a=0;const y=[];let u,d,g,h,n,b,P,B,m=0,f=0,w=0;if(n=e.match(/((\+|-)[^+\-|]+|\|)/g),n||(n=[]),parseInt(n[m],32)===0){m=2;const l=parseInt(n[m],32);m++,b=parseInt(n[m],32),m++,1&l&&(f=n.indexOf("|")+1,P=parseInt(n[f],32),f++),2&l&&(w=n.indexOf("|",f)+1,B=parseInt(n[w],32),w++)}else b=parseInt(n[m],32),m++;for(;m0,hasM:w>0}}let K=class extends Q{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,r){const o=Xt(r.compressedGeometry);return o!=null?me.fromJSON(o):null}};t([i({type:[Yt]})],K.prototype,"events",void 0),t([i({type:me})],K.prototype,"geometry",void 0),t([N("geometry",["compressedGeometry"])],K.prototype,"readGeometry",null),t([i({type:[Qe]})],K.prototype,"strings",void 0),K=t([O("esri.rest.support.DirectionsFeature")],K);const er=K;function tr(e,r){if(e.length===0)return new me({spatialReference:r});const o=[];for(const u of e)for(const d of u.paths)o.push(...d);const s=[];o.forEach((u,d)=>{d!==0&&u[0]===o[d-1][0]&&u[1]===o[d-1][1]||s.push(u)});const{hasM:a,hasZ:y}=e[0];return new me({hasM:a,hasZ:y,paths:[s],spatialReference:r})}let I=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){if(!e)return[];const o=r.summary.envelope.spatialReference??r.spatialReference,s=o&&W.fromJSON(o);return e.map(a=>{const y=er.fromJSON(a);if(y.geometry!=null&&(y.geometry.spatialReference=s),y.events!=null)for(const u of y.events)u.geometry!=null&&(u.geometry.spatialReference=s);return y})}get mergedGeometry(){return this.features?tr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter($e)}};t([i({type:Ue,json:{read:{source:"summary.envelope"}}})],I.prototype,"extent",void 0),t([i({nonNullable:!0})],I.prototype,"features",void 0),t([N("features")],I.prototype,"readFeatures",null),t([i()],I.prototype,"geometryType",void 0),t([i({readOnly:!0})],I.prototype,"mergedGeometry",null),t([i()],I.prototype,"routeId",void 0),t([i()],I.prototype,"routeName",void 0),t([i({value:null,readOnly:!0})],I.prototype,"strings",null),t([i({json:{read:{source:"summary.totalDriveTime"}}})],I.prototype,"totalDriveTime",void 0),t([i({json:{read:{source:"summary.totalLength"}}})],I.prototype,"totalLength",void 0),t([i({json:{read:{source:"summary.totalTime"}}})],I.prototype,"totalTime",void 0),I=t([O("esri.rest.support.DirectionsFeatureSet")],I);const rr=I;let C=class extends D{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([i({type:E,json:{write:!0}})],C.prototype,"directionLines",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"directionPoints",void 0),t([i({type:rr,json:{write:!0}})],C.prototype,"directions",void 0),t([i({type:Q,json:{write:!0}})],C.prototype,"route",void 0),t([i({type:String,json:{write:!0}})],C.prototype,"routeName",void 0),t([i({type:[Q],json:{write:!0}})],C.prototype,"stops",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedEdges",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedJunctions",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedTurns",void 0),C=t([O("esri.rest.support.RouteResult")],C);const or=C;function ge(e){return e?E.fromJSON(e).features.filter($e):[]}let J=class extends D{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return ge(r.barriers)}readPolylineBarriers(e){return ge(e)}readPolygonBarriers(e){return ge(e)}};t([i({type:[Ht]})],J.prototype,"messages",void 0),t([i({type:[Q]})],J.prototype,"pointBarriers",void 0),t([N("pointBarriers",["barriers"])],J.prototype,"readPointBarriers",null),t([i({type:[Q]})],J.prototype,"polylineBarriers",void 0),t([N("polylineBarriers")],J.prototype,"readPolylineBarriers",null),t([i({type:[Q]})],J.prototype,"polygonBarriers",void 0),t([N("polygonBarriers")],J.prototype,"readPolygonBarriers",null),t([i({type:[or]})],J.prototype,"routeResults",void 0),J=t([O("esri.rest.support.RouteSolveResult")],J);const ir=J;function ae(e){return e instanceof E}async function sr(e,r,o){const s=[],a=[],y={},u={},d=qe(e),{path:g}=d;ae(r.stops)&&ne(r.stops.features,a,"stops.features",y),ae(r.pointBarriers)&&ne(r.pointBarriers.features,a,"pointBarriers.features",y),ae(r.polylineBarriers)&&ne(r.polylineBarriers.features,a,"polylineBarriers.features",y),ae(r.polygonBarriers)&&ne(r.polygonBarriers.features,a,"polygonBarriers.features",y);const h=await Gt(a);for(const B in y){const m=y[B];s.push(B),u[B]=h.slice(m[0],m[1])}if(Vt(u,s)){let B=null;try{B=await Ke(g,r.apiKey,o)}catch{}B&&!B.hasZ&&Zt(u,s)}for(const B in u)u[B].forEach((m,f)=>{dt(r,B)[f].geometry=m});const n={...o,query:{...d.query,...Et(r),f:"json"}},b=g.endsWith("/solve")?g:`${g}/solve`,{data:P}=await Y(b,n);return nr(P)}function nr(e){const{barriers:r,directionLines:o,directionPoints:s,directions:a,messages:y,polygonBarriers:u,polylineBarriers:d,routes:g,stops:h,traversedEdges:n,traversedJunctions:b,traversedTurns:P}=e,B=l=>{const T=f.find(j=>j.routeName===l);if(T!=null)return T;const S={routeId:f.length+1,routeName:l};return f.push(S),S},m=l=>{const T=f.find(j=>j.routeId===l);if(T!=null)return T;const S={routeId:l,routeName:null};return f.push(S),S},f=[];g?.features.forEach((l,T)=>{l.geometry.spatialReference=g.spatialReference??void 0;const S=l.attributes.Name,j=T+1;f.push({routeId:j,routeName:S,route:l})}),a?.forEach(l=>{const{routeName:T}=l;B(T).directions=l});const w=(h?.features.every(l=>l.attributes.RouteName==null)??!1)&&f.length>0?f[0].routeName:null;return h?.features.forEach(l=>{l.geometry&&(l.geometry.spatialReference??=h.spatialReference??void 0);const T=w??l.attributes.RouteName,S=B(T);S.stops??=[],S.stops.push(l)}),o?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=o;S.directionLines??={features:[],geometryType:j,spatialReference:F},S.directionLines.features.push(l)}),s?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=s;S.directionPoints??={features:[],geometryType:j,spatialReference:F},S.directionPoints.features.push(l)}),n?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=n;S.traversedEdges??={features:[],geometryType:j,spatialReference:F},S.traversedEdges.features.push(l)}),b?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=b;S.traversedJunctions??={features:[],geometryType:j,spatialReference:F},S.traversedJunctions.features.push(l)}),P?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T);S.traversedTurns??={features:[]},S.traversedTurns.features.push(l)}),ir.fromJSON({routeResults:f,barriers:r,polygonBarriers:u,polylineBarriers:d,messages:y})}const ar={type:String,json:{read:{source:"token"},write:{target:"token"}}};let x=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};t([i({type:Boolean,json:{write:!0}})],x.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({types:tt,json:{read:rt,write:!0}})],x.prototype,"geometry",void 0),t([A(It)],x.prototype,"geometryType",void 0),t([i({type:String,json:{name:"layerName",write:!0}})],x.prototype,"name",void 0),t([A(Dt,{name:"spatialRel"})],x.prototype,"spatialRelationship",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"where",void 0),x=t([O("esri.rest.support.DataLayer")],x);const lr=x;var Te;let de=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([i({type:Boolean,json:{write:!0}})],de.prototype,"doNotLocateOnRestrictedElements",void 0),de=Te=t([O("esri.rest.support.NetworkFeatureSet")],de);const ur=de;let te=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([i({type:Boolean,json:{write:!0}})],te.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({type:String,json:{write:!0}})],te.prototype,"url",void 0),te=t([O("esri.rest.support.NetworkUrl")],te);const pr=te;var Ne;let p=Ne=class extends Re(D){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return ot(Ne,e)}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}writePointBarriers(e,r,o){le(e,r,o)}writePolygonBarrier(e,r,o){le(e,r,o)}writePolylineBarrier(e,r,o){le(e,r,o)}readRestrictionAttributes(e){return e==null?null:e.map(r=>De.fromJSON(r))}writeRestrictionAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>De.toJSON(s)))}readStartTime(e,r){const{startTime:o}=r;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){e!=null&&(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return hr(r.stops)}writeStops(e,r,o){le(e,r,o)}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],p.prototype,"accumulateAttributes",void 0),t([N("accumulateAttributes")],p.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributes")],p.prototype,"writeAccumulateAttributes",null),t([i(ar)],p.prototype,"apiKey",void 0),t([i({json:{write:!0}})],p.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"directionsLanguage",void 0),t([A(Ze)],p.prototype,"directionsLengthUnits",void 0),t([A(Ct)],p.prototype,"directionsOutputType",void 0),t([A(Mt)],p.prototype,"directionsStyleName",void 0),t([A(Ae,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],p.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"ignoreInvalidLocations",void 0),t([A(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],p.prototype,"impedanceAttribute",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"outputGeometryPrecision",void 0),t([A(_t)],p.prototype,"outputGeometryPrecisionUnits",void 0),t([A(Jt)],p.prototype,"outputLines",void 0),t([i({type:W,json:{name:"outSR",write:!0}})],p.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],p.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],p.prototype,"pointBarriers",void 0),t([$("pointBarriers")],p.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],p.prototype,"polygonBarriers",void 0),t([$("polygonBarriers")],p.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],p.prototype,"polylineBarriers",void 0),t([$("polylineBarriers")],p.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],p.prototype,"restrictionAttributes",void 0),t([N("restrictionAttributes")],p.prototype,"readRestrictionAttributes",null),t([$("restrictionAttributes")],p.prototype,"writeRestrictionAttributes",null),t([A(kt)],p.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnZ",void 0),t([i({json:{write:!0}})],p.prototype,"startTime",void 0),t([N("startTime")],p.prototype,"readStartTime",null),t([$("startTime")],p.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],p.prototype,"stops",void 0),t([N("stops")],p.prototype,"readStops",null),t([$("stops")],p.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"timeWindowsAreUTC",void 0),t([i({type:Oe,json:{write:!0}})],p.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useTimeWindows",void 0),p=Ne=t([O("esri.rest.support.RouteParameters")],p);const yr=p;function cr(e){return e&&"type"in e}function dr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function mr(e){return e&&"url"in e}function fr(e){return e&&"features"in e}function hr(e){return cr(e)?lr.fromJSON(e):mr(e)?pr.fromJSON(e):dr(e)?ur.fromJSON(e):fr(e)?E.fromJSON(e):null}function le(e,r,o){e!=null&&(r[o]=L.isCollection(e)?{features:e.toArray().map(s=>s.toJSON())}:e.toJSON())}function Se(e){return e.length?e:null}function Pe(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Pe("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Pe("esriGeometryPolyline")}}}function ue(e){return"layers"in e}function vr(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function wr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function gr(e,r,o){const s=r.networkDataset?.networkAttributes,a=s?.filter(({usageType:c})=>c==="cost")??[],y=o.travelMode??r.defaultTravelMode;if(y==null)return void Ye().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:u,distanceAttributeName:d}=y,g=a.find(({name:c})=>c===u),h=a.find(({name:c})=>c===d),n=o.travelMode?.impedanceAttributeName??o.impedanceAttribute??r.impedance,b=g?.units,P=h?.units;if(!b||!P)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??r.directionsLanguage,m=o.accumulateAttributes??r.accumulateAttributeNames??[],f=new Set(a.filter(({name:c})=>c===u||c===d||c===n||c!=null&&m.includes(c)).map(({name:c})=>c)),w=c=>{for(const Le in c)f.has(Le)||delete c[Le]};for(const c of e.pointBarriers)c.costs!=null&&(c.addedCost=c.costs[n]??0,w(c.costs));for(const c of e.polygonBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));for(const c of e.polylineBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));const{routeInfo:l}=e,{findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe}=o;l.analysisSettings=new Ft({accumulateAttributes:m,directionsLanguage:B,findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe,travelMode:y}),l.totalDuration=z(l.totalCosts?.[u]??0,b),l.totalDistance=be(l.totalCosts?.[d]??0,P),l.totalLateDuration=z(l.totalViolations?.[u]??0,b),l.totalWaitDuration=z(l.totalWait?.[u]??0,b),l.totalCosts!=null&&w(l.totalCosts),l.totalViolations!=null&&w(l.totalViolations),l.totalWait!=null&&w(l.totalWait);for(const c of e.stops)c.serviceCosts!=null&&(c.serviceDuration=z(c.serviceCosts[u]??0,b),c.serviceDistance=be(c.serviceCosts[d]??0,P),w(c.serviceCosts)),c.cumulativeCosts!=null&&(c.cumulativeDuration=z(c.cumulativeCosts[u]??0,b),c.cumulativeDistance=be(c.cumulativeCosts[d]??0,P),w(c.cumulativeCosts)),c.violations!=null&&(c.lateDuration=z(c.violations[u]??0,b),w(c.violations)),c.wait!=null&&(c.waitDuration=z(c.wait[u]??0,b),w(c.wait))}async function _e(e){const r=W.WGS84;return await wt(e.spatialReference,r),gt(e,r)}function z(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function be(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:mt(e,r,"meters")}function Sr(e){const{attributes:r,geometry:o,popupTemplate:s,symbol:a}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:s,symbol:a}}const br=L.ofType(pe),Br=L.ofType(ye),Je=L.ofType(re),ke=L.ofType(oe),xe=L.ofType(ie),Ee=L.ofType(se),He="esri.layers.RouteLayer",Ye=()=>We.getLogger(He);let v=class extends bt(Nt(Bt(Tt(ht(St))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new ze,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Je,this.polygonBarriers=new ke,this.polylineBarriers=new xe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new Ee,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(it(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,s){const a=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(d=>!!d),y=a.map((d,g)=>g),u=s.origin==="web-map"?"featureCollection.layers":"layers";st(u,a,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=y}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>pe.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>ye.fromGraphic(o))}get fullExtent(){const e=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(this.routeInfo?.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const r=this.stops.filter(a=>a.geometry!=null);if(r.length<2)return e;const{spatialReference:o}=r.at(0).geometry;if(o==null)return e;const s=r.toArray().map(a=>{const y=a.geometry;return[y.x,y.y]});return new nt({points:s,spatialReference:o}).extent}readMaxScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.maxScale!=null)?.layerDefinition.maxScale??0}readMinScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.minScale!=null)?.layerDefinition.minScale??0}readPointBarriers(e,r){return this._getNetworkFeatures(r,"Barriers",o=>re.fromGraphic(o))}readPolygonBarriers(e,r){return this._getNetworkFeatures(r,"PolygonBarriers",o=>oe.fromGraphic(o))}readPolylineBarriers(e,r){return this._getNetworkFeatures(r,"PolylineBarriers",o=>ie.fromGraphic(o))}readRouteInfo(e,r){return this._getNetworkFeatures(r,"RouteInfo",o=>we.fromGraphic(o)).at(0)??null}readSpatialReference(e,r){const o=ue(r)?r.layers:r.featureCollection?.layers;if(!o?.length)return W.WGS84;const{layerDefinition:s,featureSet:a}=o[0],y=a.features[0],u=y?.geometry?.spatialReference??a.spatialReference??s.spatialReference??s.extent.spatialReference??je;return W.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>se.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ie.routeServiceUrl}set url(e){e!=null?this._set("url",Pt(e,Ye())):this._set("url",Ie.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o.signIn(),o.user||await r.reload();const{itemUrl:s,itemControl:a}=r;if(a!=="admin"&&a!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const y={messages:[],origin:"portal-item",portal:o,url:s?at(s):void 0,writtenProperties:[]},u=this.write(void 0,y);return r.extent=await _e(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Rt.from(e).clone();o.extent??=await _e(this.fullExtent),o.id=null,o.portal??=lt.getDefault(),o.title??=this.title,o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",At.MULTI_LAYER,"Route Layer"];const{portal:s}=o,a={messages:[],origin:"portal-item",portal:s,url:null,writtenProperties:[]};await s.signIn();const y=r?.folder,u=this.write(void 0,a);return await s.user.addItem({item:o,folder:y,data:u}),this.portalItem=o,vt(a),a.portalItem=o,o}async solve(e,r){const o=e?.stops??this.stops,s=e?.pointBarriers??Se(this.pointBarriers),a=e?.polylineBarriers??Se(this.polylineBarriers),y=e?.polygonBarriers??Se(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((vr(o)||wr(o))&&o.features.length<2||L.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(L.isCollection(o))for(const f of o)f.routeName=null;const u=e?.apiKey,d=this.url,g=await this._getServiceDescription(d,u,r),h=e?.travelMode??g.defaultTravelMode,n=e?.accumulateAttributes??[];h!=null&&(n.push(h.distanceAttributeName),h.timeAttributeName&&n.push(h.timeAttributeName));const b={accumulateAttributes:n,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:s,polylineBarriers:a,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!s,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!a,returnRoutes:!0,returnStops:!0,stops:o},P=yr.from(e??{});let B;P.set(b);try{B=await sr(d,P,r)}catch(f){throw ut(f)?f:new M("routelayer:failed-route-request","the routing request failed",{error:f})}const m=this._toRouteLayerSolution(B);return this._isOverridden("title")||(this.title=m.routeInfo.name??"Route"),gr(m,g,P),m}update(e){const{stops:r,directionLines:o,directionPoints:s,pointBarriers:a,polylineBarriers:y,polygonBarriers:u,routeInfo:d}=e;this.set({stops:r,pointBarriers:a,polylineBarriers:y,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",s),this._set("routeInfo",d),d.geometry!=null&&(this.spatialReference=d.geometry.spatialReference)}_getNetworkFeatures(e,r,o,s){const a=ue(e)?e.layers:e.featureCollection?.layers,y=a?.find(f=>f.layerDefinition.name===r);if(y==null)return new L;const{layerDefinition:u,popupInfo:d,featureSet:g}=y,h=u.drawingInfo.renderer,{features:n}=g,b=g.spatialReference??u.spatialReference??u.extent.spatialReference??je,P=h&&ft(h),B=W.fromJSON(b),m=n.map(f=>{const w=Q.fromJSON(f);w.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(w.geometry.spatialReference=B);const l=o(w);return l.symbol??=P?.getSymbol(w)??this._getNetworkSymbol(r),l.popupTemplate??=d&&pt.fromJSON(d),l});return s&&m.some(({symbol:f})=>!f)&&s(m),new L(m)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,r,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const s=await Ke(e,r,o);return this._cachedServiceDescription={serviceDescription:s,url:e},s}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:n})=>n!=null))return;const{first:r,last:o,middle:s,unlocated:a,waypoint:y,break:u}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((n,b)=>{switch(b){case 0:n.symbol=r;break;case e.length-1:n.symbol=o;break;default:n.symbol=s}});const d=e.map(({sequence:n})=>n).filter(n=>n!=null),g=Math.min(...d),h=Math.max(...d);for(const n of e)n.sequence!==g?n.sequence!==h?n.status==="ok"||n.status==="not-located-on-closest"?n.locationType!=="waypoint"?n.locationType!=="break"?n.symbol=s:n.symbol=u:n.symbol=y:n.symbol=a:n.symbol=o:n.symbol=r}_toRouteLayerSolution(e){const r=e.routeResults[0].stops?.map(h=>se.fromJSON(h.toJSON()));this._setStopSymbol(r);const o=new Ee(r),s=new ke(e.polygonBarriers?.map(h=>{const n=oe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polygonBarriers,n})),a=new xe(e.polylineBarriers?.map(h=>{const n=ie.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polylineBarriers,n})),y=new Je(e.pointBarriers?.map(h=>{const n=re.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.pointBarriers,n})),u=e.routeResults[0].route?.toJSON(),d=we.fromJSON(u);d.symbol=this.defaultSymbols.routeInfo;const g=new Br(e.routeResults[0].directionPoints?.features.map(h=>{const n=ye.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionPoints,n}));return{directionLines:new br(e.routeResults[0].directionLines?.features.map(h=>{const n=pe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionLines,n})),directionPoints:g,pointBarriers:y,polygonBarriers:s,polylineBarriers:a,routeInfo:d,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",pe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ye.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,s,a,y){if(!e?.length)return null;const u=this.spatialReference.toJSON(),{fullExtent:d,maxScale:g,minScale:h}=this;return{featureSet:{features:e.toArray().map(n=>Sr(n)),geometryType:o,spatialReference:u},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:r!=null?r.toJSON():Pe(o)}},extent:d.toJSON(),fields:s,geometryType:o,hasM:!1,hasZ:!1,maxScale:g,minScale:h,name:a,objectIdField:"ObjectID",spatialReference:u,title:y,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ie.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new L([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",we.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",se.fields,"Stops","Stops");if(e==null)return null;const{stops:r}=this.defaultSymbols,o=r?.first?.toJSON(),s=r?.middle?.toJSON(),a=r?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:s,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:a,label:"Last Stop"}]},e}};t([i({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],v.prototype,"_featureCollection",void 0),t([$(["web-map","portal-item"],"_featureCollection")],v.prototype,"writeFeatureCollectionWebmap",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],v.prototype,"_type",void 0),t([i({nonNullable:!0,type:ze})],v.prototype,"defaultSymbols",void 0),t([i({readOnly:!0})],v.prototype,"directionLines",void 0),t([N(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],v.prototype,"readDirectionLines",null),t([i({readOnly:!0})],v.prototype,"directionPoints",void 0),t([N(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],v.prototype,"readDirectionPoints",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],v.prototype,"featureCollectionType",void 0),t([i({readOnly:!0})],v.prototype,"fullExtent",null),t([i({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],v.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],v.prototype,"listMode",void 0),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"maxScale",void 0),t([N(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],v.prototype,"readMaxScale",null),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"minScale",void 0),t([N(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],v.prototype,"readMinScale",null),t([i({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],v.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0,type:L.ofType(re)})],v.prototype,"pointBarriers",void 0),t([N(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],v.prototype,"readPointBarriers",null),t([i({nonNullable:!0,type:L.ofType(oe)})],v.prototype,"polygonBarriers",void 0),t([N(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolygonBarriers",null),t([i({nonNullable:!0,type:L.ofType(ie)})],v.prototype,"polylineBarriers",void 0),t([N(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolylineBarriers",null),t([i({readOnly:!0})],v.prototype,"routeInfo",void 0),t([N(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],v.prototype,"readRouteInfo",null),t([i({type:W})],v.prototype,"spatialReference",void 0),t([N(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],v.prototype,"readSpatialReference",null),t([i({nonNullable:!0,type:L.ofType(se)})],v.prototype,"stops",void 0),t([N(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],v.prototype,"readStops",null),t([i()],v.prototype,"title",null),t([i({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),t([i()],v.prototype,"url",null),v=t([O(He)],v);const To=v;export{To as default}; diff --git a/custom-toc-separator/assets/RouteLayer-BQQ6WxtH-l4NjCf3m.js b/custom-toc-separator/assets/RouteLayer-BQQ6WxtH-l4NjCf3m.js new file mode 100644 index 00000000..6337ec17 --- /dev/null +++ b/custom-toc-separator/assets/RouteLayer-BQQ6WxtH-l4NjCf3m.js @@ -0,0 +1,2 @@ +import{v as t,S as i,jP as Z,i as O,jQ as he,jR as et,bz as A,a0 as N,ac as $,aK as Fe,w as Ge,m as me,n as Ue,bi as Q,aa as Re,af as tt,g as rt,aO as ot,J as W,ag as L,ai as it,dK as st,G as nt,eS as je,C as Ie,o as M,a as at,r as lt,aU as ut,bL as pt,e as D,e0 as V,d_ as ve,d$ as yt,f as Y,d4 as Be,N as ct,aq as $e,aR as dt,di as mt,a1 as We}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{o as ft}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as ht}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{n as vt}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{N as wt,K as gt}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{D as St}from"./Layer-ChoECxvZ-ocw70508.js";import{u as bt}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as Bt}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as Tt}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as Nt}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{j as Pt}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import Rt from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{E as At}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import{a as fe,y as qe}from"./utils-9sQxfkoa-CwJW9dca.js";import{A as H,Q as Ae,a as Ot,c as Lt,s as Ze,e as Oe,y as jt,m as It,d as Dt,V as De,o as Ct,u as Mt,Z as _t,n as Jt,$ as kt,T as pe,b as ye,v as re,f as oe,S as ie,N as se,g as we,W as xt,h as Et,t as Ft}from"./Stop-he5xSAJJ-Cm3NmLQL.js";import{B as Gt}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{O as E}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./main-BTdHgocv.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";let G=class extends D{constructor(e){super(e),this.break=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new V({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new V({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new V({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new V({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};t([i({types:Z})],G.prototype,"break",void 0),t([i({types:Z})],G.prototype,"first",void 0),t([i({types:Z})],G.prototype,"unlocated",void 0),t([i({types:Z})],G.prototype,"last",void 0),t([i({types:Z})],G.prototype,"middle",void 0),t([i({types:Z})],G.prototype,"waypoint",void 0),G=t([O("esri.layers.support.RouteStopSymbols")],G);const Ve=G;let k=class extends D{constructor(e){super(e),this.directionLines=new ve({color:[0,122,194],width:6}),this.directionPoints=new V({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new V({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new yt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new ve({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new ve({width:8,color:[20,89,127]}),this.stops=new Ve}};t([i({types:he})],k.prototype,"directionLines",void 0),t([i({types:Z})],k.prototype,"directionPoints",void 0),t([i({types:Z})],k.prototype,"pointBarriers",void 0),t([i({types:et})],k.prototype,"polygonBarriers",void 0),t([i({types:he})],k.prototype,"polylineBarriers",void 0),t([i({types:he})],k.prototype,"routeInfo",void 0),t([i({type:Ve})],k.prototype,"stops",void 0),k=t([O("esri.layers.support.RouteSymbols")],k);const ze=k;let _=class extends D{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};t([i({type:String})],_.prototype,"dataType",void 0),t([A(H,{ignoreUnknown:!1})],_.prototype,"name",void 0),t([i({type:[String]})],_.prototype,"parameterNames",void 0),t([i({type:String})],_.prototype,"restrictionUsageParameterName",void 0),t([A(Ae,{ignoreUnknown:!1})],_.prototype,"timeNeutralAttributeName",void 0),t([i({type:String})],_.prototype,"trafficSupport",void 0),t([A(Ot)],_.prototype,"units",void 0),t([A(Lt)],_.prototype,"usageType",void 0),_=t([O("esri.rest.support.NetworkAttribute")],_);const Ut=_;let q=class extends D{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};t([i({type:Number})],q.prototype,"buildTime",void 0),t([i({type:String})],q.prototype,"name",void 0),t([i({type:[Ut]})],q.prototype,"networkAttributes",void 0),t([i()],q.prototype,"networkSources",void 0),t([i({type:String})],q.prototype,"state",void 0),q=t([O("esri.rest.support.NetworkDataset")],q);const $t=q;let R=class extends D{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;o=10.4?Kt(e,r,o):zt(e,o),{defaultTravelMode:u,supportedTravelModes:d}=await y;return a.defaultTravelMode=u,a.supportedTravelModes=d,Wt.fromJSON(a)}async function zt(e,r){const o=fe({f:"json"},r),{data:s}=await Y(e.replace(/\/rest\/.*$/i,"/info"),o);if(!s?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:a}=s,y=Be(a)+"/sharing/rest/portals/self",{data:u}=await Y(y,o),d=ct("helperServices.routingUtilities.url",u);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const g=qe(a),h=/\/solve$/i.test(g.path)?"Route":/\/solveclosestfacility$/i.test(g.path)?"ClosestFacility":"ServiceAreas",n=fe({f:"json",serviceName:h},r),b=Be(d)+"/GetTravelModes/execute",P=await Y(b,n),B=[];let m=null;if(P?.data?.results?.length){const f=P.data.results;for(const w of f)if(w.paramName==="supportedTravelModes"){if(w.value?.features){for(const{attributes:l}of w.value.features)if(l){const T=JSON.parse(l.TravelMode);B.push(T)}}}else w.paramName==="defaultTravelMode"&&(m=w.value)}return{supportedTravelModes:B,defaultTravelMode:m}}async function Kt(e,r,o){try{const s=fe({f:"json",token:r},o),a=Be(e)+"/retrieveTravelModes",{data:{supportedTravelModes:y,defaultTravelMode:u}}=await Y(a,s);return{supportedTravelModes:y,defaultTravelMode:u}}catch(s){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:s})}}const Ce=new Fe({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let X=class extends D{constructor(e){super(e),this.description=null,this.type=null}};t([i({type:String,json:{write:!0}})],X.prototype,"description",void 0),t([i({type:String,json:{read:Ce.read,write:Ce.write}})],X.prototype,"type",void 0),X=t([O("esri.rest.support.GPMessage")],X);const Qt=X,Me=new Fe({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ce=class extends Qt{constructor(e){super(e),this.type=null}};t([i({type:String,json:{read:Me.read,write:Me.write}})],ce.prototype,"type",void 0),ce=t([O("esri.rest.support.NAMessage")],ce);const Ht=ce;let ee=class extends D{constructor(e){super(e)}};t([i({json:{read:{source:"string"}}})],ee.prototype,"text",void 0),t([A(jt,{name:"stringType"})],ee.prototype,"type",void 0),ee=t([O("esri.rest.support.DirectionsString")],ee);const Qe=ee;let U=class extends D{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return xt(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return Ge.fromJSON(r.point)}};t([i({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),t([i()],U.prototype,"arriveTimeOffset",void 0),t([N("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),t([i({type:Ge})],U.prototype,"geometry",void 0),t([N("geometry",["point"])],U.prototype,"readGeometry",null),t([i({type:[Qe]})],U.prototype,"strings",void 0),U=t([O("esri.rest.support.DirectionsEvent")],U);const Yt=U;function Xt(e){if(e==null||e==="")return null;let r=0,o=0,s=0,a=0;const y=[];let u,d,g,h,n,b,P,B,m=0,f=0,w=0;if(n=e.match(/((\+|-)[^+\-|]+|\|)/g),n||(n=[]),parseInt(n[m],32)===0){m=2;const l=parseInt(n[m],32);m++,b=parseInt(n[m],32),m++,1&l&&(f=n.indexOf("|")+1,P=parseInt(n[f],32),f++),2&l&&(w=n.indexOf("|",f)+1,B=parseInt(n[w],32),w++)}else b=parseInt(n[m],32),m++;for(;m0,hasM:w>0}}let K=class extends Q{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,r){const o=Xt(r.compressedGeometry);return o!=null?me.fromJSON(o):null}};t([i({type:[Yt]})],K.prototype,"events",void 0),t([i({type:me})],K.prototype,"geometry",void 0),t([N("geometry",["compressedGeometry"])],K.prototype,"readGeometry",null),t([i({type:[Qe]})],K.prototype,"strings",void 0),K=t([O("esri.rest.support.DirectionsFeature")],K);const er=K;function tr(e,r){if(e.length===0)return new me({spatialReference:r});const o=[];for(const u of e)for(const d of u.paths)o.push(...d);const s=[];o.forEach((u,d)=>{d!==0&&u[0]===o[d-1][0]&&u[1]===o[d-1][1]||s.push(u)});const{hasM:a,hasZ:y}=e[0];return new me({hasM:a,hasZ:y,paths:[s],spatialReference:r})}let I=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){if(!e)return[];const o=r.summary.envelope.spatialReference??r.spatialReference,s=o&&W.fromJSON(o);return e.map(a=>{const y=er.fromJSON(a);if(y.geometry!=null&&(y.geometry.spatialReference=s),y.events!=null)for(const u of y.events)u.geometry!=null&&(u.geometry.spatialReference=s);return y})}get mergedGeometry(){return this.features?tr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter($e)}};t([i({type:Ue,json:{read:{source:"summary.envelope"}}})],I.prototype,"extent",void 0),t([i({nonNullable:!0})],I.prototype,"features",void 0),t([N("features")],I.prototype,"readFeatures",null),t([i()],I.prototype,"geometryType",void 0),t([i({readOnly:!0})],I.prototype,"mergedGeometry",null),t([i()],I.prototype,"routeId",void 0),t([i()],I.prototype,"routeName",void 0),t([i({value:null,readOnly:!0})],I.prototype,"strings",null),t([i({json:{read:{source:"summary.totalDriveTime"}}})],I.prototype,"totalDriveTime",void 0),t([i({json:{read:{source:"summary.totalLength"}}})],I.prototype,"totalLength",void 0),t([i({json:{read:{source:"summary.totalTime"}}})],I.prototype,"totalTime",void 0),I=t([O("esri.rest.support.DirectionsFeatureSet")],I);const rr=I;let C=class extends D{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([i({type:E,json:{write:!0}})],C.prototype,"directionLines",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"directionPoints",void 0),t([i({type:rr,json:{write:!0}})],C.prototype,"directions",void 0),t([i({type:Q,json:{write:!0}})],C.prototype,"route",void 0),t([i({type:String,json:{write:!0}})],C.prototype,"routeName",void 0),t([i({type:[Q],json:{write:!0}})],C.prototype,"stops",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedEdges",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedJunctions",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedTurns",void 0),C=t([O("esri.rest.support.RouteResult")],C);const or=C;function ge(e){return e?E.fromJSON(e).features.filter($e):[]}let J=class extends D{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return ge(r.barriers)}readPolylineBarriers(e){return ge(e)}readPolygonBarriers(e){return ge(e)}};t([i({type:[Ht]})],J.prototype,"messages",void 0),t([i({type:[Q]})],J.prototype,"pointBarriers",void 0),t([N("pointBarriers",["barriers"])],J.prototype,"readPointBarriers",null),t([i({type:[Q]})],J.prototype,"polylineBarriers",void 0),t([N("polylineBarriers")],J.prototype,"readPolylineBarriers",null),t([i({type:[Q]})],J.prototype,"polygonBarriers",void 0),t([N("polygonBarriers")],J.prototype,"readPolygonBarriers",null),t([i({type:[or]})],J.prototype,"routeResults",void 0),J=t([O("esri.rest.support.RouteSolveResult")],J);const ir=J;function ae(e){return e instanceof E}async function sr(e,r,o){const s=[],a=[],y={},u={},d=qe(e),{path:g}=d;ae(r.stops)&&ne(r.stops.features,a,"stops.features",y),ae(r.pointBarriers)&&ne(r.pointBarriers.features,a,"pointBarriers.features",y),ae(r.polylineBarriers)&&ne(r.polylineBarriers.features,a,"polylineBarriers.features",y),ae(r.polygonBarriers)&&ne(r.polygonBarriers.features,a,"polygonBarriers.features",y);const h=await Gt(a);for(const B in y){const m=y[B];s.push(B),u[B]=h.slice(m[0],m[1])}if(Vt(u,s)){let B=null;try{B=await Ke(g,r.apiKey,o)}catch{}B&&!B.hasZ&&Zt(u,s)}for(const B in u)u[B].forEach((m,f)=>{dt(r,B)[f].geometry=m});const n={...o,query:{...d.query,...Et(r),f:"json"}},b=g.endsWith("/solve")?g:`${g}/solve`,{data:P}=await Y(b,n);return nr(P)}function nr(e){const{barriers:r,directionLines:o,directionPoints:s,directions:a,messages:y,polygonBarriers:u,polylineBarriers:d,routes:g,stops:h,traversedEdges:n,traversedJunctions:b,traversedTurns:P}=e,B=l=>{const T=f.find(j=>j.routeName===l);if(T!=null)return T;const S={routeId:f.length+1,routeName:l};return f.push(S),S},m=l=>{const T=f.find(j=>j.routeId===l);if(T!=null)return T;const S={routeId:l,routeName:null};return f.push(S),S},f=[];g?.features.forEach((l,T)=>{l.geometry.spatialReference=g.spatialReference??void 0;const S=l.attributes.Name,j=T+1;f.push({routeId:j,routeName:S,route:l})}),a?.forEach(l=>{const{routeName:T}=l;B(T).directions=l});const w=(h?.features.every(l=>l.attributes.RouteName==null)??!1)&&f.length>0?f[0].routeName:null;return h?.features.forEach(l=>{l.geometry&&(l.geometry.spatialReference??=h.spatialReference??void 0);const T=w??l.attributes.RouteName,S=B(T);S.stops??=[],S.stops.push(l)}),o?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=o;S.directionLines??={features:[],geometryType:j,spatialReference:F},S.directionLines.features.push(l)}),s?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=s;S.directionPoints??={features:[],geometryType:j,spatialReference:F},S.directionPoints.features.push(l)}),n?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=n;S.traversedEdges??={features:[],geometryType:j,spatialReference:F},S.traversedEdges.features.push(l)}),b?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=b;S.traversedJunctions??={features:[],geometryType:j,spatialReference:F},S.traversedJunctions.features.push(l)}),P?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T);S.traversedTurns??={features:[]},S.traversedTurns.features.push(l)}),ir.fromJSON({routeResults:f,barriers:r,polygonBarriers:u,polylineBarriers:d,messages:y})}const ar={type:String,json:{read:{source:"token"},write:{target:"token"}}};let x=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};t([i({type:Boolean,json:{write:!0}})],x.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({types:tt,json:{read:rt,write:!0}})],x.prototype,"geometry",void 0),t([A(It)],x.prototype,"geometryType",void 0),t([i({type:String,json:{name:"layerName",write:!0}})],x.prototype,"name",void 0),t([A(Dt,{name:"spatialRel"})],x.prototype,"spatialRelationship",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"where",void 0),x=t([O("esri.rest.support.DataLayer")],x);const lr=x;var Te;let de=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([i({type:Boolean,json:{write:!0}})],de.prototype,"doNotLocateOnRestrictedElements",void 0),de=Te=t([O("esri.rest.support.NetworkFeatureSet")],de);const ur=de;let te=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([i({type:Boolean,json:{write:!0}})],te.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({type:String,json:{write:!0}})],te.prototype,"url",void 0),te=t([O("esri.rest.support.NetworkUrl")],te);const pr=te;var Ne;let p=Ne=class extends Re(D){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return ot(Ne,e)}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}writePointBarriers(e,r,o){le(e,r,o)}writePolygonBarrier(e,r,o){le(e,r,o)}writePolylineBarrier(e,r,o){le(e,r,o)}readRestrictionAttributes(e){return e==null?null:e.map(r=>De.fromJSON(r))}writeRestrictionAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>De.toJSON(s)))}readStartTime(e,r){const{startTime:o}=r;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){e!=null&&(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return hr(r.stops)}writeStops(e,r,o){le(e,r,o)}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],p.prototype,"accumulateAttributes",void 0),t([N("accumulateAttributes")],p.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributes")],p.prototype,"writeAccumulateAttributes",null),t([i(ar)],p.prototype,"apiKey",void 0),t([i({json:{write:!0}})],p.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"directionsLanguage",void 0),t([A(Ze)],p.prototype,"directionsLengthUnits",void 0),t([A(Ct)],p.prototype,"directionsOutputType",void 0),t([A(Mt)],p.prototype,"directionsStyleName",void 0),t([A(Ae,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],p.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"ignoreInvalidLocations",void 0),t([A(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],p.prototype,"impedanceAttribute",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"outputGeometryPrecision",void 0),t([A(_t)],p.prototype,"outputGeometryPrecisionUnits",void 0),t([A(Jt)],p.prototype,"outputLines",void 0),t([i({type:W,json:{name:"outSR",write:!0}})],p.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],p.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],p.prototype,"pointBarriers",void 0),t([$("pointBarriers")],p.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],p.prototype,"polygonBarriers",void 0),t([$("polygonBarriers")],p.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],p.prototype,"polylineBarriers",void 0),t([$("polylineBarriers")],p.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],p.prototype,"restrictionAttributes",void 0),t([N("restrictionAttributes")],p.prototype,"readRestrictionAttributes",null),t([$("restrictionAttributes")],p.prototype,"writeRestrictionAttributes",null),t([A(kt)],p.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnZ",void 0),t([i({json:{write:!0}})],p.prototype,"startTime",void 0),t([N("startTime")],p.prototype,"readStartTime",null),t([$("startTime")],p.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],p.prototype,"stops",void 0),t([N("stops")],p.prototype,"readStops",null),t([$("stops")],p.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"timeWindowsAreUTC",void 0),t([i({type:Oe,json:{write:!0}})],p.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useTimeWindows",void 0),p=Ne=t([O("esri.rest.support.RouteParameters")],p);const yr=p;function cr(e){return e&&"type"in e}function dr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function mr(e){return e&&"url"in e}function fr(e){return e&&"features"in e}function hr(e){return cr(e)?lr.fromJSON(e):mr(e)?pr.fromJSON(e):dr(e)?ur.fromJSON(e):fr(e)?E.fromJSON(e):null}function le(e,r,o){e!=null&&(r[o]=L.isCollection(e)?{features:e.toArray().map(s=>s.toJSON())}:e.toJSON())}function Se(e){return e.length?e:null}function Pe(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Pe("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Pe("esriGeometryPolyline")}}}function ue(e){return"layers"in e}function vr(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function wr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function gr(e,r,o){const s=r.networkDataset?.networkAttributes,a=s?.filter(({usageType:c})=>c==="cost")??[],y=o.travelMode??r.defaultTravelMode;if(y==null)return void Ye().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:u,distanceAttributeName:d}=y,g=a.find(({name:c})=>c===u),h=a.find(({name:c})=>c===d),n=o.travelMode?.impedanceAttributeName??o.impedanceAttribute??r.impedance,b=g?.units,P=h?.units;if(!b||!P)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??r.directionsLanguage,m=o.accumulateAttributes??r.accumulateAttributeNames??[],f=new Set(a.filter(({name:c})=>c===u||c===d||c===n||c!=null&&m.includes(c)).map(({name:c})=>c)),w=c=>{for(const Le in c)f.has(Le)||delete c[Le]};for(const c of e.pointBarriers)c.costs!=null&&(c.addedCost=c.costs[n]??0,w(c.costs));for(const c of e.polygonBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));for(const c of e.polylineBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));const{routeInfo:l}=e,{findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe}=o;l.analysisSettings=new Ft({accumulateAttributes:m,directionsLanguage:B,findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe,travelMode:y}),l.totalDuration=z(l.totalCosts?.[u]??0,b),l.totalDistance=be(l.totalCosts?.[d]??0,P),l.totalLateDuration=z(l.totalViolations?.[u]??0,b),l.totalWaitDuration=z(l.totalWait?.[u]??0,b),l.totalCosts!=null&&w(l.totalCosts),l.totalViolations!=null&&w(l.totalViolations),l.totalWait!=null&&w(l.totalWait);for(const c of e.stops)c.serviceCosts!=null&&(c.serviceDuration=z(c.serviceCosts[u]??0,b),c.serviceDistance=be(c.serviceCosts[d]??0,P),w(c.serviceCosts)),c.cumulativeCosts!=null&&(c.cumulativeDuration=z(c.cumulativeCosts[u]??0,b),c.cumulativeDistance=be(c.cumulativeCosts[d]??0,P),w(c.cumulativeCosts)),c.violations!=null&&(c.lateDuration=z(c.violations[u]??0,b),w(c.violations)),c.wait!=null&&(c.waitDuration=z(c.wait[u]??0,b),w(c.wait))}async function _e(e){const r=W.WGS84;return await wt(e.spatialReference,r),gt(e,r)}function z(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function be(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:mt(e,r,"meters")}function Sr(e){const{attributes:r,geometry:o,popupTemplate:s,symbol:a}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:s,symbol:a}}const br=L.ofType(pe),Br=L.ofType(ye),Je=L.ofType(re),ke=L.ofType(oe),xe=L.ofType(ie),Ee=L.ofType(se),He="esri.layers.RouteLayer",Ye=()=>We.getLogger(He);let v=class extends bt(Nt(Bt(Tt(ht(St))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new ze,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Je,this.polygonBarriers=new ke,this.polylineBarriers=new xe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new Ee,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(it(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,s){const a=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(d=>!!d),y=a.map((d,g)=>g),u=s.origin==="web-map"?"featureCollection.layers":"layers";st(u,a,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=y}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>pe.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>ye.fromGraphic(o))}get fullExtent(){const e=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(this.routeInfo?.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const r=this.stops.filter(a=>a.geometry!=null);if(r.length<2)return e;const{spatialReference:o}=r.at(0).geometry;if(o==null)return e;const s=r.toArray().map(a=>{const y=a.geometry;return[y.x,y.y]});return new nt({points:s,spatialReference:o}).extent}readMaxScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.maxScale!=null)?.layerDefinition.maxScale??0}readMinScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.minScale!=null)?.layerDefinition.minScale??0}readPointBarriers(e,r){return this._getNetworkFeatures(r,"Barriers",o=>re.fromGraphic(o))}readPolygonBarriers(e,r){return this._getNetworkFeatures(r,"PolygonBarriers",o=>oe.fromGraphic(o))}readPolylineBarriers(e,r){return this._getNetworkFeatures(r,"PolylineBarriers",o=>ie.fromGraphic(o))}readRouteInfo(e,r){return this._getNetworkFeatures(r,"RouteInfo",o=>we.fromGraphic(o)).at(0)??null}readSpatialReference(e,r){const o=ue(r)?r.layers:r.featureCollection?.layers;if(!o?.length)return W.WGS84;const{layerDefinition:s,featureSet:a}=o[0],y=a.features[0],u=y?.geometry?.spatialReference??a.spatialReference??s.spatialReference??s.extent.spatialReference??je;return W.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>se.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ie.routeServiceUrl}set url(e){e!=null?this._set("url",Pt(e,Ye())):this._set("url",Ie.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o.signIn(),o.user||await r.reload();const{itemUrl:s,itemControl:a}=r;if(a!=="admin"&&a!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const y={messages:[],origin:"portal-item",portal:o,url:s?at(s):void 0,writtenProperties:[]},u=this.write(void 0,y);return r.extent=await _e(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Rt.from(e).clone();o.extent??=await _e(this.fullExtent),o.id=null,o.portal??=lt.getDefault(),o.title??=this.title,o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",At.MULTI_LAYER,"Route Layer"];const{portal:s}=o,a={messages:[],origin:"portal-item",portal:s,url:null,writtenProperties:[]};await s.signIn();const y=r?.folder,u=this.write(void 0,a);return await s.user.addItem({item:o,folder:y,data:u}),this.portalItem=o,vt(a),a.portalItem=o,o}async solve(e,r){const o=e?.stops??this.stops,s=e?.pointBarriers??Se(this.pointBarriers),a=e?.polylineBarriers??Se(this.polylineBarriers),y=e?.polygonBarriers??Se(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((vr(o)||wr(o))&&o.features.length<2||L.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(L.isCollection(o))for(const f of o)f.routeName=null;const u=e?.apiKey,d=this.url,g=await this._getServiceDescription(d,u,r),h=e?.travelMode??g.defaultTravelMode,n=e?.accumulateAttributes??[];h!=null&&(n.push(h.distanceAttributeName),h.timeAttributeName&&n.push(h.timeAttributeName));const b={accumulateAttributes:n,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:s,polylineBarriers:a,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!s,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!a,returnRoutes:!0,returnStops:!0,stops:o},P=yr.from(e??{});let B;P.set(b);try{B=await sr(d,P,r)}catch(f){throw ut(f)?f:new M("routelayer:failed-route-request","the routing request failed",{error:f})}const m=this._toRouteLayerSolution(B);return this._isOverridden("title")||(this.title=m.routeInfo.name??"Route"),gr(m,g,P),m}update(e){const{stops:r,directionLines:o,directionPoints:s,pointBarriers:a,polylineBarriers:y,polygonBarriers:u,routeInfo:d}=e;this.set({stops:r,pointBarriers:a,polylineBarriers:y,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",s),this._set("routeInfo",d),d.geometry!=null&&(this.spatialReference=d.geometry.spatialReference)}_getNetworkFeatures(e,r,o,s){const a=ue(e)?e.layers:e.featureCollection?.layers,y=a?.find(f=>f.layerDefinition.name===r);if(y==null)return new L;const{layerDefinition:u,popupInfo:d,featureSet:g}=y,h=u.drawingInfo.renderer,{features:n}=g,b=g.spatialReference??u.spatialReference??u.extent.spatialReference??je,P=h&&ft(h),B=W.fromJSON(b),m=n.map(f=>{const w=Q.fromJSON(f);w.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(w.geometry.spatialReference=B);const l=o(w);return l.symbol??=P?.getSymbol(w)??this._getNetworkSymbol(r),l.popupTemplate??=d&&pt.fromJSON(d),l});return s&&m.some(({symbol:f})=>!f)&&s(m),new L(m)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,r,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const s=await Ke(e,r,o);return this._cachedServiceDescription={serviceDescription:s,url:e},s}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:n})=>n!=null))return;const{first:r,last:o,middle:s,unlocated:a,waypoint:y,break:u}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((n,b)=>{switch(b){case 0:n.symbol=r;break;case e.length-1:n.symbol=o;break;default:n.symbol=s}});const d=e.map(({sequence:n})=>n).filter(n=>n!=null),g=Math.min(...d),h=Math.max(...d);for(const n of e)n.sequence!==g?n.sequence!==h?n.status==="ok"||n.status==="not-located-on-closest"?n.locationType!=="waypoint"?n.locationType!=="break"?n.symbol=s:n.symbol=u:n.symbol=y:n.symbol=a:n.symbol=o:n.symbol=r}_toRouteLayerSolution(e){const r=e.routeResults[0].stops?.map(h=>se.fromJSON(h.toJSON()));this._setStopSymbol(r);const o=new Ee(r),s=new ke(e.polygonBarriers?.map(h=>{const n=oe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polygonBarriers,n})),a=new xe(e.polylineBarriers?.map(h=>{const n=ie.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polylineBarriers,n})),y=new Je(e.pointBarriers?.map(h=>{const n=re.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.pointBarriers,n})),u=e.routeResults[0].route?.toJSON(),d=we.fromJSON(u);d.symbol=this.defaultSymbols.routeInfo;const g=new Br(e.routeResults[0].directionPoints?.features.map(h=>{const n=ye.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionPoints,n}));return{directionLines:new br(e.routeResults[0].directionLines?.features.map(h=>{const n=pe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionLines,n})),directionPoints:g,pointBarriers:y,polygonBarriers:s,polylineBarriers:a,routeInfo:d,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",pe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ye.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,s,a,y){if(!e?.length)return null;const u=this.spatialReference.toJSON(),{fullExtent:d,maxScale:g,minScale:h}=this;return{featureSet:{features:e.toArray().map(n=>Sr(n)),geometryType:o,spatialReference:u},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:r!=null?r.toJSON():Pe(o)}},extent:d.toJSON(),fields:s,geometryType:o,hasM:!1,hasZ:!1,maxScale:g,minScale:h,name:a,objectIdField:"ObjectID",spatialReference:u,title:y,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ie.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new L([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",we.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",se.fields,"Stops","Stops");if(e==null)return null;const{stops:r}=this.defaultSymbols,o=r?.first?.toJSON(),s=r?.middle?.toJSON(),a=r?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:s,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:a,label:"Last Stop"}]},e}};t([i({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],v.prototype,"_featureCollection",void 0),t([$(["web-map","portal-item"],"_featureCollection")],v.prototype,"writeFeatureCollectionWebmap",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],v.prototype,"_type",void 0),t([i({nonNullable:!0,type:ze})],v.prototype,"defaultSymbols",void 0),t([i({readOnly:!0})],v.prototype,"directionLines",void 0),t([N(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],v.prototype,"readDirectionLines",null),t([i({readOnly:!0})],v.prototype,"directionPoints",void 0),t([N(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],v.prototype,"readDirectionPoints",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],v.prototype,"featureCollectionType",void 0),t([i({readOnly:!0})],v.prototype,"fullExtent",null),t([i({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],v.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],v.prototype,"listMode",void 0),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"maxScale",void 0),t([N(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],v.prototype,"readMaxScale",null),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"minScale",void 0),t([N(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],v.prototype,"readMinScale",null),t([i({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],v.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0,type:L.ofType(re)})],v.prototype,"pointBarriers",void 0),t([N(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],v.prototype,"readPointBarriers",null),t([i({nonNullable:!0,type:L.ofType(oe)})],v.prototype,"polygonBarriers",void 0),t([N(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolygonBarriers",null),t([i({nonNullable:!0,type:L.ofType(ie)})],v.prototype,"polylineBarriers",void 0),t([N(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolylineBarriers",null),t([i({readOnly:!0})],v.prototype,"routeInfo",void 0),t([N(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],v.prototype,"readRouteInfo",null),t([i({type:W})],v.prototype,"spatialReference",void 0),t([N(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],v.prototype,"readSpatialReference",null),t([i({nonNullable:!0,type:L.ofType(se)})],v.prototype,"stops",void 0),t([N(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],v.prototype,"readStops",null),t([i()],v.prototype,"title",null),t([i({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),t([i()],v.prototype,"url",null),v=t([O(He)],v);const To=v;export{To as default}; diff --git a/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-BtSAtlez.js b/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-BtSAtlez.js new file mode 100644 index 00000000..79a46c6f --- /dev/null +++ b/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-BtSAtlez.js @@ -0,0 +1 @@ +import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./story-DT1Ep1ux.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-Cm3NmLQL.js";import{X as F,Y as G}from"./LayerView-Bish-E63-B3VRdVIM.js";import{d as H}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./main-BTdHgocv.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ai=p;export{Ai as default}; diff --git a/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-v-fxrPaX.js b/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-v-fxrPaX.js deleted file mode 100644 index 218f613e..00000000 --- a/custom-toc-separator/assets/RouteLayerView2D-Bpui7Ggx-v-fxrPaX.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./story-OUarUCIt.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-Bv9OY5sh.js";import{X as F,Y as G}from"./LayerView-Bish-E63-DehQ-_Za.js";import{d as H}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./main-lj2zzr_L.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ai=p;export{Ai as default}; diff --git a/custom-toc-separator/assets/SDFHelper-B6k8Ig6R-D3_atHyF.js b/custom-toc-separator/assets/SDFHelper-B6k8Ig6R-D3_atHyF.js deleted file mode 100644 index 099ec1d9..00000000 --- a/custom-toc-separator/assets/SDFHelper-B6k8Ig6R-D3_atHyF.js +++ /dev/null @@ -1 +0,0 @@ -import{l as V}from"./floatRGBA-4pIJN00G-DCWbfrRi.js";import{eQ as X}from"./story-OUarUCIt.js";import{o as U}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{C as D,n as Y}from"./definitions-DJSdSb77-DkoRHaVx.js";const _=.45;function j(n,t=.5){switch(n.type){case"CIMPointSymbol":{const r=n.symbolLayers;if(!r||r.length!==1)return null;const o=r[0];return o.type!=="CIMVectorMarker"?null:j(o)}case"CIMVectorMarker":{const r=n.markerGraphics;if(!r||r.length!==1)return null;const o=r[0];if(!o)return null;const e=o.geometry;if(!e)return null;const i=o.symbol;return!i||i.type!=="CIMPolygonSymbol"&&i.type!=="CIMLineSymbol"||i.symbolLayers?.some(l=>!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function N(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function O(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function N(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function O(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; diff --git a/custom-toc-separator/assets/ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js b/custom-toc-separator/assets/ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js deleted file mode 100644 index 42f23a72..00000000 --- a/custom-toc-separator/assets/ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js +++ /dev/null @@ -1 +0,0 @@ -import{v as n,S as i,i as S}from"./story-OUarUCIt.js";const s=a=>{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; diff --git a/custom-toc-separator/assets/SceneLayer-DOh9PmQy-BBBCEzRV.js b/custom-toc-separator/assets/SceneLayer-DOh9PmQy-BBBCEzRV.js new file mode 100644 index 00000000..a0376790 --- /dev/null +++ b/custom-toc-separator/assets/SceneLayer-DOh9PmQy-BBBCEzRV.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as M}from"./main-BTdHgocv.js";import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,dL as G}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{u as ge}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{F as we}from"./Mesh-DLzjDUIO-BGFhxEuV.js";import{D as be}from"./Layer-ChoECxvZ-ocw70508.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as _e}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as xe}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-CobyO2zX.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import{f as We}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import{p as et}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import{C as tt}from"./persistable-C6RBwzJi-DSWzGhuz.js";import{J as rt,a as it}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{g as st}from"./styleUtils-ChrJTYIw-DnWMc-4t.js";import{b as ot}from"./Query-BrwMGK8U-FWeI_AU8.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import{w as lt}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j-DOy8KABV.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-BOsTLw9-.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./MeshTransform-C--IG09w-DmlAOJ8b.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BChBDP40.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-UtmvndF2.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./vec3-BazNroeq-xVxXS26y.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CEZkOwEl.js";import"./External-D_wl4XAw-CF3XmPYl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-iZLDgXmu.js";import"./projectVectorToVector-sIYLNlex-DFXrlpsW.js";import"./sphere-BenPORjV-B4r28WKg.js";import"./I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new $,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-C1Nc4Ce5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},vt={"mesh-pyramids":"mesh",points:"point"},_i=o;export{_i as default}; diff --git a/custom-toc-separator/assets/SceneLayer-DOh9PmQy-DjFmWa6Y.js b/custom-toc-separator/assets/SceneLayer-DOh9PmQy-DjFmWa6Y.js deleted file mode 100644 index 2a41e23a..00000000 --- a/custom-toc-separator/assets/SceneLayer-DOh9PmQy-DjFmWa6Y.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BlkhMH5A.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-lj2zzr_L.js";import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,dL as G}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{u as ge}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{F as we}from"./Mesh-DLzjDUIO-BlTrUdFo.js";import{D as be}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as _e}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as xe}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-Dbvqi9tG.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import{f as We}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import{p as et}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import{C as tt}from"./persistable-C6RBwzJi-BbuVIS8Z.js";import{J as rt,a as it}from"./projection-BA9M1R7d-Cytmrlsd.js";import{g as st}from"./styleUtils-ChrJTYIw-CbI3fdq_.js";import{b as ot}from"./Query-BrwMGK8U-gUIs0TS1.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import{w as lt}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j-CH-xwlo7.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-911d_F5-.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Bin5_zrY.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./vec3-BazNroeq-C58EAHFm.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CF_vNE3j.js";import"./External-D_wl4XAw-BzQ8-YjD.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-CYtArgCw.js";import"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new $,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-BlkhMH5A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},vt={"mesh-pyramids":"mesh",points:"point"},_i=o;export{_i as default}; diff --git a/custom-toc-separator/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-D5Gfszvz.js b/custom-toc-separator/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-D5Gfszvz.js new file mode 100644 index 00000000..3aac8367 --- /dev/null +++ b/custom-toc-separator/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-D5Gfszvz.js @@ -0,0 +1 @@ +import{v as C,i as v,dg as p,$ as x,i8 as m}from"./story-DT1Ep1ux.js";import{j as h,g as f,N as l}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{u as L,q as P,y as S}from"./lineSegment-CcqvCARM-CJhaINhC.js";import{F as _,t as w,b as V}from"./sphere-BenPORjV-B4r28WKg.js";import{y as b}from"./Octree-CJNwbhg4-Cw-pFVV-.js";import{k as j}from"./edgeProcessing-CALv8P-b-BbULsEOo.js";import"./main-BTdHgocv.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./deduplicate-D2d-E5Pw-UtmvndF2.js";import"./Indices-DEr2HrWx-BChBDP40.js";import"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const I=1e3;function T(t,o,e){const i=V(),n=_(i);return l(n,n,t,.5),l(n,n,o,.5),i[3]=f(n,t),h(n,n,e),i}let g=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;dt.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;di.map(i=>d[i]); -import{_ as P}from"./main-lj2zzr_L.js";import{J as C,hf as K,bw as Q}from"./story-OUarUCIt.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{z as Z,O as ee}from"./vec3-BazNroeq-C58EAHFm.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./I3SUtil-Bq8KpP2j-CH-xwlo7.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function He(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function ze(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function Je(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Ye(e){await g(),oe(e)}async function $e(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function Ge(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-CiwR2FyN.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-Cytmrlsd.js"),__vite__mapDeps([7,4,5,3,6,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-C4Z0zGYQ.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([8,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,7,20,21,22,23,24,25]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Qe(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const Xe={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{Ke as destroyContext,ze as dracoDecompressPointCloudData,Je as filterObbsForModifications,ne as filterObbsForModificationsSync,We as initialize,Qe as interpretObbModificationResults,He as process,Ge as project,$e as setLegacySchema,Ye as setModifications,oe as setModificationsSync,Xe as test,qe as transformNormals}; diff --git a/custom-toc-separator/assets/SceneLayerWorker-BC8rXiXB-DBvhsCCT.js b/custom-toc-separator/assets/SceneLayerWorker-BC8rXiXB-DBvhsCCT.js new file mode 100644 index 00000000..73a489b2 --- /dev/null +++ b/custom-toc-separator/assets/SceneLayerWorker-BC8rXiXB-DBvhsCCT.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./i3s-BX0wo_Kt-c1D9OuB8.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./projection-BA9M1R7d-DTN1X2Bt.js","./projectMeshVertexPositions-CFs_XMKX-SvAQB6ru.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./mat4-DX7gBViE-B27FdgMD.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./vec3-BazNroeq-xVxXS26y.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4-DWDdg1fj-CEZkOwEl.js"])))=>i.map(i=>d[i]); +import{_ as P}from"./main-BTdHgocv.js";import{J as C,hf as K,bw as Q}from"./story-DT1Ep1ux.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{z as Z,O as ee}from"./vec3-BazNroeq-xVxXS26y.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-B4r28WKg.js";import"./I3SUtil-Bq8KpP2j-DOy8KABV.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./projectVectorToVector-sIYLNlex-DFXrlpsW.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function He(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function ze(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function Je(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Ye(e){await g(),oe(e)}async function $e(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function Ge(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-CMjj6oJy.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-DTN1X2Bt.js"),__vite__mapDeps([7,4,5,3,6,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-SvAQB6ru.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([8,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,7,20,21,22,23,24,25]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Qe(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const Xe={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{Ke as destroyContext,ze as dracoDecompressPointCloudData,Je as filterObbsForModifications,ne as filterObbsForModificationsSync,We as initialize,Qe as interpretObbModificationResults,He as process,Ge as project,$e as setLegacySchema,Ye as setModifications,oe as setModificationsSync,Xe as test,qe as transformNormals}; diff --git a/custom-toc-separator/assets/SceneService-BZqGtWmG-CobyO2zX.js b/custom-toc-separator/assets/SceneService-BZqGtWmG-CobyO2zX.js new file mode 100644 index 00000000..a6c87424 --- /dev/null +++ b/custom-toc-separator/assets/SceneService-BZqGtWmG-CobyO2zX.js @@ -0,0 +1,3 @@ +import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./story-DT1Ep1ux.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import J from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{i as A}from"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import{d as Z}from"./saveUtils-CIYk-dsQ-LlVI_Glz.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: +${d.join(` +`)}`;if(w.getLogger(this).error(`_validateAgainstJSONSchema(): ${f}`),r.failPolicy==="throw"){const v=d.map(u=>new c("sceneservice:schema-validation",u));throw new c("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:v})}}}};return o([p(F)],a.prototype,"id",void 0),o([p({type:_})],a.prototype,"spatialReference",void 0),o([h("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),o([p({type:S})],a.prototype,"fullExtent",void 0),o([h("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),o([p({readOnly:!0,type:$})],a.prototype,"heightModelInfo",void 0),o([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),o([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),o([p({readOnly:!0})],a.prototype,"version",void 0),o([h("version",["store.version"])],a.prototype,"readVersion",null),o([p({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([p({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),o([p({type:String})],a.prototype,"title",void 0),o([h("portal-item","title")],a.prototype,"readTitlePortalItem",null),o([h("service","title",["name"])],a.prototype,"readTitleService",null),o([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),o([p(k)],a.prototype,"url",null),o([P("url")],a.prototype,"writeUrl",null),o([p()],a.prototype,"parsedUrl",null),o([p({readOnly:!0})],a.prototype,"store",void 0),o([p({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=o([L("esri.layers.mixins.SceneService")],a),a},x=-1e38;function I(s){if(s.spatialReference!=null)return _.fromJSON(s.spatialReference);const a=s.store,t=a.indexCRS||a.geographicCRS,e=t&&parseInt(t.slice(t.lastIndexOf("/")+1),10);return e!=null?new _(e):null}function j(s,a,t){s.typeKeywords||(s.typeKeywords=[]);const e=a.getTypeKeywords();for(const i of e)s.typeKeywords.push(i);s.typeKeywords&&(s.typeKeywords=s.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r),t===m.newItem&&(s.typeKeywords=s.typeKeywords.filter(i=>i!=="Hosted Service")))}var m;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(m||(m={}));const b="Scene Service",R={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var g;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(g||(g={}));export{G as T,ne as W,g as f}; diff --git a/custom-toc-separator/assets/SceneService-BZqGtWmG-Dbvqi9tG.js b/custom-toc-separator/assets/SceneService-BZqGtWmG-Dbvqi9tG.js deleted file mode 100644 index 5b0e7b4c..00000000 --- a/custom-toc-separator/assets/SceneService-BZqGtWmG-Dbvqi9tG.js +++ /dev/null @@ -1,3 +0,0 @@ -import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./story-OUarUCIt.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import J from"./PortalItem-CctGdnxF-DgukgleB.js";import{i as A}from"./jsonContext-BA8GHqVk-CN6VxGdq.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-DTC51C_z.js";import{d as Z}from"./saveUtils-CIYk-dsQ-BafA6Tfo.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: -${d.join(` -`)}`;if(w.getLogger(this).error(`_validateAgainstJSONSchema(): ${f}`),r.failPolicy==="throw"){const v=d.map(u=>new c("sceneservice:schema-validation",u));throw new c("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:v})}}}};return o([p(F)],a.prototype,"id",void 0),o([p({type:_})],a.prototype,"spatialReference",void 0),o([h("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),o([p({type:S})],a.prototype,"fullExtent",void 0),o([h("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),o([p({readOnly:!0,type:$})],a.prototype,"heightModelInfo",void 0),o([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),o([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),o([p({readOnly:!0})],a.prototype,"version",void 0),o([h("version",["store.version"])],a.prototype,"readVersion",null),o([p({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([p({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),o([p({type:String})],a.prototype,"title",void 0),o([h("portal-item","title")],a.prototype,"readTitlePortalItem",null),o([h("service","title",["name"])],a.prototype,"readTitleService",null),o([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),o([p(k)],a.prototype,"url",null),o([P("url")],a.prototype,"writeUrl",null),o([p()],a.prototype,"parsedUrl",null),o([p({readOnly:!0})],a.prototype,"store",void 0),o([p({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=o([L("esri.layers.mixins.SceneService")],a),a},x=-1e38;function I(s){if(s.spatialReference!=null)return _.fromJSON(s.spatialReference);const a=s.store,t=a.indexCRS||a.geographicCRS,e=t&&parseInt(t.slice(t.lastIndexOf("/")+1),10);return e!=null?new _(e):null}function j(s,a,t){s.typeKeywords||(s.typeKeywords=[]);const e=a.getTypeKeywords();for(const i of e)s.typeKeywords.push(i);s.typeKeywords&&(s.typeKeywords=s.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r),t===m.newItem&&(s.typeKeywords=s.typeKeywords.filter(i=>i!=="Hosted Service")))}var m;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(m||(m={}));const b="Scene Service",R={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var g;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(g||(g={}));export{G as T,ne as W,g as f}; diff --git a/custom-toc-separator/assets/Scheduler-B7UX7Wr5-C-sG6deK.js b/custom-toc-separator/assets/Scheduler-B7UX7Wr5-C-sG6deK.js deleted file mode 100644 index 867f224f..00000000 --- a/custom-toc-separator/assets/Scheduler-B7UX7Wr5-C-sG6deK.js +++ /dev/null @@ -1 +0,0 @@ -import{v as m,S as p,i as F,j as D,dE as R,c$ as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,dF as Y}from"./story-OUarUCIt.js";import{o as L}from"./signal-CETehA7D-TD-k6B-y.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; diff --git a/custom-toc-separator/assets/Scheduler-B7UX7Wr5-xYmcMbo2.js b/custom-toc-separator/assets/Scheduler-B7UX7Wr5-xYmcMbo2.js new file mode 100644 index 00000000..f77dad1f --- /dev/null +++ b/custom-toc-separator/assets/Scheduler-B7UX7Wr5-xYmcMbo2.js @@ -0,0 +1 @@ +import{v as m,S as p,i as F,j as D,dE as R,c$ as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,dF as Y}from"./story-DT1Ep1ux.js";import{o as L}from"./signal-CETehA7D-o0XgAOKb.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; diff --git a/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-B8-206Wc.js b/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-B8-206Wc.js new file mode 100644 index 00000000..12ebb33c --- /dev/null +++ b/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-B8-206Wc.js @@ -0,0 +1 @@ +import{g as l}from"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{m as f,p as g}; diff --git a/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-C3HNN94j.js b/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-C3HNN94j.js deleted file mode 100644 index e279dd2b..00000000 --- a/custom-toc-separator/assets/SourceLayerData-BT_Ywuvg-C3HNN94j.js +++ /dev/null @@ -1 +0,0 @@ -import{g as l}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{m as f,p as g}; diff --git a/custom-toc-separator/assets/SpatialFilter-BlQBFhwz-B_zCY5td.js b/custom-toc-separator/assets/SpatialFilter-BlQBFhwz-B_zCY5td.js new file mode 100644 index 00000000..69b65a49 --- /dev/null +++ b/custom-toc-separator/assets/SpatialFilter-BlQBFhwz-B_zCY5td.js @@ -0,0 +1 @@ +import{c2 as X,F as $,J as ee,t as M}from"./story-DT1Ep1ux.js";import{D as te}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{a as c,D as C,N as x,w as P,P as k,x as L,L as ne,y as F,k as re,E as se,b as G,h as B,J as Z}from"./shared-D1w-26bA-BBBcUeQg.js";import{m as O,r as ae,O as j}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{Z as T,n as g,a as m,r as W}from"./WhereClause-DxwoyBMS-Daxq3yaK.js";import{union as ie,geodesicArea as le,planarArea as oe,geodesicLength as ue,planarLength as ce,relate as he,crosses as de,touches as pe,within as fe,overlaps as _e,contains as ge,intersects as H}from"./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js";import{o as me}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";var f;(function(s){s.NeverReach="NeverReach",s.NotImplemented="NotImplemented",s.Cancelled="Cancelled",s.InvalidStatResponse="InvalidStatResponse",s.InvalidRequest="InvalidRequest",s.RequestFailed="RequestFailed",s.MissingFeatures="MissingFeatures",s.AggregationFieldNotFound="AggregationFieldNotFound",s.DataElementsNotFound="DataElementsNotFound"})(f||(f={}));const ye={[f.Cancelled]:"Cancelled",[f.InvalidStatResponse]:"Invalid statistics response from service",[f.InvalidRequest]:"Invalid request",[f.RequestFailed]:"Request failed - {reason}",[f.MissingFeatures]:"Missing features",[f.AggregationFieldNotFound]:"Aggregation field not found",[f.DataElementsNotFound]:"Data elements not found on service",[f.NeverReach]:"Encountered unreachable logic",[f.NotImplemented]:"Not implemented"};class y extends Error{constructor(e,t){super(X(ye[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,y)}}class A{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}A.applicationCache=null;class Se{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}async nextBatchAsArcadeFeatures(e,t){const n=await this.nextBatch(e);return n===null?n:n.map(r=>te.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=r._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class E{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),e?.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new y(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new y(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new y(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?ie(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);M(o)?o.then(d=>{this._reduceImpl(e,t,d,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):M(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry?.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return e?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lte.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=r._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class E{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),e?.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new y(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new y(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new y(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?ie(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);M(o)?o.then(d=>{this._reduceImpl(e,t,d,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):M(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry?.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return e?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lY.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; diff --git a/custom-toc-separator/assets/Stop-he5xSAJJ-Cm3NmLQL.js b/custom-toc-separator/assets/Stop-he5xSAJJ-Cm3NmLQL.js new file mode 100644 index 00000000..7f8574b9 --- /dev/null +++ b/custom-toc-separator/assets/Stop-he5xSAJJ-Cm3NmLQL.js @@ -0,0 +1 @@ +import{cr as o,aa as D,bi as w,v as t,S as i,m as K,bL as C,dM as I,i as S,a0 as p,w as z,ac as A,l as Z,bz as j,e as g}from"./story-DT1Ep1ux.js";const $={esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"},Q=o()($);o()({...$,esriIntFeet:"international-feet",esriIntInches:"international-inches",esriIntMiles:"international-miles",esriIntNauticalMiles:"international-nautical-miles",esriIntYards:"international-yards"}),o()({esriAcres:"international-acres",esriAcresUS:"us-acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-international-feet",esriSquareFeetUS:"square-us-feet",esriSquareInches:"square-international-inches",esriSquareInchesUS:"square-us-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-international-miles",esriSquareMilesUS:"square-us-miles",esriSquareMillimeters:"square-millimeters",esriSquareYards:"square-international-yards",esriSquareYardsUS:"square-us-yards",esriUnknownAreaUnits:"unknown"});const ne=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"});o()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const le=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),ue=o()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),pe=o()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});o()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const ee=o()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});o()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),o()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const te=o()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),m=o()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),E=o()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),N=o()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),k=o()({1:"right",2:"left"},{useNumericKeys:!0}),h=o()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),W=o()({0:"permit",1:"restrict"},{useNumericKeys:!0}),L=o()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),J=o()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),de=o()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),ie=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),re=o()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),O=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),Y=o()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),me=o()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),ce=o()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),ye=o()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),Te=o()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var P;let c=P=class extends D(g){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){return new P({directionLineType:J.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?J.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(e.FromLevel=this.fromLevel),this.toLevel!=null&&(e.ToLevel=this.toLevel),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};c.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}],t([i({type:J.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:J.read}}})],c.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),t([i({type:K})],c.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),t([i({type:C})],c.prototype,"popupTemplate",void 0),t([i({types:I})],c.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=P=t([S("esri.rest.support.DirectionLine")],c);const be=c;var R;let l=R=class extends D(g){constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,r){return r.attributes.ArrivalTime!=null?new Date(r.attributes.ArrivalTime):null}static fromGraphic(e){return new R({alternateName:e.attributes.AlternateName??null,arrivalTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:L.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?L.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(e.AlternateName=this.alternateName),this.arrivalTime!=null&&(e.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(e.Azimuth=this.azimuth),this.branchName!=null&&(e.BranchName=this.branchName),this.displayText!=null&&(e.DisplayText=this.displayText),this.exitName!=null&&(e.ExitName=this.exitName),this.intersectingName!=null&&(e.IntersectingName=this.intersectingName),this.level!=null&&(e.Level=this.level),this.name!=null&&(e.Name=this.name),this.shortVoiceInstruction!=null&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(e.TowardName=this.towardName),this.voiceInstruction!=null&&(e.VoiceInstruction=this.voiceInstruction),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}],t([i({json:{read:{source:"attributes.AlternateName"}}})],l.prototype,"alternateName",void 0),t([i()],l.prototype,"arrivalTime",void 0),t([p("arrivalTime",["attributes.ArrivalTime"])],l.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],l.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],l.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],l.prototype,"branchName",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:L.read}}})],l.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],l.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],l.prototype,"exitName",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.IntersectingName"}}})],l.prototype,"intersectingName",void 0),t([i({json:{read:{source:"attributes.Level"}}})],l.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:C})],l.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],l.prototype,"sequence",void 0),t([i({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],l.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],l.prototype,"stopId",void 0),t([i({types:I})],l.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],l.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i({json:{read:{source:"attributes.VoiceInstruction"}}})],l.prototype,"voiceInstruction",void 0),l=R=t([S("esri.rest.support.DirectionPoint")],l);const he=l;function f(e,r){if(e==null)return null;const n={},T=new RegExp(`^${r}`,"i");for(const M of Object.keys(e))if(T.test(M)){const X=M.slice(r.length);n[O.fromJSON(X)]=e[M]}return n}function H(e,r,n){if(e!=null){r.attributes||(r.attributes={});for(const T in e){const M=O.toJSON(T);r.attributes[`${n}${M}`]=e[T]}}}function F(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.fromJSON(T)]=e[n]}return r}function U(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.toJSON(T)]=e[n]}return r}function B(e,r){return e==null||r==null?null:Math.round((e-r)/6e4)}function ve(e){const r=e.toJSON(),n=r;return n.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),n.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),n.barriers&&=JSON.stringify(r.barriers),n.outSR&&=r.outSR?.wkid,n.overrides&&=JSON.stringify(r.overrides),n.polygonBarriers&&=JSON.stringify(r.polygonBarriers),n.polylineBarriers&&=JSON.stringify(r.polylineBarriers),n.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),n.stops&&=JSON.stringify(r.stops),n.travelMode&&=JSON.stringify(r.travelMode),n}var V;let u=V=class extends D(g){constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new V({addedCost:e.attributes.AddedCost??null,barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,fullEdge:e.attributes.FullEdge!=null?W.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?W.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?N.toJSON(this.status):null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};u.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}],t([i()],u.prototype,"addedCost",void 0),t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],u.prototype,"barrierType",void 0),t([i()],u.prototype,"costs",void 0),t([p("costs",["attributes"])],u.prototype,"readCosts",null),t([A("costs")],u.prototype,"writeCosts",null),t([i({constructOnly:!0,type:m.apiValues,json:{read:{source:"attributes.CurbApproach",reader:m.read}}})],u.prototype,"curbApproach",void 0),t([i({type:W.apiValues,json:{name:"attributes.FullEdge",read:{reader:W.read},write:{writer:W.write}}})],u.prototype,"fullEdge",void 0),t([i({type:z,json:{write:!0}})],u.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],u.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],u.prototype,"objectId",void 0),t([i({type:C})],u.prototype,"popupTemplate",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],u.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],u.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],u.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],u.prototype,"status",void 0),t([i({types:I})],u.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],u.prototype,"type",void 0),u=V=t([S("esri.rest.support.PointBarrier")],u);const fe=u;var x;let y=x=class extends D(g){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new x({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],y.prototype,"barrierType",void 0),t([i()],y.prototype,"costs",void 0),t([p("costs",["attributes"])],y.prototype,"readCosts",null),t([A("costs")],y.prototype,"writeCosts",null),t([i({type:Z,json:{write:!0}})],y.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],y.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],y.prototype,"objectId",void 0),t([i({type:C})],y.prototype,"popupTemplate",void 0),t([i()],y.prototype,"scaleFactor",void 0),t([i({types:I})],y.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=x=t([S("esri.rest.support.PolygonBarrier")],y);const Se=y;var q;let b=q=class extends D(g){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,r){return f(r.attributes,"Attr_")}static fromGraphic(e){return new q({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};b.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{read:{source:"attributes.BarrierType",reader:h.read}}})],b.prototype,"barrierType",void 0),t([i()],b.prototype,"costs",void 0),t([p("costs",["attributes"])],b.prototype,"readCosts",null),t([i({type:K,json:{write:!0}})],b.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],b.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],b.prototype,"objectId",void 0),t([i({type:C})],b.prototype,"popupTemplate",void 0),t([i()],b.prototype,"scaleFactor",void 0),t([i({types:I})],b.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),b=q=t([S("esri.rest.support.PolylineBarrier")],b);const ge=b;let d=class extends D(g){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,r){return r.id??r.itemId??null}readRestrictionAttributes(e,r){const{restrictionAttributeNames:n}=r;return n==null?null:n.map(T=>Y.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; diff --git a/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-BIucz7KM.js b/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-BIucz7KM.js deleted file mode 100644 index cf641fde..00000000 --- a/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-BIucz7KM.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-BSkWYYSj.js","./utils-BVWK2jiA-Bnz0n_UG.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./createConnection-CrkuTLXs-DMli8kp_.js","./query-DFW9-NG_-CLOB0soI.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js"])))=>i.map(i=>d[i]); -import{_ as f}from"./main-lj2zzr_L.js";import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as v,a1 as O,bW as h,bo as A,f as k,dL as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as M}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{a as W}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as z}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{E as B}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as K}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{y as le}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as de}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{g as ue}from"./styleUtils-ChrJTYIw-CbI3fdq_.js";import{b as he}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as ye}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await f(()=>import("./streamLayerUtils-CLc_16nt-BSkWYYSj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){v(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([f(()=>import("./createConnection-CrkuTLXs-DMli8kp_.js"),__vite__mapDeps([14,3,4,2,5,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),v(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ft=i;export{Ft as default}; diff --git a/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-dCedDpZK.js b/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-dCedDpZK.js new file mode 100644 index 00000000..4a3d2db2 --- /dev/null +++ b/custom-toc-separator/assets/StreamLayer-Bqnt-d3H-dCedDpZK.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-BaVi8fY7.js","./utils-BVWK2jiA-inSV67A_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./createConnection-CrkuTLXs-CphPkuWc.js","./query-DFW9-NG_-SSagAgRu.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./TimeExtent-Cn0Jofqr-BFc609ot.js"])))=>i.map(i=>d[i]); +import{_ as f}from"./main-BTdHgocv.js";import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as v,a1 as O,bW as h,bo as A,f as k,dL as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as M}from"./Layer-ChoECxvZ-ocw70508.js";import{a as W}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as z}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{E as B}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as K}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{y as le}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as de}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{g as ue}from"./styleUtils-ChrJTYIw-DnWMc-4t.js";import{b as he}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as ye}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await f(()=>import("./streamLayerUtils-CLc_16nt-BaVi8fY7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){v(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([f(()=>import("./createConnection-CrkuTLXs-CphPkuWc.js"),__vite__mapDeps([14,3,4,2,5,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),v(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ft=i;export{Ft as default}; diff --git a/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-BBcyEYP-.js b/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-BBcyEYP-.js new file mode 100644 index 00000000..b33a0ab5 --- /dev/null +++ b/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-BBcyEYP-.js @@ -0,0 +1 @@ +import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./story-DT1Ep1ux.js";import{O as c}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js";import g from"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./main-BTdHgocv.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-CSAKuiyl.js";import"./LayerView-Bish-E63-B3VRdVIM.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";import"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const fe=s;export{fe as default}; diff --git a/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-CCV-pdDA.js b/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-CCV-pdDA.js deleted file mode 100644 index 33772d4b..00000000 --- a/custom-toc-separator/assets/StreamLayerView2D-Bh_aEalU-CCV-pdDA.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./story-OUarUCIt.js";import{O as c}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js";import g from"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./main-lj2zzr_L.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import"./LayerView-Bish-E63-DehQ-_Za.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";import"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const fe=s;export{fe as default}; diff --git a/custom-toc-separator/assets/StyleRepository-D3WuVprR-D1hVbbHk.js b/custom-toc-separator/assets/StyleRepository-D3WuVprR-D1hVbbHk.js deleted file mode 100644 index 7cd2c4b5..00000000 --- a/custom-toc-separator/assets/StyleRepository-D3WuVprR-D1hVbbHk.js +++ /dev/null @@ -1,9 +0,0 @@ -import{p as T,t as F,n as Z}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{cf as me,ar as b}from"./story-OUarUCIt.js";import{N as W}from"./enums-qHpGJ28Q-CmnLAccm.js";import{Z as xt,G as we,K as re,X as Ee,F as N,d as vt}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import{I as g}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{n as v}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{U as Kt,l as qt,T as Wt}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{u as Te}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{d as be}from"./definitions-DJSdSb77-DkoRHaVx.js";let Ie=class{constructor(n){this._array=[],this._stride=n}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(n,t){return 65535&n|t<<16}static i8888to32(n,t,e,r){return 255&n|(255&t)<<8|(255&e)<<16|r<<24}static i8816to32(n,t,e){return 255&n|(255&t)<<8|e<<16}};var c,K;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(K||(K={}));let j=class Dt{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,i,a){const o=this.getUniforms();for(const s of o){const{name:l,type:u,getValue:h}=s,p=h(r,e,i,a);if(p!==null)switch(u){case"float":t.setUniform1f(l,p);break;case"vec2":t.setUniform2fv(l,p);break;case"vec4":t.setUniform4fv(l,p)}}}encodeAttributes(t,e,r,i){const a=this.attributesInfo(),o=this.getEncodingInfos(),s=[];let l=0,u=0;for(const h of Object.keys(o)){const p=o[h],{type:f,precisionFactor:d,isLayout:L}=a[h],M=L?r.getLayoutProperty(h):r.getPaintProperty(h),z=M.interpolator?.getInterpolationRange(e);let $=0;for(const I of p){const{offset:_,bufferElementsToAdd:U}=I;if(U>0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}L.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` -`,i=` -`;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; -`;const o=this.attributes(),s=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:h,type:p,precisionFactor:f,isLayout:d}=s[u],L=f&&f!==1?" * "+1/f:"",{bytesPerElement:M,count:z}=Dt._encodingInfo[p],$=I=>`a_data_${I.dataIndex}${ve(z,I.offset,M)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const I=this._getType(z),_=`u_${h}`;a.push({name:_,type:I,getValue:(U,E,H,R)=>{const O=d?U.getLayoutValue(u,E):U.getPaintValue(u,E);if(p===c.R16G16B16A16_DASHARRAY){const B=U.getDashKey(O,U.getLayoutValue("line-cap",E)),nt=R.getMosaicItemPosition(B,!1);if(nt==null)return null;const{tl:st,br:jt}=nt;return[st[0],jt[1],jt[0],st[1]]}if(p===c.R16G16B16A16_PATTERN){const B=R.getMosaicItemPosition(O,!u.includes("line-"));if(B==null)return null;const{tl:nt,br:st}=B;return[nt[0],st[1],st[0],nt[1]]}if(p===c.R8G8B8A8_COLOR){const B=O[3];return[B*O[0],B*O[1],B*O[2],B]}return O}}),r+=`uniform ${I} ${_}; -`,i+=`${I} ${h} = ${_}; -`}break;case K.DATA_DRIVEN:{const I=$(e[u][0]);i+=`${this._getType(z)} ${h} = ${I}${L}; -`}break;case K.INTERPOLATED_DATA_DRIVEN:{const I=`u_t_${h}`;a.push({name:I,type:"float",getValue:(E,H,R,O)=>(d?E.getLayoutProperty(u):E.getPaintProperty(u)).interpolator.interpolationUniformValue(R,H)}),r+=`uniform float ${I}; -`;const _=$(e[u][0]),U=$(e[u][1]);i+=`${this._getType(z)} ${h} = mix(${_}${L}, ${U}${L}, ${I}); -`}}}this._shaderHeader=r,this._shaderMain=i,this._uniforms=a}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return Ie.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r?.rect)return;const i=2,a=r.rect,o=r.width,s=r.height;e[t]=this._encodeShort(a.x+i,0),e[t]|=this._encodeShort(a.y+i+s,16),e[t+1]=this._encodeShort(a.x+i+o,0),e[t+1]|=this._encodeShort(a.y+i,16)}_encodeByte(t,e){return(255&t)<{switch(n){case g.FLOAT:case g.INT:case g.UNSIGNED_INT:return 4;case g.SHORT:case g.UNSIGNED_SHORT:case g.HALF_FLOAT:return 2;case g.BYTE:case g.UNSIGNED_BYTE:return 1}},ve=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class yt extends j{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new v("a_pos",2,g.BYTE,0,2)],J.ATTRIBUTES_INFO={};let Q=class ft extends j{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};Q.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],Q.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],Q.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class gt extends j{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class X extends j{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return X.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?X.ATTRIBUTES_FILL:X.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?X.ATTRIBUTES_INFO_FILL:X.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,8),new v("a_offset",2,g.BYTE,4,8),new v("a_xnormal",2,g.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class dt extends j{constructor(t){super(t)}geometryInfo(){return dt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return dt.ATTRIBUTES}attributesInfo(){return dt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,16),new v("a_extrude_offset",4,g.BYTE,4,16),new v("a_dir_normal",4,g.BYTE,8,16),new v("a_accumulatedDistance",2,g.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const ie=[new v("a_pos",2,g.SHORT,0,16),new v("a_vertexOffset",2,g.SHORT,4,16),new v("a_texAngleRange",4,g.UNSIGNED_BYTE,8,16),new v("a_levelInfo",4,g.UNSIGNED_BYTE,12,16)],ae=[new v("a_opacityInfo",1,g.UNSIGNED_BYTE,0,1)];let lt=class Rt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],lt.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let ut=class Nt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};ut.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],ut.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};const ne={kind:"null"},w={kind:"number"},S={kind:"string"},D={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ht(n,t){return{kind:"array",itemType:n,n:t}}const De=[ne,w,S,D,Y,bt,ht(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function It(n){if(n===null)return ne;if(typeof n=="string")return S;if(typeof n=="boolean")return D;if(typeof n=="number")return w;if(n instanceof b)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=It(e);if(t){if(t!==r){t=C;break}}else t=r}return ht(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of De)if(At(n,e))return!0}return t.kind===n.kind}function Pt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof b?n.toString():JSON.stringify(n)}let Re=class{constructor(n){this._parent=n,this._vars={}}add(n,t){this._vars[n]=t}get(n){return this._vars[n]?this._vars[n]:this._parent?this._parent.get(n):null}},Ne=class se{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new se}evaluate(t,e){return t?.id}};class Lt{constructor(){this.type=S}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new Lt}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let Ae=class oe{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new oe}evaluate(t,e){return t?.values}},le=class ue{constructor(){this.type=w}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new ue}evaluate(t,e){return e}};class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=D}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new x(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class Pe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r===i)}}class xe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r!==i)}}class Le extends x{static parse(t,e){return x.parse(t,e,(r,i)=>re<=r)}};class Ue extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>i)}}class Oe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>=i)}}class St{constructor(t){this._arg=t,this.type=D}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new St(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ut{constructor(t){this._args=t,this.type=D}static parse(t,e){const r=[];for(let i=1;i1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${a[0]}"`)}if(t.length%2!=1)throw new Error(`"${i}" expects an even number of arguments`);const o=y(t[2],e,w);let s;i==="interpolate-hcl"||i==="interpolate-lab"?s=Y:r&&r.kind!=="value"&&(s=r);const l=[];for(let u=3;u=h)throw new Error(`"${i}" requires strictly ascending stop inputs`);const p=y(t[u+1],e,s);s||(s=p.type),l.push([h,p])}if(s&&s!==Y&&s!==w&&(s.kind!=="array"||s.itemType!==w))throw new Error(`"${i}" cannot interpolate type ${rt(s)}`);return new k(i,s,a,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this.input.evaluate(t,e);if(i<=r[0][0])return r[0][1].evaluate(t,e);if(i>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let a=0;for(;++aN(p,h[f],l));if(this.type.kind==="color"&&u instanceof b&&h instanceof b){const p=new b(u),f=new b(h);return new b([N(p.r,f.r,l),N(p.g,f.g,l),N(p.b,f.b,l),N(p.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof h=="number")return N(u,h,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=Kt(u),f=Kt(h),d=f.h-p.h,L=qt({h:p.h+l*(d>180||d<-180?d-360*Math.round(d/360):d),c:N(p.c,f.c,l),l:N(p.l,f.l,l)});return new b({a:N(u.a,h.a,l),...L})}if(this._operator==="interpolate-lab"){const p=Wt(u),f=Wt(h),d=qt({l:N(p.l,f.l,l),a:N(p.a,f.a,l),b:N(p.b,f.b,l)});return new b({a:N(u.a,h.a,l),...d})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let i=0;for(;++i=r)return[r,r];let i=0;for(;++i1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,i){const a=i-r;if(a===0)return 0;const o=t-r;return e===1?o/a:(e**o-1)/(e**a-1)}}class Bt{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,w);let i;const a=[];a.push([-1/0,y(t[2],e)]);for(let o=3;o=s)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);i||(i=l.type),a.push([s,l])}return new Bt(i,r,a)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this._input.evaluate(t,e);let a=0;for(;++a=i.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return i[r]}};class _t{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new _t(r);case 3:return r=y(t[1],e),i=y(t[2],e),new _t(r,i);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t?.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=D}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),i=y(t[2],e),new mt(r,i);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!t?.values[r]}}let Me=class de{constructor(t,e){this._key=t,this._vals=e,this.type=D}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new de(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}};class wt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=w}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),i=y(t[2],e);if(t.length===4){const a=y(t[3],e,w);return new wt(r,i,a)}return new wt(r,i)}evaluate(t,e){const r=this._item.evaluate(t,e),i=this._array.evaluate(t,e);if(this._from){const a=this._from.evaluate(t,e);if(a!==Math.floor(a))throw new Error('"index-of" index must be an integer');return i.indexOf(r,a)}return i.indexOf(r)}}class kt{constructor(t){this._arg=t,this.type=w}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new kt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class Et{constructor(t,e,r,i){this.type=t,this._array=e,this._from=r,this._to=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),i=y(t[2],e,w);if(i.type!==w)throw new Error('"slice" index must return a number');if(t.length===4){const a=y(t[3],e,w);if(a.type!==w)throw new Error('"slice" index must return a number');return new Et(r.type,r,i,a)}return new Et(r.type,r,i)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const i=this._from.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');if(this._to){const a=this._to.evaluate(t,e);if(a<0||a>=r.length)throw new Error('"slice" index out of bounds');if(a!==Math.floor(a))throw new Error('"slice" index must be an integer');return r.slice(i,a)}return r.slice(i)}}class zt{constructor(){this.type=D}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new zt}evaluate(t,e){return t?.id!==void 0}}class A{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e,r){const i=t.slice(1).map(a=>y(a,e));return new A(i,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}class $e extends A{static parse(t,e){switch(t.length){case 2:return A.parse(t,e,r=>-r[0]);case 3:return A.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Ce extends A{static parse(t,e){return A.parse(t,e,r=>{let i=1;for(const a of r)i*=a;return i})}}class Ye extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class He extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class je extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class Ke extends A{static parse(t,e){return A.parse(t,e,r=>{let i=0;for(const a of r)i+=a;return i})}}class m{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e){const r=t.slice(1).map(i=>y(i,e));return new m(r,m.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}m.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class Ft{constructor(t){this._args=t,this.type=S}static parse(t,e){return new Ft(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class it{constructor(t,e){this._arg=t,this._calculate=e,this.type=S}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new it(r,it.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}it.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class Vt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(i=>y(i,e));return new Vt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e));return new b({r,g:i,b:a})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class Mt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(i=>y(i,e));return new Mt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new b({r,g:i,b:a,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class $t{constructor(t){this._color=t,this.type=ht(w,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new $t(r)}evaluate(t,e){return new b(this._color.evaluate(t,e)).toRgba()}}class q{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let i,a=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":i=S;break;case"number":i=w;break;case"boolean":i=D;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else i=C;let s;if(t.length>3){if(s=t[2],s!==null&&(typeof s!="number"||s<0||s!==Math.floor(s)))throw new Error('"array" length argument must be a positive integer literal');a++}i=ht(i,s)}else switch(r){case"string":i=S;break;case"number":i=w;break;case"boolean":i=D;break;case"object":i=bt}const o=[];for(;a":Ue,">=":Oe,all:Ut,any:Be,case:Ge,coalesce:ke,match:ze,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:Bt,let:Gt,var:Fe,concat:Ft,downcase:it,"is-supported-script":null,"resolved-locale":null,upcase:it,rgb:Vt,rgba:Mt,"to-rgba":$t,"-":$e,"*":Ce,"/":Ye,"%":He,"^":je,"+":Ke,abs:m,acos:m,asin:m,atan:m,ceil:m,cos:m,e:m,floor:m,ln:m,ln2:m,log10:m,log2:m,max:m,min:m,pi:m,round:m,sin:m,sqrt:m,tan:m,zoom:le,"heatmap-density":null,"has-id":zt,none:Ot};class P{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,D);return new P(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return P.convertComparison(e,t[1],t[2]);case"in":return P.convertIn(t[1],t.slice(2));case"!in":return P.negate(P.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return P.convertCombining(e,t.slice(1));case"has":return P.convertHas(t[1]);case"!has":return P.negate(P.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Tt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&_e[e[0]]){const a={number:w,color:Y,string:S,boolean:D,enum:S};try{const o=t.type==="array"?ht(a[t.value]||C,t.length):a[t.type],s=y(e,null,o);this.getValue=this._buildExpression(s,t),this.isDataDriven=!0,s instanceof k&&s.input instanceof le&&(this.interpolator=s)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const i=e?.stops&&e.stops.length>0;if(i)for(const a of e.stops)a[1]=this._validate(a[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),i)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else i?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Tt._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=Pt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,i)=>{try{const a=t.evaluate(i,r);return a===void 0?e.default:this._validate(a,e)}catch(a){return console.log(a.message),e.default}}}_buildIdentity(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a!==void 0&&(a=this._validate(a,e)),a??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a=this._categorical(a,t.stops),a!==void 0?a:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interval(a,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interpolate(a,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let i=0;ithis._create(e,r,i)).filter(e=>!!e),this.layers)for(let e=0;e=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t?.id)return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let i,a=!0;const o=this._layerByName[t.id];if(o){const s=this.layers.indexOf(o);e||(e=s),e===s?(a=!1,i=ot._recreateLayer(t,o),this.layers[e]=i,r.layers[e]=t):(this.layers.splice(s,1),r.layers.splice(s,1),i=this._create(t,e,this.layers),this.layers.splice(e,0,i),r.layers.splice(e,0,t))}else i=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(i),r.layers.push(t)):(this.layers.splice(e,0,i),r.layers.splice(e,0,t));this._layerByName[t.id]=i,this._uidToLayer.set(i.uid,i),a&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].paint=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].layout=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const i=r.layout||{};i.visibility=e;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:i,paint:r.paint},o=ot._recreateLayer(a,r),s=this.layers.indexOf(r);this.layers[s]=o,this._style.layers[s].layout=i,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];return e?e.layout?.visibility??"visible":"none"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ra.keyo.key?1:0);const i=t.length;for(let a=0;a0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}L.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` +`,i=` +`;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; +`;const o=this.attributes(),s=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:h,type:p,precisionFactor:f,isLayout:d}=s[u],L=f&&f!==1?" * "+1/f:"",{bytesPerElement:M,count:z}=Dt._encodingInfo[p],$=I=>`a_data_${I.dataIndex}${ve(z,I.offset,M)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const I=this._getType(z),_=`u_${h}`;a.push({name:_,type:I,getValue:(U,E,H,R)=>{const O=d?U.getLayoutValue(u,E):U.getPaintValue(u,E);if(p===c.R16G16B16A16_DASHARRAY){const B=U.getDashKey(O,U.getLayoutValue("line-cap",E)),nt=R.getMosaicItemPosition(B,!1);if(nt==null)return null;const{tl:st,br:jt}=nt;return[st[0],jt[1],jt[0],st[1]]}if(p===c.R16G16B16A16_PATTERN){const B=R.getMosaicItemPosition(O,!u.includes("line-"));if(B==null)return null;const{tl:nt,br:st}=B;return[nt[0],st[1],st[0],nt[1]]}if(p===c.R8G8B8A8_COLOR){const B=O[3];return[B*O[0],B*O[1],B*O[2],B]}return O}}),r+=`uniform ${I} ${_}; +`,i+=`${I} ${h} = ${_}; +`}break;case K.DATA_DRIVEN:{const I=$(e[u][0]);i+=`${this._getType(z)} ${h} = ${I}${L}; +`}break;case K.INTERPOLATED_DATA_DRIVEN:{const I=`u_t_${h}`;a.push({name:I,type:"float",getValue:(E,H,R,O)=>(d?E.getLayoutProperty(u):E.getPaintProperty(u)).interpolator.interpolationUniformValue(R,H)}),r+=`uniform float ${I}; +`;const _=$(e[u][0]),U=$(e[u][1]);i+=`${this._getType(z)} ${h} = mix(${_}${L}, ${U}${L}, ${I}); +`}}}this._shaderHeader=r,this._shaderMain=i,this._uniforms=a}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return Ie.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r?.rect)return;const i=2,a=r.rect,o=r.width,s=r.height;e[t]=this._encodeShort(a.x+i,0),e[t]|=this._encodeShort(a.y+i+s,16),e[t+1]=this._encodeShort(a.x+i+o,0),e[t+1]|=this._encodeShort(a.y+i,16)}_encodeByte(t,e){return(255&t)<{switch(n){case g.FLOAT:case g.INT:case g.UNSIGNED_INT:return 4;case g.SHORT:case g.UNSIGNED_SHORT:case g.HALF_FLOAT:return 2;case g.BYTE:case g.UNSIGNED_BYTE:return 1}},ve=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class yt extends j{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new v("a_pos",2,g.BYTE,0,2)],J.ATTRIBUTES_INFO={};let Q=class ft extends j{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};Q.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],Q.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],Q.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class gt extends j{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class X extends j{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return X.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?X.ATTRIBUTES_FILL:X.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?X.ATTRIBUTES_INFO_FILL:X.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,8),new v("a_offset",2,g.BYTE,4,8),new v("a_xnormal",2,g.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class dt extends j{constructor(t){super(t)}geometryInfo(){return dt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return dt.ATTRIBUTES}attributesInfo(){return dt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new v("a_pos",2,g.SHORT,0,16),new v("a_extrude_offset",4,g.BYTE,4,16),new v("a_dir_normal",4,g.BYTE,8,16),new v("a_accumulatedDistance",2,g.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const ie=[new v("a_pos",2,g.SHORT,0,16),new v("a_vertexOffset",2,g.SHORT,4,16),new v("a_texAngleRange",4,g.UNSIGNED_BYTE,8,16),new v("a_levelInfo",4,g.UNSIGNED_BYTE,12,16)],ae=[new v("a_opacityInfo",1,g.UNSIGNED_BYTE,0,1)];let lt=class Rt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],lt.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let ut=class Nt extends j{constructor(t){super(t)}geometryInfo(){return ie}opacityInfo(){return ae}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};ut.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],ut.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};const ne={kind:"null"},w={kind:"number"},S={kind:"string"},D={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ht(n,t){return{kind:"array",itemType:n,n:t}}const De=[ne,w,S,D,Y,bt,ht(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function It(n){if(n===null)return ne;if(typeof n=="string")return S;if(typeof n=="boolean")return D;if(typeof n=="number")return w;if(n instanceof b)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=It(e);if(t){if(t!==r){t=C;break}}else t=r}return ht(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of De)if(At(n,e))return!0}return t.kind===n.kind}function Pt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof b?n.toString():JSON.stringify(n)}let Re=class{constructor(n){this._parent=n,this._vars={}}add(n,t){this._vars[n]=t}get(n){return this._vars[n]?this._vars[n]:this._parent?this._parent.get(n):null}},Ne=class se{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new se}evaluate(t,e){return t?.id}};class Lt{constructor(){this.type=S}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new Lt}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let Ae=class oe{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new oe}evaluate(t,e){return t?.values}},le=class ue{constructor(){this.type=w}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new ue}evaluate(t,e){return e}};class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=D}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new x(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class Pe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r===i)}}class xe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r!==i)}}class Le extends x{static parse(t,e){return x.parse(t,e,(r,i)=>re<=r)}};class Ue extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>i)}}class Oe extends x{static parse(t,e){return x.parse(t,e,(r,i)=>r>=i)}}class St{constructor(t){this._arg=t,this.type=D}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new St(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ut{constructor(t){this._args=t,this.type=D}static parse(t,e){const r=[];for(let i=1;i1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${a[0]}"`)}if(t.length%2!=1)throw new Error(`"${i}" expects an even number of arguments`);const o=y(t[2],e,w);let s;i==="interpolate-hcl"||i==="interpolate-lab"?s=Y:r&&r.kind!=="value"&&(s=r);const l=[];for(let u=3;u=h)throw new Error(`"${i}" requires strictly ascending stop inputs`);const p=y(t[u+1],e,s);s||(s=p.type),l.push([h,p])}if(s&&s!==Y&&s!==w&&(s.kind!=="array"||s.itemType!==w))throw new Error(`"${i}" cannot interpolate type ${rt(s)}`);return new k(i,s,a,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this.input.evaluate(t,e);if(i<=r[0][0])return r[0][1].evaluate(t,e);if(i>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let a=0;for(;++aN(p,h[f],l));if(this.type.kind==="color"&&u instanceof b&&h instanceof b){const p=new b(u),f=new b(h);return new b([N(p.r,f.r,l),N(p.g,f.g,l),N(p.b,f.b,l),N(p.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof h=="number")return N(u,h,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=Kt(u),f=Kt(h),d=f.h-p.h,L=qt({h:p.h+l*(d>180||d<-180?d-360*Math.round(d/360):d),c:N(p.c,f.c,l),l:N(p.l,f.l,l)});return new b({a:N(u.a,h.a,l),...L})}if(this._operator==="interpolate-lab"){const p=Wt(u),f=Wt(h),d=qt({l:N(p.l,f.l,l),a:N(p.a,f.a,l),b:N(p.b,f.b,l)});return new b({a:N(u.a,h.a,l),...d})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let i=0;for(;++i=r)return[r,r];let i=0;for(;++i1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,i){const a=i-r;if(a===0)return 0;const o=t-r;return e===1?o/a:(e**o-1)/(e**a-1)}}class Bt{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,w);let i;const a=[];a.push([-1/0,y(t[2],e)]);for(let o=3;o=s)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);i||(i=l.type),a.push([s,l])}return new Bt(i,r,a)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const i=this._input.evaluate(t,e);let a=0;for(;++a=i.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return i[r]}};class _t{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new _t(r);case 3:return r=y(t[1],e),i=y(t[2],e),new _t(r,i);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t?.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=D}static parse(t,e){let r,i;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),i=y(t[2],e),new mt(r,i);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!t?.values[r]}}let Me=class de{constructor(t,e){this._key=t,this._vals=e,this.type=D}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new de(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}};class wt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=w}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),i=y(t[2],e);if(t.length===4){const a=y(t[3],e,w);return new wt(r,i,a)}return new wt(r,i)}evaluate(t,e){const r=this._item.evaluate(t,e),i=this._array.evaluate(t,e);if(this._from){const a=this._from.evaluate(t,e);if(a!==Math.floor(a))throw new Error('"index-of" index must be an integer');return i.indexOf(r,a)}return i.indexOf(r)}}class kt{constructor(t){this._arg=t,this.type=w}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new kt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class Et{constructor(t,e,r,i){this.type=t,this._array=e,this._from=r,this._to=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),i=y(t[2],e,w);if(i.type!==w)throw new Error('"slice" index must return a number');if(t.length===4){const a=y(t[3],e,w);if(a.type!==w)throw new Error('"slice" index must return a number');return new Et(r.type,r,i,a)}return new Et(r.type,r,i)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const i=this._from.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');if(this._to){const a=this._to.evaluate(t,e);if(a<0||a>=r.length)throw new Error('"slice" index out of bounds');if(a!==Math.floor(a))throw new Error('"slice" index must be an integer');return r.slice(i,a)}return r.slice(i)}}class zt{constructor(){this.type=D}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new zt}evaluate(t,e){return t?.id!==void 0}}class A{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e,r){const i=t.slice(1).map(a=>y(a,e));return new A(i,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}class $e extends A{static parse(t,e){switch(t.length){case 2:return A.parse(t,e,r=>-r[0]);case 3:return A.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Ce extends A{static parse(t,e){return A.parse(t,e,r=>{let i=1;for(const a of r)i*=a;return i})}}class Ye extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class He extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class je extends A{static parse(t,e){if(t.length===3)return A.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class Ke extends A{static parse(t,e){return A.parse(t,e,r=>{let i=0;for(const a of r)i+=a;return i})}}class m{constructor(t,e){this._args=t,this._calculate=e,this.type=w}static parse(t,e){const r=t.slice(1).map(i=>y(i,e));return new m(r,m.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(i=>i.evaluate(t,e))),this._calculate(r)}}m.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class Ft{constructor(t){this._args=t,this.type=S}static parse(t,e){return new Ft(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class it{constructor(t,e){this._arg=t,this._calculate=e,this.type=S}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new it(r,it.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}it.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class Vt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(i=>y(i,e));return new Vt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e));return new b({r,g:i,b:a})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class Mt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(i=>y(i,e));return new Mt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new b({r,g:i,b:a,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class $t{constructor(t){this._color=t,this.type=ht(w,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new $t(r)}evaluate(t,e){return new b(this._color.evaluate(t,e)).toRgba()}}class q{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let i,a=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":i=S;break;case"number":i=w;break;case"boolean":i=D;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else i=C;let s;if(t.length>3){if(s=t[2],s!==null&&(typeof s!="number"||s<0||s!==Math.floor(s)))throw new Error('"array" length argument must be a positive integer literal');a++}i=ht(i,s)}else switch(r){case"string":i=S;break;case"number":i=w;break;case"boolean":i=D;break;case"object":i=bt}const o=[];for(;a":Ue,">=":Oe,all:Ut,any:Be,case:Ge,coalesce:ke,match:ze,within:null,interpolate:k,"interpolate-hcl":k,"interpolate-lab":k,step:Bt,let:Gt,var:Fe,concat:Ft,downcase:it,"is-supported-script":null,"resolved-locale":null,upcase:it,rgb:Vt,rgba:Mt,"to-rgba":$t,"-":$e,"*":Ce,"/":Ye,"%":He,"^":je,"+":Ke,abs:m,acos:m,asin:m,atan:m,ceil:m,cos:m,e:m,floor:m,ln:m,ln2:m,log10:m,log2:m,max:m,min:m,pi:m,round:m,sin:m,sqrt:m,tan:m,zoom:le,"heatmap-density":null,"has-id":zt,none:Ot};class P{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,D);return new P(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return P.convertComparison(e,t[1],t[2]);case"in":return P.convertIn(t[1],t.slice(2));case"!in":return P.negate(P.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return P.convertCombining(e,t.slice(1));case"has":return P.convertHas(t[1]);case"!has":return P.negate(P.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Tt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&_e[e[0]]){const a={number:w,color:Y,string:S,boolean:D,enum:S};try{const o=t.type==="array"?ht(a[t.value]||C,t.length):a[t.type],s=y(e,null,o);this.getValue=this._buildExpression(s,t),this.isDataDriven=!0,s instanceof k&&s.input instanceof le&&(this.interpolator=s)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const i=e?.stops&&e.stops.length>0;if(i)for(const a of e.stops)a[1]=this._validate(a[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),i)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else i?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Tt._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=Pt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,i)=>{try{const a=t.evaluate(i,r);return a===void 0?e.default:this._validate(a,e)}catch(a){return console.log(a.message),e.default}}}_buildIdentity(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a!==void 0&&(a=this._validate(a,e)),a??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a=this._categorical(a,t.stops),a!==void 0?a:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interval(a,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),typeof a=="number"?this._interpolate(a,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let i=0;ithis._create(e,r,i)).filter(e=>!!e),this.layers)for(let e=0;e=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t?.id)return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let i,a=!0;const o=this._layerByName[t.id];if(o){const s=this.layers.indexOf(o);e||(e=s),e===s?(a=!1,i=ot._recreateLayer(t,o),this.layers[e]=i,r.layers[e]=t):(this.layers.splice(s,1),r.layers.splice(s,1),i=this._create(t,e,this.layers),this.layers.splice(e,0,i),r.layers.splice(e,0,t))}else i=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(i),r.layers.push(t)):(this.layers.splice(e,0,i),r.layers.splice(e,0,t));this._layerByName[t.id]=i,this._uidToLayer.set(i.uid,i),a&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].paint=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},a=ot._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=a,this._style.layers[o].layout=e,this._layerByName[r.id]=a,this._uidToLayer.set(r.uid,a)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const i=r.layout||{};i.visibility=e;const a={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:i,paint:r.paint},o=ot._recreateLayer(a,r),s=this.layers.indexOf(r);this.layers[s]=o,this._style.layers[s].layout=i,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];return e?e.layout?.visibility??"visible":"none"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ra.keyo.key?1:0);const i=t.length;for(let a=0;ai.map(i=>d[i]); +import{_ as te}from"./main-BTdHgocv.js";import{bR as re,aB as ie,o as c,f as M,bS as se,K as ae,bT as oe,a7 as le,a1 as E,bG as ne,ag as k,X as pe,bU as D,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./story-DT1Ep1ux.js";import{m as fe}from"./Version-CoKzbupV-CGLbrkRD.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{I as G}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{C as ve}from"./QueryTask-CwHwH2rS-LNltUUKG.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{y as Le}from"./FeatureType-C9hJmS6_-zoljUYGr.js";import{y as xe}from"./Field-C6hA1tZj-aKnzhZ32.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import{p as _e}from"./Relationship-PyhUibYK-Dl9eU1qo.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-FWeI_AU8.js";import{y as qe}from"./utils-9sQxfkoa-CwJW9dca.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import{w as Re}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{c as je}from"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(re(ie)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=se(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=ae("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(oe(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(le(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return ne(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${pe(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await te(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-DV01qpqc.js");return{default:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const ut=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,yt as M,ut as k}; diff --git a/custom-toc-separator/assets/SublayersOwner-DfTaMJ5V-DEkAA9m8.js b/custom-toc-separator/assets/SublayersOwner-DfTaMJ5V-DEkAA9m8.js deleted file mode 100644 index f696a9a0..00000000 --- a/custom-toc-separator/assets/SublayersOwner-DfTaMJ5V-DEkAA9m8.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-gUIs0TS1.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./Layer-ChoECxvZ-DxWUU3pP.js","./workers-PiCjreoO-mU03Z-E4.js","./editsZScale-BDsX6vv--D74kwHO-.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); -import{_ as te}from"./main-lj2zzr_L.js";import{bR as re,aB as ie,o as c,f as M,bS as se,K as ae,bT as oe,a7 as le,a1 as E,bG as ne,ag as k,X as pe,bU as D,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./story-OUarUCIt.js";import{m as fe}from"./Version-CoKzbupV-5qCYzF4G.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{I as G}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{C as ve}from"./QueryTask-CwHwH2rS-Cdg8UCnQ.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{y as Le}from"./FeatureType-C9hJmS6_-BoBeHHAU.js";import{y as xe}from"./Field-C6hA1tZj-DY7R6puO.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import{p as _e}from"./Relationship-PyhUibYK-Jg399ifo.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-gUIs0TS1.js";import{y as qe}from"./utils-9sQxfkoa-Djr5L7DU.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import{w as Re}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{c as je}from"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(re(ie)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=se(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=ae("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(oe(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(le(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return ne(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${pe(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await te(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-_MOPDF8o.js");return{default:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const ut=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,yt as M,ut as k}; diff --git a/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-B8cBzyBr.js b/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-B8cBzyBr.js new file mode 100644 index 00000000..110655a2 --- /dev/null +++ b/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-B8cBzyBr.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DpexmTpL.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./utils-BVWK2jiA-inSV67A_.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./FeatureLayerSource-k4WMYop1-CO3-WMru.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./mat4-DX7gBViE-B27FdgMD.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./clientSideDefaults-BqqayPct-B1aankCm.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-LNltUUKG.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./executeForIds-Z1gkLduF-CKWTLnam.js","./query-DFW9-NG_-SSagAgRu.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./executeQueryPBF-o8010HS9-Bi7xykzy.js","./featureConversionUtils-D6hFQ4Af-C534NCdS.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./executeQueryJSON-CcHnccia-BAMZ5LEx.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./LRUCache-C3erQTWv-D3oKynNB.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./editsZScale-BDsX6vv--CJojmgz5.js"])))=>i.map(i=>d[i]); +import{_ as P}from"./main-BTdHgocv.js";import{ct as K,aa as V,bR as W,bT as D,P as v,dK as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,dL as de,jS as ye,hG as ce,jT as he,aB as me}from"./story-DT1Ep1ux.js";import{y as fe}from"./loadAll-e978YItg-EK1YwFYX.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as be}from"./Layer-ChoECxvZ-ocw70508.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as ve}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as we}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{C as Se}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as Te}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as Ke,e as We}from"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import{f as k}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{p as $}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{X as rt}from"./colorUtils-Cthpxcks-DXg8vX2o.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js";import{x as st,C as ot}from"./utils-DPtQ14k3-QfypPSGF.js";import{p as M}from"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{b as B}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as lt}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import{w as pt}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{a as ut}from"./versionUtils-LZYZz-38-esAtUime.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=K({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(W(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return D(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){D(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await P(()=>import("./featureLayerUtils-BlPdhYbm-DpexmTpL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(P(()=>import("./FeatureLayerSource-k4WMYop1-CO3-WMru.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return Ke(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return We(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Rr=p;export{Rr as default}; diff --git a/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-BCv27zTO.js b/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-BCv27zTO.js deleted file mode 100644 index 54886a85..00000000 --- a/custom-toc-separator/assets/SubtypeGroupLayer-D1vAbwEU-BCv27zTO.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-DxeKRxzI.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./utils-BVWK2jiA-Bnz0n_UG.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-DgukgleB.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./FeatureLayerSource-k4WMYop1-Czmqxz6U.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./mat4-DX7gBViE-d6nV0_rZ.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-BlkhMH5A.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./clientSideDefaults-BqqayPct-BCK_HM0i.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-Cdg8UCnQ.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./executeForIds-Z1gkLduF-BLtp2DWt.js","./query-DFW9-NG_-CLOB0soI.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./executeQueryPBF-o8010HS9-DA2vEqjE.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./executeQueryJSON-CcHnccia-C6q0seac.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./editsZScale-BDsX6vv--D74kwHO-.js"])))=>i.map(i=>d[i]); -import{_ as P}from"./main-lj2zzr_L.js";import{ct as K,aa as V,bR as W,bT as D,P as v,dK as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,dL as de,jS as ye,hG as ce,jT as he,aB as me}from"./story-OUarUCIt.js";import{y as fe}from"./loadAll-e978YItg-cyBswBq0.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as be}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as ve}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as we}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{C as Se}from"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as Te}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as Ke,e as We}from"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import{f as k}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{p as $}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{X as rt}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-CX4234se.js";import{x as st,C as ot}from"./utils-DPtQ14k3-DGbScRZv.js";import{p as M}from"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{b as B}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as lt}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import{w as pt}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{a as ut}from"./versionUtils-LZYZz-38-CcEiEhYk.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=K({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(W(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return D(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){D(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await P(()=>import("./featureLayerUtils-BlPdhYbm-DxeKRxzI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(P(()=>import("./FeatureLayerSource-k4WMYop1-Czmqxz6U.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return Ke(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return We(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Rr=p;export{Rr as default}; diff --git a/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-BGjNrWaa.js b/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-BGjNrWaa.js new file mode 100644 index 00000000..3762c9ea --- /dev/null +++ b/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-BGjNrWaa.js @@ -0,0 +1,7 @@ +import{v as s,i as d,ah as n,aL as u,K as l}from"./story-DT1Ep1ux.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-CoTmCoKm.js";import"./main-BTdHgocv.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./timeSupport-ohWmWReZ-CSAKuiyl.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./LayerView-Bish-E63-B3VRdVIM.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";import"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} + -> hasRenderer ${t} + -> hasPendingCommand ${r} + -> updatingRequiredFields ${o} + -> updatingProxy ${p} + -> updatingPipeline ${m} +`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const gt=i;export{gt as default}; diff --git a/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-CM05Li9N.js b/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-CM05Li9N.js deleted file mode 100644 index 054ded4d..00000000 --- a/custom-toc-separator/assets/SubtypeGroupLayerView2D-Byn0xzbb-CM05Li9N.js +++ /dev/null @@ -1,7 +0,0 @@ -import{v as s,i as d,ah as n,aL as u,K as l}from"./story-OUarUCIt.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-BgsGmz2w.js";import"./main-lj2zzr_L.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./LayerView-Bish-E63-DehQ-_Za.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";import"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} - -> hasRenderer ${t} - -> hasPendingCommand ${r} - -> updatingRequiredFields ${o} - -> updatingProxy ${p} - -> updatingPipeline ${m} -`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const gt=i;export{gt as default}; diff --git a/custom-toc-separator/assets/TablesMixin-C8RojhYs-R4uQiiTY.js b/custom-toc-separator/assets/TablesMixin-C8RojhYs-R4uQiiTY.js deleted file mode 100644 index 29b1cebb..00000000 --- a/custom-toc-separator/assets/TablesMixin-C8RojhYs-R4uQiiTY.js +++ /dev/null @@ -1 +0,0 @@ -import{f as c}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./story-OUarUCIt.js";import{D as b}from"./Layer-ChoECxvZ-DxWUU3pP.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; diff --git a/custom-toc-separator/assets/TablesMixin-C8RojhYs-Zkv0UFc1.js b/custom-toc-separator/assets/TablesMixin-C8RojhYs-Zkv0UFc1.js new file mode 100644 index 00000000..ac9f95a2 --- /dev/null +++ b/custom-toc-separator/assets/TablesMixin-C8RojhYs-Zkv0UFc1.js @@ -0,0 +1 @@ +import{f as c}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./story-DT1Ep1ux.js";import{D as b}from"./Layer-ChoECxvZ-ocw70508.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; diff --git a/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-0VdCfDO3.js b/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-0VdCfDO3.js new file mode 100644 index 00000000..c20bf581 --- /dev/null +++ b/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-0VdCfDO3.js @@ -0,0 +1 @@ +import{K as c,o as E,a1 as S}from"./story-DT1Ep1ux.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-D0v5nxXn.js";import{H as D,V as z}from"./Texture-BCt2hphT-B6HwLstV.js";import{h as P}from"./TileContainer-D48pXXgL-B6YzhmFG.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; diff --git a/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-DHC_8Pj6.js b/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-DHC_8Pj6.js deleted file mode 100644 index 8f3b0b00..00000000 --- a/custom-toc-separator/assets/TechniqueInstance-DGTKoOL6-DHC_8Pj6.js +++ /dev/null @@ -1 +0,0 @@ -import{K as c,o as E,a1 as S}from"./story-OUarUCIt.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-DeIeQX6y.js";import{H as D,V as z}from"./Texture-BCt2hphT-Bv29bzNX.js";import{h as P}from"./TileContainer-D48pXXgL-DF8HooMp.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; diff --git a/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-C3u5XocC.js b/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-C3u5XocC.js new file mode 100644 index 00000000..1c35782e --- /dev/null +++ b/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-C3u5XocC.js @@ -0,0 +1 @@ +import{aa as l,v as o,S as t,i as s,e as i}from"./story-DT1Ep1ux.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; diff --git a/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js b/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js deleted file mode 100644 index 067653de..00000000 --- a/custom-toc-separator/assets/TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as l,v as o,S as t,i as s,e as i}from"./story-OUarUCIt.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; diff --git a/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-B2VZ6x81.js b/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-B2VZ6x81.js new file mode 100644 index 00000000..ebae708e --- /dev/null +++ b/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-B2VZ6x81.js @@ -0,0 +1 @@ +import{v as t,S as i,a0 as a,i as l,dL as u}from"./story-DT1Ep1ux.js";import{s as d}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{r as m,w as y,v as w}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{k as x}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:y,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; diff --git a/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-DgT3hhJl.js b/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-DgT3hhJl.js deleted file mode 100644 index ff0b02d6..00000000 --- a/custom-toc-separator/assets/TemporalLayer-CpOrN_w9-DgT3hhJl.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as i,a0 as a,i as l,dL as u}from"./story-OUarUCIt.js";import{s as d}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{r as m,w as y,v as w}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{k as x}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:y,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; diff --git a/custom-toc-separator/assets/Texture-BCt2hphT-B6HwLstV.js b/custom-toc-separator/assets/Texture-BCt2hphT-B6HwLstV.js new file mode 100644 index 00000000..3fd5b4b8 --- /dev/null +++ b/custom-toc-separator/assets/Texture-BCt2hphT-B6HwLstV.js @@ -0,0 +1 @@ +import{K as $,o as p,a1 as Y}from"./story-DT1Ep1ux.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(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))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; diff --git a/custom-toc-separator/assets/Texture-BCt2hphT-Bv29bzNX.js b/custom-toc-separator/assets/Texture-BCt2hphT-Bv29bzNX.js deleted file mode 100644 index bd2d56c4..00000000 --- a/custom-toc-separator/assets/Texture-BCt2hphT-Bv29bzNX.js +++ /dev/null @@ -1 +0,0 @@ -import{K as $,o as p,a1 as Y}from"./story-OUarUCIt.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(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))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; diff --git a/custom-toc-separator/assets/Theme-rblUnB2V-Cwu0Sicn.js b/custom-toc-separator/assets/Theme-rblUnB2V-Cwu0Sicn.js new file mode 100644 index 00000000..68740dce --- /dev/null +++ b/custom-toc-separator/assets/Theme-rblUnB2V-Cwu0Sicn.js @@ -0,0 +1 @@ +import{k0 as tt}from"./story-DT1Ep1ux.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; diff --git a/custom-toc-separator/assets/Theme-rblUnB2V-DrMnmN3S.js b/custom-toc-separator/assets/Theme-rblUnB2V-DrMnmN3S.js deleted file mode 100644 index 2934c2cc..00000000 --- a/custom-toc-separator/assets/Theme-rblUnB2V-DrMnmN3S.js +++ /dev/null @@ -1 +0,0 @@ -import{k0 as tt}from"./story-OUarUCIt.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; diff --git a/custom-toc-separator/assets/Tick-DUHqbpyB-RP-X2t6b.js b/custom-toc-separator/assets/Tick-DUHqbpyB-RP-X2t6b.js new file mode 100644 index 00000000..5a03e7f6 --- /dev/null +++ b/custom-toc-separator/assets/Tick-DUHqbpyB-RP-X2t6b.js @@ -0,0 +1 @@ +import{k0 as O}from"./story-DT1Ep1ux.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-Cwu0Sicn.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; diff --git a/custom-toc-separator/assets/Tick-DUHqbpyB-iDoSp0SS.js b/custom-toc-separator/assets/Tick-DUHqbpyB-iDoSp0SS.js deleted file mode 100644 index 54de3c58..00000000 --- a/custom-toc-separator/assets/Tick-DUHqbpyB-iDoSp0SS.js +++ /dev/null @@ -1 +0,0 @@ -import{k0 as O}from"./story-OUarUCIt.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-DrMnmN3S.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; diff --git a/custom-toc-separator/assets/Tile-D75RMC64-DDmsm7e7.js b/custom-toc-separator/assets/Tile-D75RMC64-DDmsm7e7.js deleted file mode 100644 index 9773a80b..00000000 --- a/custom-toc-separator/assets/Tile-D75RMC64-DDmsm7e7.js +++ /dev/null @@ -1 +0,0 @@ -import{n as rt}from"./common-CYWrYyJl-E8-sukrT.js";import{dB as lt,v as b,S as F,i as at,aG as H,j as ht,aA as ct,an as ut,dC as ft,bh as D,n as mt,ba as dt,dD as pt}from"./story-OUarUCIt.js";import{s as L}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{f as gt,M as $}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{k as _t}from"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import{b as yt}from"./quickselect-DHTstthl-Ds_Aj0x5.js";import{a as xt}from"./Query-BrwMGK8U-gUIs0TS1.js";function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Mt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function wt(t,e,i,s,o,n,r){return t[0]=e,t[1]=i,t[2]=s,t[3]=o,t[4]=n,t[5]=r,t}function It(t,e){const i=e[0],s=e[1],o=e[2],n=e[3],r=e[4],l=e[5];let a=i*n-s*o;return a?(a=1/a,t[0]=n*a,t[1]=-s*a,t[2]=-o*a,t[3]=i*a,t[4]=(o*l-n*r)*a,t[5]=(s*r-i*l)*a,t):null}function St(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1],f=i[2],m=i[3],_=i[4],d=i[5];return t[0]=s*h+n*c,t[1]=o*h+r*c,t[2]=s*f+n*m,t[3]=o*f+r*m,t[4]=s*_+n*d+l,t[5]=o*_+r*d+a,t}function Bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=Math.sin(i),c=Math.cos(i);return t[0]=s*c+n*h,t[1]=o*c+r*h,t[2]=s*-h+n*c,t[3]=o*-h+r*c,t[4]=l,t[5]=a,t}function bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s*h,t[1]=o*h,t[2]=n*c,t[3]=r*c,t[4]=l,t[5]=a,t}function Tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s,t[1]=o,t[2]=n,t[3]=r,t[4]=s*h+n*c+l,t[5]=o*h+r*c+a,t}function Ct(t,e){const i=Math.sin(e),s=Math.cos(e);return t[0]=s,t[1]=i,t[2]=-i,t[3]=s,t[4]=0,t[5]=0,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function zt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Yt(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Xt(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function Pt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t}function et(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t}function kt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t}function Rt(t,e,i,s){return t[0]=e[0]+i[0]*s,t[1]=e[1]+i[1]*s,t[2]=e[2]+i[2]*s,t[3]=e[3]+i[3]*s,t[4]=e[4]+i[4]*s,t[5]=e[5]+i[5]*s,t}function Lt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function At(t,e){const i=t[0],s=t[1],o=t[2],n=t[3],r=t[4],l=t[5],a=e[0],h=e[1],c=e[2],f=e[3],m=e[4],_=e[5],d=rt();return Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=d*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-m)<=d*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(l-_)<=d*Math.max(1,Math.abs(l),Math.abs(_))}const Ot=tt,Vt=et;Object.freeze(Object.defineProperty({__proto__:null,add:Pt,copy:vt,determinant:St,equals:At,exactEquals:Lt,frob:Xt,fromRotation:Ct,fromScaling:Ft,fromTranslation:zt,identity:Mt,invert:It,mul:Ot,multiply:tt,multiplyScalar:kt,multiplyScalarAndAdd:Rt,rotate:Bt,scale:bt,set:wt,str:Yt,sub:Vt,subtract:et,translate:Tt},Symbol.toStringTag,{value:"Module"}));function qt(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function Et(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function jt(t,e,i,s,o,n){const r=new Float32Array(6);return r[0]=t,r[1]=e,r[2]=i,r[3]=s,r[4]=o,r[5]=n,r}function Nt(t,e){return new Float32Array(t,e,6)}function it(t,e,i,s){const o=e[s],n=e[s+1];t[s]=i[0]*o+i[2]*n+i[4],t[s+1]=i[1]*o+i[3]*n+i[5]}function Kt(t,e,i,s=0,o=0,n=2){const r=o||e.length/n;for(let l=s;l=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Dt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Wt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=D();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}W.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=D(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;s=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Dt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Wt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=D();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}W.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=D(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;st.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; diff --git a/custom-toc-separator/assets/TileContainer-D48pXXgL-DF8HooMp.js b/custom-toc-separator/assets/TileContainer-D48pXXgL-DF8HooMp.js deleted file mode 100644 index 8157e50a..00000000 --- a/custom-toc-separator/assets/TileContainer-D48pXXgL-DF8HooMp.js +++ /dev/null @@ -1 +0,0 @@ -import{K as i}from"./story-OUarUCIt.js";import{E as n}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{N as l,Z as a,r as o}from"./WGLContainer-LxgEo4I_-DR17gokR.js";const c=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; diff --git a/custom-toc-separator/assets/TileInfo-CWIRDhZl-561xzxdP.js b/custom-toc-separator/assets/TileInfo-CWIRDhZl-561xzxdP.js deleted file mode 100644 index 3ed7b454..00000000 --- a/custom-toc-separator/assets/TileInfo-CWIRDhZl-561xzxdP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,cZ as W,aC as F,b8 as A,bh as j}from"./story-OUarUCIt.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; diff --git a/custom-toc-separator/assets/TileInfo-CWIRDhZl-C54e75zw.js b/custom-toc-separator/assets/TileInfo-CWIRDhZl-C54e75zw.js new file mode 100644 index 00000000..f79329c0 --- /dev/null +++ b/custom-toc-separator/assets/TileInfo-CWIRDhZl-C54e75zw.js @@ -0,0 +1 @@ +import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,cZ as W,aC as F,b8 as A,bh as j}from"./story-DT1Ep1ux.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; diff --git a/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js b/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js new file mode 100644 index 00000000..767fbc68 --- /dev/null +++ b/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js @@ -0,0 +1 @@ +import{c_ as n,o as h,aU as r}from"./story-DT1Ep1ux.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; diff --git a/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-NBsOGvA0.js b/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-NBsOGvA0.js deleted file mode 100644 index 270c9c5c..00000000 --- a/custom-toc-separator/assets/TileInfoTilemapCache-D1SExPij-NBsOGvA0.js +++ /dev/null @@ -1 +0,0 @@ -import{c_ as n,o as h,aU as r}from"./story-OUarUCIt.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; diff --git a/custom-toc-separator/assets/TileKey-C5IL-JBr-Cy7bNm0k.js b/custom-toc-separator/assets/TileKey-C5IL-JBr-Cy7bNm0k.js deleted file mode 100644 index f7635ede..00000000 --- a/custom-toc-separator/assets/TileKey-C5IL-JBr-Cy7bNm0k.js +++ /dev/null @@ -1 +0,0 @@ -import{dB as c}from"./story-OUarUCIt.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; diff --git a/custom-toc-separator/assets/TileKey-C5IL-JBr-Do29X9ef.js b/custom-toc-separator/assets/TileKey-C5IL-JBr-Do29X9ef.js new file mode 100644 index 00000000..cb1a290d --- /dev/null +++ b/custom-toc-separator/assets/TileKey-C5IL-JBr-Do29X9ef.js @@ -0,0 +1 @@ +import{dB as c}from"./story-DT1Ep1ux.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; diff --git a/custom-toc-separator/assets/TileLayer-Be5tWeN5-B-Oi14XY.js b/custom-toc-separator/assets/TileLayer-Be5tWeN5-B-Oi14XY.js deleted file mode 100644 index 4e39f25c..00000000 --- a/custom-toc-separator/assets/TileLayer-Be5tWeN5-B-Oi14XY.js +++ /dev/null @@ -1 +0,0 @@ -import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./story-OUarUCIt.js";import{y as W}from"./loadAll-e978YItg-cyBswBq0.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as L}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-CD3MqLHR.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-DEkAA9m8.js";import{a as C}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as D}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as N}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as I}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{Z as V}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{u as y}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js";import"./TilemapCache-CRRxws77-Buzexpoq.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./QueryTask-CwHwH2rS-Cdg8UCnQ.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./executeForIds-Z1gkLduF-BLtp2DWt.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./executeQueryJSON-CcHnccia-C6q0seac.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";var d;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Wr=i;export{Wr as default}; diff --git a/custom-toc-separator/assets/TileLayer-Be5tWeN5-NuBFIOK0.js b/custom-toc-separator/assets/TileLayer-Be5tWeN5-NuBFIOK0.js new file mode 100644 index 00000000..3fc6c737 --- /dev/null +++ b/custom-toc-separator/assets/TileLayer-Be5tWeN5-NuBFIOK0.js @@ -0,0 +1 @@ +import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./story-DT1Ep1ux.js";import{y as W}from"./loadAll-e978YItg-EK1YwFYX.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as L}from"./Layer-ChoECxvZ-ocw70508.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-BFUuSyiK.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-BYFVn9A8.js";import{a as C}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as D}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as N}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as I}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{Z as V}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{u as y}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js";import"./TilemapCache-CRRxws77-CQyTs6St.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./QueryTask-CwHwH2rS-LNltUUKG.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./executeForIds-Z1gkLduF-CKWTLnam.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";var d;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Wr=i;export{Wr as default}; diff --git a/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-Bld-zHRh.js b/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-Bld-zHRh.js new file mode 100644 index 00000000..8f616fba --- /dev/null +++ b/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-Bld-zHRh.js @@ -0,0 +1 @@ +import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./story-DT1Ep1ux.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-DlEO67jH.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-DEpR3hKq.js";import{X as U,Y as q}from"./LayerView-Bish-E63-B3VRdVIM.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-BMVHv0vO.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-XRkD8ADC.js";import{s as d}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-DuRcnjsf.js";import{x as k}from"./drapedUtils-BZ1SGPtE-Da6Q2jMK.js";import{i as z}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./main-BTdHgocv.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./TurboLine-CIlsAy5m-BHDUzrZk.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./languageUtils-BYxF9hRA-5dy33zDL.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-CIwWTPAs.js";import"./popupUtils-nV1O8RUO-BOsTLw9-.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const pe=h;export{pe as default}; diff --git a/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-D6qmdXwB.js b/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-D6qmdXwB.js deleted file mode 100644 index d5c848d2..00000000 --- a/custom-toc-separator/assets/TileLayerView2D-CT-Yu10P-D6qmdXwB.js +++ /dev/null @@ -1 +0,0 @@ -import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./story-OUarUCIt.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-C70OrCUT.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-CYao57HT.js";import{X as U,Y as q}from"./LayerView-Bish-E63-DehQ-_Za.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-D6UZL3gv.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-DDmsm7e7.js";import{s as d}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-BvBuLg8b.js";import{x as k}from"./drapedUtils-BZ1SGPtE-2iUYAy9z.js";import{i as z}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./main-lj2zzr_L.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./TurboLine-CIlsAy5m-BIV61-kY.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./Bitmap-CcqmzvfR-BO796kOM.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./scaleUtils-DxsfQwK1-rzzukPSH.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-CJNrSXfS.js";import"./popupUtils-nV1O8RUO-911d_F5-.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const pe=h;export{pe as default}; diff --git a/custom-toc-separator/assets/TilemapCache-CRRxws77-Buzexpoq.js b/custom-toc-separator/assets/TilemapCache-CRRxws77-Buzexpoq.js deleted file mode 100644 index 4999ca48..00000000 --- a/custom-toc-separator/assets/TilemapCache-CRRxws77-Buzexpoq.js +++ /dev/null @@ -1 +0,0 @@ -import{c$ as T,v as d,S as y,j as z,f as D,ah as S,aL as q,aU as _,d0 as L,x,o as u,E as P,X as I,i as M,P as U,d1 as C,a2 as j,aS as k,d2 as E}from"./story-OUarUCIt.js";import{G as R}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as F}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function J(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){N(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=J(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function $(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function N(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function A(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=D,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new F(2*R.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject(A(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw A(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=$(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=$(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; diff --git a/custom-toc-separator/assets/TilemapCache-CRRxws77-CQyTs6St.js b/custom-toc-separator/assets/TilemapCache-CRRxws77-CQyTs6St.js new file mode 100644 index 00000000..91c09801 --- /dev/null +++ b/custom-toc-separator/assets/TilemapCache-CRRxws77-CQyTs6St.js @@ -0,0 +1 @@ +import{c$ as T,v as d,S as y,j as z,f as D,ah as S,aL as q,aU as _,d0 as L,x,o as u,E as P,X as I,i as M,P as U,d1 as C,a2 as j,aS as k,d2 as E}from"./story-DT1Ep1ux.js";import{G as R}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as F}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function J(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){N(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=J(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function $(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function N(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function A(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=D,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new F(2*R.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject(A(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw A(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=$(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=$(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; diff --git a/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BFc609ot.js b/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BFc609ot.js new file mode 100644 index 00000000..751506b6 --- /dev/null +++ b/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BFc609ot.js @@ -0,0 +1 @@ +import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,c7 as g,cu as D,F as E}from"./story-DT1Ep1ux.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; diff --git a/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BYNqT7sE.js b/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BYNqT7sE.js deleted file mode 100644 index 75578911..00000000 --- a/custom-toc-separator/assets/TimeExtent-Cn0Jofqr-BYNqT7sE.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,c7 as g,cu as D,F as E}from"./story-OUarUCIt.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; diff --git a/custom-toc-separator/assets/TimeInfo-w_HB2CsF-CygrHAJu.js b/custom-toc-separator/assets/TimeInfo-w_HB2CsF-CygrHAJu.js new file mode 100644 index 00000000..75b331eb --- /dev/null +++ b/custom-toc-separator/assets/TimeInfo-w_HB2CsF-CygrHAJu.js @@ -0,0 +1 @@ +import{cr as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./story-DT1Ep1ux.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; diff --git a/custom-toc-separator/assets/TimeInfo-w_HB2CsF-DPmXTSB9.js b/custom-toc-separator/assets/TimeInfo-w_HB2CsF-DPmXTSB9.js deleted file mode 100644 index 45ad44f3..00000000 --- a/custom-toc-separator/assets/TimeInfo-w_HB2CsF-DPmXTSB9.js +++ /dev/null @@ -1 +0,0 @@ -import{cr as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./story-OUarUCIt.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; diff --git a/custom-toc-separator/assets/TimeOnly-DSMefxKy-52VbaSQ6.js b/custom-toc-separator/assets/TimeOnly-DSMefxKy-52VbaSQ6.js new file mode 100644 index 00000000..9cada329 --- /dev/null +++ b/custom-toc-separator/assets/TimeOnly-DSMefxKy-52VbaSQ6.js @@ -0,0 +1 @@ +import{F as a,c5 as M,b_ as g,c7 as Z,h as U,c2 as q,n as b}from"./story-DT1Ep1ux.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; diff --git a/custom-toc-separator/assets/TimeOnly-DSMefxKy-C9JclgbM.js b/custom-toc-separator/assets/TimeOnly-DSMefxKy-C9JclgbM.js deleted file mode 100644 index 3cb5b328..00000000 --- a/custom-toc-separator/assets/TimeOnly-DSMefxKy-C9JclgbM.js +++ /dev/null @@ -1 +0,0 @@ -import{F as a,c5 as M,b_ as g,c7 as Z,h as U,c2 as q,n as b}from"./story-OUarUCIt.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; diff --git a/custom-toc-separator/assets/Tooltip-B0HefZ7r-BDGW0IFP.js b/custom-toc-separator/assets/Tooltip-B0HefZ7r-BDGW0IFP.js deleted file mode 100644 index d9559177..00000000 --- a/custom-toc-separator/assets/Tooltip-B0HefZ7r-BDGW0IFP.js +++ /dev/null @@ -1 +0,0 @@ -import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-DrMnmN3S.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; diff --git a/custom-toc-separator/assets/Tooltip-B0HefZ7r-CIb4Q87H.js b/custom-toc-separator/assets/Tooltip-B0HefZ7r-CIb4Q87H.js new file mode 100644 index 00000000..298d7836 --- /dev/null +++ b/custom-toc-separator/assets/Tooltip-B0HefZ7r-CIb4Q87H.js @@ -0,0 +1 @@ +import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-Cwu0Sicn.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; diff --git a/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js b/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js new file mode 100644 index 00000000..f2c5372e --- /dev/null +++ b/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js @@ -0,0 +1 @@ +import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./story-DT1Ep1ux.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./main-BTdHgocv.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const b=t;export{b as default}; diff --git a/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js b/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js deleted file mode 100644 index 6977e908..00000000 --- a/custom-toc-separator/assets/TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./story-OUarUCIt.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./main-lj2zzr_L.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const b=t;export{b as default}; diff --git a/custom-toc-separator/assets/TurboLine-CIlsAy5m-BHDUzrZk.js b/custom-toc-separator/assets/TurboLine-CIlsAy5m-BHDUzrZk.js new file mode 100644 index 00000000..98b0ef8d --- /dev/null +++ b/custom-toc-separator/assets/TurboLine-CIlsAy5m-BHDUzrZk.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./libtess-asm-CEhQARv_-C8K5Bmv1.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./libtess-DHRgJTgB-4cw3_oA4.js"])))=>i.map(i=>d[i]); +import{_ as wt}from"./main-BTdHgocv.js";import{K as bt,bw as pt}from"./story-DT1Ep1ux.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function It(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(r=>r.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(r=>r.l)).default({locateFile:r=>pt(`esri/core/libs/libtess/${r}`)})}function Pt(r,i){const x=Math.max(r.length,Mt);return gt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function kt(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let f=1;ff){W=!0;const t=(f-E)/T;T=f-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,v,v,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,v,-v,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,v,v,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,v,-v,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,x){const f=i[0],E=i[i.length-1],W=Vt(f,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=vt(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=vt(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=vt(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(v){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=xt,V=st}else m=st,V=xt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?ft(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(v){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=xt,V=st}else m=st,V=xt;const K=s?ft(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=ft(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=v?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=v?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,rt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),rt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),v?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,rt),this._writeTriangle(X,rt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=v?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{St as D,It as M,Pt as k}; diff --git a/custom-toc-separator/assets/TurboLine-CIlsAy5m-BIV61-kY.js b/custom-toc-separator/assets/TurboLine-CIlsAy5m-BIV61-kY.js deleted file mode 100644 index 4196a7a7..00000000 --- a/custom-toc-separator/assets/TurboLine-CIlsAy5m-BIV61-kY.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./libtess-asm-CEhQARv_-C8K5Bmv1.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./libtess-DHRgJTgB-4cw3_oA4.js"])))=>i.map(i=>d[i]); -import{_ as wt}from"./main-lj2zzr_L.js";import{K as bt,bw as pt}from"./story-OUarUCIt.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function It(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(r=>r.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(r=>r.l)).default({locateFile:r=>pt(`esri/core/libs/libtess/${r}`)})}function Pt(r,i){const x=Math.max(r.length,Mt);return gt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function kt(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let f=1;ff){W=!0;const t=(f-E)/T;T=f-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,v,v,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,v,-v,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,v,v,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,v,-v,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,x){const f=i[0],E=i[i.length-1],W=Vt(f,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=vt(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=vt(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=vt(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(v){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=xt,V=st}else m=st,V=xt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?ft(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(v){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=xt,V=st}else m=st,V=xt;const K=s?ft(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=ft(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=v?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=v?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,rt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),rt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),v?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,rt),this._writeTriangle(X,rt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=v?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{St as D,It as M,Pt as k}; diff --git a/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-BruVICcm.js b/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-BruVICcm.js deleted file mode 100644 index 2d0653e6..00000000 --- a/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-BruVICcm.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as l,i as h,aK as x,ad as U,a0 as I,bB as et,aa as be,e as g,ac as H,dN as tt,dO as St,dP as me,dQ as Ae,ct as xt,dR as st,dS as It,dM as le,dT as _t,bG as it,a1 as V,dU as Ce,dV as lt,P as f,dW as fe,d7 as Re,dX as T,bz as rt,aq as zt,o as at,r as xe,a4 as jt,dY as Ft,dZ as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./story-OUarUCIt.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-D0XKNTvx.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import{g as Rt}from"./styleUtils-BtpNqZyT-BHhk4mUO.js";var Ie;let Q=Ie=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Ie({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Ie=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],Q);var _e;let O=_e=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new _e({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=_e=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var ze;let A=ze=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new ze({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=ze=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([I("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let K=class extends g{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};s([l({type:Zt,json:{write:!0}})],K.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],K.prototype,"type",void 0),K=s([h("esri.renderers.Renderer")],K);const ot=K;function Wt(e){return e.match(Qt)?.[1]?.replace(/\\'/g,"'")??null}const Qt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([I("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Kt=F;var ke;let D=ke=class extends se{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Kt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Qe(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Ke(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Qe(e)}readMaxSize(e,t,i){return Ke(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Qe(e)}readMinSize(e,t,i){return Ke(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([I("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([I("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([I("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([I("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e?.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([I("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:It,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:_t,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const _=b.createSyntaxTree(y);c=b.createFunction(_),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(zt).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:_,description:C}=c,[P,J,Z]=y?_?.toString()?.split(a||"")||[]:[_],z=[];return(t||u)&&z.push(P),i&&z.push(J),r&&z.push(Z),{symbol:b,label:w,values:[z],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?j().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let i=0;ie+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:_,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:z,value3:wt}=J,ie=[Z];i&&ie.push(z),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:_,value:Vt,description:P}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:_,value:C,description:P}=b,[J,Z,z]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:_,description:P,values:[new L({value:J,value2:Z,value3:z})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([I("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([I("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; diff --git a/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js b/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js new file mode 100644 index 00000000..93dfc4bf --- /dev/null +++ b/custom-toc-separator/assets/UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js @@ -0,0 +1 @@ +import{v as s,S as l,i as h,aK as x,ad as U,a0 as I,bB as et,aa as be,e as g,ac as H,dN as tt,dO as St,dP as me,dQ as Ae,ct as xt,dR as st,dS as It,dM as le,dT as _t,bG as it,a1 as V,dU as Ce,dV as lt,P as f,dW as fe,d7 as Re,dX as T,bz as rt,aq as zt,o as at,r as xe,a4 as jt,dY as Ft,dZ as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./story-DT1Ep1ux.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-Yy2GlotV.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import{g as Rt}from"./styleUtils-BtpNqZyT-DM-kTnEs.js";var Ie;let Q=Ie=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Ie({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Ie=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],Q);var _e;let O=_e=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new _e({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=_e=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var ze;let A=ze=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new ze({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=ze=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([I("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let K=class extends g{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};s([l({type:Zt,json:{write:!0}})],K.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],K.prototype,"type",void 0),K=s([h("esri.renderers.Renderer")],K);const ot=K;function Wt(e){return e.match(Qt)?.[1]?.replace(/\\'/g,"'")??null}const Qt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([I("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Kt=F;var ke;let D=ke=class extends se{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Kt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Qe(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Ke(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Qe(e)}readMaxSize(e,t,i){return Ke(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Qe(e)}readMinSize(e,t,i){return Ke(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([I("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([I("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([I("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([I("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e?.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([I("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:It,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:_t,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const _=b.createSyntaxTree(y);c=b.createFunction(_),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(zt).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:_,description:C}=c,[P,J,Z]=y?_?.toString()?.split(a||"")||[]:[_],z=[];return(t||u)&&z.push(P),i&&z.push(J),r&&z.push(Z),{symbol:b,label:w,values:[z],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?j().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let i=0;ie+t.getAttributeHash(),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:_,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:z,value3:wt}=J,ie=[Z];i&&ie.push(z),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:_,value:Vt,description:P}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:_,value:C,description:P}=b,[J,Z,z]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:_,description:P,values:[new L({value:J,value2:Z,value3:z})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([I("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([I("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; diff --git a/custom-toc-separator/assets/UnknownLayer-DwWK383_-BkjNaYrE.js b/custom-toc-separator/assets/UnknownLayer-DwWK383_-BkjNaYrE.js new file mode 100644 index 00000000..1664849b --- /dev/null +++ b/custom-toc-separator/assets/UnknownLayer-DwWK383_-BkjNaYrE.js @@ -0,0 +1 @@ +import{aQ as p,v as t,S as s,i as a,o as l}from"./story-DT1Ep1ux.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as m}from"./Layer-ChoECxvZ-ocw70508.js";import{C as u}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const P=e;export{P as default}; diff --git a/custom-toc-separator/assets/UnknownLayer-DwWK383_-CSQMJeuE.js b/custom-toc-separator/assets/UnknownLayer-DwWK383_-CSQMJeuE.js deleted file mode 100644 index a1b05671..00000000 --- a/custom-toc-separator/assets/UnknownLayer-DwWK383_-CSQMJeuE.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as p,v as t,S as s,i as a,o as l}from"./story-OUarUCIt.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as m}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{C as u}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const P=e;export{P as default}; diff --git a/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BFI0PL8S.js b/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BFI0PL8S.js new file mode 100644 index 00000000..1ad8ea45 --- /dev/null +++ b/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BFI0PL8S.js @@ -0,0 +1 @@ +import{c7 as o,c5 as c}from"./story-DT1Ep1ux.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; diff --git a/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BlA07cjv.js b/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BlA07cjv.js deleted file mode 100644 index 504d7f2b..00000000 --- a/custom-toc-separator/assets/UnknownTimeZone-C--TOcPG-BlA07cjv.js +++ /dev/null @@ -1 +0,0 @@ -import{c7 as o,c5 as c}from"./story-OUarUCIt.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; diff --git a/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-BMYpECe1.js b/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-BMYpECe1.js new file mode 100644 index 00000000..54786b60 --- /dev/null +++ b/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-BMYpECe1.js @@ -0,0 +1 @@ +import{aQ as n,v as o,S as i,i as l,o as a}from"./story-DT1Ep1ux.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as u}from"./Layer-ChoECxvZ-ocw70508.js";import{C as y}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const j=t;export{j as default}; diff --git a/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-CmEV-4Pa.js b/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-CmEV-4Pa.js deleted file mode 100644 index fb94c753..00000000 --- a/custom-toc-separator/assets/UnsupportedLayer-CCUtmZ2i-CmEV-4Pa.js +++ /dev/null @@ -1 +0,0 @@ -import{aQ as n,v as o,S as i,i as l,o as a}from"./story-OUarUCIt.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as u}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{C as y}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const j=t;export{j as default}; diff --git a/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js b/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js deleted file mode 100644 index b5d36b48..00000000 --- a/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js +++ /dev/null @@ -1,62 +0,0 @@ -import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,eE as un,K as li,j as Go,ah as Vo,cf as Ho,ca as rt,cb as gt,eQ as ht,bh as Qt,g_ as lr,cc as Ds,es as bt,et as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,c9 as ki,l as Xo,dB as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./story-OUarUCIt.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-BNEY6jgo.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-DDmsm7e7.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-DeIeQX6y.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let n,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+i,n[6]=this.x+s,n[7]=this.y+i;const r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} -${s.join(` -`)} -${h} -${l.join(` -`)} -${o.join(` -`)} -${i.join(` -`)} -${n.join(` -`)} -${a.join(` -`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r)=>{for(let o=0;o{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r,o)=>{for(let a=0;ae.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},gl=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},tn=class extends no{constructor(){super(...arguments),this.uniforms=new _l,this.code=new gl,this.constants=new oo}get builder(){return this}},yl=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},xl=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ia(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((s,i)=>t.push(e==="vertex"?`out ${s} ${i};`:`in ${s} ${i};`)),t}},Ni=class $i{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const s=t==="vertex"?$i.ALLOWLIST_VERTEX:$i.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>s.includes(i)).map(i=>`#extension ${i} : enable`)}};Ni.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],Ni.ALLOWLIST_VERTEX=[];let oo=class E{constructor(){this._entries=new Set}add(t,s,i){let n="ERROR_CONSTRUCTOR_STRING";switch(s){case"float":n=E._numberToFloatStr(i);break;case"int":n=E._numberToIntStr(i);break;case"bool":n=i.toString();break;case"vec2":n=`vec2(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])})`;break;case"vec3":n=`vec3(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])})`;break;case"vec4":n=`vec4(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])}, ${E._numberToFloatStr(i[3])})`;break;case"ivec2":n=`ivec2(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])})`;break;case"ivec3":n=`ivec3(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])})`;break;case"ivec4":n=`ivec4(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])}, ${E._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${s}(${Array.prototype.map.call(i,r=>E._numberToFloatStr(r)).join(", ")})`}return this._entries.add(`const ${s} ${t} = ${n};`),this}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};function bl(){return`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp sampler2D; -#else - precision mediump float; - precision mediump sampler2D; -#endif -`}const Pl=`precision highp float; -precision highp sampler2D;`;function wl(e){return e.split(" ").map((t,s)=>s>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function vl(e,t){const s=[];for(s.push(t);s.length;){const i=s.pop();if(typeof i=="object"&&!e.has(i.uid)){e.add(i.uid);for(const n of i.children)s.push(n)}}}let ee=class Ri{constructor(){this.uid=Ri.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(t){return t=wl(t),this._debugName=t,this.isImplicit&&this.children[0]instanceof Ri&&this.children[0].setDebugName(t),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}};function v(e){return typeof e=="object"?e.clone():e}ee.NodeCount=0;let D=class extends ee{constructor(){super(...arguments),this.shaderType="primitive-node"}},Sl=class ao extends ee{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new ao(v(this.child));return this.cloneInto(t),t}},Ml=class ho extends ee{constructor(t,s,i){super(),this.property=t,this.target=s,this.returnType=i,this.shaderType="property-access-node"}get children(){const t=[this.target];return typeof this.property!="string"&&t.push(this.property),t}clone(){const t=new ho(this.property,v(this.target),this.returnType);return this.cloneInto(t),t}},Cl=class lo extends ee{constructor(t,s,i){super(),this.condition=t,this.ifTrue=s,this.ifFalse=i,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=v(this.ifTrue),s=this.ifFalse?v(this.ifFalse):null,i=new lo(this.condition,t,s);return this.cloneInto(i),i}},Il=class co extends ee{constructor(t,s,i,n){super(),this.captureList=t,this.returnType=s,this.generator=n,this.shaderType="block-node",i&&(this.subgraph=new Sl(i))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const i in this.captureList)t[i]=v(this.captureList[i]);const s=new co(t,this.returnType,this.subgraph?v(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(s),s}},jt=class uo extends ee{constructor(t,s,i,n,r,o=!1){super(),this.token=t,this._children=s,this.isInfix=i,this.isPropertyAccess=n,this.returnType=r,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new uo(this.token,this._children.map(v),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}};var ss,Di,Gi,Vi,Hi,Bi,Xi,Ui,Yi,Wi,qi,Ki,ji,Ji;function kl(e){const t=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const s of t)if(s.includes(e))return s.map(i=>Al[i]);throw new Error("Unable to find type family")}function po(e){return new Proxy(e,{get(t,s){if(s==="constructor")return new Proxy(t.constructor,{construct:(i,n,r)=>po(new i(...n))});if(s in t)return t[s];if(typeof s=="string"){const i=kl(e.type);return tt(e,s,i[s.length-1])}}})}function st(e){return new Proxy(e,{construct:(t,s,i)=>po(new t(...s))})}function Tl(e){return new Proxy(e,{get(t,s){if(s in t)return t[s];if(typeof s=="string"){const i=parseInt(s,10);if(!isNaN(i))return tt(e,`[${i}]`,e.elementType.constructor)}}})}function zl(e){return new Proxy(e,{construct:(t,s,i)=>Tl(new t(...s))})}let Zi=class extends Error{},ct=ss=class extends D{constructor(e,t){super(),this.elementType=e,this.size=t,this.children=[],this.type="array"}clone(){const e=new ss(this.elementType,this.size);return super.cloneInto(e),e}get(e){if(typeof e=="number"){const t=new Gt(e);return t.isImplicit=!0,tt(this,t,this.elementType.constructor)}return tt(this,e,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(e,t,s){return Fl(this,e,t,s)}glslFindIndex(e,t,s){return Nl(this,e,t,s)}static ofType(e,t){const s={construct:(i,n)=>new ss(new e,t)};return new Proxy(ss,s)}};ct.type="array",ct=ss=g([zl],ct);let mt=class fo extends D{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const t=new fo;return t.children=this.children.map(v),super.cloneInto(t),t}};mt.type="sampler2D";let x=class he extends D{constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new he(v(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ot(this,typeof t=="number"?G(t,he):t)}divide(t){return _s(this,typeof t=="number"?G(t,he):t)}add(t){return xe(this,typeof t=="number"?G(t,he):t)}subtract(t){return gs(this,typeof t=="number"?G(t,he):t)}};x.type="float";let T=Di=class extends D{constructor(e,t){super(),this.type="vec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Di(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){throw new Zi}get 3(){throw new Zi}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};T.type="vec2",T=Di=g([st],T);let H=Gi=class extends D{constructor(e,t,s){super(),this.type="vec3",this.children=[e,t,s].filter(i=>i!=null)}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){throw new Zi}clone(){const e=new Gi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};H.type="vec3",H=Gi=g([st],H);let A=Vi=class extends D{constructor(e,t,s,i){super(),this.type="vec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Vi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){return tt(this,"[3]",x)}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};A.type="vec4",A=Vi=g([st],A);let Xs=Hi=class extends D{constructor(e){super(),this.type="uint",this.children=[e]}clone(){const e=new Hi(v(this.children[0]));return super.cloneInto(e),e}};Xs.type="uint",Xs=Hi=g([st],Xs);let Us=Bi=class extends D{constructor(e,t){super(),this.type="uvec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Bi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Us.type="uvec2",Us=Bi=g([st],Us);let Ys=Xi=class extends D{constructor(e,t,s){super(),this.type="uvec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new Xi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Ys.type="uvec3",Ys=Xi=g([st],Ys);let Ws=Ui=class extends D{constructor(e,t,s,i){super(),this.type="uvec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ui(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Ws.type="uvec4",Ws=Ui=g([st],Ws);class j extends D{constructor(t){super(),this.type="bool",this.children=[t]}and(t){return tr(this,t)}or(t){return go(this,t)}clone(){const t=new j(v(this.children[0]));return super.cloneInto(t),t}}j.type="bool";let qs=Yi=class extends D{constructor(e,t){super(),this.type="bvec2",this.children=[e,t].filter(s=>s!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Yi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};qs.type="bvec2",qs=Yi=g([st],qs);let Ks=Wi=class extends D{constructor(e,t,s){super(),this.type="bvec3",this.children=[e,t,s].filter(i=>i!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Wi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};function G(e,t){return typeof e=="number"?new t(e):e}Ks.type="bvec3",Ks=Wi=g([st],Ks);let js=qi=class extends D{constructor(e,t,s,i){super(),this.type="bvec4",this.children=[e,t,s,i].filter(n=>n!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new qi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};js.type="bvec4",js=qi=g([st],js);let Gt=class le extends D{constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ot(this,G(t,le))}add(t){return xe(this,G(t,le))}subtract(t){return gs(this,G(t,le))}divide(t){return _s(this,G(t,le))}clone(){const t=new le(v(this.children[0]));return super.cloneInto(t),t}};Gt.type="int";let Js=Ki=class extends D{constructor(e,t){super(),this.type="ivec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Ki(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Js.type="ivec2",Js=Ki=g([st],Js);let Zs=ji=class extends D{constructor(e,t,s){super(),this.type="ivec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new ji(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Zs.type="ivec3",Zs=ji=g([st],Zs);let Qs=Ji=class extends D{constructor(e,t,s,i){super(),this.type="ivec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ji(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Qs.type="ivec4",Qs=Ji=g([st],Qs);let Ll=class mo extends D{constructor(t,s,i,n){super(),this.type="mat2",this.children=[t,s,i,n]}clone(){const t=new mo(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(t),t}multiply(t){return Ot(this,t)}};Ll.type="mat2";let xt=class ti extends D{static identity(){return new ti(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const s=Pr(t),i=yo(t);return new ti(i,s,0,ni(s),i,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l){super(),this.type="mat3",this.children=[t,s,i,n,r,o,a,h,l]}add(t){return xe(this,t)}multiply(t){return Ot(this,t)}clone(){const t=new ti(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]));return super.cloneInto(t),t}};xt.type="mat3";class ns extends D{static identity(){return new ns(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_){super(),this.type="mat4",this.children=[t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_]}static fromColumns(t,s,i,n){return new ns(t.x,t.y,t.z,t.w,s.x,s.y,s.z,s.w,i.x,i.y,i.z,i.w,n.x,n.y,n.z,n.w)}multiply(t){return Ot(this,t)}clone(){const t=new ns(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]),v(this.children[9]),v(this.children[10]),v(this.children[11]),v(this.children[12]),v(this.children[13]),v(this.children[14]),v(this.children[15]));return super.cloneInto(t),t}}ns.type="mat4";const Al={float:x,vec2:T,vec3:H,vec4:A,int:Gt,ivec2:Js,ivec3:Zs,ivec4:Qs,uint:Xs,uvec2:Us,uvec3:Ys,uvec4:Ws,bool:j,bvec2:qs,bvec3:Ks,bvec4:js},ne=(...e)=>new Gt(...e),F=(...e)=>new x(...e),Qi=(...e)=>new T(...e),Ol=(...e)=>new H(...e),El=(...e)=>new A(...e),en=(...e)=>new xt(...e);function tt(e,t,s){const i=new s(new Ml(t,e,s));return i.isImplicit=!0,i}function J(e,t,s,i=null){if(i){const r=new i,o=new i(new jt(e,[t,s],!0,!1,r));return o.isImplicit=!0,o}if(t.type==="float"||t.type==="int"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}if((t.type==="mat2"||t.type==="mat3"||t.type==="mat4")&&s.type!=="float"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}const n=new t.constructor(new jt(e,[t,s],!0,!1,t.constructor));return n.isImplicit=!0,n}function q(e,t,s=t.constructor){const i=new s(new jt(e,[t],!1,!1,s));return i.isImplicit=!0,i}function At(e,t,s,i=t.constructor){const n=new i(new jt(e,[t,s],!1,!1,i));return n.isImplicit=!0,n}function mr(e,t,s,i,n=t.constructor){const r=new n(new jt(e,[t,s,i],!1,!1,n));return r.isImplicit=!0,r}function ni(e){return Ot(e,F(-1))}function _o(e,t,s,i){return new t(new Il(e,t,s,i))}function Fl(e,t,s=0,i=e.size){const n=new Gt(s).setMutable().setDebugName("FindIndexIterator"),r=t(e.get(n)).setDebugName("FindIndexPredicate");return _o({iter:n},Gt,r,({out:o,iter:a,subgraph:h})=>` -${o} = -1; - -for (; ${a} < ${i}; ${a}++) { - -${h.body} - - if (${h.varName}) { - ${o} = ${a}; - break; - } - -} -`).setDebugName("FindIndexBlock")}function Nl(e,t,s=0,i=e.size){return _o({array:e},Gt,null,({out:n,array:r})=>` -${n} = -1; -for (int i = ${s}; i < ${i}; i++) { - bool condition; - ${t({array:r,i:"i",out:"condition"})} - if (condition) { - ${n} = i; - break; - } -} -`).setDebugName("GlslFindIndexBlock")}function B(e,t,s){const i=typeof t=="function"?t():t,n=typeof s=="function"?s():s,r=new i.constructor(new Cl(e,i,n));return r.isImplicit=!0,r}function ms(...e){const t=e.map(([a,h])=>typeof h=="function"?[a,h()]:[a,h]),s=t[0][1].constructor,i=t.findIndex(a=>a[0]===!0);if(i===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=t.slice(0,i),r=t[i][1],o=new s(n.reduceRight((a,h)=>B(h[0],h[1],a),r));return o.isImplicit=!0,o}function Ot(e,t){return J("*",e,t)}function _s(e,t){return J("/",e,t)}function xe(e,t){return J("+",e,t)}function gs(e,t){return J("-",e,t)}function uu(e,t){return J("%",e,t)}function pu(e,t){return J(">>",e,t)}function du(e,t){return J("&",e,t)}function _r(e,t){return J("==",e,t,j)}function $l(e,t){return J("<",e,t,j)}function mi(e,t){return J("<=",e,t,j)}function et(e,t){return J(">",e,t,j)}function _i(e,t){return J(">=",e,t,j)}function go(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Rl(t,s),e[0])}function Rl(e,t){return J("||",e,t,j)}function tr(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Dl(t,s),e[0])}function Dl(e,t){return J("&&",e,t,j)}function Gl(e){return q("abs",e)}function gr(e){return q("all",e,j)}function yr(e){return q("any",e,j)}function fu(e,t){return t==null?q("atan",e):At("atan",e,t,e.constructor)}function Vl(e){return q("ceil",e)}function xr(e,t,s){return mr("clamp",e,t,s,e.constructor)}function yo(e){return q("cos",e)}function xo(e,t){return At("distance",e,t,x)}function br(e,t){return At("dot",e,t,x)}function Hl(e){return q("floor",e)}function bo(e){return q("fract",e)}function Po(e){return q("length",e,x)}function de(e,t){return At("max",e,t)}function er(e,t){return At("min",e,t)}function be(e,t,s){return mr("mix",e,t,s)}function Pe(e,t){return At("mod",e,t)}function Bl(e){return q("normalize",e)}function Xl(e){return e.type==="bool"?q("!",e):q("not",e)}function mu(e,t){return At("pow",e,t)}function _u(e){return q("round",e)}function Pr(e){return q("sin",e)}function gu(e,t,s){return mr("smoothstep",e,t,s)}function yu(e){return q("sqrt",e)}function Dt(e,t){return At("step",e,t,t.constructor)}function _t(e,t){return At("texture",e,t,A)}const Le=5;function X(e,t,s){const i=t.split(` -`);for(const n of i)if(n.trim().length){{let r="";s!=null&&(r+=`/*id:${s??"000"}*/ `),e.body+=r.padEnd(14)}e.body+=" ".repeat(e.indent)+n+` -`}}let sn=class{write(e){for(const t of e.rootOutputNodes())e.shouldPruneOutputNode(t)||(t.variableName=this._write(e,t.node));return e}_createVarName(e,t){let s="";return typeof t!="boolean"&&typeof t!="number"&&t.debugInfo.name&&(s=`${t.debugInfo.name}_`),`${s}v${e.varCount++}`}_write(e,t,s=!1){if(typeof t=="number"||typeof t=="boolean")return t.toString();let i=e.getEmit(t);if(i)return i;switch(t.shaderType){case"scope-node":i=this._writeScopeNode(e,t);break;case"primitive-node":i=this._writePrimitiveNode(e,t,s);break;case"function-node":i=this._writeFunctionNode(e,t);break;case"property-access-node":i=this._writePropertyAccessNode(e,t);break;case"text-node":i=t.text;break;case"block-node":i=this._writeBlockNode(e,t);break;case"condition-node":i=this._writeConditionNode(e,t)}return e.setEmit(t,i),i}_writeScopeNode(e,t){const s=new t.child.constructor;s.setDebugName(t.debugInfo.name);const i=this._write(e,s,!0);return X(e,`{ /*ScopeStart: ${t.uid} ${t.debugInfo.name}*/`),e.indent+=2,X(e,`${i} = ${this._write(e,t.child)};`),e.indent-=2,X(e,`} /*ScopeEnd: ${t.uid} ${t.debugInfo.name}*/`),i}_writeConditionNode(e,t){const s=new t.ifTrue.constructor,i=this._write(e,s,!0);X(e,`if (${this._write(e,t.condition)}) {`),e.indent+=2;const n=e.createSubgraphContext(),r=this._write(n,t.ifTrue);if(e.body+=n.body,r&&X(e,`${i} = ${r};`),e.indent-=2,X(e,"}"),t.ifFalse){X(e,"else {"),e.indent+=2;const o=e.createSubgraphContext(),a=this._write(o,t.ifFalse);e.body+=o.body,a&&X(e,`${i} = ${a};`),e.indent-=2,X(e,"}")}return i}_writeBlockNode(e,t){const{captureList:s,generator:i,returnType:n}=t,r={};for(const l in s){if(!s[l])continue;const c=this._write(e,s[l]);r[l]=c}const o=new n,a=this._write(e,o,!0);if(r.out=a,t.subgraph){const l=e.createSubgraphContext(),c=this._write(l,t.subgraph.child),u=l.body;r.subgraph={varName:c,body:u}}const h=i(r);return X(e,`{ -`),e.indent+=2,X(e,h),e.indent-=2,X(e,`} -`),a}_writePropertyAccessNode(e,t){const s=this._write(e,t.target);return typeof t.property=="string"&&t.property.includes("[")?`${s}${t.property}`:typeof t.property!="string"?`${s}[${this._write(e,t.property)}]`:`${s}.${t.property}`}_writeFunctionNode(e,t){const s=t.returnType.type;if(t.isInfix){const[r,o]=t.children.map(h=>this._write(e,h)),a=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${a} = ${r} ${t.token} ${o};`,t.uid),a}const i=t.children.map(r=>this._write(e,r)).join(", "),n=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${n} = ${t.token}(${i});`,t.uid),n}_writePrimitiveNode(e,t,s=!1){const i=e.getInput(t);if(i)return i.isUsed=!0,i.variableName;const n=t.children.length===1&&t.children[0]?.type===t.type;if(t.isImplicit||n)return this._write(e,t.children[0]);const r=this._createVarName(e,t);if(s)return X(e,`${t.type.padEnd(Le)} ${r};`,t.uid),r;const o=!t.debugInfo.name&&!t.isMutable;if(o&&t.type==="float"&&typeof t.children[0]=="number")return Number.isInteger(t.children[0])?t.children[0].toFixed(1):t.children[0].toString();if(o&&t.type==="int"&&typeof t.children[0]=="number"&&Number.isInteger(t.children[0]))return t.children[0].toString();const a=t.children.map(h=>this._write(e,h)).join(", ");return t.type==="array"?(X(e,`${t.type.padEnd(Le)} ${r} = [${a}];`,t.uid),r):o?`${t.type}(${a})`:(X(e,`${t.type.padEnd(Le)} ${r} = ${t.type}(${a});`,t.uid),r)}},oe=class wo{constructor(t,s,i){this.variableName=t,this.variableInputType=s,this.node=i,this.type="shader-input",this.isUsed=!1}clone(){return new wo(this.variableName,this.variableInputType,v(this.node))}},ae=class vo{constructor(t,s,i){this.outVariableName=t,this.outVariableType=s,this.node=i,this.type="shader-output"}clone(){const t=new vo(this.outVariableName,this.outVariableType,v(this.node));return t.variableName=this.variableName,t}},rn=class ei{static createVertex(t,s,i,n,r,o){const a=[];for(const l in t){const c=t[l],u=i.get(l);u?a.push(new oe(u,"builtin",c)):a.push(new oe("a_"+l,"in",c))}for(const l of n){const c=l.uniformHydrated;a.push(new oe(l.uniformName,"uniform",c))}const h=[];for(const l in s){const c=s[l];l==="glPosition"?h.push(new ae("gl_Position","builtin",c)):l==="glPointSize"?h.push(new ae("gl_PointSize","builtin",c)):h.push(new ae("v_"+l,"out",c))}return new ei(a,h,r,o)}static createFragment(t,s,i,n,r,o){const a=[],h=Array.from(r.rootOutputNodes());for(const c in t){const u=t[c],p=i.get(c);if(p){a.push(new oe(p,"builtin",u));continue}const d=h.find(f=>f.node===u);d&&a.push(new oe(d.outVariableName,"in",u))}for(const c of n){const u=c.uniformHydrated;a.push(new oe(c.uniformName,"uniform",u))}const l=[];for(const c in s){const u=s[c],p=i.get(c);c==="discard"?l.push(new ae(null,"discard",u)):p?l.push(new ae(p,"builtin",u)):l.push(new ae(c,"out",u))}return new ei(a,l,o)}constructor(t,s,i,n){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of t)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=s,this._transformFeedbackBindings=i,this._transformFeedbackNames=new Set(i.map(r=>"v_"+r.propertyKey)),this._usedInFragmentShader=n}shouldPruneOutputNode(t){return!!this._usedInFragmentShader&&t.outVariableType!=="builtin"&&!this._transformFeedbackNames.has(t.outVariableName)&&!this._usedInFragmentShader.has(t.node.uid)}setEmit(t,s){this._nodeEmitMap.set(t.uid,s)}getEmit(t){return this._nodeEmitMap.get(t.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(t){return this._inputShaderTypesByNodeUid.get(t.uid)}*rootOutputNodes(){for(const t of this._outputShaderTypes)yield t}*nodes(){const t=[];for(const s of this._outputShaderTypes.values())t.push(s.node);for(;t.length;){const s=t.pop();typeof s!="number"&&typeof s!="boolean"&&t.push(...s.children.filter(Boolean)),yield s}}*nodesOfTypeOrFunction(){for(const t of this.nodes())typeof t!="number"&&typeof t!="boolean"&&(yield t)}createSubgraphContext(){const t=this.clone();return t.body="",t.indent=this.indent+2,t._nodeEmitMap=new Map(this._nodeEmitMap),t}clone(){const t=new ei([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return t._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,t.indent=this.indent,t.body=this.body,t.varCount=this.varCount,t._nodeEmitMap=this._nodeEmitMap,t}insertVertexShader(t){t.vertex.code.add(""),this._insertInputs(t,"vertex"),t.vertex.code.add(""),t.vertex.code.add("// OUTPUTS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes()){const i=s.outVariableType==="builtin";this.shouldPruneOutputNode(s)||(i?t.vertex.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.vertex.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`))}t.vertex.code.add(""),t.vertex.code.add("void main() {"),t.vertex.code.add(" "+this.body.split(` -`).join(` - `));for(const s of this.rootOutputNodes())this.shouldPruneOutputNode(s)||t.vertex.code.add(` ${s.outVariableName} = ${s.variableName};`);t.vertex.code.add("}")}insertFragmentShader(t){this._insertInputs(t,"fragment"),t.fragment.code.add(""),t.fragment.code.add("// OUTPUTS: "),t.fragment.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes())s.outVariableType==="builtin"?t.fragment.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.fragment.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`);t.fragment.code.add(""),t.fragment.code.add("void main() {"),t.fragment.code.add(" "+this.body.split(` -`).join(` - `));for(const s of this.rootOutputNodes())s.outVariableType==="discard"?(t.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),t.fragment.code.add(` if (${s.variableName}) {`),t.fragment.code.add(" discard;"),t.fragment.code.add(" }"),t.fragment.code.add(" ")):t.fragment.code.add(` ${s.outVariableName} = ${s.variableName};`);t.fragment.code.add("}")}_insertInputs(t,s){t[s].code.add("// INPUTS: "),t[s].code.add("// --------------------------------------------------------- ");for(const i of this.inputs())i.isUsed&&i.variableInputType!=="builtin"&&(i.node.type==="array"?t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.elementType.type.padEnd(9)} ${i.variableName}[${i.node.size}];`):t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.type.padEnd(9)} ${i.variableName};`))}};const Ul=()=>ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function Ae(e,t,s){const i=t.length;if(i!==s){const n=new pn("Invalid Uniform",`Invalid length, expected ${s} but got ${i}`,{uniformName:e,values:t});Ul().errorOnce(n)}}let nn=class{constructor(e,t,s,i,n,r){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=s,this._locationInfo=i,this._uniformBindings=n,this._transformFeedbackBindings=r}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const i=new Map;for(const[r,o]of this._locations)i.set(r,o);const n=[];for(const r of this._transformFeedbackBindings??[]){const{index:o,propertyKey:a}=r;n[o]=`v_${a}`}this._program=new ka(e,this.vertexShader,this.fragmentShader,i,new Map,n)}const s=this._program;e.useProgram(s);for(const i of this._uniformBindings){const{shaderModulePath:n,uniformName:r,uniformType:o,uniformArrayLength:a}=i,h=Wo(n,t);if(h==null){if(o==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${n}`)}switch(o==="array"?i.uniformArrayElementType:o){case"sampler2D":{const{unit:l,texture:c}=h;if(s.setUniform1i(r,l),"type"in c)e.bindTexture(c,l);else{const u=Ca(e,c.descriptor,c.data);e.bindTexture(u,l)}break}case"int":if(!a){s.setUniform1i(r,h);break}Ae(i.uniformName,h,a),s.setUniform1iv(r,h);break;case"float":if(!a){s.setUniform1f(r,h);break}Ae(i.uniformName,h,a),s.setUniform1fv(r,h);break;case"vec2":if(!a){s.setUniform2f(r,h[0],h[1]);break}Ae(i.uniformName,h,a),s.setUniform2fv(r,h.flat());break;case"vec3":if(!a){s.setUniform3f(r,h[0],h[1],h[2]);break}Ae(i.uniformName,h,a),s.setUniform3fv(r,h.flat());break;case"vec4":if(!a){s.setUniform4f(r,h[0],h[1],h[2],h[3]);break}Ae(i.uniformName,h,a),s.setUniform4fv(r,h.flat());break;case"mat3":s.setUniformMatrix3fv(r,h);break;case"mat4":s.setUniformMatrix4fv(r,h);break;default:throw new Error(`Unable to set uniform for type ${o}`)}}}};function Oe(e){return new e}function ys(e,t,s){const i=e.constructor[t]??[];e.constructor.hasOwnProperty(t)||Object.defineProperty(e.constructor,t,{value:i.slice()}),e.constructor[t].push(s)}function k(e,t){return(s,i)=>{ys(s,"locations",{typeCtor:t,propertyKey:i,parameterIndex:null,index:e})}}const R=e=>(t,s,i)=>{ys(t,"inputs",{inputCtor:e,propertyKey:s,parameterIndex:i})},M=e=>(t,s)=>{ys(t,"uniforms",{typeCtor:e,propertyKey:s})},Y=e=>(t,s)=>{ys(t,"options",{typeCtor:e,propertyKey:s})},on=(e,t)=>{ys(e,"defines",{propertyKey:t})},sr=(e,t)=>(s,i)=>{s.constructor.builtins.push({builtin:e,propertyKey:i,typeCtor:t})};class ir{}ir.builtins=[],g([sr("gl_VertexID",Gt)],ir.prototype,"glVertexID",void 0);let Yl=class{},os=class{};os.builtins=[],g([sr("gl_FragCoord",A)],os.prototype,"glFragCoord",void 0),g([sr("gl_PointCoord",T)],os.prototype,"glPointCoord",void 0);let Wl=class{},it=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},ql=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return this._shaderModuleClass.inputs.findLast(e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const s of this.locations)t.has(s.index)?ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${s.propertyKey} to ${s.index}. Index already in use`,{locationsMap:e}):(e.set(s.propertyKey,s.index),t.add(s.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,r])=>`${n}.${r}`).join("."),s=Bo(t),i=this.computeAttributes;this._locationInfo={hash:s,locations:e,computeAttributeMap:i}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,s,i){try{const{vertex:n,fragment:r,uniformBindings:o}=this._generateShaders(e,t,s,i);return new nn(n,r,this.renamedLocationsMap,this.locationInfo,o,this.transformFeedbackBindings)}catch{return new nn("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(i=>i.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const s=this._uniforms.find(i=>i.propertyKey===e);if(!s)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:s.typeCtor}}getShaderKey(e,t,s,i){const n=Object.keys(e).map(h=>`${h}.${e[h]}`).join("."),r=Object.keys(s).map(h=>`${h}.${s[h]}`).join("."),o=Object.keys(i).map(h=>`${h}.${i[h]}`).join("."),a=Object.keys(t).filter(h=>this.optionPropertyKeys.has(h)&&t[h]).join(".");return`${this.constructor.name}.${n}.${r}.${o}.${a}`}_generateShaders(e,t,s,i){const n=[];this._setDefines(s),this._setOptionalUniforms(n,t),this._setRequiredUniforms(n);const r=this._hydrateVertexInput(i),o=this._injectPackPrecisionFactor(r,e),a=this._hydrateComputeInput(),h=a&&this._injectComputePackPrecisionFactor(a,e),l=this.vertex(o,h),c=this._hydrateFragmentInput(l),u=this.fragment(c),p=new Set;for(const w in u){const S=u[w];vl(p,S)}const d=this._getVertexInputBuiltins(),f=rn.createVertex({...r,...a},l,d,n,this.transformFeedbackBindings,p);new sn().write(f);const m=this._getFragmentInputBuiltins(u);m.set("glPointCoord","gl_PointCoord");const _=rn.createFragment(c,u,m,n,f,this.transformFeedbackBindings);new sn().write(_);const y=this._createShaderBuilder(f,_),b=y.generate("vertex",!0),P=y.generate("fragment",!0);return this.logShader&&(console.log(b),console.log(P)),{vertex:b,fragment:P,uniformBindings:n}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const s of this._options)t[s.propertyKey]?this[s.propertyKey]=this._hydrateUniformGroup(e,s):this[s.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const s=new t.typeCtor;for(const i of s._uniforms??[]){const n=Oe(i.typeCtor),r=`u_${t.propertyKey}_${i.propertyKey}`,o=n.type,a=[t.propertyKey,i.propertyKey].join(".");if("type"in i.typeCtor&&i.typeCtor.type==="array"){const h=n;e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformArrayLength:h.size,uniformArrayElementType:h.elementType.type,uniformHydrated:n})}else e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformHydrated:n});s[i.propertyKey]=n}return s}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,s=t.locations.reduce((i,n)=>e[n.propertyKey]===!1?i:{...i,[n.propertyKey]:Oe(n.typeCtor)},{});for(const{propertyKey:i,typeCtor:n}of t.builtins){const r=Oe(n);s[i]=r}return s}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:Oe(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const s={};for(const i in e){const n=e[i],r=t[i];if(r){if(n.type!=="float"&&n.type!=="vec2"&&n.type!=="vec3"&&n.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${n.type}`);s[i]=n.divide(new x(r))}else s[i]=n}return s}_injectComputePackPrecisionFactor(e,t){const s={},i=new Map;for(const n in this.computeAttributes)for(const r of this.computeAttributes[n]??[])i.set(r,n);for(const n in e){const r=e[n],o=i.get(n);if(!o)continue;const a=t[o];if(a){if(r.type!=="float"&&r.type!=="vec2"&&r.type!=="vec3"&&r.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${r.type}`);s[n]=r.divide(new x(a))}else s[n]=r}return s}_hydrateFragmentInput(e){const t={};for(const s in e)t[s]=e[s];for(const{propertyKey:s,typeCtor:i}of os.builtins){const n=Oe(i);t[s]=n}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:s,propertyKey:i}of e.builtins)t.set(i,s);return t}_getFragmentInputBuiltins(e){const t=e.constructor,s=new Map;for(const i of t.builtins??[])s.set(i.propertyKey,i.builtin);return s}_createShaderBuilder(e,t){const s=new ml;return this._insertDebugInfo(s),e.insertVertexShader(s),t.insertFragmentShader(s),s}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};function an(e){const t=F(12.9898),s=F(78.233),i=F(43758.5453),n=br(e,Qi(t,s)),r=Pe(n,F(3.14));return bo(Pr(r).multiply(i))}function te(e){return _r(e,F(ll))}function Kl(e,t){return e.x.multiply(t.y).subtract(t.x.multiply(e.y))}function jl(e){return e.multiply(2).subtract(1)}function Vt(e,t){const s=F(2**t);return Pe(Hl(e.divide(s)),F(2))}function xu(e,t){return et(Vt(e,t),F(.5))}function Ii(e,t){return Vt(e,t+mn)}function Jl(e,t){return Vt(e,t)}function Zl(e){const t=Vt(e.z,7),s=F(1).subtract(t),i=e.xyz.subtract(Ol(0,0,F(128)));return s.multiply(e).add(t.multiply(i))}function Ql(e){const t=El(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return br(e,t)}function bu(e){return de(de(de(e.x,e.y),e.z),e.w)}function Pu(e){return new x(1).subtract(e)}function wu(e){return e.subtract(new x(1))}function vu(e,t){return e.subtract(new x(t))}let ft=class extends it{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=_t(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=Zl(e),s=this.size,i=ne(t.x),n=ne(t.y).multiply(ne(256)),r=ne(t.z).multiply(ne(256)).multiply(ne(256)),o=F(i.add(n).add(r)),a=Pe(o,s),h=o.subtract(a).divide(s);this._uv=new T(a,h).add(.5).divide(s)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return _t(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return _t(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return _t(this.gpgpu,t).setDebugName("storage4")}getLocalTimeOrigin(e){const t=this.getAttributeDataCoords(e);return _t(this.localTimeOrigin,t).x.setDebugName("storage5")}getFilterFlags(e){return li("webgl-ignores-sampler-precision")?Vl(this.getFilterData(e).x.multiply(F(255))):this.getFilterData(e).x.multiply(F(255))}getLabelVisibility(e){const t=this.getFilterData(e).y.multiply(255);return new x(1).subtract(t)}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};g([M(mt)],ft.prototype,"filterFlags",void 0),g([M(mt)],ft.prototype,"animation",void 0),g([M(mt)],ft.prototype,"gpgpu",void 0),g([M(mt)],ft.prototype,"localTimeOrigin",void 0),g([M(mt)],ft.prototype,"visualVariableData",void 0),g([M(mt)],ft.prototype,"dataDriven0",void 0),g([M(mt)],ft.prototype,"dataDriven1",void 0),g([M(mt)],ft.prototype,"dataDriven2",void 0),g([M(x)],ft.prototype,"size",void 0);let rr=class extends it{};g([M(x)],rr.prototype,"activeReasons",void 0),g([M(x)],rr.prototype,"highlightAll",void 0);let is=class extends it{};g([M(T)],is.prototype,"position",void 0),g([M(x)],is.prototype,"distance",void 0),g([M(x)],is.prototype,"smallSymbolDistance",void 0),g([M(x)],is.prototype,"smallSymbolSizeThreshold",void 0);let K=class extends it{};g([M(xt)],K.prototype,"displayViewScreenMat3",void 0),g([M(xt)],K.prototype,"displayViewMat3",void 0),g([M(xt)],K.prototype,"displayMat3",void 0),g([M(xt)],K.prototype,"viewMat3",void 0),g([M(xt)],K.prototype,"tileMat3",void 0),g([M(x)],K.prototype,"displayZoomFactor",void 0),g([M(x)],K.prototype,"requiredZoomFactor",void 0),g([M(T)],K.prototype,"tileOffset",void 0),g([M(x)],K.prototype,"currentScale",void 0),g([M(x)],K.prototype,"currentZoom",void 0),g([M(x)],K.prototype,"metersPerSRUnit",void 0),g([M(x)],K.prototype,"rotation",void 0),g([M(x)],K.prototype,"pixelRatio",void 0);let Zt=class extends ir{};g([k(0,H)],Zt.prototype,"id",void 0),g([k(1,x)],Zt.prototype,"bitset",void 0),g([k(2,T)],Zt.prototype,"pos",void 0);let zt=class extends Yl{};g([k(14,T)],zt.prototype,"nextPos1",void 0),g([k(15,T)],zt.prototype,"nextPos2",void 0);let gi=class extends os{},It=class extends ql{clip(e,t){let s=new x(0);const i=this.storage.getFilterFlags(e);if(s=s.add(F(2).multiply(F(1).subtract(Ii(i,0)))),this.inside?s=s.add(F(2).multiply(F(1).subtract(Ii(i,1)))):this.outside?s=s.add(F(2).multiply(Ii(i,1))):this.highlight&&(s=s.add(F(2).multiply(F(1).subtract(this._checkHighlight(i))))),t!=null){const n=new x(1).subtract(Dt(t.x,this.view.currentZoom)),r=Dt(t.y,this.view.currentZoom);s=s.add(new x(2).multiply(n.add(r)))}return s}getFragmentOutput(e,t,s=new x(1/255)){const i=new Wl;return i.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,s)??e,i}_maybeHighlight(e,t){return this.highlight?new A(e.rgb,Dt(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let s=1;s{const h=as(e,t,s),l=as(e,s,i),c=as(e,i,t);return er(er(h,l),c)}])}function So(e){return e.distance.add(1)}function wr(e,t,s){const{viewMat3:i,tileMat3:n}=e.view,r=i.multiply(n),o=r.multiply(new H(t.pos,1)),a=r.multiply(new H(s.nextPos1,1)),h=r.multiply(new H(s.nextPos2,1));return rc(e.hittestRequest.position,o.xy,a.xy,h.xy)}function Su(e,t,s){return xo(e,s).subtract(t)}let us=class extends it{getColor(e,t,s){return ms([go(te(e),s),t],[mi(e,this.values.first()),this.colors.first()],[_i(e,this.values.last()),this.colors.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.colors.get(r),this.colors.get(i),a)}])}};g([M(ct.ofType(A,8))],us.prototype,"colors",void 0),g([M(ct.ofType(x,8))],us.prototype,"values",void 0);let ps=class extends it{getOpacity(e){return ms([te(e),new x(1)],[mi(e,this.opacityValues.first()),this.opacities.first()],[_i(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(o=>et(o,e)),s=this.opacityValues.get(t),i=t.subtract(1),n=this.opacityValues.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.opacities.get(i),this.opacities.get(t),r)}])}};g([M(ct.ofType(x,8))],ps.prototype,"opacities",void 0),g([M(ct.ofType(x,8))],ps.prototype,"opacityValues",void 0);function Mo(e){return e.visualVariableSizeMinMaxValue!=null||e.visualVariableSizeScaleStops!=null||e.visualVariableSizeStops!=null||e.visualVariableSizeUnitValue!=null}function nc(e,t,s){if(Mo(e)){const i=e.storage.getSizeValue(t);return e.visualVariableSizeMinMaxValue?.getSize(i,s)??e.visualVariableSizeScaleStops?.getSizeForViewScale(e.view.currentScale)??e.visualVariableSizeStops?.getSize(i,s)??e.visualVariableSizeUnitValue?.getSize(i,s)}return s}function vr(e,t,s,i=new j(!1)){if(e.visualVariableColor==null)return s;const n=e.storage.getColorValue(t);return e.visualVariableColor.getColor(n,s,i)}function Sr(e,t){if(e.visualVariableOpacity==null)return new x(1);const s=e.storage.getOpacityValue(t);return e.visualVariableOpacity.getOpacity(s)}function Mu(e,t){if(e.visualVariableRotation==null)return xt.identity();const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getVVRotationMat3(s)}function Cu(e,t){if(e.visualVariableRotation==null)return new x(0);const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getNormalizedAngle(s)}let ds=class extends Zt{};g([k(3,A)],ds.prototype,"color",void 0),g([k(4,T)],ds.prototype,"zoomRange",void 0);let ue=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const s=Sr(this,e.id),i=vr(this,e.id,e.color).multiply(s),n=this.view.displayViewScreenMat3.multiply(new H(e.pos.xy,1)),r=this.clip(e.id,e.zoomRange);return{glPosition:new A(n.xy,r,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new x(0))}hittest(e,t){return wr(this,e,t)}};g([Y(us)],ue.prototype,"visualVariableColor",void 0),g([Y(ps)],ue.prototype,"visualVariableOpacity",void 0),g([$(0,R(ds)),$(1,R(zt))],ue.prototype,"vertex",null),g([$(0,R(gi))],ue.prototype,"fragment",null);let me=class extends it{getPatternOffsetAtTileOrigin(e,t=new x(0),s=new x(1)){const i=new T(dl).divide(e);let n=e.multiply(bo(this.maxIntsToLocalOrigin.multiply(i))).add(this.tileOffsetFromLocalOrigin).subtract(new x(.5).multiply(e));return n=new T(n.x.multiply(s).subtract(n.y.multiply(t)),n.x.multiply(t).add(n.y.multiply(s))),Pe(n,e)}};g([M(T)],me.prototype,"tileOffsetFromLocalOrigin",void 0),g([M(T)],me.prototype,"maxIntsToLocalOrigin",void 0);let _e=class extends it{};g([M(T)],_e.prototype,"size",void 0),g([M(mt)],_e.prototype,"texture",void 0);let Ut=class extends ds{};g([k(5,A)],Ut.prototype,"tlbr",void 0),g([k(6,x)],Ut.prototype,"width",void 0),g([k(7,x)],Ut.prototype,"height",void 0),g([k(8,T)],Ut.prototype,"offset",void 0),g([k(9,T)],Ut.prototype,"scale",void 0),g([k(10,x)],Ut.prototype,"angle",void 0);let oc=class extends gi{};function ac(e,t,s,i,n){const r=_r(Vt(n,pl),F(1)),o=Ql(new A(e,0));return B(r,en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,an(Qi(o,0)),an(Qi(0,o)),1),en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,0,0,1))}function Co(e,t){const s=e.view.requiredZoomFactor,i=new T(t.width,t.height),n=i.multiply(t.scale).multiply(s),r=t.angle.multiply(nl),o=Pr(r),a=yo(r),h=ac(t.id,n,o,a,t.bitset),l=e.localTileOffset.getPatternOffsetAtTileOrigin(i,o,a),c=s.multiply(t.scale).multiply(t.offset.subtract(l)).divide(n),u=new H(t.pos,1),p=h.multiply(u).xy.subtract(c),d=t.tlbr.divide(e.mosaicInfo.size.xyxy);let f=Vt(t.bitset,cl);return e.visualVariableColor!=null&&(f=B(te(e.storage.getColorValue(t.id)),new x(0),f)),{tileTextureCoord:p,tlbr:d,sampleAlphaOnly:f}}function Io(e,t){const s=Pe(t.tileTextureCoord,new x(1)),i=be(t.tlbr.xy,t.tlbr.zw,s);let n=_t(e.mosaicInfo.texture,i);return n=B(et(t.sampleAlphaOnly,new x(.5)),n.aaaa,n),t.color.multiply(n)}let Es=class extends ue{vertex(e,t){return{...super.vertex(e,t),...Co(this,e)}}fragment(e){const t=Io(this,e);return this.getFragmentOutput(t,e,new x(0))}};g([M(_e)],Es.prototype,"mosaicInfo",void 0),g([M(me)],Es.prototype,"localTileOffset",void 0),g([$(0,R(Ut)),$(1,R(zt))],Es.prototype,"vertex",null),g([$(0,R(oc))],Es.prototype,"fragment",null);let Mr=class extends it{getSize(e,t){const s=this.minMaxValueAndSize.xy,i=this.minMaxValueAndSize.zw;return B(te(e),t,()=>{const n=e.subtract(s.x).divide(s.y.subtract(s.x)),r=xr(n,new x(0),new x(1));return i.x.add(r.multiply(i.y.subtract(i.x)))})}};g([M(A)],Mr.prototype,"minMaxValueAndSize",void 0);let oi=class extends it{getSizeForViewScale(e){return ms([mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(o=>et(o,e)),s=this.values.get(t),i=t.subtract(1),n=this.values.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.sizes.get(i),this.sizes.get(t),r)}])}};g([M(ct.ofType(x,8))],oi.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],oi.prototype,"values",void 0);let ai=class extends it{getSize(e,t){const s=ms([te(e),t],[mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.sizes.get(r),this.sizes.get(i),a)}]);return B(te(s),t,s)}};g([M(ct.ofType(x,8))],ai.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],ai.prototype,"values",void 0);let Cr=class extends it{getSize(e,t){return B(te(e),t,e.multiply(this.unitValueToPixelsRatio))}};g([M(x)],Cr.prototype,"unitValueToPixelsRatio",void 0);class Yt extends Zt{}g([k(3,A)],Yt.prototype,"color",void 0),g([k(4,T)],Yt.prototype,"offset",void 0),g([k(5,T)],Yt.prototype,"normal",void 0),g([k(6,x)],Yt.prototype,"halfWidth",void 0),g([k(7,x)],Yt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Yt.prototype,"zoomRange",void 0);let ko=class extends gi{},hi=class extends it{};function To(e){return de(new x(ol).multiply(Dt(e,new x(al))),new x(1))}function hc(e,t){const{halfWidth:s,normal:i}=e,n=To(s),r=Po(i).multiply(s);return xr(n.multiply(s.subtract(r)).divide(t.add(n).subtract(new x(1))),new x(0),new x(1))}function lc(e,t){const{id:s,halfWidth:i,referenceHalfWidth:n}=t;if(Mo(e)){const r=new x(2).multiply(n),o=nc(e,s,r);return new x(.5).multiply(i.divide(de(n,new x(hl)))).multiply(o)}return i}function zo(e,t){const{id:s,offset:i,pos:n,normal:r,zoomRange:o}=t,{displayViewScreenMat3:a,displayViewMat3:h}=e.view,l=vr(e,s,t.color),c=Sr(e,s),u=lc(e,t),p=new x(.5).multiply(e.antialiasingControls.antialiasing),d=de(u.add(p),new x(.45)).add(new x(.1).multiply(p)),f=To(d).multiply(d).multiply(i),m=h.multiply(new H(f,new x(0))),_=a.multiply(new H(n,new x(1))).add(m),y=new x(2).multiply(Dt(u,new x(0))).add(e.clip(s,o)),b=new A(_.xy,y,1);return{color:l,opacity:c,halfWidth:d,normal:r,scaledOffset:f,scaledHalfWidth:u,glPosition:new A(b.xy,y,1)}}function yi(e,t){const{opacity:s,color:i}=e,n=hc(e,t);return s.multiply(i).multiply(n)}g([M(x)],hi.prototype,"antialiasing",void 0),g([M(x)],hi.prototype,"blur",void 0);class vt extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,s){const i=zo(this,t);return{...i,...this.maybeRunHittest(t,s,i.halfWidth)}}fragment(t){const s=yi(t,this.antialiasingControls.blur);return this.getFragmentOutput(s,t)}hittest(t,s,i){const{viewMat3:n,tileMat3:r}=this.view,o=n.multiply(r),a=o.multiply(new H(t.pos,1)),h=o.multiply(new H(s.nextPos1,1)),l=o.multiply(new H(s.nextPos2,1)),{distance:c,smallSymbolDistance:u,smallSymbolSizeThreshold:p}=this.hittestRequest,d=Dt(i,p.multiply(.5)).multiply(c.subtract(u)),f=this.hittestRequest.position;return er(as(f,a.xy,h.xy),as(f,a.xy,l.xy)).subtract(i).add(d)}}g([M(hi)],vt.prototype,"antialiasingControls",void 0),g([Y(us)],vt.prototype,"visualVariableColor",void 0),g([Y(ps)],vt.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],vt.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],vt.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],vt.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],vt.prototype,"visualVariableSizeUnitValue",void 0),g([$(0,R(Yt)),$(1,R(zt))],vt.prototype,"vertex",null),g([$(0,R(ko))],vt.prototype,"fragment",null);class Nt extends Zt{}g([k(3,T)],Nt.prototype,"offset",void 0),g([k(4,A)],Nt.prototype,"color",void 0),g([k(5,T)],Nt.prototype,"normal",void 0),g([k(6,x)],Nt.prototype,"halfWidth",void 0),g([k(7,x)],Nt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Nt.prototype,"zoomRange",void 0);let Lo=class extends ko{};function Ir(e,t,s){const{id:i,bitset:n}=t,r=Vt(n,ul),o=et(r,new x(.5)),a=zo(e,t),h=B(o,a.halfWidth,new x(0)),l=Sr(e,i),c=vr(e,i,t.color),u=B(o,t.color,c.multiply(l)),p=e.view.displayViewScreenMat3.multiply(new H(t.pos.xy,1)),d=e.clip(t.id),f=new A(p.xy,d,1),m=B(o,a.glPosition,f),_=s&&e.maybeRunHittest(t,s,o);return{isOutline:r,color:u,opacity:new x(1),halfWidth:h,normal:a.normal,glPosition:m,..._}}let Ct=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};g([M(hi)],Ct.prototype,"antialiasingControls",void 0),g([Y(us)],Ct.prototype,"visualVariableColor",void 0),g([Y(ps)],Ct.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],Ct.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],Ct.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],Ct.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],Ct.prototype,"visualVariableSizeUnitValue",void 0);class nr extends Ct{vertex(t,s){return Ir(this,t,s)}fragment(t){const{color:s,isOutline:i}=t,n=et(i,new x(.5)),r=yi(t,this.antialiasingControls.blur),o=B(n,r,s),a=B(n,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([$(0,R(Nt)),$(1,R(zt))],nr.prototype,"vertex",null),g([$(0,R(Lo))],nr.prototype,"fragment",null);let or=class extends ds{};g([k(5,A)],or.prototype,"tlbr",void 0),g([k(6,x)],or.prototype,"inverseRasterizationScale",void 0);class cc extends gi{}function uc(e){const t=new x(1),s=new x(0);return new xt(t.divide(e.x),s.divide(e.y),0,ni(s.divide(e.x)),t.divide(e.y),0,0,0,1)}function Ao(e,t){const s=t.tlbr.xy,i=t.tlbr.zw,n=i.x.subtract(s.x),r=s.y.subtract(i.y),o=new T(n,r).multiply(t.inverseRasterizationScale),a=o.multiply(e.view.requiredZoomFactor),h=uc(a),l=e.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new H(t.pos,1);return{tileTextureCoord:h.multiply(c).xy.subtract(l),tlbr:t.tlbr.divide(e.mosaicInfo.size.xyxy)}}function Oo(e,t){const s=Pe(e.tileTextureCoord,new x(1)),i=be(e.tlbr.xy,e.tlbr.zw,s),n=_t(t.texture,i);return e.color.multiply(n)}class Fs extends ue{vertex(t,s){return{...super.vertex(t,s),...Ao(this,t)}}fragment(t){const s=Oo(t,this.mosaicInfo);return this.getFragmentOutput(s,t,new x(0))}}g([M(_e)],Fs.prototype,"mosaicInfo",void 0),g([M(me)],Fs.prototype,"localTileOffset",void 0),g([$(0,R(or)),$(1,R(zt))],Fs.prototype,"vertex",null),g([$(0,R(cc))],Fs.prototype,"fragment",null);let ar=class extends Nt{};g([k(9,A)],ar.prototype,"tlbr",void 0),g([k(10,x)],ar.prototype,"inverseRasterizationScale",void 0);let Eo=class extends Lo{},Ns=class extends nr{vertex(e,t){return{...Ir(this,e,t),...Ao(this,e)}}fragment(e){const{isOutline:t}=e,s=et(t,new x(.5)),i=yi(e,this.antialiasingControls.blur),n=Oo(e,this.mosaicInfo),r=B(s,i,n),o=B(s,new x(1/255),new x(0));return this.getFragmentOutput(r,e,o)}};g([M(_e)],Ns.prototype,"mosaicInfo",void 0),g([M(me)],Ns.prototype,"localTileOffset",void 0),g([$(0,R(ar)),$(1,R(zt))],Ns.prototype,"vertex",null),g([$(0,R(Eo))],Ns.prototype,"fragment",null);const pc=16,hn=1/pc,dc=128;class St extends Zt{}g([k(3,A)],St.prototype,"color",void 0),g([k(4,A)],St.prototype,"tlbr",void 0),g([k(5,x)],St.prototype,"angle",void 0),g([k(6,x)],St.prototype,"aux1",void 0),g([k(7,x)],St.prototype,"aux2",void 0),g([k(8,T)],St.prototype,"aux3",void 0),g([k(9,T)],St.prototype,"aux4",void 0),g([k(10,T)],St.prototype,"zoomRange",void 0);class fc extends Eo{}class $s extends Ct{vertex(t,s){const{aux1:i,aux2:n,aux3:r,aux4:o}=t,a={...t,width:i,height:n,offset:r,scale:o.multiply(hn)},h={...t,halfWidth:i,referenceHalfWidth:n,offset:r,normal:o.subtract(dc).multiply(hn)},l=Ir(this,h),c=Co(this,a),u=et(l.isOutline,new x(.5));return{...l,...c,...this.maybeRunHittest(t,s,u)}}fragment(t){const{isOutline:s}=t,i=et(s,new x(.5)),n=yi(t,this.antialiasingControls.blur),r=Io(this,t),o=B(i,n,r),a=B(i,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([M(_e)],$s.prototype,"mosaicInfo",void 0),g([M(me)],$s.prototype,"localTileOffset",void 0),g([$(0,R(St)),$(1,R(zt))],$s.prototype,"vertex",null),g([$(0,R(fc))],$s.prototype,"fragment",null);const mc=8388607,_c=8388608,Iu=e=>e&mc;function ku(e,t){return((t?_c:0)|e)>>>0}var ln;(function(e){e.Local="Local",e.Global="Global"})(ln||(ln={}));class we{generateSource(t){const s=[];for(let n=1;n= ${hr}) { top = ${hr-1}; }`);return s}}let ve=128;class gc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class yc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class xc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class bc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function hs(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${e.out} = oscillate ? 1.0 - of : of;`]}const Pc={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},wc={Loop:1,None:2,Oscillate:3},vc={Local:1,Global:2};function ls(e){const t=Pc[e.easing],s=wc[e.repeatType],i=vc[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}class Sc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...hs({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;",` - vec2 translation = vec2( - cos1 * s1 * x2 - sin1 * s1 * y2 + x1, - sin1 * s1 * x2 + cos1 * s1 * y2 + y1 - ); - `,"out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...ls(t.translation.timing),...ls(t.rotation.timing),...ls(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class Mc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...ls(t.color.timing),...ls(t.opacity.timing)]}}const cn={scalar:new yc,vector3:new xc,vector4:new bc,animatedTransform:new Sc,animatedColor:new Mc,ret:new gc},Cc=40,hr=4;function Tu(e){const t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push("int top = 0;"),t.push(`vec4 stack[${hr}];`),t.push(`for (int counter = 0; counter < ${Cc}; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;"),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push("if (false) {");for(const s in cn){const i=cn[s];t.push(`} else if (int(atom0.x) == ${i.opcode}) {`);for(const n of i.generateSource(e))t.push(n)}return t.push("} // End if-else."),t.push("} // End for."),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(` -`)}let Rs=class extends Go{constructor(e){super(e),this.debugName="",this._updatingHandles=new za,this._idToUpdatingState=new Ta}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(li("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([s,i])=>`-> ${s}: ${i}`).join(` -`);console.log(`${this.debugName}: Updating: ${e} --> Handles: ${this._updatingHandles.updating} -${t}`)}return e}addUpdateTracking(e,t){const s=Vo(()=>t.updating,i=>this._idToUpdatingState.set(e,i),{sync:!0});this.addHandles(s)}addPromise(e){return this._updatingHandles.addPromise(e)}};g([kr({constructOnly:!0})],Rs.prototype,"debugName",void 0),g([kr({readOnly:!0})],Rs.prototype,"updating",null),Rs=g([$o("esri.views.2d.layers.support.UpdateTracking2D")],Rs);export{te as $,on as A,xh as B,it as C,Fr as D,N as E,B as F,cn as G,bh as H,ns as I,zh as J,Th as K,A as L,xt as M,_r as N,lh as O,pl as P,ku as Q,fh as R,x as S,Zr as T,au as U,Zt as V,lu as W,ou as X,hu as Y,Iu as Z,nl as _,Rs as a,su as a$,It as a0,Cu as a1,Pr as a2,yo as a3,H as a4,mi as a5,ms as a6,_t as a7,Ql as a8,iu as a9,Po as aA,gu as aB,br as aC,bu as aD,ue as aE,Es as aF,$s as aG,nr as aH,Fs as aI,Ns as aJ,Su as aK,er as aL,Hl as aM,ru as aN,Mu as aO,nu as aP,Gt as aQ,pu as aR,du as aS,vt as aT,Yt as aU,bo as aV,yu as aW,mu as aX,zo as aY,hc as aZ,mt as a_,xr as aa,Gl as ab,Yl as ac,Vt as ad,Ll as ae,nc as af,vr as ag,go as ah,j as ai,xu as aj,be as ak,Sr as al,$l as am,xo as an,rc as ao,et as ap,sc as aq,T as ar,ni as as,ec as at,Dt as au,So as av,R as aw,ir as ax,ql as ay,de as az,pc as b,_o as b0,Tu as b1,_e as b2,us as b3,ps as b4,Mr as b5,oi as b6,ai as b7,Cr as b8,Wl as b9,K as ba,gi as bb,zt as bc,os as bd,nn as be,jl as bf,Pu as bg,wu as bh,vu as bi,_u as bj,uu as bk,Ot as bl,fu as bm,cu as bn,tu as bo,Qc as bp,Jc as bq,eu as br,Zc as bs,qc as bt,Fi as bu,Kc as c,ul as d,dc as e,jr as f,Oa as g,Kn as h,jc as i,mh as j,re as k,ln as l,_h as m,Wc as n,vh as o,Ih as p,Ch as q,Yn as r,mc as s,k as t,Yc as u,M as v,Y as w,cl as x,ll as y,ct as z}; diff --git a/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-DP9rSN0d.js b/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-DP9rSN0d.js new file mode 100644 index 00000000..39454540 --- /dev/null +++ b/custom-toc-separator/assets/UpdateTracking2D-Du_WIf4G-DP9rSN0d.js @@ -0,0 +1,62 @@ +import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,eE as un,K as li,j as Go,ah as Vo,cf as Ho,ca as rt,cb as gt,eQ as ht,bh as Qt,g_ as lr,cc as Ds,es as bt,et as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,c9 as ki,l as Xo,dB as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./story-DT1Ep1ux.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-BKynsqQg.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-XRkD8ADC.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-D0v5nxXn.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let n,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+i,n[6]=this.x+s,n[7]=this.y+i;const r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} +${s.join(` +`)} +${h} +${l.join(` +`)} +${o.join(` +`)} +${i.join(` +`)} +${n.join(` +`)} +${a.join(` +`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Pass];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r)=>{for(let o=0;o{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)}),this.fragment.uniforms.entries.forEach(n=>{const r=n.bind[Ms.Draw];r&&t.set(n.name,r)});const s=Array.from(t.values()),i=s.length;return(n,r,o)=>{for(let a=0;ae.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},gl=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},tn=class extends no{constructor(){super(...arguments),this.uniforms=new _l,this.code=new gl,this.constants=new oo}get builder(){return this}},yl=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},xl=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ia(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((s,i)=>t.push(e==="vertex"?`out ${s} ${i};`:`in ${s} ${i};`)),t}},Ni=class $i{constructor(){this._entries=new Set}add(t){this._entries.add(t)}generateSource(t){const s=t==="vertex"?$i.ALLOWLIST_VERTEX:$i.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(i=>s.includes(i)).map(i=>`#extension ${i} : enable`)}};Ni.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],Ni.ALLOWLIST_VERTEX=[];let oo=class E{constructor(){this._entries=new Set}add(t,s,i){let n="ERROR_CONSTRUCTOR_STRING";switch(s){case"float":n=E._numberToFloatStr(i);break;case"int":n=E._numberToIntStr(i);break;case"bool":n=i.toString();break;case"vec2":n=`vec2(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])})`;break;case"vec3":n=`vec3(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])})`;break;case"vec4":n=`vec4(${E._numberToFloatStr(i[0])}, ${E._numberToFloatStr(i[1])}, ${E._numberToFloatStr(i[2])}, ${E._numberToFloatStr(i[3])})`;break;case"ivec2":n=`ivec2(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])})`;break;case"ivec3":n=`ivec3(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])})`;break;case"ivec4":n=`ivec4(${E._numberToIntStr(i[0])}, ${E._numberToIntStr(i[1])}, ${E._numberToIntStr(i[2])}, ${E._numberToIntStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${s}(${Array.prototype.map.call(i,r=>E._numberToFloatStr(r)).join(", ")})`}return this._entries.add(`const ${s} ${t} = ${n};`),this}static _numberToIntStr(t){return t.toFixed(0)}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}};function bl(){return`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif +`}const Pl=`precision highp float; +precision highp sampler2D;`;function wl(e){return e.split(" ").map((t,s)=>s>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function vl(e,t){const s=[];for(s.push(t);s.length;){const i=s.pop();if(typeof i=="object"&&!e.has(i.uid)){e.add(i.uid);for(const n of i.children)s.push(n)}}}let ee=class Ri{constructor(){this.uid=Ri.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(t){return t=wl(t),this._debugName=t,this.isImplicit&&this.children[0]instanceof Ri&&this.children[0].setDebugName(t),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}};function v(e){return typeof e=="object"?e.clone():e}ee.NodeCount=0;let D=class extends ee{constructor(){super(...arguments),this.shaderType="primitive-node"}},Sl=class ao extends ee{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new ao(v(this.child));return this.cloneInto(t),t}},Ml=class ho extends ee{constructor(t,s,i){super(),this.property=t,this.target=s,this.returnType=i,this.shaderType="property-access-node"}get children(){const t=[this.target];return typeof this.property!="string"&&t.push(this.property),t}clone(){const t=new ho(this.property,v(this.target),this.returnType);return this.cloneInto(t),t}},Cl=class lo extends ee{constructor(t,s,i){super(),this.condition=t,this.ifTrue=s,this.ifFalse=i,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=v(this.ifTrue),s=this.ifFalse?v(this.ifFalse):null,i=new lo(this.condition,t,s);return this.cloneInto(i),i}},Il=class co extends ee{constructor(t,s,i,n){super(),this.captureList=t,this.returnType=s,this.generator=n,this.shaderType="block-node",i&&(this.subgraph=new Sl(i))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const i in this.captureList)t[i]=v(this.captureList[i]);const s=new co(t,this.returnType,this.subgraph?v(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(s),s}},jt=class uo extends ee{constructor(t,s,i,n,r,o=!1){super(),this.token=t,this._children=s,this.isInfix=i,this.isPropertyAccess=n,this.returnType=r,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new uo(this.token,this._children.map(v),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}};var ss,Di,Gi,Vi,Hi,Bi,Xi,Ui,Yi,Wi,qi,Ki,ji,Ji;function kl(e){const t=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const s of t)if(s.includes(e))return s.map(i=>Al[i]);throw new Error("Unable to find type family")}function po(e){return new Proxy(e,{get(t,s){if(s==="constructor")return new Proxy(t.constructor,{construct:(i,n,r)=>po(new i(...n))});if(s in t)return t[s];if(typeof s=="string"){const i=kl(e.type);return tt(e,s,i[s.length-1])}}})}function st(e){return new Proxy(e,{construct:(t,s,i)=>po(new t(...s))})}function Tl(e){return new Proxy(e,{get(t,s){if(s in t)return t[s];if(typeof s=="string"){const i=parseInt(s,10);if(!isNaN(i))return tt(e,`[${i}]`,e.elementType.constructor)}}})}function zl(e){return new Proxy(e,{construct:(t,s,i)=>Tl(new t(...s))})}let Zi=class extends Error{},ct=ss=class extends D{constructor(e,t){super(),this.elementType=e,this.size=t,this.children=[],this.type="array"}clone(){const e=new ss(this.elementType,this.size);return super.cloneInto(e),e}get(e){if(typeof e=="number"){const t=new Gt(e);return t.isImplicit=!0,tt(this,t,this.elementType.constructor)}return tt(this,e,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(e,t,s){return Fl(this,e,t,s)}glslFindIndex(e,t,s){return Nl(this,e,t,s)}static ofType(e,t){const s={construct:(i,n)=>new ss(new e,t)};return new Proxy(ss,s)}};ct.type="array",ct=ss=g([zl],ct);let mt=class fo extends D{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const t=new fo;return t.children=this.children.map(v),super.cloneInto(t),t}};mt.type="sampler2D";let x=class he extends D{constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new he(v(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ot(this,typeof t=="number"?G(t,he):t)}divide(t){return _s(this,typeof t=="number"?G(t,he):t)}add(t){return xe(this,typeof t=="number"?G(t,he):t)}subtract(t){return gs(this,typeof t=="number"?G(t,he):t)}};x.type="float";let T=Di=class extends D{constructor(e,t){super(),this.type="vec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Di(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){throw new Zi}get 3(){throw new Zi}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};T.type="vec2",T=Di=g([st],T);let H=Gi=class extends D{constructor(e,t,s){super(),this.type="vec3",this.children=[e,t,s].filter(i=>i!=null)}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){throw new Zi}clone(){const e=new Gi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};H.type="vec3",H=Gi=g([st],H);let A=Vi=class extends D{constructor(e,t,s,i){super(),this.type="vec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Vi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}get 0(){return tt(this,"[0]",x)}get 1(){return tt(this,"[1]",x)}get 2(){return tt(this,"[2]",x)}get 3(){return tt(this,"[3]",x)}multiply(e){return Ot(this,typeof e=="number"?G(e,x):e)}divide(e){return _s(this,typeof e=="number"?G(e,x):e)}add(e){return xe(this,typeof e=="number"?G(e,x):e)}subtract(e){return gs(this,typeof e=="number"?G(e,x):e)}};A.type="vec4",A=Vi=g([st],A);let Xs=Hi=class extends D{constructor(e){super(),this.type="uint",this.children=[e]}clone(){const e=new Hi(v(this.children[0]));return super.cloneInto(e),e}};Xs.type="uint",Xs=Hi=g([st],Xs);let Us=Bi=class extends D{constructor(e,t){super(),this.type="uvec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Bi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Us.type="uvec2",Us=Bi=g([st],Us);let Ys=Xi=class extends D{constructor(e,t,s){super(),this.type="uvec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new Xi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Ys.type="uvec3",Ys=Xi=g([st],Ys);let Ws=Ui=class extends D{constructor(e,t,s,i){super(),this.type="uvec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ui(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Ws.type="uvec4",Ws=Ui=g([st],Ws);class j extends D{constructor(t){super(),this.type="bool",this.children=[t]}and(t){return tr(this,t)}or(t){return go(this,t)}clone(){const t=new j(v(this.children[0]));return super.cloneInto(t),t}}j.type="bool";let qs=Yi=class extends D{constructor(e,t){super(),this.type="bvec2",this.children=[e,t].filter(s=>s!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Yi(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};qs.type="bvec2",qs=Yi=g([st],qs);let Ks=Wi=class extends D{constructor(e,t,s){super(),this.type="bvec3",this.children=[e,t,s].filter(i=>i!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new Wi(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};function G(e,t){return typeof e=="number"?new t(e):e}Ks.type="bvec3",Ks=Wi=g([st],Ks);let js=qi=class extends D{constructor(e,t,s,i){super(),this.type="bvec4",this.children=[e,t,s,i].filter(n=>n!=null)}all(){return gr(this)}any(){return yr(this)}clone(){const e=new qi(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};js.type="bvec4",js=qi=g([st],js);let Gt=class le extends D{constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ot(this,G(t,le))}add(t){return xe(this,G(t,le))}subtract(t){return gs(this,G(t,le))}divide(t){return _s(this,G(t,le))}clone(){const t=new le(v(this.children[0]));return super.cloneInto(t),t}};Gt.type="int";let Js=Ki=class extends D{constructor(e,t){super(),this.type="ivec2",this.children=[e,t].filter(s=>s!=null)}clone(){const e=new Ki(v(this.children[0]),v(this.children[1]));return super.cloneInto(e),e}};Js.type="ivec2",Js=Ki=g([st],Js);let Zs=ji=class extends D{constructor(e,t,s){super(),this.type="ivec3",this.children=[e,t,s].filter(i=>i!=null)}clone(){const e=new ji(v(this.children[0]),v(this.children[1]),v(this.children[2]));return super.cloneInto(e),e}};Zs.type="ivec3",Zs=ji=g([st],Zs);let Qs=Ji=class extends D{constructor(e,t,s,i){super(),this.type="ivec4",this.children=[e,t,s,i].filter(n=>n!=null)}clone(){const e=new Ji(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(e),e}};Qs.type="ivec4",Qs=Ji=g([st],Qs);let Ll=class mo extends D{constructor(t,s,i,n){super(),this.type="mat2",this.children=[t,s,i,n]}clone(){const t=new mo(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]));return super.cloneInto(t),t}multiply(t){return Ot(this,t)}};Ll.type="mat2";let xt=class ti extends D{static identity(){return new ti(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const s=Pr(t),i=yo(t);return new ti(i,s,0,ni(s),i,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l){super(),this.type="mat3",this.children=[t,s,i,n,r,o,a,h,l]}add(t){return xe(this,t)}multiply(t){return Ot(this,t)}clone(){const t=new ti(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]));return super.cloneInto(t),t}};xt.type="mat3";class ns extends D{static identity(){return new ns(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_){super(),this.type="mat4",this.children=[t,s,i,n,r,o,a,h,l,c,u,p,d,f,m,_]}static fromColumns(t,s,i,n){return new ns(t.x,t.y,t.z,t.w,s.x,s.y,s.z,s.w,i.x,i.y,i.z,i.w,n.x,n.y,n.z,n.w)}multiply(t){return Ot(this,t)}clone(){const t=new ns(v(this.children[0]),v(this.children[1]),v(this.children[2]),v(this.children[3]),v(this.children[4]),v(this.children[5]),v(this.children[6]),v(this.children[7]),v(this.children[8]),v(this.children[9]),v(this.children[10]),v(this.children[11]),v(this.children[12]),v(this.children[13]),v(this.children[14]),v(this.children[15]));return super.cloneInto(t),t}}ns.type="mat4";const Al={float:x,vec2:T,vec3:H,vec4:A,int:Gt,ivec2:Js,ivec3:Zs,ivec4:Qs,uint:Xs,uvec2:Us,uvec3:Ys,uvec4:Ws,bool:j,bvec2:qs,bvec3:Ks,bvec4:js},ne=(...e)=>new Gt(...e),F=(...e)=>new x(...e),Qi=(...e)=>new T(...e),Ol=(...e)=>new H(...e),El=(...e)=>new A(...e),en=(...e)=>new xt(...e);function tt(e,t,s){const i=new s(new Ml(t,e,s));return i.isImplicit=!0,i}function J(e,t,s,i=null){if(i){const r=new i,o=new i(new jt(e,[t,s],!0,!1,r));return o.isImplicit=!0,o}if(t.type==="float"||t.type==="int"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}if((t.type==="mat2"||t.type==="mat3"||t.type==="mat4")&&s.type!=="float"){const r=new s.constructor(new jt(e,[t,s],!0,!1,s.constructor));return r.isImplicit=!0,r}const n=new t.constructor(new jt(e,[t,s],!0,!1,t.constructor));return n.isImplicit=!0,n}function q(e,t,s=t.constructor){const i=new s(new jt(e,[t],!1,!1,s));return i.isImplicit=!0,i}function At(e,t,s,i=t.constructor){const n=new i(new jt(e,[t,s],!1,!1,i));return n.isImplicit=!0,n}function mr(e,t,s,i,n=t.constructor){const r=new n(new jt(e,[t,s,i],!1,!1,n));return r.isImplicit=!0,r}function ni(e){return Ot(e,F(-1))}function _o(e,t,s,i){return new t(new Il(e,t,s,i))}function Fl(e,t,s=0,i=e.size){const n=new Gt(s).setMutable().setDebugName("FindIndexIterator"),r=t(e.get(n)).setDebugName("FindIndexPredicate");return _o({iter:n},Gt,r,({out:o,iter:a,subgraph:h})=>` +${o} = -1; + +for (; ${a} < ${i}; ${a}++) { + +${h.body} + + if (${h.varName}) { + ${o} = ${a}; + break; + } + +} +`).setDebugName("FindIndexBlock")}function Nl(e,t,s=0,i=e.size){return _o({array:e},Gt,null,({out:n,array:r})=>` +${n} = -1; +for (int i = ${s}; i < ${i}; i++) { + bool condition; + ${t({array:r,i:"i",out:"condition"})} + if (condition) { + ${n} = i; + break; + } +} +`).setDebugName("GlslFindIndexBlock")}function B(e,t,s){const i=typeof t=="function"?t():t,n=typeof s=="function"?s():s,r=new i.constructor(new Cl(e,i,n));return r.isImplicit=!0,r}function ms(...e){const t=e.map(([a,h])=>typeof h=="function"?[a,h()]:[a,h]),s=t[0][1].constructor,i=t.findIndex(a=>a[0]===!0);if(i===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=t.slice(0,i),r=t[i][1],o=new s(n.reduceRight((a,h)=>B(h[0],h[1],a),r));return o.isImplicit=!0,o}function Ot(e,t){return J("*",e,t)}function _s(e,t){return J("/",e,t)}function xe(e,t){return J("+",e,t)}function gs(e,t){return J("-",e,t)}function uu(e,t){return J("%",e,t)}function pu(e,t){return J(">>",e,t)}function du(e,t){return J("&",e,t)}function _r(e,t){return J("==",e,t,j)}function $l(e,t){return J("<",e,t,j)}function mi(e,t){return J("<=",e,t,j)}function et(e,t){return J(">",e,t,j)}function _i(e,t){return J(">=",e,t,j)}function go(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Rl(t,s),e[0])}function Rl(e,t){return J("||",e,t,j)}function tr(...e){return e.length<=1?e[0]:e.slice(1).reduce((t,s)=>Dl(t,s),e[0])}function Dl(e,t){return J("&&",e,t,j)}function Gl(e){return q("abs",e)}function gr(e){return q("all",e,j)}function yr(e){return q("any",e,j)}function fu(e,t){return t==null?q("atan",e):At("atan",e,t,e.constructor)}function Vl(e){return q("ceil",e)}function xr(e,t,s){return mr("clamp",e,t,s,e.constructor)}function yo(e){return q("cos",e)}function xo(e,t){return At("distance",e,t,x)}function br(e,t){return At("dot",e,t,x)}function Hl(e){return q("floor",e)}function bo(e){return q("fract",e)}function Po(e){return q("length",e,x)}function de(e,t){return At("max",e,t)}function er(e,t){return At("min",e,t)}function be(e,t,s){return mr("mix",e,t,s)}function Pe(e,t){return At("mod",e,t)}function Bl(e){return q("normalize",e)}function Xl(e){return e.type==="bool"?q("!",e):q("not",e)}function mu(e,t){return At("pow",e,t)}function _u(e){return q("round",e)}function Pr(e){return q("sin",e)}function gu(e,t,s){return mr("smoothstep",e,t,s)}function yu(e){return q("sqrt",e)}function Dt(e,t){return At("step",e,t,t.constructor)}function _t(e,t){return At("texture",e,t,A)}const Le=5;function X(e,t,s){const i=t.split(` +`);for(const n of i)if(n.trim().length){{let r="";s!=null&&(r+=`/*id:${s??"000"}*/ `),e.body+=r.padEnd(14)}e.body+=" ".repeat(e.indent)+n+` +`}}let sn=class{write(e){for(const t of e.rootOutputNodes())e.shouldPruneOutputNode(t)||(t.variableName=this._write(e,t.node));return e}_createVarName(e,t){let s="";return typeof t!="boolean"&&typeof t!="number"&&t.debugInfo.name&&(s=`${t.debugInfo.name}_`),`${s}v${e.varCount++}`}_write(e,t,s=!1){if(typeof t=="number"||typeof t=="boolean")return t.toString();let i=e.getEmit(t);if(i)return i;switch(t.shaderType){case"scope-node":i=this._writeScopeNode(e,t);break;case"primitive-node":i=this._writePrimitiveNode(e,t,s);break;case"function-node":i=this._writeFunctionNode(e,t);break;case"property-access-node":i=this._writePropertyAccessNode(e,t);break;case"text-node":i=t.text;break;case"block-node":i=this._writeBlockNode(e,t);break;case"condition-node":i=this._writeConditionNode(e,t)}return e.setEmit(t,i),i}_writeScopeNode(e,t){const s=new t.child.constructor;s.setDebugName(t.debugInfo.name);const i=this._write(e,s,!0);return X(e,`{ /*ScopeStart: ${t.uid} ${t.debugInfo.name}*/`),e.indent+=2,X(e,`${i} = ${this._write(e,t.child)};`),e.indent-=2,X(e,`} /*ScopeEnd: ${t.uid} ${t.debugInfo.name}*/`),i}_writeConditionNode(e,t){const s=new t.ifTrue.constructor,i=this._write(e,s,!0);X(e,`if (${this._write(e,t.condition)}) {`),e.indent+=2;const n=e.createSubgraphContext(),r=this._write(n,t.ifTrue);if(e.body+=n.body,r&&X(e,`${i} = ${r};`),e.indent-=2,X(e,"}"),t.ifFalse){X(e,"else {"),e.indent+=2;const o=e.createSubgraphContext(),a=this._write(o,t.ifFalse);e.body+=o.body,a&&X(e,`${i} = ${a};`),e.indent-=2,X(e,"}")}return i}_writeBlockNode(e,t){const{captureList:s,generator:i,returnType:n}=t,r={};for(const l in s){if(!s[l])continue;const c=this._write(e,s[l]);r[l]=c}const o=new n,a=this._write(e,o,!0);if(r.out=a,t.subgraph){const l=e.createSubgraphContext(),c=this._write(l,t.subgraph.child),u=l.body;r.subgraph={varName:c,body:u}}const h=i(r);return X(e,`{ +`),e.indent+=2,X(e,h),e.indent-=2,X(e,`} +`),a}_writePropertyAccessNode(e,t){const s=this._write(e,t.target);return typeof t.property=="string"&&t.property.includes("[")?`${s}${t.property}`:typeof t.property!="string"?`${s}[${this._write(e,t.property)}]`:`${s}.${t.property}`}_writeFunctionNode(e,t){const s=t.returnType.type;if(t.isInfix){const[r,o]=t.children.map(h=>this._write(e,h)),a=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${a} = ${r} ${t.token} ${o};`,t.uid),a}const i=t.children.map(r=>this._write(e,r)).join(", "),n=this._createVarName(e,t);return X(e,`${s.padEnd(Le)} ${n} = ${t.token}(${i});`,t.uid),n}_writePrimitiveNode(e,t,s=!1){const i=e.getInput(t);if(i)return i.isUsed=!0,i.variableName;const n=t.children.length===1&&t.children[0]?.type===t.type;if(t.isImplicit||n)return this._write(e,t.children[0]);const r=this._createVarName(e,t);if(s)return X(e,`${t.type.padEnd(Le)} ${r};`,t.uid),r;const o=!t.debugInfo.name&&!t.isMutable;if(o&&t.type==="float"&&typeof t.children[0]=="number")return Number.isInteger(t.children[0])?t.children[0].toFixed(1):t.children[0].toString();if(o&&t.type==="int"&&typeof t.children[0]=="number"&&Number.isInteger(t.children[0]))return t.children[0].toString();const a=t.children.map(h=>this._write(e,h)).join(", ");return t.type==="array"?(X(e,`${t.type.padEnd(Le)} ${r} = [${a}];`,t.uid),r):o?`${t.type}(${a})`:(X(e,`${t.type.padEnd(Le)} ${r} = ${t.type}(${a});`,t.uid),r)}},oe=class wo{constructor(t,s,i){this.variableName=t,this.variableInputType=s,this.node=i,this.type="shader-input",this.isUsed=!1}clone(){return new wo(this.variableName,this.variableInputType,v(this.node))}},ae=class vo{constructor(t,s,i){this.outVariableName=t,this.outVariableType=s,this.node=i,this.type="shader-output"}clone(){const t=new vo(this.outVariableName,this.outVariableType,v(this.node));return t.variableName=this.variableName,t}},rn=class ei{static createVertex(t,s,i,n,r,o){const a=[];for(const l in t){const c=t[l],u=i.get(l);u?a.push(new oe(u,"builtin",c)):a.push(new oe("a_"+l,"in",c))}for(const l of n){const c=l.uniformHydrated;a.push(new oe(l.uniformName,"uniform",c))}const h=[];for(const l in s){const c=s[l];l==="glPosition"?h.push(new ae("gl_Position","builtin",c)):l==="glPointSize"?h.push(new ae("gl_PointSize","builtin",c)):h.push(new ae("v_"+l,"out",c))}return new ei(a,h,r,o)}static createFragment(t,s,i,n,r,o){const a=[],h=Array.from(r.rootOutputNodes());for(const c in t){const u=t[c],p=i.get(c);if(p){a.push(new oe(p,"builtin",u));continue}const d=h.find(f=>f.node===u);d&&a.push(new oe(d.outVariableName,"in",u))}for(const c of n){const u=c.uniformHydrated;a.push(new oe(c.uniformName,"uniform",u))}const l=[];for(const c in s){const u=s[c],p=i.get(c);c==="discard"?l.push(new ae(null,"discard",u)):p?l.push(new ae(p,"builtin",u)):l.push(new ae(c,"out",u))}return new ei(a,l,o)}constructor(t,s,i,n){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of t)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=s,this._transformFeedbackBindings=i,this._transformFeedbackNames=new Set(i.map(r=>"v_"+r.propertyKey)),this._usedInFragmentShader=n}shouldPruneOutputNode(t){return!!this._usedInFragmentShader&&t.outVariableType!=="builtin"&&!this._transformFeedbackNames.has(t.outVariableName)&&!this._usedInFragmentShader.has(t.node.uid)}setEmit(t,s){this._nodeEmitMap.set(t.uid,s)}getEmit(t){return this._nodeEmitMap.get(t.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(t){return this._inputShaderTypesByNodeUid.get(t.uid)}*rootOutputNodes(){for(const t of this._outputShaderTypes)yield t}*nodes(){const t=[];for(const s of this._outputShaderTypes.values())t.push(s.node);for(;t.length;){const s=t.pop();typeof s!="number"&&typeof s!="boolean"&&t.push(...s.children.filter(Boolean)),yield s}}*nodesOfTypeOrFunction(){for(const t of this.nodes())typeof t!="number"&&typeof t!="boolean"&&(yield t)}createSubgraphContext(){const t=this.clone();return t.body="",t.indent=this.indent+2,t._nodeEmitMap=new Map(this._nodeEmitMap),t}clone(){const t=new ei([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return t._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,t.indent=this.indent,t.body=this.body,t.varCount=this.varCount,t._nodeEmitMap=this._nodeEmitMap,t}insertVertexShader(t){t.vertex.code.add(""),this._insertInputs(t,"vertex"),t.vertex.code.add(""),t.vertex.code.add("// OUTPUTS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes()){const i=s.outVariableType==="builtin";this.shouldPruneOutputNode(s)||(i?t.vertex.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.vertex.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`))}t.vertex.code.add(""),t.vertex.code.add("void main() {"),t.vertex.code.add(" "+this.body.split(` +`).join(` + `));for(const s of this.rootOutputNodes())this.shouldPruneOutputNode(s)||t.vertex.code.add(` ${s.outVariableName} = ${s.variableName};`);t.vertex.code.add("}")}insertFragmentShader(t){this._insertInputs(t,"fragment"),t.fragment.code.add(""),t.fragment.code.add("// OUTPUTS: "),t.fragment.code.add("// --------------------------------------------------------- ");for(const s of this.rootOutputNodes())s.outVariableType==="builtin"?t.fragment.code.add(`// ${s.outVariableType.padEnd(7)} ${s.node.type.padEnd(9)} ${s.outVariableName};`):t.fragment.code.add(`${s.outVariableType.padEnd(10)} ${s.node.type.padEnd(9)} ${s.outVariableName};`);t.fragment.code.add(""),t.fragment.code.add("void main() {"),t.fragment.code.add(" "+this.body.split(` +`).join(` + `));for(const s of this.rootOutputNodes())s.outVariableType==="discard"?(t.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),t.fragment.code.add(` if (${s.variableName}) {`),t.fragment.code.add(" discard;"),t.fragment.code.add(" }"),t.fragment.code.add(" ")):t.fragment.code.add(` ${s.outVariableName} = ${s.variableName};`);t.fragment.code.add("}")}_insertInputs(t,s){t[s].code.add("// INPUTS: "),t[s].code.add("// --------------------------------------------------------- ");for(const i of this.inputs())i.isUsed&&i.variableInputType!=="builtin"&&(i.node.type==="array"?t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.elementType.type.padEnd(9)} ${i.variableName}[${i.node.size}];`):t[s].code.add(`${i.variableInputType.padEnd(10)} ${i.node.type.padEnd(9)} ${i.variableName};`))}};const Ul=()=>ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function Ae(e,t,s){const i=t.length;if(i!==s){const n=new pn("Invalid Uniform",`Invalid length, expected ${s} but got ${i}`,{uniformName:e,values:t});Ul().errorOnce(n)}}let nn=class{constructor(e,t,s,i,n,r){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=s,this._locationInfo=i,this._uniformBindings=n,this._transformFeedbackBindings=r}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const i=new Map;for(const[r,o]of this._locations)i.set(r,o);const n=[];for(const r of this._transformFeedbackBindings??[]){const{index:o,propertyKey:a}=r;n[o]=`v_${a}`}this._program=new ka(e,this.vertexShader,this.fragmentShader,i,new Map,n)}const s=this._program;e.useProgram(s);for(const i of this._uniformBindings){const{shaderModulePath:n,uniformName:r,uniformType:o,uniformArrayLength:a}=i,h=Wo(n,t);if(h==null){if(o==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${n}`)}switch(o==="array"?i.uniformArrayElementType:o){case"sampler2D":{const{unit:l,texture:c}=h;if(s.setUniform1i(r,l),"type"in c)e.bindTexture(c,l);else{const u=Ca(e,c.descriptor,c.data);e.bindTexture(u,l)}break}case"int":if(!a){s.setUniform1i(r,h);break}Ae(i.uniformName,h,a),s.setUniform1iv(r,h);break;case"float":if(!a){s.setUniform1f(r,h);break}Ae(i.uniformName,h,a),s.setUniform1fv(r,h);break;case"vec2":if(!a){s.setUniform2f(r,h[0],h[1]);break}Ae(i.uniformName,h,a),s.setUniform2fv(r,h.flat());break;case"vec3":if(!a){s.setUniform3f(r,h[0],h[1],h[2]);break}Ae(i.uniformName,h,a),s.setUniform3fv(r,h.flat());break;case"vec4":if(!a){s.setUniform4f(r,h[0],h[1],h[2],h[3]);break}Ae(i.uniformName,h,a),s.setUniform4fv(r,h.flat());break;case"mat3":s.setUniformMatrix3fv(r,h);break;case"mat4":s.setUniformMatrix4fv(r,h);break;default:throw new Error(`Unable to set uniform for type ${o}`)}}}};function Oe(e){return new e}function ys(e,t,s){const i=e.constructor[t]??[];e.constructor.hasOwnProperty(t)||Object.defineProperty(e.constructor,t,{value:i.slice()}),e.constructor[t].push(s)}function k(e,t){return(s,i)=>{ys(s,"locations",{typeCtor:t,propertyKey:i,parameterIndex:null,index:e})}}const R=e=>(t,s,i)=>{ys(t,"inputs",{inputCtor:e,propertyKey:s,parameterIndex:i})},M=e=>(t,s)=>{ys(t,"uniforms",{typeCtor:e,propertyKey:s})},Y=e=>(t,s)=>{ys(t,"options",{typeCtor:e,propertyKey:s})},on=(e,t)=>{ys(e,"defines",{propertyKey:t})},sr=(e,t)=>(s,i)=>{s.constructor.builtins.push({builtin:e,propertyKey:i,typeCtor:t})};class ir{}ir.builtins=[],g([sr("gl_VertexID",Gt)],ir.prototype,"glVertexID",void 0);let Yl=class{},os=class{};os.builtins=[],g([sr("gl_FragCoord",A)],os.prototype,"glFragCoord",void 0),g([sr("gl_PointCoord",T)],os.prototype,"glPointCoord",void 0);let Wl=class{},it=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},ql=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return this._shaderModuleClass.inputs.findLast(e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=this._shaderModuleClass.inputs.findLast(t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const s of this.locations)t.has(s.index)?ge.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${s.propertyKey} to ${s.index}. Index already in use`,{locationsMap:e}):(e.set(s.propertyKey,s.index),t.add(s.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,r])=>`${n}.${r}`).join("."),s=Bo(t),i=this.computeAttributes;this._locationInfo={hash:s,locations:e,computeAttributeMap:i}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,s,i){try{const{vertex:n,fragment:r,uniformBindings:o}=this._generateShaders(e,t,s,i);return new nn(n,r,this.renamedLocationsMap,this.locationInfo,o,this.transformFeedbackBindings)}catch{return new nn("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(i=>i.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const s=this._uniforms.find(i=>i.propertyKey===e);if(!s)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:s.typeCtor}}getShaderKey(e,t,s,i){const n=Object.keys(e).map(h=>`${h}.${e[h]}`).join("."),r=Object.keys(s).map(h=>`${h}.${s[h]}`).join("."),o=Object.keys(i).map(h=>`${h}.${i[h]}`).join("."),a=Object.keys(t).filter(h=>this.optionPropertyKeys.has(h)&&t[h]).join(".");return`${this.constructor.name}.${n}.${r}.${o}.${a}`}_generateShaders(e,t,s,i){const n=[];this._setDefines(s),this._setOptionalUniforms(n,t),this._setRequiredUniforms(n);const r=this._hydrateVertexInput(i),o=this._injectPackPrecisionFactor(r,e),a=this._hydrateComputeInput(),h=a&&this._injectComputePackPrecisionFactor(a,e),l=this.vertex(o,h),c=this._hydrateFragmentInput(l),u=this.fragment(c),p=new Set;for(const w in u){const S=u[w];vl(p,S)}const d=this._getVertexInputBuiltins(),f=rn.createVertex({...r,...a},l,d,n,this.transformFeedbackBindings,p);new sn().write(f);const m=this._getFragmentInputBuiltins(u);m.set("glPointCoord","gl_PointCoord");const _=rn.createFragment(c,u,m,n,f,this.transformFeedbackBindings);new sn().write(_);const y=this._createShaderBuilder(f,_),b=y.generate("vertex",!0),P=y.generate("fragment",!0);return this.logShader&&(console.log(b),console.log(P)),{vertex:b,fragment:P,uniformBindings:n}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const s of this._options)t[s.propertyKey]?this[s.propertyKey]=this._hydrateUniformGroup(e,s):this[s.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const s=new t.typeCtor;for(const i of s._uniforms??[]){const n=Oe(i.typeCtor),r=`u_${t.propertyKey}_${i.propertyKey}`,o=n.type,a=[t.propertyKey,i.propertyKey].join(".");if("type"in i.typeCtor&&i.typeCtor.type==="array"){const h=n;e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformArrayLength:h.size,uniformArrayElementType:h.elementType.type,uniformHydrated:n})}else e.push({shaderModulePath:a,uniformName:r,uniformType:o,uniformHydrated:n});s[i.propertyKey]=n}return s}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,s=t.locations.reduce((i,n)=>e[n.propertyKey]===!1?i:{...i,[n.propertyKey]:Oe(n.typeCtor)},{});for(const{propertyKey:i,typeCtor:n}of t.builtins){const r=Oe(n);s[i]=r}return s}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:Oe(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const s={};for(const i in e){const n=e[i],r=t[i];if(r){if(n.type!=="float"&&n.type!=="vec2"&&n.type!=="vec3"&&n.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${n.type}`);s[i]=n.divide(new x(r))}else s[i]=n}return s}_injectComputePackPrecisionFactor(e,t){const s={},i=new Map;for(const n in this.computeAttributes)for(const r of this.computeAttributes[n]??[])i.set(r,n);for(const n in e){const r=e[n],o=i.get(n);if(!o)continue;const a=t[o];if(a){if(r.type!=="float"&&r.type!=="vec2"&&r.type!=="vec3"&&r.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${r.type}`);s[n]=r.divide(new x(a))}else s[n]=r}return s}_hydrateFragmentInput(e){const t={};for(const s in e)t[s]=e[s];for(const{propertyKey:s,typeCtor:i}of os.builtins){const n=Oe(i);t[s]=n}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:s,propertyKey:i}of e.builtins)t.set(i,s);return t}_getFragmentInputBuiltins(e){const t=e.constructor,s=new Map;for(const i of t.builtins??[])s.set(i.propertyKey,i.builtin);return s}_createShaderBuilder(e,t){const s=new ml;return this._insertDebugInfo(s),e.insertVertexShader(s),t.insertFragmentShader(s),s}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};function an(e){const t=F(12.9898),s=F(78.233),i=F(43758.5453),n=br(e,Qi(t,s)),r=Pe(n,F(3.14));return bo(Pr(r).multiply(i))}function te(e){return _r(e,F(ll))}function Kl(e,t){return e.x.multiply(t.y).subtract(t.x.multiply(e.y))}function jl(e){return e.multiply(2).subtract(1)}function Vt(e,t){const s=F(2**t);return Pe(Hl(e.divide(s)),F(2))}function xu(e,t){return et(Vt(e,t),F(.5))}function Ii(e,t){return Vt(e,t+mn)}function Jl(e,t){return Vt(e,t)}function Zl(e){const t=Vt(e.z,7),s=F(1).subtract(t),i=e.xyz.subtract(Ol(0,0,F(128)));return s.multiply(e).add(t.multiply(i))}function Ql(e){const t=El(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return br(e,t)}function bu(e){return de(de(de(e.x,e.y),e.z),e.w)}function Pu(e){return new x(1).subtract(e)}function wu(e){return e.subtract(new x(1))}function vu(e,t){return e.subtract(new x(t))}let ft=class extends it{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=_t(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=Zl(e),s=this.size,i=ne(t.x),n=ne(t.y).multiply(ne(256)),r=ne(t.z).multiply(ne(256)).multiply(ne(256)),o=F(i.add(n).add(r)),a=Pe(o,s),h=o.subtract(a).divide(s);this._uv=new T(a,h).add(.5).divide(s)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return _t(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return _t(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return _t(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return _t(this.gpgpu,t).setDebugName("storage4")}getLocalTimeOrigin(e){const t=this.getAttributeDataCoords(e);return _t(this.localTimeOrigin,t).x.setDebugName("storage5")}getFilterFlags(e){return li("webgl-ignores-sampler-precision")?Vl(this.getFilterData(e).x.multiply(F(255))):this.getFilterData(e).x.multiply(F(255))}getLabelVisibility(e){const t=this.getFilterData(e).y.multiply(255);return new x(1).subtract(t)}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};g([M(mt)],ft.prototype,"filterFlags",void 0),g([M(mt)],ft.prototype,"animation",void 0),g([M(mt)],ft.prototype,"gpgpu",void 0),g([M(mt)],ft.prototype,"localTimeOrigin",void 0),g([M(mt)],ft.prototype,"visualVariableData",void 0),g([M(mt)],ft.prototype,"dataDriven0",void 0),g([M(mt)],ft.prototype,"dataDriven1",void 0),g([M(mt)],ft.prototype,"dataDriven2",void 0),g([M(x)],ft.prototype,"size",void 0);let rr=class extends it{};g([M(x)],rr.prototype,"activeReasons",void 0),g([M(x)],rr.prototype,"highlightAll",void 0);let is=class extends it{};g([M(T)],is.prototype,"position",void 0),g([M(x)],is.prototype,"distance",void 0),g([M(x)],is.prototype,"smallSymbolDistance",void 0),g([M(x)],is.prototype,"smallSymbolSizeThreshold",void 0);let K=class extends it{};g([M(xt)],K.prototype,"displayViewScreenMat3",void 0),g([M(xt)],K.prototype,"displayViewMat3",void 0),g([M(xt)],K.prototype,"displayMat3",void 0),g([M(xt)],K.prototype,"viewMat3",void 0),g([M(xt)],K.prototype,"tileMat3",void 0),g([M(x)],K.prototype,"displayZoomFactor",void 0),g([M(x)],K.prototype,"requiredZoomFactor",void 0),g([M(T)],K.prototype,"tileOffset",void 0),g([M(x)],K.prototype,"currentScale",void 0),g([M(x)],K.prototype,"currentZoom",void 0),g([M(x)],K.prototype,"metersPerSRUnit",void 0),g([M(x)],K.prototype,"rotation",void 0),g([M(x)],K.prototype,"pixelRatio",void 0);let Zt=class extends ir{};g([k(0,H)],Zt.prototype,"id",void 0),g([k(1,x)],Zt.prototype,"bitset",void 0),g([k(2,T)],Zt.prototype,"pos",void 0);let zt=class extends Yl{};g([k(14,T)],zt.prototype,"nextPos1",void 0),g([k(15,T)],zt.prototype,"nextPos2",void 0);let gi=class extends os{},It=class extends ql{clip(e,t){let s=new x(0);const i=this.storage.getFilterFlags(e);if(s=s.add(F(2).multiply(F(1).subtract(Ii(i,0)))),this.inside?s=s.add(F(2).multiply(F(1).subtract(Ii(i,1)))):this.outside?s=s.add(F(2).multiply(Ii(i,1))):this.highlight&&(s=s.add(F(2).multiply(F(1).subtract(this._checkHighlight(i))))),t!=null){const n=new x(1).subtract(Dt(t.x,this.view.currentZoom)),r=Dt(t.y,this.view.currentZoom);s=s.add(new x(2).multiply(n.add(r)))}return s}getFragmentOutput(e,t,s=new x(1/255)){const i=new Wl;return i.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,s)??e,i}_maybeHighlight(e,t){return this.highlight?new A(e.rgb,Dt(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let s=1;s{const h=as(e,t,s),l=as(e,s,i),c=as(e,i,t);return er(er(h,l),c)}])}function So(e){return e.distance.add(1)}function wr(e,t,s){const{viewMat3:i,tileMat3:n}=e.view,r=i.multiply(n),o=r.multiply(new H(t.pos,1)),a=r.multiply(new H(s.nextPos1,1)),h=r.multiply(new H(s.nextPos2,1));return rc(e.hittestRequest.position,o.xy,a.xy,h.xy)}function Su(e,t,s){return xo(e,s).subtract(t)}let us=class extends it{getColor(e,t,s){return ms([go(te(e),s),t],[mi(e,this.values.first()),this.colors.first()],[_i(e,this.values.last()),this.colors.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.colors.get(r),this.colors.get(i),a)}])}};g([M(ct.ofType(A,8))],us.prototype,"colors",void 0),g([M(ct.ofType(x,8))],us.prototype,"values",void 0);let ps=class extends it{getOpacity(e){return ms([te(e),new x(1)],[mi(e,this.opacityValues.first()),this.opacities.first()],[_i(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(o=>et(o,e)),s=this.opacityValues.get(t),i=t.subtract(1),n=this.opacityValues.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.opacities.get(i),this.opacities.get(t),r)}])}};g([M(ct.ofType(x,8))],ps.prototype,"opacities",void 0),g([M(ct.ofType(x,8))],ps.prototype,"opacityValues",void 0);function Mo(e){return e.visualVariableSizeMinMaxValue!=null||e.visualVariableSizeScaleStops!=null||e.visualVariableSizeStops!=null||e.visualVariableSizeUnitValue!=null}function nc(e,t,s){if(Mo(e)){const i=e.storage.getSizeValue(t);return e.visualVariableSizeMinMaxValue?.getSize(i,s)??e.visualVariableSizeScaleStops?.getSizeForViewScale(e.view.currentScale)??e.visualVariableSizeStops?.getSize(i,s)??e.visualVariableSizeUnitValue?.getSize(i,s)}return s}function vr(e,t,s,i=new j(!1)){if(e.visualVariableColor==null)return s;const n=e.storage.getColorValue(t);return e.visualVariableColor.getColor(n,s,i)}function Sr(e,t){if(e.visualVariableOpacity==null)return new x(1);const s=e.storage.getOpacityValue(t);return e.visualVariableOpacity.getOpacity(s)}function Mu(e,t){if(e.visualVariableRotation==null)return xt.identity();const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getVVRotationMat3(s)}function Cu(e,t){if(e.visualVariableRotation==null)return new x(0);const s=e.storage.getRotationValue(t);return e.visualVariableRotation.getNormalizedAngle(s)}let ds=class extends Zt{};g([k(3,A)],ds.prototype,"color",void 0),g([k(4,T)],ds.prototype,"zoomRange",void 0);let ue=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const s=Sr(this,e.id),i=vr(this,e.id,e.color).multiply(s),n=this.view.displayViewScreenMat3.multiply(new H(e.pos.xy,1)),r=this.clip(e.id,e.zoomRange);return{glPosition:new A(n.xy,r,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new x(0))}hittest(e,t){return wr(this,e,t)}};g([Y(us)],ue.prototype,"visualVariableColor",void 0),g([Y(ps)],ue.prototype,"visualVariableOpacity",void 0),g([$(0,R(ds)),$(1,R(zt))],ue.prototype,"vertex",null),g([$(0,R(gi))],ue.prototype,"fragment",null);let me=class extends it{getPatternOffsetAtTileOrigin(e,t=new x(0),s=new x(1)){const i=new T(dl).divide(e);let n=e.multiply(bo(this.maxIntsToLocalOrigin.multiply(i))).add(this.tileOffsetFromLocalOrigin).subtract(new x(.5).multiply(e));return n=new T(n.x.multiply(s).subtract(n.y.multiply(t)),n.x.multiply(t).add(n.y.multiply(s))),Pe(n,e)}};g([M(T)],me.prototype,"tileOffsetFromLocalOrigin",void 0),g([M(T)],me.prototype,"maxIntsToLocalOrigin",void 0);let _e=class extends it{};g([M(T)],_e.prototype,"size",void 0),g([M(mt)],_e.prototype,"texture",void 0);let Ut=class extends ds{};g([k(5,A)],Ut.prototype,"tlbr",void 0),g([k(6,x)],Ut.prototype,"width",void 0),g([k(7,x)],Ut.prototype,"height",void 0),g([k(8,T)],Ut.prototype,"offset",void 0),g([k(9,T)],Ut.prototype,"scale",void 0),g([k(10,x)],Ut.prototype,"angle",void 0);let oc=class extends gi{};function ac(e,t,s,i,n){const r=_r(Vt(n,pl),F(1)),o=Ql(new A(e,0));return B(r,en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,an(Qi(o,0)),an(Qi(0,o)),1),en(i.divide(t.x),s.divide(t.y),0,ni(s.divide(t.x)),i.divide(t.y),0,0,0,1))}function Co(e,t){const s=e.view.requiredZoomFactor,i=new T(t.width,t.height),n=i.multiply(t.scale).multiply(s),r=t.angle.multiply(nl),o=Pr(r),a=yo(r),h=ac(t.id,n,o,a,t.bitset),l=e.localTileOffset.getPatternOffsetAtTileOrigin(i,o,a),c=s.multiply(t.scale).multiply(t.offset.subtract(l)).divide(n),u=new H(t.pos,1),p=h.multiply(u).xy.subtract(c),d=t.tlbr.divide(e.mosaicInfo.size.xyxy);let f=Vt(t.bitset,cl);return e.visualVariableColor!=null&&(f=B(te(e.storage.getColorValue(t.id)),new x(0),f)),{tileTextureCoord:p,tlbr:d,sampleAlphaOnly:f}}function Io(e,t){const s=Pe(t.tileTextureCoord,new x(1)),i=be(t.tlbr.xy,t.tlbr.zw,s);let n=_t(e.mosaicInfo.texture,i);return n=B(et(t.sampleAlphaOnly,new x(.5)),n.aaaa,n),t.color.multiply(n)}let Es=class extends ue{vertex(e,t){return{...super.vertex(e,t),...Co(this,e)}}fragment(e){const t=Io(this,e);return this.getFragmentOutput(t,e,new x(0))}};g([M(_e)],Es.prototype,"mosaicInfo",void 0),g([M(me)],Es.prototype,"localTileOffset",void 0),g([$(0,R(Ut)),$(1,R(zt))],Es.prototype,"vertex",null),g([$(0,R(oc))],Es.prototype,"fragment",null);let Mr=class extends it{getSize(e,t){const s=this.minMaxValueAndSize.xy,i=this.minMaxValueAndSize.zw;return B(te(e),t,()=>{const n=e.subtract(s.x).divide(s.y.subtract(s.x)),r=xr(n,new x(0),new x(1));return i.x.add(r.multiply(i.y.subtract(i.x)))})}};g([M(A)],Mr.prototype,"minMaxValueAndSize",void 0);let oi=class extends it{getSizeForViewScale(e){return ms([mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(o=>et(o,e)),s=this.values.get(t),i=t.subtract(1),n=this.values.get(i),r=e.subtract(n).divide(s.subtract(n));return be(this.sizes.get(i),this.sizes.get(t),r)}])}};g([M(ct.ofType(x,8))],oi.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],oi.prototype,"values",void 0);let ai=class extends it{getSize(e,t){const s=ms([te(e),t],[mi(e,this.values.first()),this.sizes.first()],[_i(e,this.values.last()),this.sizes.last()],[!0,()=>{const i=this.values.findIndex(h=>et(h,e)),n=this.values.get(i),r=i.subtract(1),o=this.values.get(r),a=e.subtract(o).divide(n.subtract(o));return be(this.sizes.get(r),this.sizes.get(i),a)}]);return B(te(s),t,s)}};g([M(ct.ofType(x,8))],ai.prototype,"sizes",void 0),g([M(ct.ofType(x,8))],ai.prototype,"values",void 0);let Cr=class extends it{getSize(e,t){return B(te(e),t,e.multiply(this.unitValueToPixelsRatio))}};g([M(x)],Cr.prototype,"unitValueToPixelsRatio",void 0);class Yt extends Zt{}g([k(3,A)],Yt.prototype,"color",void 0),g([k(4,T)],Yt.prototype,"offset",void 0),g([k(5,T)],Yt.prototype,"normal",void 0),g([k(6,x)],Yt.prototype,"halfWidth",void 0),g([k(7,x)],Yt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Yt.prototype,"zoomRange",void 0);let ko=class extends gi{},hi=class extends it{};function To(e){return de(new x(ol).multiply(Dt(e,new x(al))),new x(1))}function hc(e,t){const{halfWidth:s,normal:i}=e,n=To(s),r=Po(i).multiply(s);return xr(n.multiply(s.subtract(r)).divide(t.add(n).subtract(new x(1))),new x(0),new x(1))}function lc(e,t){const{id:s,halfWidth:i,referenceHalfWidth:n}=t;if(Mo(e)){const r=new x(2).multiply(n),o=nc(e,s,r);return new x(.5).multiply(i.divide(de(n,new x(hl)))).multiply(o)}return i}function zo(e,t){const{id:s,offset:i,pos:n,normal:r,zoomRange:o}=t,{displayViewScreenMat3:a,displayViewMat3:h}=e.view,l=vr(e,s,t.color),c=Sr(e,s),u=lc(e,t),p=new x(.5).multiply(e.antialiasingControls.antialiasing),d=de(u.add(p),new x(.45)).add(new x(.1).multiply(p)),f=To(d).multiply(d).multiply(i),m=h.multiply(new H(f,new x(0))),_=a.multiply(new H(n,new x(1))).add(m),y=new x(2).multiply(Dt(u,new x(0))).add(e.clip(s,o)),b=new A(_.xy,y,1);return{color:l,opacity:c,halfWidth:d,normal:r,scaledOffset:f,scaledHalfWidth:u,glPosition:new A(b.xy,y,1)}}function yi(e,t){const{opacity:s,color:i}=e,n=hc(e,t);return s.multiply(i).multiply(n)}g([M(x)],hi.prototype,"antialiasing",void 0),g([M(x)],hi.prototype,"blur",void 0);class vt extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,s){const i=zo(this,t);return{...i,...this.maybeRunHittest(t,s,i.halfWidth)}}fragment(t){const s=yi(t,this.antialiasingControls.blur);return this.getFragmentOutput(s,t)}hittest(t,s,i){const{viewMat3:n,tileMat3:r}=this.view,o=n.multiply(r),a=o.multiply(new H(t.pos,1)),h=o.multiply(new H(s.nextPos1,1)),l=o.multiply(new H(s.nextPos2,1)),{distance:c,smallSymbolDistance:u,smallSymbolSizeThreshold:p}=this.hittestRequest,d=Dt(i,p.multiply(.5)).multiply(c.subtract(u)),f=this.hittestRequest.position;return er(as(f,a.xy,h.xy),as(f,a.xy,l.xy)).subtract(i).add(d)}}g([M(hi)],vt.prototype,"antialiasingControls",void 0),g([Y(us)],vt.prototype,"visualVariableColor",void 0),g([Y(ps)],vt.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],vt.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],vt.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],vt.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],vt.prototype,"visualVariableSizeUnitValue",void 0),g([$(0,R(Yt)),$(1,R(zt))],vt.prototype,"vertex",null),g([$(0,R(ko))],vt.prototype,"fragment",null);class Nt extends Zt{}g([k(3,T)],Nt.prototype,"offset",void 0),g([k(4,A)],Nt.prototype,"color",void 0),g([k(5,T)],Nt.prototype,"normal",void 0),g([k(6,x)],Nt.prototype,"halfWidth",void 0),g([k(7,x)],Nt.prototype,"referenceHalfWidth",void 0),g([k(8,T)],Nt.prototype,"zoomRange",void 0);let Lo=class extends ko{};function Ir(e,t,s){const{id:i,bitset:n}=t,r=Vt(n,ul),o=et(r,new x(.5)),a=zo(e,t),h=B(o,a.halfWidth,new x(0)),l=Sr(e,i),c=vr(e,i,t.color),u=B(o,t.color,c.multiply(l)),p=e.view.displayViewScreenMat3.multiply(new H(t.pos.xy,1)),d=e.clip(t.id),f=new A(p.xy,d,1),m=B(o,a.glPosition,f),_=s&&e.maybeRunHittest(t,s,o);return{isOutline:r,color:u,opacity:new x(1),halfWidth:h,normal:a.normal,glPosition:m,..._}}let Ct=class extends It{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};g([M(hi)],Ct.prototype,"antialiasingControls",void 0),g([Y(us)],Ct.prototype,"visualVariableColor",void 0),g([Y(ps)],Ct.prototype,"visualVariableOpacity",void 0),g([Y(Mr)],Ct.prototype,"visualVariableSizeMinMaxValue",void 0),g([Y(oi)],Ct.prototype,"visualVariableSizeScaleStops",void 0),g([Y(ai)],Ct.prototype,"visualVariableSizeStops",void 0),g([Y(Cr)],Ct.prototype,"visualVariableSizeUnitValue",void 0);class nr extends Ct{vertex(t,s){return Ir(this,t,s)}fragment(t){const{color:s,isOutline:i}=t,n=et(i,new x(.5)),r=yi(t,this.antialiasingControls.blur),o=B(n,r,s),a=B(n,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([$(0,R(Nt)),$(1,R(zt))],nr.prototype,"vertex",null),g([$(0,R(Lo))],nr.prototype,"fragment",null);let or=class extends ds{};g([k(5,A)],or.prototype,"tlbr",void 0),g([k(6,x)],or.prototype,"inverseRasterizationScale",void 0);class cc extends gi{}function uc(e){const t=new x(1),s=new x(0);return new xt(t.divide(e.x),s.divide(e.y),0,ni(s.divide(e.x)),t.divide(e.y),0,0,0,1)}function Ao(e,t){const s=t.tlbr.xy,i=t.tlbr.zw,n=i.x.subtract(s.x),r=s.y.subtract(i.y),o=new T(n,r).multiply(t.inverseRasterizationScale),a=o.multiply(e.view.requiredZoomFactor),h=uc(a),l=e.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new H(t.pos,1);return{tileTextureCoord:h.multiply(c).xy.subtract(l),tlbr:t.tlbr.divide(e.mosaicInfo.size.xyxy)}}function Oo(e,t){const s=Pe(e.tileTextureCoord,new x(1)),i=be(e.tlbr.xy,e.tlbr.zw,s),n=_t(t.texture,i);return e.color.multiply(n)}class Fs extends ue{vertex(t,s){return{...super.vertex(t,s),...Ao(this,t)}}fragment(t){const s=Oo(t,this.mosaicInfo);return this.getFragmentOutput(s,t,new x(0))}}g([M(_e)],Fs.prototype,"mosaicInfo",void 0),g([M(me)],Fs.prototype,"localTileOffset",void 0),g([$(0,R(or)),$(1,R(zt))],Fs.prototype,"vertex",null),g([$(0,R(cc))],Fs.prototype,"fragment",null);let ar=class extends Nt{};g([k(9,A)],ar.prototype,"tlbr",void 0),g([k(10,x)],ar.prototype,"inverseRasterizationScale",void 0);let Eo=class extends Lo{},Ns=class extends nr{vertex(e,t){return{...Ir(this,e,t),...Ao(this,e)}}fragment(e){const{isOutline:t}=e,s=et(t,new x(.5)),i=yi(e,this.antialiasingControls.blur),n=Oo(e,this.mosaicInfo),r=B(s,i,n),o=B(s,new x(1/255),new x(0));return this.getFragmentOutput(r,e,o)}};g([M(_e)],Ns.prototype,"mosaicInfo",void 0),g([M(me)],Ns.prototype,"localTileOffset",void 0),g([$(0,R(ar)),$(1,R(zt))],Ns.prototype,"vertex",null),g([$(0,R(Eo))],Ns.prototype,"fragment",null);const pc=16,hn=1/pc,dc=128;class St extends Zt{}g([k(3,A)],St.prototype,"color",void 0),g([k(4,A)],St.prototype,"tlbr",void 0),g([k(5,x)],St.prototype,"angle",void 0),g([k(6,x)],St.prototype,"aux1",void 0),g([k(7,x)],St.prototype,"aux2",void 0),g([k(8,T)],St.prototype,"aux3",void 0),g([k(9,T)],St.prototype,"aux4",void 0),g([k(10,T)],St.prototype,"zoomRange",void 0);class fc extends Eo{}class $s extends Ct{vertex(t,s){const{aux1:i,aux2:n,aux3:r,aux4:o}=t,a={...t,width:i,height:n,offset:r,scale:o.multiply(hn)},h={...t,halfWidth:i,referenceHalfWidth:n,offset:r,normal:o.subtract(dc).multiply(hn)},l=Ir(this,h),c=Co(this,a),u=et(l.isOutline,new x(.5));return{...l,...c,...this.maybeRunHittest(t,s,u)}}fragment(t){const{isOutline:s}=t,i=et(s,new x(.5)),n=yi(t,this.antialiasingControls.blur),r=Io(this,t),o=B(i,n,r),a=B(i,new x(1/255),new x(0));return this.getFragmentOutput(o,t,a)}hittest(t,s,i){return B(i,So(this.hittestRequest),wr(this,t,s))}}g([M(_e)],$s.prototype,"mosaicInfo",void 0),g([M(me)],$s.prototype,"localTileOffset",void 0),g([$(0,R(St)),$(1,R(zt))],$s.prototype,"vertex",null),g([$(0,R(fc))],$s.prototype,"fragment",null);const mc=8388607,_c=8388608,Iu=e=>e&mc;function ku(e,t){return((t?_c:0)|e)>>>0}var ln;(function(e){e.Local="Local",e.Global="Global"})(ln||(ln={}));class we{generateSource(t){const s=[];for(let n=1;n= ${hr}) { top = ${hr-1}; }`);return s}}let ve=128;class gc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class yc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class xc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class bc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function hs(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${e.out} = oscillate ? 1.0 - of : of;`]}const Pc={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},wc={Loop:1,None:2,Oscillate:3},vc={Local:1,Global:2};function ls(e){const t=Pc[e.easing],s=wc[e.repeatType],i=vc[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}class Sc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...hs({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;",` + vec2 translation = vec2( + cos1 * s1 * x2 - sin1 * s1 * y2 + x1, + sin1 * s1 * x2 + cos1 * s1 * y2 + y1 + ); + `,"out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...ls(t.translation.timing),...ls(t.rotation.timing),...ls(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class Mc extends we{constructor(){super(...arguments),this.opcode=++ve,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...hs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...hs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...ls(t.color.timing),...ls(t.opacity.timing)]}}const cn={scalar:new yc,vector3:new xc,vector4:new bc,animatedTransform:new Sc,animatedColor:new Mc,ret:new gc},Cc=40,hr=4;function Tu(e){const t=[];t.push(`float globalTime = ${e.globalTime};`),t.push(`float localTimeOrigin = ${e.localTimeOrigin};`),t.push(`vec2 pointer = ${e.animationPointer};`),t.push(`vec2 size = ${e.animationTextureSize};`),t.push("int top = 0;"),t.push(`vec4 stack[${hr}];`),t.push(`for (int counter = 0; counter < ${Cc}; counter++) {`),t.push(`vec4 atom0 = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;"),t.push(`vec2 pixelDimensions = ${e.pixelDimensions};`),t.push("if (false) {");for(const s in cn){const i=cn[s];t.push(`} else if (int(atom0.x) == ${i.opcode}) {`);for(const n of i.generateSource(e))t.push(n)}return t.push("} // End if-else."),t.push("} // End for."),t.push(`${e.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),t.join(` +`)}let Rs=class extends Go{constructor(e){super(e),this.debugName="",this._updatingHandles=new za,this._idToUpdatingState=new Ta}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(li("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([s,i])=>`-> ${s}: ${i}`).join(` +`);console.log(`${this.debugName}: Updating: ${e} +-> Handles: ${this._updatingHandles.updating} +${t}`)}return e}addUpdateTracking(e,t){const s=Vo(()=>t.updating,i=>this._idToUpdatingState.set(e,i),{sync:!0});this.addHandles(s)}addPromise(e){return this._updatingHandles.addPromise(e)}};g([kr({constructOnly:!0})],Rs.prototype,"debugName",void 0),g([kr({readOnly:!0})],Rs.prototype,"updating",null),Rs=g([$o("esri.views.2d.layers.support.UpdateTracking2D")],Rs);export{te as $,on as A,xh as B,it as C,Fr as D,N as E,B as F,cn as G,bh as H,ns as I,zh as J,Th as K,A as L,xt as M,_r as N,lh as O,pl as P,ku as Q,fh as R,x as S,Zr as T,au as U,Zt as V,lu as W,ou as X,hu as Y,Iu as Z,nl as _,Rs as a,su as a$,It as a0,Cu as a1,Pr as a2,yo as a3,H as a4,mi as a5,ms as a6,_t as a7,Ql as a8,iu as a9,Po as aA,gu as aB,br as aC,bu as aD,ue as aE,Es as aF,$s as aG,nr as aH,Fs as aI,Ns as aJ,Su as aK,er as aL,Hl as aM,ru as aN,Mu as aO,nu as aP,Gt as aQ,pu as aR,du as aS,vt as aT,Yt as aU,bo as aV,yu as aW,mu as aX,zo as aY,hc as aZ,mt as a_,xr as aa,Gl as ab,Yl as ac,Vt as ad,Ll as ae,nc as af,vr as ag,go as ah,j as ai,xu as aj,be as ak,Sr as al,$l as am,xo as an,rc as ao,et as ap,sc as aq,T as ar,ni as as,ec as at,Dt as au,So as av,R as aw,ir as ax,ql as ay,de as az,pc as b,_o as b0,Tu as b1,_e as b2,us as b3,ps as b4,Mr as b5,oi as b6,ai as b7,Cr as b8,Wl as b9,K as ba,gi as bb,zt as bc,os as bd,nn as be,jl as bf,Pu as bg,wu as bh,vu as bi,_u as bj,uu as bk,Ot as bl,fu as bm,cu as bn,tu as bo,Qc as bp,Jc as bq,eu as br,Zc as bs,qc as bt,Fi as bu,Kc as c,ul as d,dc as e,jr as f,Oa as g,Kn as h,jc as i,mh as j,re as k,ln as l,_h as m,Wc as n,vh as o,Ih as p,Ch as q,Yn as r,mc as s,k as t,Yc as u,M as v,Y as w,cl as x,ll as y,ct as z}; diff --git a/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CQ9rGZXi.js b/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CQ9rGZXi.js deleted file mode 100644 index d74f4be8..00000000 --- a/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CQ9rGZXi.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./story-OUarUCIt.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; diff --git a/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CobdaRul.js b/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CobdaRul.js new file mode 100644 index 00000000..f6d978f3 --- /dev/null +++ b/custom-toc-separator/assets/UpdatingHandles-CUu3u1ms-CobdaRul.js @@ -0,0 +1 @@ +import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./story-DT1Ep1ux.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; diff --git a/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DqAW9Qpj.js b/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DqAW9Qpj.js deleted file mode 100644 index fd6f7bc8..00000000 --- a/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DqAW9Qpj.js +++ /dev/null @@ -1 +0,0 @@ -import{W as T,f as w,a as x,y as S,cA as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,cx as W,bX as O,d4 as J,$ as K,a5 as ue,jX as z,b7 as D,eS as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./story-OUarUCIt.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as fe}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-CD3MqLHR.js";import{a as Se}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{u as we}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as _e}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{f as G}from"./TilemapCache-CRRxws77-Buzexpoq.js";import{s as X}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{a as Re}from"./jsonContext-BA8GHqVk-CN6VxGdq.js";import{a as Te}from"./StyleRepository-D3WuVprR-D1hVbbHk.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return g(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new Te(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Ct=p;export{Ct as default}; diff --git a/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DuYwzcLx.js b/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DuYwzcLx.js new file mode 100644 index 00000000..b3eda765 --- /dev/null +++ b/custom-toc-separator/assets/VectorTileLayer-DruyQukp-DuYwzcLx.js @@ -0,0 +1 @@ +import{W as T,f as w,a as x,y as S,cA as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,cx as W,bX as O,d4 as J,$ as K,a5 as ue,jX as z,b7 as D,eS as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./story-DT1Ep1ux.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as fe}from"./Layer-ChoECxvZ-ocw70508.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-BFUuSyiK.js";import{a as Se}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{u as we}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as _e}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{f as G}from"./TilemapCache-CRRxws77-CQyTs6St.js";import{s as X}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{a as Re}from"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import{a as Te}from"./StyleRepository-D3WuVprR-DmkdyZGe.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return g(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new Te(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Ct=p;export{Ct as default}; diff --git a/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-Axm5-Bu1.js b/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-Axm5-Bu1.js new file mode 100644 index 00000000..e144fb92 --- /dev/null +++ b/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-Axm5-Bu1.js @@ -0,0 +1 @@ +import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cf as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,d1 as he}from"./story-DT1Ep1ux.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-DrDY4oeh.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-B6HwLstV.js";import{o as X}from"./pbf-D-y3_eZO-CKuZ8F1K.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-CKukuAVJ.js";import{s as A}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{b as et}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-XRkD8ADC.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import{r as M}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{V as Oe}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{o as ut}from"./signal-CETehA7D-o0XgAOKb.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-B6YzhmFG.js";import{N as pt}from"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-B8-206Wc.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-DmkdyZGe.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-B3VRdVIM.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import{i as pe}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./main-BTdHgocv.js";import"./floatRGBA-4pIJN00G-BOmhq_GU.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Ni=Q;export{Ni as default}; diff --git a/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-D2L4mIEx.js b/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-D2L4mIEx.js deleted file mode 100644 index e163bd72..00000000 --- a/custom-toc-separator/assets/VectorTileLayerView2D-B9OYHbL4-D2L4mIEx.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cf as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,d1 as he}from"./story-OUarUCIt.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-mU03Z-E4.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-Bv29bzNX.js";import{o as X}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js";import{s as A}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{b as et}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-DDmsm7e7.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import{r as M}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{V as Oe}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{o as ut}from"./signal-CETehA7D-TD-k6B-y.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-DF8HooMp.js";import{N as pt}from"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-C3HNN94j.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-D1hVbbHk.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-DehQ-_Za.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import{i as pe}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./main-lj2zzr_L.js";import"./floatRGBA-4pIJN00G-DCWbfrRi.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Ni=Q;export{Ni as default}; diff --git a/custom-toc-separator/assets/Version-CoKzbupV-5qCYzF4G.js b/custom-toc-separator/assets/Version-CoKzbupV-5qCYzF4G.js deleted file mode 100644 index b031524f..00000000 --- a/custom-toc-separator/assets/Version-CoKzbupV-5qCYzF4G.js +++ /dev/null @@ -1 +0,0 @@ -import{o as i}from"./story-OUarUCIt.js";let c=class n{constructor(t,e,o=""){this.major=t,this.minor=e,this._context=o}lessThan(t,e){return this.major_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; diff --git a/custom-toc-separator/assets/VertexArrayObject-M4iRGGoi-Z_yPXqAH.js b/custom-toc-separator/assets/VertexArrayObject-M4iRGGoi-Z_yPXqAH.js deleted file mode 100644 index 08bc8316..00000000 --- a/custom-toc-separator/assets/VertexArrayObject-M4iRGGoi-Z_yPXqAH.js +++ /dev/null @@ -1 +0,0 @@ -import{iB as u,hT as a,a1 as _}from"./story-OUarUCIt.js";import{V as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as f}from"./Texture-BCt2hphT-Bv29bzNX.js";const n=()=>_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; diff --git a/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-DWgvXyZj.js b/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-DWgvXyZj.js new file mode 100644 index 00000000..641b7f67 --- /dev/null +++ b/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-DWgvXyZj.js @@ -0,0 +1,204 @@ +import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dk as Wl,hZ as ni,a1 as tg,ai as sg,dg as ga}from"./story-DT1Ep1ux.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as rg}from"./Layer-ChoECxvZ-ocw70508.js";import{u as ng}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{Z as ug}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-C3u5XocC.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r +`;return s}getResponseHeader(s){return(this._response||this._error)?.getHeader?.(s)??null}open(s,e){switch(this._sendFlag=!1,this._options={},s){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=e,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(s){throw new Error("overrideMimeType not implemented")}send(s){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");const e=this._options;s instanceof URLSearchParams?e.body=s.toString():e.body=s,e.responseType=this.responseType===""?"text":this.responseType==="arraybuffer"?"array-buffer":this.responseType,e.signal=this._abortController?.signal,this.timeout&&(e.timeout=this.timeout),this.withCredentials&&(e.withCredentials=!0),ro(this._url,e).then(t=>{this._response=t,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(t=>{this._sendFlag&&(this._error=t.details,this._updateReadyState(this.DONE),eg(t)?this._dispatchProgressEvent("timeout"):t.name==="AbortError"?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(s,e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[s]=e}_dispatchProgressEvent(s){const e=new ProgressEvent(s,{loaded:0,total:0});this.dispatchEvent(e),this[`on${s}`]?.(e)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(s){if(this._readyState!==s&&(this._readyState=s,s!==this.UNSENT)){const e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}};ui.UNSENT=0,ui.OPENED=1,ui.HEADERS_RECEIVED=2,ui.LOADING=3,ui.DONE=4;let Bt=class extends Ln(Nn){constructor(s){super(s),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(s,e){return e.end!=null?new Date(e.end):null}writeEnd(s,e){e.end=s?s.getTime():null}readStart(s,e){return e.start!=null?new Date(e.start):null}writeStart(s,e){e.start=s?s.getTime():null}};K([Z({type:Number,json:{write:{allowNull:!0}}})],Bt.prototype,"duration",void 0),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"end",void 0),K([gi("end")],Bt.prototype,"readEnd",null),K([io("end")],Bt.prototype,"writeEnd",null),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"start",void 0),K([gi("start")],Bt.prototype,"readStart",null),K([io("start")],Bt.prototype,"writeStart",null),K([Z({type:String})],Bt.prototype,"timezone",void 0),Bt=K([Ds("esri.layers.support.VideoTimeExtent")],Bt);const vg=Bt,_a="application/x-mpegURL",bg="video/mp4",ne={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function Tg(s){const{duration:e,end:t,start:i,timezone:r="UTC"}=s||{};return typeof e!="number"?null:new vg({duration:e||null,end:typeof t=="number"?new Date(t):null,start:typeof i=="number"?new Date(i):null,timezone:r})}function Sg(s,e){const t=[...e],i=t.findIndex(r=>r.equals(s));return i>-1&&t.splice(i),t.push(s),t}function Eg(s){if(!s?.size)return new no;const e=Rg(s),t=Ag(s),i=Pg(s),r=Ng(e,t);return new no({frameCenter:t,frameOutline:i,lineOfSight:r,sensorLocation:e})}function Cg(s){return s?.size?s.get(ne.EsriGroundControlPoints)?.value??null??null:null}function wg(s){return s?.size?s.get(ne.EsriHorizonPixelPack)?.value??null:null}function Ag(s){return Dg(s)??Ig(s)}function xg(s){if(!s)return _a;let e="";const t=new RegExp(/\.(\w{3,4})(?:$|\?)/i),i=s?s.match(t):[];return i?.length?(e=i[0],e.toLowerCase().replaceAll(".","")==="mp4"?bg:_a):_a}function kg(s){const e=s?.layers;return e?.length?e.map(t=>({layerId:t.id,posterUrl:t.poster,sourceType:t.serviceType,title:t.name,type:t.type||"Video Layer"})):[]}function Dg(s){return s&&s.has(ne.EsriFrameCenterLatitude)&&s.has(ne.EsriFrameCenterLongitude)?new Jt({x:s.get(ne.EsriFrameCenterLongitude).value,y:s.get(ne.EsriFrameCenterLatitude).value,z:s.get(ne.FrameCenterElevation).value}):null}function Ig(s){return s&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)?new Jt({x:s.get(ne.FrameCenterLongitude)?.value,y:s.get(ne.FrameCenterLatitude)?.value,z:s.get(ne.FrameCenterElevation)?.value}):null}function Pg(s){if(!s)return null;const e=s.get(ne.EsriFrameOutline)?.value;return e?On.fromJSON(e.geometry):Lg(s)??Og(s)}function Lg(s){if(!(s.has(ne.EsriCornerLatitudePt1)&&s.has(ne.EsriCornerLongitudePt1)&&s.has(ne.EsriCornerLatitudePt2)&&s.has(ne.EsriCornerLongitudePt2)&&s.has(ne.EsriCornerLatitudePt3)&&s.has(ne.EsriCornerLongitudePt3)&&s.has(ne.EsriCornerLatitudePt4)&&s.has(ne.EsriCornerLongitudePt4)))return null;const e=[s.get(ne.EsriCornerLongitudePt1)?.value,s.get(ne.EsriCornerLatitudePt1)?.value],t=[s.get(ne.EsriCornerLongitudePt2)?.value,s.get(ne.EsriCornerLatitudePt2)?.value],i=[s.get(ne.EsriCornerLongitudePt3)?.value,s.get(ne.EsriCornerLatitudePt3)?.value],r=[s.get(ne.EsriCornerLongitudePt4)?.value,s.get(ne.EsriCornerLatitudePt4)?.value];return new On({rings:[[e,t,i,r]]})}function Og(s){if(!(s.has(ne.OffsetCorner1Latitude)&&s.has(ne.OffsetCorner1Longitude)&&s.has(ne.OffsetCorner2Latitude)&&s.has(ne.OffsetCorner2Longitude)&&s.has(ne.OffsetCorner3Latitude)&&s.has(ne.OffsetCorner3Longitude)&&s.has(ne.OffsetCorner4Latitude)&&s.has(ne.OffsetCorner4Longitude)&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)))return null;const e=s.get(ne.FrameCenterLatitude)?.value,t=s.get(ne.FrameCenterLongitude)?.value,i=e+s.get(ne.OffsetCorner1Latitude)?.value,r=t+s.get(ne.OffsetCorner1Longitude)?.value,n=e+s.get(ne.OffsetCorner2Latitude)?.value,a=t+s.get(ne.OffsetCorner2Longitude)?.value,l=e+s.get(ne.OffsetCorner3Latitude)?.value,h=t+s.get(ne.OffsetCorner3Longitude)?.value,p=e+s.get(ne.OffsetCorner4Latitude)?.value,g=t+s.get(ne.OffsetCorner4Longitude)?.value;return new On({rings:[[[r,i],[a,n],[h,l],[g,p]]]})}function Ng(s,e){if(!s||!e)return null;const t=[s.x,s.y,s.z??0],i=[e.x,e.y,e.z??0];return new rn({paths:[[t,i]]})}function Rg(s){if(!s?.size)return null;if(s.has(ne.EsriSensorPosition)){const e=s.get(ne.EsriSensorPosition)?.value;if(e)return Jt.fromJSON(e.geometry)}return s.has(ne.SensorLongitude)&&s.has(ne.SensorLatitude)&&s.has(ne.SensorTrueAltitude)?new Jt({x:s.get(ne.SensorLongitude)?.value,y:s.get(ne.SensorLatitude)?.value,z:s.get(ne.SensorTrueAltitude)?.value}):null}const ft=Math.PI/180;let Qe=class extends Lo{constructor(s){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const i=t[0],r=t[1],n=t[2];return dg(i[0],r[0],n[0],i[1],r[1],n[1],i[2],r[2],n[2])},this._multiplyMat3=(t,i)=>{const r=Gl();return cg(r,t,i),r},this._transposeMat3=t=>{const i=Gl();return pg(i,t),i},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*ft),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*ft)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*ft,this.sensorPitchAngle*ft,this.sensorRollAngle*ft),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*ft),i=Math.cos(this.sensorLatitude*ft),r=Math.sin(this.sensorLongitude*ft),n=Math.cos(this.sensorLongitude*ft);return this._createMat3FromValues([[-t*n,-r,-i*n],[-t*r,n,-i*r],[i,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*ft,this.platformPitchAngle*ft,this.platformRollAngle*ft),this._extractValues=t=>{this.imageWidth=t.get(ne.EsriVideoWidth)?.value,this.imageHeight=t.get(ne.EsriVideoHeight)?.value;const i=t.get(ne.SensorEllipsoidHeight)?.value;this.sensorAltitude=i??t.get(ne.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(ne.SensorLatitude)?.value,this.sensorLongitude=t.get(ne.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(ne.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(ne.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(ne.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(ne.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(ne.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(ne.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(ne.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(ne.PlatformRollAngle)?.value,this.averageElevation=t.get(ne.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,i,r)=>{const n=Math.cos(t),a=Math.sin(t),l=Math.cos(i),h=Math.sin(i),p=Math.cos(r),g=Math.sin(r);return this._createMat3FromValues([[n*l,n*h*g-p*a,a*g+n*p*h],[l*a,n*p+a*h*g,p*a*h-n*g],[-h,l*g,l*p]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),i=this._calculateCameraFovReverse(),r=this._calculateCameraLook(),n=this._calculateImageDimensionsForward(),a=this._calculateImageDimensionsReverse(),l=this._calculatePlatformPositionMatrix(),h=this._calculatePlatformOrientation(),p=this._multiplyMat3(this._multiplyMat3(l,h),r);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(p,t),n);const g=this._multiplyMat3(a,i);this._earthToImageTransform=this._multiplyMat3(g,this._transposeMat3(p)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const i=t.get(ne.EsriVideoWidth)?.value??0,r=t.get(ne.EsriVideoHeight)?.value??0;if(i<=0||r<=0)return!1;const n=t.get(ne.SensorEllipsoidHeight)?.value,a=t.get(ne.SensorTrueAltitude)?.value,l=t.get(ne.SensorLatitude)?.value,h=t.get(ne.SensorLongitude)?.value;if(n==null&&a==null||l==null||h==null)return!1;const p=t.get(ne.PlatformHeadingAngle)?.value,g=t.get(ne.PlatformPitchAngle)?.value,y=t.get(ne.PlatformRollAngle)?.value;if(p==null||g==null||y==null)return!1;const w=t.get(ne.SensorHorizontalFOV)?.value,E=t.get(ne.SensorVerticalFOV)?.value;if(w==null||E==null)return!1;const I=t.get(ne.SensorAzimuthAngle)?.value,v=t.get(ne.SensorElevationAngle)?.value,L=t.get(ne.SensorRollAngle)?.value;return I!=null&&v!=null&&L!=null},this._projectPointToECEF=(t,i,r)=>{const n=[];return Yl([t,i,r],Zr.WGS84,0,n,ya,0),new Jt({x:n[0],y:n[1],z:n[2],spatialReference:ya})},this._projectImageVectorToEllipsoid=(t,i)=>{const r=Wl.semiMajorAxis+i,n=Wl.semiMinorAxis+i,a=n/r,l=r/n,{x:h,y:p,z:g}=this._platformPositionEcef,y=g??this.averageElevation,w=ni(h,p,l*y),E=fa(t,t),I=fa(t,w),v=fa(w,w)-r*r,L=(-I-Math.sqrt(I*I-E*v))/E;if(L<0)return[NaN,NaN,NaN];const R=ga();return mg(R,w,t,L),R[2]=R[2]*a,R};const e=s?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(s,e,t){const i=this._platformPositionEcef;if(!i)return[0,0];const{x:r,y:n,z:a}=i,l=ni(r,n,a),h=this._projectPointToECEF(s,e,t||this.averageElevation),p=ga(),g=ni(h.x,h.y,h.z);gg(p,g,l),Xl(p,p,this._earthToImageTransform);const y=p[0],w=p[1],E=p[2];let I=ni(NaN,NaN,NaN);return isNaN(E)||(I=ni(y/E,w/E,E/E)),[I[0],I[1]]}transformImageToGeo(s,e){const t=ni(s,e,1),i=ga();Xl(i,t,this._imageToEarthTransform);const r=this._projectImageVectorToEllipsoid(i,this.averageElevation);let n;if(!isNaN(r[0])){const a=[];Yl([r[0],r[1],r[2]],ya,0,a,Zr.WGS84,0),n=new Jt({x:a[0],y:a[1],z:a[2],spatialReference:Zr.WGS84})}return n}};K([Z()],Qe.prototype,"averageElevation",void 0),K([Z()],Qe.prototype,"imageHeight",void 0),K([Z()],Qe.prototype,"imageWidth",void 0),K([Z({readOnly:!0})],Qe.prototype,"metadataSupportsTransforms",void 0),K([Z()],Qe.prototype,"platformHeadingAngle",void 0),K([Z()],Qe.prototype,"platformPitchAngle",void 0),K([Z()],Qe.prototype,"platformRollAngle",void 0),K([Z()],Qe.prototype,"sensorHeadingAngle",void 0),K([Z()],Qe.prototype,"sensorAltitude",void 0),K([Z()],Qe.prototype,"sensorHorizontalFieldOfView",void 0),K([Z()],Qe.prototype,"sensorLatitude",void 0),K([Z()],Qe.prototype,"sensorLongitude",void 0),K([Z()],Qe.prototype,"sensorPitchAngle",void 0),K([Z()],Qe.prototype,"sensorRollAngle",void 0),K([Z()],Qe.prototype,"sensorVerticalFieldOfView",void 0),K([Z()],Qe.prototype,"vttMetadata",void 0),Qe=K([Ds("esri.layers.video.VideoCameraSensorModel")],Qe);const Mg=Qe;var Kl,Ql;function Rn(){return Ql?Kl:(Ql=1,s=typeof window<"u"?window:an!==void 0?an:typeof self<"u"?self:{},Kl=s);var s}const k=vr(Rn());var Jl,Zl,va,eu,ba,tu,su,iu,ru,nu,au,ou,lu,uu,Ta,hu,Sa,du,Ea,cu,Ca,pu,mu,gu,fu,yu;function Id(){if(Zl)return Jl;Zl=1;var s=Array.prototype.slice;function e(t,i){for(("length"in t)||(t=[t]),t=s.call(t);t.length;){var r=t.shift(),n=i(r);if(n)return n;r.childNodes&&r.childNodes.length&&(t=s.call(r.childNodes).concat(t))}}return Jl=e}function Bg(){if(eu)return va;function s(e,t){if(!(this instanceof s))return new s(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}return eu=1,va=s,s.prototype.nodeType=8,s.prototype.nodeName="#comment",s.prototype.toString=function(){return"[object Comment]"},va}function Fg(){if(tu)return ba;function s(e,t){if(!(this instanceof s))return new s(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}return tu=1,ba=s,s.prototype.type="DOMTextNode",s.prototype.nodeType=3,s.prototype.nodeName="#text",s.prototype.toString=function(){return this.data},s.prototype.replaceData=function(e,t,i){var r=this.data,n=r.substring(0,e),a=r.substring(e+t,r.length);this.data=n+i+a,this.length=this.data.length},ba}function Pd(){if(iu)return su;function s(e){var t=this,i=e.type;e.target||(e.target=t),t.listeners||(t.listeners={});var r=t.listeners[i];if(r)return r.forEach(function(n){e.currentTarget=t,typeof n=="function"?n(e):n.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}return iu=1,su=s}function Ld(){if(nu)return ru;function s(e,t){var i=this;i.listeners||(i.listeners={}),i.listeners[e]||(i.listeners[e]=[]),i.listeners[e].indexOf(t)===-1&&i.listeners[e].push(t)}return nu=1,ru=s}function Od(){if(ou)return au;function s(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],n=r.indexOf(t);n!==-1&&r.splice(n,1)}}return ou=1,au=s}function Ug(){if(uu)return lu;uu=1;var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function e(g){switch(g.nodeType){case 3:return h(g.data);case 8:return"";default:return t(g)}}function t(g){var y=[],w=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),y.push("<"+w+l(g)+n(g)),s.indexOf(w)>-1?y.push(" />"):(y.push(">"),g.childNodes.length?y.push.apply(y,g.childNodes.map(e)):g.textContent||g.innerText?y.push(h(g.textContent||g.innerText)):g.innerHTML&&y.push(g.innerHTML),y.push("")),y.join("")}function i(g,y){var w=typeof g[y];return y==="style"&&Object.keys(g.style).length>0||g.hasOwnProperty(y)&&(w==="string"||w==="boolean"||w==="number")&&y!=="nodeName"&&y!=="className"&&y!=="tagName"&&y!=="textContent"&&y!=="innerText"&&y!=="namespaceURI"&&y!=="innerHTML"}function r(g){if(typeof g=="string")return g;var y="";return Object.keys(g).forEach(function(w){var E=g[w];w=w.replace(/[A-Z]/g,function(I){return"-"+I.toLowerCase()}),y+=w+":"+E+";"}),y}function n(g){var y=g.dataset,w=[];for(var E in y)w.push({name:"data-"+E,value:y[E]});return w.length?a(w):""}function a(g){var y=[];return g.forEach(function(w){var E=w.name,I=w.value;E==="style"&&(I=r(I)),y.push(E+'="'+p(I)+'"')}),y.length?" "+y.join(" "):""}function l(g){var y=[];for(var w in g)i(g,w)&&y.push({name:w,value:g[w]});for(var E in g._attributes)for(var I in g._attributes[E]){var v=g._attributes[E][I],L=(v.prefix?v.prefix+":":"")+I;y.push({name:L,value:v.value})}return g.className&&y.push({name:"class",value:g.className}),y.length?a(y):""}function h(g){var y="";return typeof g=="string"?y=g:g&&(y=g.toString()),y.replace(/&/g,"&").replace(//g,">")}function p(g){return h(g).replace(/"/g,""")}return lu=e}function Nd(){if(hu)return Ta;hu=1;var s=Id(),e=Pd(),t=Ld(),i=Od(),r=Ug(),n="http://www.w3.org/1999/xhtml";function a(l,h,p){if(!(this instanceof a))return new a(l);var g=p===void 0?n:p||null;this.tagName=g===n?String(l).toUpperCase():l,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=h||null,this.namespaceURI=g,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}return Ta=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(l){return l.parentNode&&l.parentNode.removeChild(l),this.childNodes.push(l),l.parentNode=this,l},a.prototype.replaceChild=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=this.childNodes.indexOf(h);return h.parentNode=null,this.childNodes[p]=l,l.parentNode=this,h},a.prototype.removeChild=function(l){var h=this.childNodes.indexOf(l);return this.childNodes.splice(h,1),l.parentNode=null,l},a.prototype.insertBefore=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=h==null?-1:this.childNodes.indexOf(h);return p>-1?this.childNodes.splice(p,0,l):this.childNodes.push(l),l.parentNode=this,l},a.prototype.setAttributeNS=function(l,h,p){var g=null,y=h,w=h.indexOf(":");w>-1&&(g=h.substr(0,w),y=h.substr(w+1)),this.tagName==="INPUT"&&h==="type"?this.type=p:(this._attributes[l]||(this._attributes[l]={}))[y]={value:p,prefix:g}},a.prototype.getAttributeNS=function(l,h){var p=this._attributes[l],g=p&&p[h]&&p[h].value;return this.tagName==="INPUT"&&h==="type"?this.type:typeof g!="string"?null:g},a.prototype.removeAttributeNS=function(l,h){var p=this._attributes[l];p&&delete p[h]},a.prototype.hasAttributeNS=function(l,h){var p=this._attributes[l];return!!p&&h in p},a.prototype.setAttribute=function(l,h){return this.setAttributeNS(null,l,h)},a.prototype.getAttribute=function(l){return this.getAttributeNS(null,l)},a.prototype.removeAttribute=function(l){return this.removeAttributeNS(null,l)},a.prototype.hasAttribute=function(l){return this.hasAttributeNS(null,l)},a.prototype.removeEventListener=i,a.prototype.addEventListener=t,a.prototype.dispatchEvent=e,a.prototype.focus=function(){},a.prototype.toString=function(){return r(this)},a.prototype.getElementsByClassName=function(l){var h=l.split(" "),p=[];return s(this,function(g){if(g.nodeType===1){var y=(g.className||"").split(" ");h.every(function(w){return y.indexOf(w)!==-1})&&p.push(g)}}),p},a.prototype.getElementsByTagName=function(l){l=l.toLowerCase();var h=[];return s(this.childNodes,function(p){p.nodeType!==1||l!=="*"&&p.tagName.toLowerCase()!==l||h.push(p)}),h},a.prototype.contains=function(l){return s(this,function(h){return l===h})||!1},Ta}function qg(){if(du)return Sa;du=1;var s=Nd();function e(t){if(!(this instanceof e))return new e;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}return Sa=e,e.prototype.type="DocumentFragment",e.prototype.nodeType=11,e.prototype.nodeName="#document-fragment",e.prototype.appendChild=s.prototype.appendChild,e.prototype.replaceChild=s.prototype.replaceChild,e.prototype.removeChild=s.prototype.removeChild,e.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")},Sa}function jg(){if(cu)return Ea;function s(e){}return cu=1,Ea=s,s.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},s.prototype.preventDefault=function(){},Ea}function Hg(){if(pu)return Ca;pu=1;var s=Id(),e=Bg(),t=Fg(),i=Nd(),r=qg(),n=jg(),a=Pd(),l=Ld(),h=Od();function p(){if(!(this instanceof p))return new p;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}Ca=p;var g=p.prototype;return g.createTextNode=function(y){return new t(y,this)},g.createElementNS=function(y,w){var E=y===null?null:String(y);return new i(w,this,E)},g.createElement=function(y){return new i(y,this)},g.createDocumentFragment=function(){return new r(this)},g.createEvent=function(y){return new n(y)},g.createComment=function(y){return new e(y,this)},g.getElementById=function(y){return y=String(y),s(this.childNodes,function(w){if(String(w.id)===y)return w})||null},g.getElementsByClassName=i.prototype.getElementsByClassName,g.getElementsByTagName=i.prototype.getElementsByTagName,g.contains=i.prototype.contains,g.removeEventListener=h,g.addEventListener=l,g.dispatchEvent=a,Ca}function $g(){if(gu)return mu;gu=1;var s=Hg();return mu=new s}function Rd(){if(yu)return fu;yu=1;var s,e=an!==void 0?an:typeof window<"u"?window:{},t=$g();return typeof document<"u"?s=document:(s=e["__GLOBAL_DOCUMENT_CACHE@4"])||(s=e["__GLOBAL_DOCUMENT_CACHE@4"]=t),fu=s}const re=vr(Rd());var _u,wa,vu,bu,Tu,Su,Eu,Cu,wu,Au,$r={exports:{}},xu={exports:{}};function Vg(){return _u||(_u=1,function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,r){if(i){if(typeof i=="string")return t(i,r);var n=Object.prototype.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(i,r):void 0}}function t(i,r){(r==null||r>i.length)&&(r=i.length);for(var n=0,a=new Array(r);n=400&&n.statusCode<=599){var l=a;if(i)if(s.TextDecoder){var h=e(n.headers&&n.headers["content-type"]);try{l=new TextDecoder(h).decode(a)}catch{}}else l=String.fromCharCode.apply(null,new Uint8Array(a));t({cause:l})}else t(null,a)}}}function Yg(){if(Au)return $r.exports;Au=1;var s=Rn(),e=Vg(),t=zg(),i=Wg(),r=Gg();p.httpHandler=Xg(),p.requestInterceptorsStorage=new i,p.responseInterceptorsStorage=new i,p.retryManager=new r;var n=function(E){var I={};return E&&E.trim().split(` +`).forEach(function(v){var L=v.indexOf(":"),R=v.slice(0,L).trim().toLowerCase(),M=v.slice(L+1).trim();I[R]===void 0?I[R]=M:Array.isArray(I[R])?I[R].push(M):I[R]=[I[R],M]}),I};function a(E,I){for(var v=0;v0&&(S=setTimeout(function(){if(!U){U=!0,H.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",G(Q)}},E.timeout)),H.setRequestHeader)for(z in W)W.hasOwnProperty(z)&&H.setRequestHeader(z,W[z]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(H.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(H),H.send($||null),H}function y(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}function w(){}return $r.exports=p,$r.exports.default=p,p.XMLHttpRequest=s.XMLHttpRequest||w,p.XDomainRequest="withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){p[E==="delete"?"del":E]=function(I,v,L){return(v=h(I,v,L)).method=E.toUpperCase(),g(v)}}),$r.exports}const Md=vr(Yg());var ku,Du,Iu,Pu,Lu,Ou,Nu,Aa={exports:{}};function Kg(){if(Du)return ku;Du=1;var s=Rd(),e=Object.create||function(){function S(){}return function(A){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=A,new S}}();function t(S,A){this.name="ParsingError",this.code=S.code,this.message=A||S.message}function i(S){function A($,W,te,J){return 3600*(0|$)+60*(0|W)+(0|te)+(0|J)/1e3}var B=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?A(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?A(B[1],B[2],0,B[4]):A(0,B[1],B[2],B[4]):null}function r(){this.values=e(null)}function n(S,A,B,$){var W=$?S.split($):[S];for(var te in W)if(typeof W[te]=="string"){var J=W[te].split(B);J.length===2&&A(J[0].trim(),J[1].trim())}}function a(S,A,B){var $=S;function W(){var oe=i(S);if(oe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+$);return S=S.replace(/^[^\sa-zA-Z-]+/,""),oe}function te(oe,Q){var Y=new r;n(oe,function(ie,se){switch(ie){case"region":for(var ee=B.length-1;ee>=0;ee--)if(B[ee].id===se){Y.set(ie,B[ee].region);break}break;case"vertical":Y.alt(ie,se,["rl","lr"]);break;case"line":var ye=se.split(","),_e=ye[0];Y.integer(ie,_e),Y.percent(ie,_e)&&Y.set("snapToLines",!1),Y.alt(ie,_e,["auto"]),ye.length===2&&Y.alt("lineAlign",ye[1],["start","center","end"]);break;case"position":ye=se.split(","),Y.percent(ie,ye[0]),ye.length===2&&Y.alt("positionAlign",ye[1],["start","center","end"]);break;case"size":Y.percent(ie,se);break;case"align":Y.alt(ie,se,["start","center","end","left","right"])}},/:/,/\s/),Q.region=Y.get("region",null),Q.vertical=Y.get("vertical","");try{Q.line=Y.get("line","auto")}catch{}Q.lineAlign=Y.get("lineAlign","start"),Q.snapToLines=Y.get("snapToLines",!0),Q.size=Y.get("size",100);try{Q.align=Y.get("align","center")}catch{Q.align=Y.get("align","middle")}try{Q.position=Y.get("position","auto")}catch{Q.position=Y.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=Y.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function J(){S=S.replace(/^\s+/,"")}if(J(),A.startTime=W(),J(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+$);S=S.substr(3),J(),A.endTime=W(),J(),te(S,A)}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(S,A){this.get(S)||A===""||(this.values[S]=A)},get:function(S,A,B){return B?this.has(S)?this.values[S]:A[B]:this.has(S)?this.values[S]:A},has:function(S){return S in this.values},alt:function(S,A,B){for(var $=0;$=0&&A<=100)&&(this.set(S,A),!0)}};var l=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},p={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function w(S,A){function B(){if(!A)return null;function _e(me){return A=A.substr(me.length),me}var ve=A.match(/^([^<]*)(<[^>]*>?)?/);return _e(ve[1]?ve[1]:ve[2])}function $(_e){return l.innerHTML=_e,_e=l.textContent,l.textContent="",_e}function W(_e,ve){return!y[ve.localName]||y[ve.localName]===_e.localName}function te(_e,ve){var me=h[_e];if(!me)return null;var Fe=S.document.createElement(me),et=g[_e];return et&&ve&&(Fe[et]=ve.trim()),Fe}for(var J,oe=S.document.createElement("div"),Q=oe,Y=[];(J=B())!==null;)if(J[0]!=="<")Q.appendChild(S.document.createTextNode($(J)));else{if(J[1]==="/"){Y.length&&Y[Y.length-1]===J.substr(2).replace(">","")&&(Y.pop(),Q=Q.parentNode);continue}var ie,se=i(J.substr(1,J.length-2));if(se){ie=S.document.createProcessingInstruction("timestamp",se),Q.appendChild(ie);continue}var ee=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||!(ie=te(ee[1],ee[3]))||!W(Q,ie))continue;if(ee[2]){var ye=ee[2].split(".");ye.forEach(function(_e){var ve=/^bg_/.test(_e),me=ve?_e.slice(3):_e;if(p.hasOwnProperty(me)){var Fe=ve?"background-color":"color",et=p[me];ie.style[Fe]=et}}),ie.className=ye.join(" ")}Y.push(ee[1]),Q.appendChild(ie),Q=ie}return oe}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function I(S){for(var A=0;A=B[0]&&S<=B[1])return!0}return!1}function v(S){var A=[],B="";if(!S||!S.childNodes)return"ltr";function $(J,oe){for(var Q=oe.childNodes.length-1;Q>=0;Q--)J.push(oe.childNodes[Q])}function W(J){if(!J||!J.length)return null;var oe=J.pop(),Q=oe.textContent||oe.innerText;if(Q){var Y=Q.match(/^.*(\n|\r)/);return Y?(J.length=0,Y[0]):Q}return oe.tagName==="ruby"?W(J):oe.childNodes?($(J,oe),W(J)):void 0}for($(A,S);B=W(A);)for(var te=0;te=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var A=S.track,B=A.textTrackList,$=0,W=0;WYe&&(et=new O(me),We=Ye),me=new O(Pe)}return et||Pe}var te=new O(A),J=A.cue,oe=L(J),Q=[];if(J.snapToLines){var Y;switch(J.vertical){case"":Q=["+y","-y"],Y="height";break;case"rl":Q=["+x","-x"],Y="width";break;case"lr":Q=["-x","+x"],Y="width"}var ie=te.lineHeight,se=ie*Math.round(oe),ee=B[Y]+ie,ye=Q[0];Math.abs(se)>ee&&(se=se<0?-1:1,se*=Math.ceil(ee/ie)*ie),oe<0&&(se+=J.vertical===""?B.height:B.width,Q=Q.reverse()),te.move(ye,se)}else{var _e=te.lineHeight/B.height*100;switch(J.lineAlign){case"center":oe-=_e/2;break;case"end":oe-=_e}switch(J.vertical){case"":A.applyStyles({top:A.formatStyle(oe,"%")});break;case"rl":A.applyStyles({left:A.formatStyle(oe,"%")});break;case"lr":A.applyStyles({right:A.formatStyle(oe,"%")})}Q=["+y","-x","+x","-y"],te=new O(A)}var ve=W(te,Q);A.move(ve.toCSSCompatValues(B))}function N(){}R.prototype.applyStyles=function(S,A){for(var B in A=A||this.div,S)S.hasOwnProperty(B)&&(A.style[B]=S[B])},R.prototype.formatStyle=function(S,A){return S===0?0:S+A},M.prototype=e(R.prototype),M.prototype.constructor=M,O.prototype.move=function(S,A){switch(A=A!==void 0?A:this.lineHeight,S){case"+x":this.left+=A,this.right+=A;break;case"-x":this.left-=A,this.right-=A;break;case"+y":this.top+=A,this.bottom+=A;break;case"-y":this.top-=A,this.bottom-=A}},O.prototype.overlaps=function(S){return this.leftS.left&&this.topS.top},O.prototype.overlapsAny=function(S){for(var A=0;A=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},O.prototype.overlapsOppositeAxis=function(S,A){switch(A){case"+x":return this.leftS.right;case"+y":return this.topS.bottom}},O.prototype.intersectPercentage=function(S){return Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left))*Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top))/(this.height*this.width)},O.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(S){var A=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,B=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,$=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;return{left:(S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S).left,right:S.right,top:S.top||$,height:S.height||A,bottom:S.bottom||$+(S.height||A),width:S.width||B}},N.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},N.convertCueToDOMTree=function(S,A){return S&&A?w(S,A):null};var z=.05,U="sans-serif",H="1.5%";return N.processCues=function(S,A,B){if(!S||!A||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var $=S.document.createElement("div");function W(Y){for(var ie=0;ie")===-1){A.cue.id=J;continue}case"CUE":try{a(J,A.cue,A.regionList)}catch(ie){A.reportOrThrowError(ie),A.cue=null,A.state="BADCUE";continue}A.state="CUETEXT";continue;case"CUETEXT":var Y=J.indexOf("-->")!==-1;if(!J||Y&&(Q=!0)){A.oncue&&A.oncue(A.cue),A.cue=null,A.state="ID";continue}A.cue.text&&(A.cue.text+=` +`),A.cue.text+=J.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":J||(A.state="ID");continue}}}catch(ie){A.reportOrThrowError(ie),A.state==="CUETEXT"&&A.cue&&A.oncue&&A.oncue(A.cue),A.cue=null,A.state=A.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=` + +`,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(A){S.reportOrThrowError(A)}return S.onflush&&S.onflush(),this}},ku=N}function Qg(){if(Pu)return Iu;Pu=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){return typeof a=="string"&&!!e[a.toLowerCase()]&&a.toLowerCase()}function r(a){return typeof a=="string"&&!!t[a.toLowerCase()]&&a.toLowerCase()}function n(a,l,h){this.hasBeenReset=!1;var p="",g=!1,y=a,w=l,E=h,I=null,v="",L=!0,R="auto",M="start",O="auto",G="auto",N=100,z="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return p},set:function(U){p=""+U}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(U){g=!!U}},startTime:{enumerable:!0,get:function(){return y},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");y=U,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return w},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");w=U,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(U){E=""+U,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return I},set:function(U){I=U,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return v},set:function(U){var H=i(U);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");v=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return L},set:function(U){L=!!U,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return R},set:function(U){if(typeof U!="number"&&U!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");R=U,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return M},set:function(U){var H=r(U);H?(M=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");O=U,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return G},set:function(U){var H=r(U);H?(G=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");N=U,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return z},set:function(U){var H=r(U);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");z=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Iu=n}function Jg(){if(Ou)return Lu;Ou=1;var s={"":!0,up:!0};function e(r){return typeof r=="string"&&!!s[r.toLowerCase()]&&r.toLowerCase()}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,h=0,p=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return p},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");p=y}},viewportAnchorX:{enumerable:!0,get:function(){return h},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");h=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var w=e(y);w===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=w}}})}return Lu=i}function Zg(){if(Nu)return Aa.exports;Nu=1;var s=Rn(),e=Aa.exports={WebVTT:Kg(),VTTCue:Qg(),VTTRegion:Jg()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Aa.exports}const Ru=vr(Zg());function ze(){return ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e-1},e.trigger=function(t){var i=this.listeners[t];if(i)if(arguments.length===2)for(var r=i.length,n=0;n-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const sf=" ",xa=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},rf=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ht=function(s){const e={};if(!s)return e;const t=s.split(rf());let i,r=t.length;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},Bu=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class nf extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((r,n)=>{const a=n(e);return a===e?r:r.concat([a])},[e]).forEach(r=>{for(let n=0;nn),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const af=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),bs=function(s){const e={};return Object.keys(s).forEach(function(t){e[af(t)]=s[t]}),e},ka=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&3*t,h=i&&2*i;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]{a.uri||!a.parts&&!a.preloadHints||(!a.map&&r&&(a.map=r),!a.key&&n&&(a.key=n),a.timeline||typeof y!="number"||(a.timeline=y),this.manifest.preloadSegment=a)}),this.parseStream.on("data",function(v){let L,R;if(t.manifest.definitions){for(const M in t.manifest.definitions)if(v.uri&&(v.uri=v.uri.replace(`{$${M}}`,t.manifest.definitions[M])),v.attributes)for(const O in v.attributes)typeof v.attributes[O]=="string"&&(v.attributes[O]=v.attributes[O].replace(`{$${M}}`,t.manifest.definitions[M]))}({tag(){({version(){v.version&&(this.manifest.version=v.version)},"allow-cache"(){this.manifest.allowCache=v.allowed,"allowed"in v||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const M={};"length"in v&&(a.byterange=M,M.length=v.length,"offset"in v||(v.offset=w)),"offset"in v&&(a.byterange=M,M.offset=v.offset),w=M.offset+M.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),v.title&&(a.title=v.title),v.duration>0&&(a.duration=v.duration),v.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(v.attributes)if(v.attributes.METHOD!=="NONE")if(v.attributes.URI){if(v.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:v.attributes});if(v.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:v.attributes.URI});if(v.attributes.KEYFORMAT===g)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(v.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(v.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),v.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):v.attributes.KEYID&&v.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:v.attributes.KEYFORMAT,keyId:v.attributes.KEYID.substring(2)},pssh:Bd(v.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));v.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:v.attributes.METHOD||"AES-128",uri:v.attributes.URI},v.attributes.IV!==void 0&&(n.iv=v.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(v.number)?this.manifest.mediaSequence=v.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+v.number})},"discontinuity-sequence"(){isFinite(v.number)?(this.manifest.discontinuitySequence=v.number,y=v.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+v.number})},"playlist-type"(){/VOD|EVENT/.test(v.playlistType)?this.manifest.playlistType=v.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+v.playlist})},map(){r={},v.uri&&(r.uri=v.uri),v.byterange&&(r.byterange=v.byterange),n&&(r.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,v.attributes?(a.attributes||(a.attributes={}),ze(a.attributes,v.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(v.attributes&&v.attributes.TYPE&&v.attributes["GROUP-ID"]&&v.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const M=this.manifest.mediaGroups[v.attributes.TYPE];M[v.attributes["GROUP-ID"]]=M[v.attributes["GROUP-ID"]]||{},L=M[v.attributes["GROUP-ID"]],R={default:/yes/i.test(v.attributes.DEFAULT)},R.default?R.autoselect=!0:R.autoselect=/yes/i.test(v.attributes.AUTOSELECT),v.attributes.LANGUAGE&&(R.language=v.attributes.LANGUAGE),v.attributes.URI&&(R.uri=v.attributes.URI),v.attributes["INSTREAM-ID"]&&(R.instreamId=v.attributes["INSTREAM-ID"]),v.attributes.CHARACTERISTICS&&(R.characteristics=v.attributes.CHARACTERISTICS),v.attributes.FORCED&&(R.forced=/yes/i.test(v.attributes.FORCED)),L[v.attributes.NAME]=R},discontinuity(){y+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=v.dateTimeString,this.manifest.dateTimeObject=v.dateTimeObject),a.dateTimeString=v.dateTimeString,a.dateTimeObject=v.dateTimeObject;const{lastProgramDateTime:M}=this;this.lastProgramDateTime=new Date(v.dateTimeString).getTime(),M===null&&this.manifest.segments.reduceRight((O,G)=>(G.programDateTime=O-1e3*G.duration,G.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(v.duration)||v.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+v.duration}):(this.manifest.targetDuration=v.duration,ka.call(this,this.manifest))},start(){v.attributes&&!isNaN(v.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:v.attributes["TIME-OFFSET"],precise:v.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){a.cueOut=v.data},"cue-out-cont"(){a.cueOutCont=v.data},"cue-in"(){a.cueIn=v.data},skip(){this.manifest.skip=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",v.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const M=this.manifest.segments.length,O=bs(v.attributes);a.parts=a.parts||[],a.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=E),E=O.byterange.offset+O.byterange.length);const G=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${G} for segment #${M}`,v.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((N,z)=>{N.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${z} lacks required attribute(s): LAST-PART`})})},"server-control"(){const M=this.manifest.serverControl=bs(v.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),M.canSkipDateranges&&!M.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const M=this.manifest.segments.length,O=bs(v.attributes),G=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=G?E:0,G&&(E=O.byterange.offset+O.byterange.length)));const N=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${N} for segment #${M}`,v.attributes,["TYPE","URI"]),O.type)for(let z=0;zz.id===O.id);this.manifest.dateRanges[N]=ze(this.manifest.dateRanges[N],O),I[O.id]=ze(I[O.id],O),this.manifest.dateRanges.pop()}else I[O.id]=O},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",v.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const M=(O,G)=>{O in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`}):this.manifest.definitions[O]=G};if("QUERYPARAM"in v.attributes){if("NAME"in v.attributes||"IMPORT"in v.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const O=this.params.get(v.attributes.QUERYPARAM);return O?void M(v.attributes.QUERYPARAM,decodeURIComponent(O)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${v.attributes.QUERYPARAM}`})}return"NAME"in v.attributes?"IMPORT"in v.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in v.attributes&&typeof v.attributes.VALUE=="string"?void M(v.attributes.NAME,v.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${v.attributes.NAME}`}):"IMPORT"in v.attributes?this.mainDefinitions[v.attributes.IMPORT]?void M(v.attributes.IMPORT,this.mainDefinitions[v.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${v.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:v.attributes,uri:v.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",v.attributes,["BANDWIDTH","URI"])}}[v.tagType]||h).call(t)},uri(){a.uri=v.uri,i.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=y,r&&(a.map=r),E=0,this.lastProgramDateTime!==null&&(a.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*a.duration),a={}},comment(){},custom(){v.segment?(a.custom=a.custom||{},a.custom[v.customType]=v.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[v.customType]=v.data)}})[v.type].call(t)})}requiredCompatibilityversion(e,t){(ep&&(h-=p,h-=p,h-=it(2))}return Number(h)},_f=function(s,e){var t={}.le,i=t!==void 0&&t;(typeof s!="bigint"&&typeof s!="number"||typeof s=="number"&&s!=s)&&(s=0),s=it(s);for(var r=gf(s),n=new Uint8Array(new ArrayBuffer(r)),a=0;a=e.length&&h.call(e,function(p,g){return p===(l[g]?l[g]&s[n+g]:s[n+g])})},bf=function(s,e,t){e.forEach(function(i){for(var r in s.mediaGroups[i])for(var n in s.mediaGroups[i][r]){var a=s.mediaGroups[i][r][n];t(a,i,r,n)}})},Zi={},os={},Ms={};function Bn(){if(ju)return Ms;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var h=0;h=0))throw new $(A,new Error(_.tagName+"@"+P));for(var ae=T.length-1;q"&&">")||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}function _e(_,T){if(T(_))return!0;if(_=_.firstChild)do if(_e(_,T))return!0;while(_=_.nextSibling)}function ve(){this.ownerDocument=this}function me(_,T,P){_&&_._inc++,P.namespaceURI===t.XMLNS&&(T._nsMap[P.prefix?P.localName:""]=P.value)}function Fe(_,T,P,q){_&&_._inc++,P.namespaceURI===t.XMLNS&&delete T._nsMap[P.prefix?P.localName:""]}function et(_,T,P){if(_&&_._inc){_._inc++;var q=T.childNodes;if(P)q[q.length++]=P;else{for(var ae=T.firstChild,le=0;ae;)q[le++]=ae,ae=ae.nextSibling;q.length=le,delete q[q.length]}}}function Pe(_,T){var P=T.previousSibling,q=T.nextSibling;return P?P.nextSibling=q:_.firstChild=q,q?q.previousSibling=P:_.lastChild=P,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,et(_.ownerDocument,_),T}function We(_){return _&&(_.nodeType===ee.DOCUMENT_NODE||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.ELEMENT_NODE)}function Ge(_){return _&&(rt(_)||Ut(_)||Ye(_)||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.COMMENT_NODE||_.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Ye(_){return _&&_.nodeType===ee.DOCUMENT_TYPE_NODE}function rt(_){return _&&_.nodeType===ee.ELEMENT_NODE}function Ut(_){return _&&_.nodeType===ee.TEXT_NODE}function Ke(_,T){var P=_.childNodes||[];if(e(P,rt)||Ye(T))return!1;var q=e(P,Ye);return!(T&&q&&P.indexOf(q)>P.indexOf(T))}function ts(_,T){var P=_.childNodes||[];function q(le){return rt(le)&&le!==T}if(e(P,q))return!1;var ae=e(P,Ye);return!(T&&ae&&P.indexOf(ae)>P.indexOf(T))}function Ps(_,T,P){if(!We(_))throw new $(S,"Unexpected parent node type "+_.nodeType);if(P&&P.parentNode!==_)throw new $(A,"child not in parent");if(!Ge(T)||Ye(T)&&_.nodeType!==ee.DOCUMENT_NODE)throw new $(S,"Unexpected node type "+T.nodeType+" for parent node type "+_.nodeType)}function Ys(_,T,P){var q=_.childNodes||[],ae=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var le=ae.filter(rt);if(le.length>1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!Ke(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!Ke(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,Ye))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!ts(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!ts(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,function(Ee){return Ye(Ee)&&Ee!==P}))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)=0;jt--)if((Pt=ae[jt]).prefix===""&&Pt.namespace===_.namespaceURI){st=Pt.namespace;break}}if(st!==_.namespaceURI)for(jt=ae.length-1;jt>=0;jt--){var Pt;if((Pt=ae[jt]).namespace===_.namespaceURI){Pt.prefix&&(qt=Pt.prefix+":"+wt);break}}}T.push("<",qt);for(var ns=0;ns"),P&&/^script$/i.test(wt))for(;Ee;)Ee.data?T.push(Ee.data):rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;else for(;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;T.push("")}else T.push("/>");return;case O:case N:for(Ee=_.firstChild;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;return;case w:return Hi(T,_.name,_.value);case E:return T.push(_.data.replace(/[<&>]/g,ye));case I:return T.push("");case M:return T.push("");case G:var Js=_.publicId,Ht=_.systemId;if(T.push("");else if(Ht&&Ht!=".")T.push(" SYSTEM ",Ht,">");else{var Zs=_.internalSubset;Zs&&T.push(" [",Zs,"]"),T.push(">")}return;case R:return T.push("");case v:return T.push("&",_.nodeName,";");default:T.push("??",_.nodeName)}}function Qs(_,T,P){var q;switch(T.nodeType){case y:(q=T.cloneNode(!1)).ownerDocument=_;case N:break;case w:P=!0}if(q||(q=T.cloneNode(!1)),q.ownerDocument=_,q.parentNode=null,P)for(var ae=T.firstChild;ae;)q.appendChild(Qs(_,ae,P)),ae=ae.nextSibling;return q}function ys(_,T,P){var q=new T.constructor;for(var ae in T)if(Object.prototype.hasOwnProperty.call(T,ae)){var le=T[ae];typeof le!="object"&&le!=q[ae]&&(q[ae]=le)}switch(T.childNodes&&(q.childNodes=new W),q.ownerDocument=_,q.nodeType){case y:var De=T.attributes,Ee=q.attributes=new oe,wt=De.length;Ee._ownerElement=q;for(var qt=0;qt=0&&_0},lookupPrefix:function(_){for(var T=this;T;){var P=T._nsMap;if(P){for(var q in P)if(Object.prototype.hasOwnProperty.call(P,q)&&P[q]===_)return q}T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(_){for(var T=this;T;){var P=T._nsMap;if(P&&Object.prototype.hasOwnProperty.call(P,_))return P[_];T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(_){return this.lookupPrefix(_)==null}},h(g,ee),h(g,ee.prototype),ve.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,T){if(_.nodeType==N){for(var P=_.firstChild;P;){var q=P.nextSibling;this.insertBefore(P,T),P=q}return _}return ss(this,_,T),_.ownerDocument=this,this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),Pe(this,_)},replaceChild:function(_,T){ss(this,_,T,ms),_.ownerDocument=this,T&&this.removeChild(T),rt(_)&&(this.documentElement=_)},importNode:function(_,T){return Qs(this,_,T)},getElementById:function(_){var T=null;return _e(this.documentElement,function(P){if(P.nodeType==y&&P.getAttribute("id")==_)return T=P,!0}),T},getElementsByClassName:function(_){var T=a(_);return new te(this,function(P){var q=[];return T.length>0&&_e(P.documentElement,function(ae){if(ae!==P&&ae.nodeType===y){var le=ae.getAttribute("class");if(le){var De=_===le;if(!De){var Ee=a(le);De=T.every(l(Ee))}De&&q.push(ae)}}}),q})},createElement:function(_){var T=new je;return T.ownerDocument=this,T.nodeName=_,T.tagName=_,T.localName=_,T.childNodes=new W,(T.attributes=new oe)._ownerElement=T,T},createDocumentFragment:function(){var _=new Ks;return _.ownerDocument=this,_.childNodes=new W,_},createTextNode:function(_){var T=new Se;return T.ownerDocument=this,T.appendData(_),T},createComment:function(_){var T=new Fi;return T.ownerDocument=this,T.appendData(_),T},createCDATASection:function(_){var T=new Ui;return T.ownerDocument=this,T.appendData(_),T},createProcessingInstruction:function(_,T){var P=new qi;return P.ownerDocument=this,P.tagName=P.nodeName=P.target=_,P.nodeValue=P.data=T,P},createAttribute:function(_){var T=new lt;return T.ownerDocument=this,T.name=_,T.nodeName=_,T.localName=_,T.specified=!0,T},createEntityReference:function(_){var T=new fs;return T.ownerDocument=this,T.nodeName=_,T},createElementNS:function(_,T){var P=new je,q=T.split(":"),ae=P.attributes=new oe;return P.childNodes=new W,P.ownerDocument=this,P.nodeName=T,P.tagName=T,P.namespaceURI=_,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,ae._ownerElement=P,P},createAttributeNS:function(_,T){var P=new lt,q=T.split(":");return P.ownerDocument=this,P.nodeName=T,P.name=T,P.namespaceURI=_,P.specified=!0,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,P}},p(ve,ee),je.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var T=this.getAttributeNode(_);return T&&T.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,T){var P=this.ownerDocument.createAttribute(_);P.value=P.nodeValue=""+T,this.setAttributeNode(P)},removeAttribute:function(_){var T=this.getAttributeNode(_);T&&this.removeAttributeNode(T)},appendChild:function(_){return _.nodeType===N?this.insertBefore(_,null):Oe(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);P&&this.removeAttributeNode(P)},hasAttributeNS:function(_,T){return this.getAttributeNodeNS(_,T)!=null},getAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);return P&&P.value||""},setAttributeNS:function(_,T,P){var q=this.ownerDocument.createAttributeNS(_,T);q.value=q.nodeValue=""+P,this.setAttributeNode(q)},getAttributeNodeNS:function(_,T){return this.attributes.getNamedItemNS(_,T)},getElementsByTagName:function(_){return new te(this,function(T){var P=[];return _e(T,function(q){q===T||q.nodeType!=y||_!=="*"&&q.tagName!=_||P.push(q)}),P})},getElementsByTagNameNS:function(_,T){return new te(this,function(P){var q=[];return _e(P,function(ae){ae===P||ae.nodeType!==y||_!=="*"&&ae.namespaceURI!==_||T!=="*"&&ae.localName!=T||q.push(ae)}),q})}},ve.prototype.getElementsByTagName=je.prototype.getElementsByTagName,ve.prototype.getElementsByTagNameNS=je.prototype.getElementsByTagNameNS,p(je,ee),lt.prototype.nodeType=w,p(lt,ee),is.prototype={data:"",substringData:function(_,T){return this.data.substring(_,_+T)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,T){this.replaceData(_,0,T)},appendChild:function(_){throw new Error(H[S])},deleteData:function(_,T){this.replaceData(_,T,"")},replaceData:function(_,T,P){P=this.data.substring(0,_)+P+this.data.substring(_+T),this.nodeValue=this.data=P,this.length=P.length}},p(is,ee),Se.prototype={nodeName:"#text",nodeType:E,splitText:function(_){var T=this.data,P=T.substring(_);T=T.substring(0,_),this.data=this.nodeValue=T,this.length=T.length;var q=this.ownerDocument.createTextNode(P);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},p(Se,is),Fi.prototype={nodeName:"#comment",nodeType:M},p(Fi,is),Ui.prototype={nodeName:"#cdata-section",nodeType:I},p(Ui,is),gs.prototype.nodeType=G,p(gs,ee),ke.prototype.nodeType=z,p(ke,ee),Ar.prototype.nodeType=L,p(Ar,ee),fs.prototype.nodeType=v,p(fs,ee),Ks.prototype.nodeName="#document-fragment",Ks.prototype.nodeType=N,p(Ks,ee),qi.prototype.nodeType=R,p(qi,ee),xr.prototype.serializeToString=function(_,T,P){return kr.call(_,T,P)},ee.prototype.toString=kr;try{if(Object.defineProperty){let _=function(T){switch(T.nodeType){case y:case N:var P=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&P.push(_(T)),T=T.nextSibling;return P.join("");default:return T.nodeValue}};Object.defineProperty(te.prototype,"length",{get:function(){return J(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return _(this)},set:function(T){switch(this.nodeType){case y:case N:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),tt=function(T,P,q){T["$$"+P]=q}}}catch{}return os.DocumentType=gs,os.DOMException=$,os.DOMImplementation=se,os.Element=je,os.Node=ee,os.NodeList=W,os.XMLSerializer=xr,os}var $u,er={},Vu={};function Tf(){return $u||($u=1,s=Vu,e=Bn().freeze,s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES),Vu;var s,e}var zu,Wu,Gu,zr={};function Sf(){if(zu)return zr;zu=1;var s=Bn().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,h=4,p=5,g=6,y=7;function w(S,A){this.message=S,this.locator=A,Error.captureStackTrace&&Error.captureStackTrace(this,w)}function E(){}function I(S,A,B,$,W){function te(Oe){if(Oe>65535){var je=55296+((Oe-=65536)>>10),lt=56320+(1023&Oe);return String.fromCharCode(je,lt)}return String.fromCharCode(Oe)}function J(Oe){var je=Oe.slice(1,-1);return Object.hasOwnProperty.call(B,je)?B[je]:je.charAt(0)==="#"?te(parseInt(je.substr(1).replace("x","0x"))):(W.error("entity not found:"+Oe),Oe)}function oe(Oe){if(Oe>ve){var je=S.substring(ve,Oe).replace(/&#?\w+;/g,J);ee&&Q(ve),$.characters(je,0,Oe-ve),ve=Oe}}function Q(Oe,je){for(;Oe>=ie&&(je=se.exec(S));)Y=je.index,ie=Y+je[0].length,ee.lineNumber++;ee.columnNumber=Oe-Y+1}for(var Y=0,ie=0,se=/.*(?:\r\n?|\n)|.*$/g,ee=$.locator,ye=[{currentNSMap:A}],_e={},ve=0;;){try{var me=S.indexOf("<",ve);if(me<0){if(!S.substr(ve).match(/^\s*$/)){var Fe=$.doc,et=Fe.createTextNode(S.substr(ve));Fe.appendChild(et),$.currentElement=et}return}switch(me>ve&&oe(me),S.charAt(me+1)){case"/":var Pe=S.indexOf(">",me+3),We=S.substring(me+2,Pe).replace(/[ \t\n\r]+$/g,""),Ge=ye.pop();Pe<0?(We=S.substring(me+2).replace(/[\s<].*/,""),W.error("end tag name: "+We+" is not complete:"+Ge.tagName),Pe=me+1+We.length):We.match(/\sve?ve=Pe:oe(Math.max(me,ve)+1)}}function v(S,A){return A.lineNumber=S.lineNumber,A.columnNumber=S.columnNumber,A}function L(S,A,B,$,W,te){function J(ee,ye,_e){B.attributeNames.hasOwnProperty(ee)&&te.fatalError("Attribute "+ee+" redefined"),B.addValue(ee,ye.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,W),_e)}for(var oe,Q=++A,Y=r;;){var ie=S.charAt(Q);switch(ie){case"=":if(Y===n)oe=S.slice(A,Q),Y=l;else{if(Y!==a)throw new Error("attribute equal must after attrName");Y=l}break;case"'":case'"':if(Y===l||Y===n){if(Y===n&&(te.warning('attribute value must after "="'),oe=S.slice(A,Q)),A=Q+1,!((Q=S.indexOf(ie,A))>0))throw new Error("attribute value no end '"+ie+"' match");J(oe,se=S.slice(A,Q),A-1),Y=p}else{if(Y!=h)throw new Error('attribute value must after "="');J(oe,se=S.slice(A,Q),A),te.warning('attribute "'+oe+'" missed start quot('+ie+")!!"),A=Q+1,Y=p}break;case"/":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:Y=y,B.closed=!0;case h:case n:break;case a:B.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return te.error("unexpected end of input"),Y==r&&B.setTagName(S.slice(A,Q)),Q;case">":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:break;case h:case n:(se=S.slice(A,Q)).slice(-1)==="/"&&(B.closed=!0,se=se.slice(0,-1));case a:Y===a&&(se=oe),Y==h?(te.warning('attribute "'+se+'" missed quot(")!'),J(oe,se,A)):(s.isHTML($[""])&&se.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),J(se,se,A));break;case l:throw new Error("attribute value missed!!")}return Q;case"€":ie=" ";default:if(ie<=" ")switch(Y){case r:B.setTagName(S.slice(A,Q)),Y=g;break;case n:oe=S.slice(A,Q),Y=a;break;case h:var se=S.slice(A,Q);te.warning('attribute "'+se+'" missed quot(")!!'),J(oe,se,A);case p:Y=g}else switch(Y){case a:B.tagName,s.isHTML($[""])&&oe.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),J(oe,oe,A),A=Q,Y=n;break;case p:te.warning('attribute space is required"'+oe+'"!!');case g:Y=n,A=Q;break;case l:Y=h,A=Q;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Q++}}function R(S,A,B){for(var $=S.tagName,W=null,te=S.length;te--;){var J=S[te],oe=J.qName,Q=J.value;if((ee=oe.indexOf(":"))>0)var Y=J.prefix=oe.slice(0,ee),ie=oe.slice(ee+1),se=Y==="xmlns"&&ie;else ie=oe,Y=null,se=oe==="xmlns"&&"";J.localName=ie,se!==!1&&(W==null&&(W={},G(B,B={})),B[se]=W[se]=Q,J.uri=s.XMLNS,A.startPrefixMapping(se,Q))}for(te=S.length;te--;)(Y=(J=S[te]).prefix)&&(Y==="xml"&&(J.uri=s.XML),Y!=="xmlns"&&(J.uri=B[Y||""]));var ee;(ee=$.indexOf(":"))>0?(Y=S.prefix=$.slice(0,ee),ie=S.localName=$.slice(ee+1)):(Y=null,ie=S.localName=$);var ye=S.uri=B[Y||""];if(A.startElement(ye,ie,$,S),!S.closed)return S.currentNSMap=B,S.localNSMap=W,!0;if(A.endElement(ye,ie,$),W)for(Y in W)Object.prototype.hasOwnProperty.call(W,Y)&&A.endPrefixMapping(Y)}function M(S,A,B,$,W){if(/^(?:script|textarea)$/i.test(B)){var te=S.indexOf("",A),J=S.substring(A+1,te);if(/[&<]/.test(J))return/^script$/i.test(B)?(W.characters(J,0,J.length),te):(J=J.replace(/&#?\w+;/g,$),W.characters(J,0,J.length),te)}return A+1}function O(S,A,B,$){var W=$[B];return W==null&&((W=S.lastIndexOf(""))",A+4))>A?(B.comment(S,A+4,W-A-4),W+3):($.error("Unclosed comment"),-1):-1;if(S.substr(A+3,6)=="CDATA["){var W=S.indexOf("]]>",A+9);return B.startCDATA(),B.characters(S,A+9,W-A-9),B.endCDATA(),W+3}var te=H(S,A),J=te.length;if(J>1&&/!doctype/i.test(te[0][0])){var oe=te[1][0],Q=!1,Y=!1;J>3&&(/^public$/i.test(te[2][0])?(Q=te[3][0],Y=J>4&&te[4][0]):/^system$/i.test(te[2][0])&&(Y=te[3][0]));var ie=te[J-1];return B.startDTD(oe,Q,Y),B.endDTD(),ie.index+ie[0].length}return-1}function z(S,A,B){var $=S.indexOf("?>",A);if($){var W=S.substring(A,$).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return W?(W[0].length,B.processingInstruction(W[1],W[2]),$+2):-1}return-1}function U(){this.attributeNames={}}function H(S,A){var B,$=[],W=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(W.lastIndex=A,W.exec(S);B=W.exec(S);)if($.push(B),B[1])return $}return w.prototype=new Error,w.prototype.name=w.name,E.prototype={parse:function(S,A,B){var $=this.domBuilder;$.startDocument(),G(A,A={}),I(S,A,B,$,this.errorHandler),$.endDocument()}},U.prototype={setTagName:function(S){if(!i.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,A,B){if(!i.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:A,offset:B}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}},zr.XMLReader=E,zr.ParseError=w,zr}function Ef(){if(Wu)return er;Wu=1;var s=Bn(),e=$d(),t=Tf(),i=Sf(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function h(L){return L.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function p(L){this.options=L||{locator:{}}}function g(L,R,M){if(!L){if(R instanceof y)return R;L=R}var O={},G=L instanceof Function;function N(z){var U=L[z];!U&&G&&(U=L.length==2?function(H){L(z,H)}:L),O[z]=U&&function(H){U("[xmldom "+z+"] "+H+E(M))}||function(){}}return M=M||{},N("warning"),N("error"),N("fatalError"),O}function y(){this.cdata=!1}function w(L,R){R.lineNumber=L.lineNumber,R.columnNumber=L.columnNumber}function E(L){if(L)return` +@`+(L.systemId||"")+"#[line:"+L.lineNumber+",col:"+L.columnNumber+"]"}function I(L,R,M){return typeof L=="string"?L.substr(R,M):L.length>=R+M||R?new java.lang.String(L,R,M)+"":L}function v(L,R){L.currentElement?L.currentElement.appendChild(R):L.doc.appendChild(R)}return p.prototype.parseFromString=function(L,R){var M=this.options,O=new l,G=M.domBuilder||new y,N=M.errorHandler,z=M.locator,U=M.xmlns||{},H=/\/x?html?$/.test(R),S=H?t.HTML_ENTITIES:t.XML_ENTITIES;z&&G.setDocumentLocator(z),O.errorHandler=g(N,G,z),O.domBuilder=M.domBuilder||G,H&&(U[""]=n.HTML),U.xml=U.xml||n.XML;var A=M.normalizeLineEndings||h;return L&&typeof L=="string"?O.parse(A(L),U,S):O.errorHandler.error("invalid doc source"),G.doc},y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(L,R,M,O){var G=this.doc,N=G.createElementNS(L,M||R),z=O.length;v(this,N),this.currentElement=N,this.locator&&w(this.locator,N);for(var U=0;U!!s&&typeof s=="object",Ze=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Xu(e[i])&&Xu(t[i])?e[i]=Ze(e[i],t[i]):e[i]=t[i]}),e),{}),Vd=s=>Object.keys(s).map(e=>s[e]),Af=(s,e)=>{const t=[];for(let i=s;is.reduce((e,t)=>e.concat(t),[]),zd=s=>{if(!s.length)return[];const e=[];for(let t=0;ts.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),kf=(s,e)=>Vd(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var wi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const gr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:Mn(s||"",e)};if(t||i){const n=(t||i).split("-");let a,l=k.BigInt?k.BigInt(n[0]):parseInt(n[0],10),h=k.BigInt?k.BigInt(n[1]):parseInt(n[1],10);l{let e;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,`${s.offset}-${e}`},Yu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),If={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=Yu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:h=1/0}=s,p=Yu(s.endNumber),g=(e+t)/1e3,y=i+a,w=g+l-y,E=Math.ceil(w*r/n),I=Math.floor((g-y-h)*r/n),v=Math.floor((g-y)*r/n);return{start:Math.max(0,I),end:typeof p=="number"?p:Math.min(E,v)}}},Pf=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},No=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=If[e](s),h=Af(a,l).map(Pf(s));if(e==="static"){const p=h.length-1,g=typeof r=="number"?r:n;h[p].duration=g-t/i*p}return h},Wd=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:h}=s;if(!e)throw new Error(wi.NO_BASE_URL);const p=gr({baseUrl:e,source:t.sourceURL,range:t.range}),g=gr({baseUrl:e,source:e,indexRange:r});if(g.map=p,h){const y=No(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},Ro=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,h=e.timescale,p=e.references.filter(L=>L.referenceType!==1),g=[],y=s.endList?"static":"dynamic",w=s.sidx.timeline;let E,I=w,v=s.mediaSequence||0;E=typeof e.firstOffset=="bigint"?k.BigInt(l)+e.firstOffset:l+e.firstOffset;for(let L=0;Lkf(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Nf=(s,e)=>{for(let t=0;t{let e=[];return bf(s,Lf,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},Qu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},Rf=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=Nf(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--);r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),Qu({playlist:i,mediaSequence:r.segments[a].number})})},Mf=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Ku(s)),i=e.playlists.concat(Ku(e));return e.timelineStarts=Gd([s.timelineStarts,e.timelineStarts]),Rf({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Fn=s=>s&&s.uri+"-"+Df(s.byterange),Ia=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=Vd(i.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=xf(i.segments||[],"discontinuity"),i))},Mo=(s,e)=>{const t=Fn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ro(s,i,s.sidx.resolvedUri),s},Bf=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Mo(s[t],e);return s},Ff=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Uf=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{e===void 0&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},qf=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"";let p=a.attributes.label||"main";if(h&&!a.attributes.label){const y=l?` (${l})`:"";p=`${a.attributes.lang}${y}`}n[p]||(n[p]={language:h,autoselect:!0,default:l==="main",playlists:[],uri:""});const g=Mo(Ff(a,t),e);return n[p].playlists.push(g),i===void 0&&l==="main"&&(i=a,i.default=!0),n},{});return i||(r[Object.keys(r)[0]].default=!0),r},jf=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(Uf(i),e)),t},{}),Hf=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),$f=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},Vf=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",zf=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",Wf=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Gf=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Ju=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Xf=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:h,minimumUpdatePeriod:p}=s[0].attributes,g=Ia(s.filter(Vf)).map($f),y=Ia(s.filter(zf)),w=Ia(s.filter(Wf)),E=s.map(G=>G.attributes.captionServices).filter(Boolean),I={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Bf(g,i)};p>=0&&(I.minimumUpdatePeriod=1e3*p),e&&(I.locations=e),t&&(I.contentSteering=t),l==="dynamic"&&(I.suggestedPresentationDelay=h),n&&n.length>0&&(I.eventStream=n);const v=I.playlists.length===0,L=y.length?qf(y,i,v):null,R=w.length?jf(w,i):null,M=g.concat(Ju(L),Ju(R)),O=M.map(({timelineStarts:G})=>G);return I.timelineStarts=Gd(O),Gf(M,I.timelineStarts),L&&(I.mediaGroups.AUDIO.audio=L),R&&(I.mediaGroups.SUBTITLES.subs=R),E.length&&(I.mediaGroups["CLOSED-CAPTIONS"].cc=Hf(E)),r?Mf({oldManifest:r,newManifest:I}):I},Yf=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:h=0}=s,p=(i+r)/1e3+h-(n+l);return Math.ceil((p*a-e)/t)},Xd=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:h}=s,p=[];let g=-1;for(let y=0;yg&&(g=v),I<0){const O=y+1;L=O===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?Yf(s,g,E):(n*a-g)/E:(e[O].t-g)/E}else L=I+1;const R=l+p.length+L;let M=l+p.length;for(;M(e,t,i,r)=>{if(e==="$$")return"$";if(s[t]===void 0)return e;const n=""+s[t];return t==="RepresentationID"?n:(r=i?parseInt(r,10):1,n.length>=r?n:`${new Array(r-n.length+1).join("0")}${n}`)},Zu=(s,e)=>s.replace(Kf,Qf(e)),Jf=(s,e)=>s.duration||e?s.duration?No(s):Xd(s,e):[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}],Zf=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=gr({baseUrl:s.baseUrl,source:Zu(i.sourceURL,t),range:i.range});return Jf(s,e).map(n=>{t.Number=n.number,t.Time=n.time;const a=Zu(s.media||"",t),l=s.timescale||1,h=s.presentationTimeOffset||0,p=s.periodStart+(n.time-h)/l;return{uri:a,timeline:n.timeline,duration:n.duration,resolvedUri:Mn(s.baseUrl||"",a),map:r,number:n.number,presentationTime:p}})},ey=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=gr({baseUrl:t,source:i.sourceURL,range:i.range}),n=gr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ty=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(wi.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>ey(s,l));let a;return t&&(a=No(s)),e&&(a=Xd(s,e)),a.map((l,h)=>{if(n[h]){const p=n[h],g=s.timescale||1,y=s.presentationTimeOffset||0;return p.timeline=l.timeline,p.duration=l.duration,p.number=l.number,p.presentationTime=r+(l.time-y)/g,p}}).filter(l=>l)},sy=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Zf,t=Ze(s,e.template)):e.base?(i=Wd,t=Ze(s,e.base)):e.list&&(i=ty,t=Ze(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},iy=s=>s.map(sy),Be=(s,e)=>zd(s.childNodes).filter(({tagName:t})=>t===e),br=s=>s.textContent.trim(),ry=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),ai=s=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!e)return 0;const[t,i,r,n,a,l]=e.slice(1);return parseFloat(t||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(r||0)*86400+parseFloat(n||0)*3600+parseFloat(a||0)*60+parseFloat(l||0)},ny=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),eh={mediaPresentationDuration:s=>ai(s),availabilityStartTime:s=>ny(s)/1e3,minimumUpdatePeriod:s=>ai(s),suggestedPresentationDelay:s=>ai(s),type:s=>s,timeShiftBufferDepth:s=>ai(s),start:s=>ai(s),width:s=>parseInt(s,10),height:s=>parseInt(s,10),bandwidth:s=>parseInt(s,10),frameRate:s=>ry(s),startNumber:s=>parseInt(s,10),timescale:s=>parseInt(s,10),presentationTimeOffset:s=>parseInt(s,10),duration(s){const e=parseInt(s,10);return isNaN(e)?ai(s):e},d:s=>parseInt(s,10),t:s=>parseInt(s,10),r:s=>parseInt(s,10),presentationTime:s=>parseInt(s,10),DEFAULT:s=>s},Xe=s=>s&&s.attributes?zd(s.attributes).reduce((e,t)=>{const i=eh[t.name]||eh.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ay={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Un=(s,e)=>e.length?Ci(s.map(function(t){return e.map(function(i){const r=br(i),n=Mn(t.baseUrl,r),a=Ze(Xe(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Bo=s=>{const e=Be(s,"SegmentTemplate")[0],t=Be(s,"SegmentList")[0],i=t&&Be(t,"SegmentURL").map(y=>Ze({tag:"SegmentURL"},Xe(y))),r=Be(s,"SegmentBase")[0],n=t||e,a=n&&Be(n,"SegmentTimeline")[0],l=t||r||e,h=l&&Be(l,"Initialization")[0],p=e&&Xe(e);p&&h?p.initialization=h&&Xe(h):p&&p.initialization&&(p.initialization={sourceURL:p.initialization});const g={template:p,segmentTimeline:a&&Be(a,"S").map(y=>Xe(y)),list:t&&Ze(Xe(t),{segmentUrls:i,initialization:Xe(h)}),base:r&&Ze(Xe(r),{initialization:Xe(h)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},oy=(s,e,t)=>i=>{const r=Be(i,"BaseURL"),n=Un(e,r),a=Ze(s,Xe(i)),l=Bo(i);return n.map(h=>({segmentInfo:Ze(t,l),attributes:Ze(a,h)}))},ly=s=>s.reduce((e,t)=>{const i=Xe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=ay[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Be(t,"cenc:pssh")[0];if(n){const a=br(n);e[r].pssh=a&&Bd(a)}}return e},{}),uy=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(n=>{const[a,l]=n.split(":");a==="lang"?t.language=l:a==="er"?t.easyReader=Number(l):a==="war"?t.aspectRatio=Number(l):a==="3D"&&(t["3D"]=Number(l))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})},hy=s=>Ci(Be(s.node,"EventStream").map(e=>{const t=Xe(e),i=t.schemeIdUri;return Be(e,"Event").map(r=>{const n=Xe(r),a=n.presentationTime||0,l=t.timescale||1,h=n.duration||0,p=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:p,end:p+h/l,messageData:br(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),dy=(s,e,t)=>i=>{const r=Xe(i),n=Un(e,Be(i,"BaseURL")),a=Be(i,"Role")[0],l={role:Xe(a)};let h=Ze(s,r,l);const p=Be(i,"Accessibility")[0],g=uy(Xe(p));g&&(h=Ze(h,{captionServices:g}));const y=Be(i,"Label")[0];if(y&&y.childNodes.length){const L=y.childNodes[0].nodeValue.trim();h=Ze(h,{label:L})}const w=ly(Be(i,"ContentProtection"));Object.keys(w).length&&(h=Ze(h,{contentProtection:w}));const E=Bo(i),I=Be(i,"Representation"),v=Ze(t,E);return Ci(I.map(oy(h,n,v)))},cy=(s,e)=>(t,i)=>{const r=Un(e,Be(t.node,"BaseURL")),n=Ze(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Be(t.node,"AdaptationSet"),l=Bo(t.node);return Ci(a.map(dy(n,r,l)))},py=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=Ze({serverURL:br(s[0])},Xe(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},my=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:e||t!=="static"?null:0,gy=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Be(s,"Period");if(!a.length)throw new Error(wi.INVALID_NUMBER_OF_PERIOD);const l=Be(s,"Location"),h=Xe(s),p=Un([{baseUrl:t}],Be(s,"BaseURL")),g=Be(s,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=i,h.clientOffset=r,l.length&&(h.locations=l.map(br));const y=[];return a.forEach((w,E)=>{const I=Xe(w),v=y[E-1];I.start=my({attributes:I,priorPeriodAttributes:v?v.attributes:null,mpdType:h.type}),y.push({node:w,attributes:I})}),{locations:h.locations,contentSteeringInfo:py(g,n),representationInfo:Ci(y.map(cy(h,p))),eventStream:Ci(y.map(hy))}},Yd=s=>{if(s==="")throw new Error(wi.DASH_EMPTY_MANIFEST);const e=new wf.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(wi.DASH_INVALID_XML);return i},fy=s=>{const e=Be(s,"UTCTiming")[0];if(!e)return null;const t=Xe(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(wi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},yy=(s,e={})=>{const t=gy(Yd(s),e),i=iy(t.representationInfo);return Xf({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_y=s=>fy(Yd(s));var th,sh,ih,rh;function vy(){if(sh)return th;sh=1;var s=Math.pow(2,32);return th={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))0;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i}}const Ty=vr(by());var Sy=ce([73,68,51]),Ey=function(s,e){e===void 0&&(e=0);var t=(s=ce(s))[e+5],i=s[e+6]<<21|s[e+7]<<14|s[e+8]<<7|s[e+9];return(16&t)>>4?i+20:i+10},nr=function s(e,t){return t===void 0&&(t=0),(e=ce(e)).length-t<10||!Me(e,Sy,{offset:t})?t:s(e,t+=Ey(e,t))},nh=function(s){return typeof s=="string"?Hd(s):s},Cy=function(s){return Array.isArray(s)?s.map(function(e){return nh(e)}):[nh(s)]},wy=function s(e,t,i){i===void 0&&(i=!1),t=Cy(t),e=ce(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,l=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(i)break;h=e.length}var p=e.subarray(n+8,h);Me(l,t[0])&&(t.length===1?r.push(p):r.push.apply(r,s(p,t.slice(1),i))),n=h}return r},Wr={EBML:ce([26,69,223,163]),DocType:ce([66,130]),Segment:ce([24,83,128,103]),SegmentInfo:ce([21,73,169,102]),Tracks:ce([22,84,174,107]),Track:ce([174]),TrackNumber:ce([215]),DefaultDuration:ce([35,227,131]),TrackEntry:ce([174]),TrackType:ce([131]),FlagDefault:ce([136]),CodecID:ce([134]),CodecPrivate:ce([99,162]),VideoTrack:ce([224]),AudioTrack:ce([225]),Cluster:ce([31,67,182,117]),Timestamp:ce([231]),TimestampScale:ce([42,215,177]),BlockGroup:ce([160]),BlockDuration:ce([155]),Block:ce([161]),SimpleBlock:ce([163])},oo=[128,64,32,16,8,4,2,1],Ay=function(s){for(var e=1,t=0;t=t.length)return t.length;var r=on(t,i,!1);if(Me(e.bytes,r.bytes))return i;var n=on(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},oh=function s(e,t){t=xy(t),e=ce(e);var i=[];if(!t.length)return i;for(var r=0;re.length?e.length:l+a.value,p=e.subarray(l,h);Me(t[0],n.bytes)&&(t.length===1?i.push(p):i=i.concat(s(p,t.slice(1)))),r+=n.length+a.length+p.length}return i},Dy=ce([0,0,0,1]),Iy=ce([0,0,1]),Py=ce([0,0,3]),Ly=function(s){for(var e=[],t=1;t>1&63),t.indexOf(h)!==-1&&(r=n+l),n+=l+(e==="h264"?1:2)}else n++}return s.subarray(0,0)},Oy=function(s,e,t){return Kd(s,"h264",e,t)},Ny=function(s,e,t){return Kd(s,"h265",e,t)},dt={webm:ce([119,101,98,109]),matroska:ce([109,97,116,114,111,115,107,97]),flac:ce([102,76,97,67]),ogg:ce([79,103,103,83]),ac3:ce([11,119]),riff:ce([82,73,70,70]),avi:ce([65,86,73]),wav:ce([87,65,86,69]),"3gp":ce([102,116,121,112,51,103]),mp4:ce([102,116,121,112]),fmp4:ce([115,116,121,112]),mov:ce([102,116,121,112,113,116]),moov:ce([109,111,111,118]),moof:ce([109,111,111,102])},Ai={aac:function(s){var e=nr(s);return Me(s,[255,16],{offset:e,mask:[255,22]})},mp3:function(s){var e=nr(s);return Me(s,[255,2],{offset:e,mask:[255,6]})},webm:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.webm)},mkv:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.matroska)},mp4:function(s){return!Ai["3gp"](s)&&!Ai.mov(s)&&(!(!Me(s,dt.mp4,{offset:4})&&!Me(s,dt.fmp4,{offset:4}))||!(!Me(s,dt.moof,{offset:4})&&!Me(s,dt.moov,{offset:4}))||void 0)},mov:function(s){return Me(s,dt.mov,{offset:4})},"3gp":function(s){return Me(s,dt["3gp"],{offset:4})},ac3:function(s){var e=nr(s);return Me(s,dt.ac3,{offset:e})},ts:function(s){if(s.length<189&&s.length>=1)return s[0]===71;for(var e=0;e+1880};function By(){if(uh)return lh;uh=1;var s,e,t,i,r,n,a,l=9e4;return r=function(h,p){return s(i(h,p))},n=function(h,p){return e(t(h),p)},a=function(h,p,g){return t(g?h:h-p)},lh={ONE_SECOND_IN_TS:l,secondsToVideoTs:s=function(h){return h*l},secondsToAudioTs:e=function(h,p){return h*p},videoTsToSeconds:t=function(h){return h/l},audioTsToSeconds:i=function(h,p){return h/p},audioTsToVideoTs:r,videoTsToAudioTs:n,metadataTsToSeconds:a}}var js=By(),uo="8.18.1";const hs={},xs=function(s,e){return hs[s]=hs[s]||[],e&&(hs[s]=hs[s].concat(e)),hs[s]},Fy=function(s,e){xs(s,e)},Qd=function(s,e){const t=xs(s).indexOf(e);return!(t<=-1)&&(hs[s]=hs[s].slice(),hs[s].splice(t,1),!0)},Uy=function(s,e){xs(s,[].concat(e).map(t=>{const i=(...r)=>(Qd(s,i),t(...r));return i}))},ln={prefixed:!0},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],hh=en[0];let ar;for(let s=0;s(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let h=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(h=`%c${s}`,n.unshift(t)),n.unshift(h+":"),yt){yt.push([].concat(n));const g=yt.length-1e3;yt.splice(0,g>0?g:0)}if(!k.console)return;let p=k.console[i];p||i!=="debug"||(p=k.console.info||k.console.log),p&&a&&l.test(i)&&p[Array.isArray(n)?"apply":"call"](k.console,n)};function ho(s,e=":",t=""){let i,r="info";function n(...a){i("log",r,a)}return i=qy(s,n,t),n.createLogger=(a,l,h)=>{const p=l!==void 0?l:e;return ho(`${s} ${p} ${a}`,p,h!==void 0?h:t)},n.createNewLogger=(a,l,h)=>ho(a,l,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>yt?[].concat(yt):[],n.history.filter=a=>(yt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{yt&&(yt.length=0)},n.history.disable=()=>{yt!==null&&(yt.length=0,yt=null)},n.history.enable=()=>{yt===null&&(yt=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const Te=ho("VIDEOJS"),Jd=Te.createLogger,jy=Object.prototype.toString,Zd=function(s){return Zt(s)?Object.keys(s):[]};function fi(s,e){Zd(s).forEach(t=>e(s[t],t))}function ec(s,e,t=0){return Zd(s).reduce((i,r)=>e(i,s[r],r),t)}function Zt(s){return!!s&&typeof s=="object"}function xi(s){return Zt(s)&&jy.call(s)==="[object Object]"&&s.constructor===Object}function Ie(...s){const e={};return s.forEach(t=>{t&&fi(t,(i,r)=>{xi(i)?(xi(e[r])||(e[r]={}),e[r]=Ie(e[r],i)):e[r]=i})}),e}function tc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function un(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var Hy=Object.freeze({__proto__:null,each:fi,reduce:ec,isObject:Zt,isPlain:xi,merge:Ie,values:tc,defineLazyProperty:un});let sc,Uo=!1,ic=null,Kt=!1,rc=!1,hi=!1,di=!1,Qt=!1,co=null,hn=null;const $y=!!(k.cast&&k.cast.framework&&k.cast.framework.CastReceiverContext);let nc=null,dn=!1,cn=!1,pn=!1,qn=!1,mn=!1,gn=!1,fn=!1;const fr=!!(Oi()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch)),Ts=k.navigator&&k.navigator.userAgentData;if(Ts&&Ts.platform&&Ts.brands&&(Kt=Ts.platform==="Android",hi=!!Ts.brands.find(s=>s.brand==="Microsoft Edge"),di=!!Ts.brands.find(s=>s.brand==="Chromium"),Qt=!hi&&di,co=hn=(Ts.brands.find(s=>s.brand==="Chromium")||{}).version||null,cn=Ts.platform==="Windows"),!di){const s=k.navigator&&k.navigator.userAgent||"";Uo=/iPod/i.test(s),ic=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Kt=/Android/i.test(s),sc=function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),rc=/Firefox/i.test(s),hi=/Edg/i.test(s),di=/Chrome/i.test(s)||/CriOS/i.test(s),Qt=!hi&&di,co=hn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nc=function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t}(),mn=/Tizen/i.test(s),gn=/Web0S/i.test(s),fn=mn||gn,dn=/Safari/i.test(s)&&!Qt&&!Kt&&!hi&&!fn,cn=/Windows/i.test(s),pn=/iPad/i.test(s)||dn&&fr&&!/iPhone/i.test(s),qn=/iPhone/i.test(s)&&!pn}const mt=qn||pn||Uo,jn=(dn||mt)&&!Qt;var ac=Object.freeze({__proto__:null,get IS_IPOD(){return Uo},get IOS_VERSION(){return ic},get IS_ANDROID(){return Kt},get ANDROID_VERSION(){return sc},get IS_FIREFOX(){return rc},get IS_EDGE(){return hi},get IS_CHROMIUM(){return di},get IS_CHROME(){return Qt},get CHROMIUM_VERSION(){return co},get CHROME_VERSION(){return hn},IS_CHROMECAST_RECEIVER:$y,get IE_VERSION(){return nc},get IS_SAFARI(){return dn},get IS_WINDOWS(){return cn},get IS_IPAD(){return pn},get IS_IPHONE(){return qn},get IS_TIZEN(){return mn},get IS_WEBOS(){return gn},get IS_SMART_TV(){return fn},TOUCH_ENABLED:fr,IS_IOS:mt,IS_ANY_SAFARI:jn});function dh(s){return typeof s=="string"&&!!s.trim()}function Vy(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Oi(){return re===k.document}function Ni(s){return Zt(s)&&s.nodeType===1}function oc(){try{return k.parent!==k.self}catch{return!0}}function lc(s){return function(e,t){if(!dh(e))return re[s](null);dh(t)&&(t=re.querySelector(t));const i=Ni(t)?t:re;return i[s]&&i[s](e)}}function ge(s="div",e={},t={},i){const r=re.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Is(r,a):r[n]===a&&n!=="tabIndex"||(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&qo(r,i),r}function Is(s,e){return s.textContent===void 0?s.innerText=e:s.textContent=e,s}function po(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ur(s,e){return Vy(e),s.classList.contains(e)}function Vs(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Hn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Te.warn("removeClass was called with an element that doesn't exist"),null)}function uc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function hc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i==null||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function ws(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function dc(s,e){return s.getAttribute(e)}function ki(s,e,t){s.setAttribute(e,t)}function $n(s,e){s.removeAttribute(e)}function cc(){re.body.focus(),re.onselectstart=function(){return!1}}function pc(){re.onselectstart=function(){return!0}}function Di(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Ii(s,"height"))),t.width||(t.width=parseFloat(Ii(s,"width"))),t}}function yr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==re[ln.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Vn(s,e){const t={x:0,y:0};if(mt){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=Ii(g,"transform");if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);t.x+=w[4],t.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);t.x+=w[12],t.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&k.WebKitCSSMatrix){const w=k.getComputedStyle(g.assignedSlot.parentElement).transform,E=new k.WebKitCSSMatrix(w);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}const i={},r=yr(e.target),n=yr(s),a=n.width,l=n.height;let h=e.offsetY-(n.top-r.top),p=e.offsetX-(n.left-r.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,mt&&(p-=t.x,h-=t.y)),i.y=1-Math.max(0,Math.min(1,h/l)),i.x=Math.max(0,Math.min(1,p/a)),i}function mc(s){return Zt(s)&&s.nodeType===3}function zn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function gc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>(typeof e=="function"&&(e=e()),Ni(e)||mc(e)?e:typeof e=="string"&&/\S/.test(e)?re.createTextNode(e):void 0)).filter(e=>e)}function qo(s,e){return gc(e).forEach(t=>s.appendChild(t)),s}function fc(s,e){return qo(zn(s),e)}function _r(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0||s.button===0&&s.buttons===1}const ks=lc("querySelector"),yc=lc("querySelectorAll");function Ii(s,e){if(!s||!e)return"";if(typeof k.getComputedStyle=="function"){let t;try{t=k.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function _c(s){[...re.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=re.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const t=re.createElement("link");t.rel="stylesheet",t.type=e.type,t.media=e.media.mediaText,t.href=e.href,s.document.head.appendChild(t)}})}var ch=Object.freeze({__proto__:null,isReal:Oi,isEl:Ni,isInFrame:oc,createEl:ge,textContent:Is,prependTo:po,hasClass:ur,addClass:Vs,removeClass:Hn,toggleClass:uc,setAttributes:hc,getAttributes:ws,getAttribute:dc,setAttribute:ki,removeAttribute:$n,blockTextSelection:cc,unblockTextSelection:pc,getBoundingClientRect:Di,findPosition:yr,getPointerPosition:Vn,isTextNode:mc,emptyEl:zn,normalizeContent:gc,appendContent:qo,insertContent:fc,isSingleLeftClick:_r,$:ks,$$:yc,computedStyle:Ii,copyStyleSheetsToWindow:_c});let mo,vc=!1;const zy=function(){if(mo.options.autoSetup===!1)return;const s=Array.prototype.slice.call(re.getElementsByTagName("video")),e=Array.prototype.slice.call(re.getElementsByTagName("audio")),t=Array.prototype.slice.call(re.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function at(s,e,t){if(!pt.has(s))return;const i=pt.get(s);if(!i.handlers)return;if(Array.isArray(e))return jo(at,s,e,t);const r=function(a,l){i.handlers[l]=[],ph(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n)if(t){if(t.guid)for(let a=0;a=e&&(s(...i),t=r)}},Sc=function(s,e,t,i=k){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,h=arguments;let p=function(){r=null,p=null,t||s.apply(l,h)};!r&&t&&s.apply(l,h),i.clearTimeout(r),r=i.setTimeout(p,e)};return a.cancel=n,a};var Ky=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Dt,bind_:Le,throttle:es,debounce:Sc});let tr;class Et{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ct(this,e,t),this.addEventListener=i}off(e,t){at(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Gn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ho(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Wn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ri(this,e)}queueTrigger(e){tr||(tr=new Map);const t=e.type||e;let i=tr.get(this);i||(i=new Map,tr.set(this,i));const r=i.get(t);i.delete(t),k.clearTimeout(r);const n=k.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tr.delete(this)),this.trigger(e)},0);i.set(t,n)}}Et.prototype.allowedEvents_={},Et.prototype.addEventListener=Et.prototype.on,Et.prototype.removeEventListener=Et.prototype.off,Et.prototype.dispatchEvent=Et.prototype.trigger;const Xn=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,ps=s=>s instanceof Et||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),Qy=(s,e)=>{ps(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},yo=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,yn=(s,e,t)=>{if(!s||!s.nodeName&&!ps(s))throw new Error(`Invalid target for ${Xn(e)}#${t}; must be a DOM node or evented object.`)},Ec=(s,e,t)=>{if(!yo(s))throw new Error(`Invalid event type for ${Xn(e)}#${t}; must be a non-empty string or array.`)},Cc=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Xn(e)}#${t}; must be a function.`)},Pa=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),yn(r,s,t),Ec(n,s,t),Cc(a,s,t),a=Le(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Bs=(s,e,t,i)=>{yn(s,s,e),s.nodeName?Yy[e](s,t,i):s[e](t,i)},Jy={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"on");if(Bs(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Bs(this,"on","dispose",n),Bs(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"one");if(e)Bs(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"any");if(e)Bs(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"any",i,n)}},off(s,e,t){if(!s||yo(s))at(this.eventBusEl_,s,e);else{const i=s,r=e;yn(i,this,"off"),Ec(r,this,"off"),Cc(t,this,"off"),t=Le(this,t),this.off("dispose",t),i.nodeName?(at(i,r,t),at(i,"dispose",t)):ps(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){yn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!yo(t))throw new Error(`Invalid event type for ${Xn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ri(this.eventBusEl_,s,e)}};function $o(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ge("span",{className:"vjs-event-bus"});return Object.assign(s,Jy),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&pt.has(i)&&pt.delete(i)}),k.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const Zy={state:{},setState(s){let e;return typeof s=="function"&&(s=s()),fi(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ps(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function wc(s,e){return Object.assign(s,Zy),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ps(s)&&s.on("statechanged",s.handleStateChanged),s}const hr=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},He=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Ac=function(s,e){return He(s)===He(e)};var e_=Object.freeze({__proto__:null,toLowerCase:hr,toTitleCase:He,titleCaseEquals:Ac});class V{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ie({},this.options_),t=this.options_=Ie(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${kt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&($o(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),wc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ie(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ge(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],h=n&&n[l];let p=i;return a&&a[e]?p=a[e]:h&&h[e]&&(p=h[e]),t&&(p=p.replace(/\{(\d+)\}/g,function(g,y){const w=t[y-1];let E=w;return w===void 0&&(E=g),E})),p}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[He(e.name())]=null,this.childNameIndex_[hr(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let h=a.opts;if(t[l]!==void 0&&(h=t[l]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const p=this.addChild(l,h);p&&(this[l]=p)};let r;const n=V.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,h;return typeof a=="string"?(l=a,h=e[l]||this.options_[l]||{}):(l=a.name,h=a),{name:l,opts:h}}).filter(a=>{const l=V.getComponent(a.opts.componentClass||He(a.name));return l&&!n.isTech(l)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ks(e,t||this.contentEl())}$$(e,t){return yc(e,t||this.contentEl())}hasClass(e){return ur(this.el_,e)}addClass(...e){Vs(this.el_,...e)}removeClass(...e){Hn(this.el_,...e)}toggleClass(e,t){uc(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return dc(this.el_,e)}setAttribute(e,t){ki(this.el_,e,t)}removeAttribute(e){$n(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:this.el_.style[e]=t==="auto"?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+He(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ii(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${He(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key==="Tab"||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=k.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const h=l.touches[0].pageX-t.pageX,p=l.touches[0].pageY-t.pageY;Math.sqrt(h*h+p*p)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&k.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),k.clearTimeout(e)),e}setInterval(e,t){e=Le(this,e),this.clearTimersOnDispose_();const i=k.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),k.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Le(this,e),t=k.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Le(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),k.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=k.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!!t(n.parentElement)&&!(!t(n)||n.style.opacity==="0"||k.getComputedStyle(n).height==="0px"||k.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(re.documentElement.clientWidth||k.innerWidth)||a.y<0||a.y>(re.documentElement.clientHeight||k.innerHeight))return!1;let l=re.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(!l.parentNode)return!1;l=l.parentNode}}return e||(e=this.el()),!(!r(e)||!i(e)||e.parentElement&&!(e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=V.getComponent("Tech"),r=i&&i.isTech(t),n=V===t||V.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw l=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=He(e),V.components_||(V.components_={});const a=V.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,h=Object.keys(l);if(l&&h.length>0&&h.map(p=>l[p]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return V.components_[e]=t,V.components_[hr(e)]=t,t}static getComponent(e){if(e&&V.components_)return V.components_[e]}}function t_(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function mh(s,e,t,i){return t_(s,i,t.length-1),t[i][e]}function La(s){let e;return e=s===void 0||s.length===0?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:mh.bind(null,"start",0,s),end:mh.bind(null,"end",1,s)},k.Symbol&&k.Symbol.iterator&&(e[k.Symbol.iterator]=()=>(s||[]).values()),e}function Ft(s,e){return Array.isArray(s)?La(s):s===void 0||e===void 0?La():La([[s,e]])}V.registerComponent("Component",V);const xc=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Vo=xc;function kc(s){Vo=s}function Dc(){Vo=xc}function Xs(s,e=s){return Vo(s,e)}var s_=Object.freeze({__proto__:null,createTimeRanges:Ft,createTimeRange:Ft,setFormatTime:kc,resetFormatTime:Dc,formatTime:Xs});function Ic(s,e){let t,i,r=0;if(!e)return 0;s&&s.length||(s=Ft(0,0));for(let n=0;ne&&(i=e),r+=i-t;return r/e}function Ue(s){if(s instanceof Ue)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Zt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ue.defaultMessages[this.code]||"")}function dr(s){return s!=null&&typeof s.then=="function"}function Wt(s){dr(s)&&s.then(null,e=>{})}Ue.prototype.code=0,Ue.prototype.message="",Ue.prototype.status=null,Ue.prototype.metadata=null,Ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Ue.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Ue.MEDIA_ERR_CUSTOM=0,Ue.prototype.MEDIA_ERR_CUSTOM=0,Ue.MEDIA_ERR_ABORTED=1,Ue.prototype.MEDIA_ERR_ABORTED=1,Ue.MEDIA_ERR_NETWORK=2,Ue.prototype.MEDIA_ERR_NETWORK=2,Ue.MEDIA_ERR_DECODE=3,Ue.prototype.MEDIA_ERR_DECODE=3,Ue.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.MEDIA_ERR_ENCRYPTED=5,Ue.prototype.MEDIA_ERR_ENCRYPTED=5;const Oa=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(s[t]&&(e[t]=s[t]),e),{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var gh={textTracksToJson:function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const r=Oa(i.track);return i.src&&(r.src=i.src),r}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(Oa))},jsonToTextTracks:function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()},trackToJson_:Oa};const Na="vjs-modal-dialog";class Pi extends V{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ge("div",{className:`${Na}-content`},{role:"document"}),this.descEl_=ge("p",{className:`${Na}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Is(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Na} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),fc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),zn(this.contentEl()),this.trigger("modalempty")}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){const e=re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable())return e.preventDefault(),void this.close();if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof k.HTMLAnchorElement||t instanceof k.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof k.HTMLInputElement||t instanceof k.HTMLSelectElement||t instanceof k.HTMLTextAreaElement||t instanceof k.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof k.HTMLIFrameElement||t instanceof k.HTMLObjectElement||t instanceof k.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Pi.prototype.options_={pauseOnOpen:!0,temporary:!0},V.registerComponent("ModalDialog",Pi);class Li extends Et{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},ps(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ma=function(s,e){for(let t=0;t=0;t--)if(e[t].selected){Ma(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ma(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Pc extends Li{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class n_{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;tt[r],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Wo=function(s){return new URL(s,re.baseURI)},Lc=function(s){return new URL(s,re.baseURI).href},Go=function(s){if(typeof s=="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(e)return e.pop().toLowerCase()}return""},Yn=function(s,e=k.location){return Wo(s).origin!==e.origin};var u_=Object.freeze({__proto__:null,parseUrl:Wo,getAbsoluteURL:Lc,getFileExtension:Go,isCrossOrigin:Yn});const yh=function(s,e){const t=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>Te.error(r)),k.console&&k.console.groupEnd&&k.console.groupEnd()),t.flush()},_h=function(s,e){const t={uri:s},i=Yn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Md(t,Le(this,function(n,a,l){if(n)return Te.error(n,a);e.loaded_=!0,typeof k.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type!=="vttjserror")return yh(l,e);Te.error(`vttjs failed to load, stopping trying to process ${e.src}`)}):yh(l,e)}))};class Tr extends zo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ie(e,{kind:l_[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=fh[t.mode]||"disabled";const r=t.default;t.kind!=="metadata"&&t.kind!=="chapters"||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new _n(this.cues_),a=new _n(this.activeCues_);let l=!1;this.timeupdateHandler=Le(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(p){fh[p]&&i!==p&&(i=p,this.preload_||i==="disabled"||this.cues.length!==0||_h(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const p=this.tech_.currentTime(),g=[];for(let y=0,w=this.cues.length;y=p&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let y=0;yi,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Nc extends zo{constructor(e={}){const t=Ie(e,{kind:a_[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ds extends Et{constructor(e={}){let t;super();const i=new Tr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=ds.NONE,i.addEventListener("loadeddata",()=>{t=ds.LOADED,this.trigger({type:"load",target:this})})}}ds.prototype.allowedEvents_={load:"load"},ds.NONE=0,ds.LOADING=1,ds.LOADED=2,ds.ERROR=3;const xt={audio:{ListClass:i_,TrackClass:Oc,capitalName:"Audio"},video:{ListClass:r_,TrackClass:Nc,capitalName:"Video"},text:{ListClass:Pc,TrackClass:Tr,capitalName:"Text"}};Object.keys(xt).forEach(function(s){xt[s].getterName=`${s}Tracks`,xt[s].privateName=`${s}Tracks_`});const yi={remoteText:{ListClass:Pc,TrackClass:Tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:n_,TrackClass:ds,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ct=Object.assign({},xt,yi);function h_(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ct.text.TrackClass(r);return n.addTrack(a),a}yi.names=Object.keys(yi),xt.names=Object.keys(xt),ct.names=[].concat(yi.names).concat(xt.names);class fe extends V{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ct.names.forEach(i=>{const r=ct[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:e.nativeCaptions!==!0&&e.nativeTextTracks!==!0||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ct.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Le(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ft(0,0)}bufferedPercent(){return Ic(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(xt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Ue(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ft(0,0):Ft()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){xt.names.forEach(e=>{const t=xt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!k.WebVTT)if(re.body.contains(this.el())){if(!this.options_["vtt.js"]&&xi(Ru)&&Object.keys(Ru).length>0)return void this.trigger("vttjsloaded");const e=re.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;lthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=kt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return fe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fe||e instanceof fe||e===fe}static registerTech(e,t){if(fe.techs_||(fe.techs_={}),!fe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=He(e),fe.techs_[e]=t,fe.techs_[hr(e)]=t,e!=="Tech"&&fe.defaultTechOrder_.push(e),t}static getTech(e){if(e)return fe.techs_&&fe.techs_[e]?fe.techs_[e]:(e=He(e),k&&k.videojs&&k.videojs[e]?(Te.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),k.videojs[e]):void 0)}}ct.names.forEach(function(s){const e=ct[s];fe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),fe.prototype.featuresVolumeControl=!0,fe.prototype.featuresMuteControl=!0,fe.prototype.featuresFullscreenResize=!1,fe.prototype.featuresPlaybackRate=!1,fe.prototype.featuresProgressEvents=!1,fe.prototype.featuresSourceset=!1,fe.prototype.featuresTimeupdateEvents=!1,fe.prototype.featuresNativeTextTracks=!1,fe.prototype.featuresVideoFrameCallback=!1,fe.withSourceHandlers=function(s){s.registerSourceHandler=function(e,t){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),t===void 0&&(t=i.length),i.splice(t,0,e)},s.canPlayType=function(e){const t=s.sourceHandlers||[];let i;for(let r=0;rUs(e,zs[e.type],t,s),1)}function p_(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function m_(s,e,t){return s.reduceRight(Xo(t),e[t]())}function g_(s,e,t,i){return e[t](s.reduce(Xo(t),i))}function vh(s,e,t,i=null){const r="call"+He(t),n=s.reduce(Xo(r),i),a=n===bn,l=a?null:e[t](n);return __(s,t,l,a),l}const f_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},y_={setCurrentTime:1,setMuted:1,setVolume:1},bh={play:1,pause:1};function Xo(s){return(e,t)=>e===bn?bn:t[s]?t[s](e):e}function __(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function v_(s){vn.hasOwnProperty(s.id())&&delete vn[s.id()]}function b_(s,e){const t=vn[s.id()];let i=null;if(t==null)return i=e(s),vn[s.id()]=[[e,i]],i;for(let r=0;r{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;const Sh=mn?10009:gn?461:8,oi={codes:{play:415,pause:19,ff:417,rw:412,back:Sh},names:{415:"play",19:"pause",417:"ff",412:"rw",[Sh]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!(!this.names[s.keyCode]||this.names[s.keyCode]!==e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Eh=5;class C_ extends Et{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(oi.isEventKey(t,"play")||oi.isEventKey(t,"pause")||oi.isEventKey(t,"ff")||oi.isEventKey(t,"rw")){t.preventDefault();const i=oi.getEventName(t);this.performMediaAction_(i)}else oi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Eh);break;case"rw":this.userSeek_(this.player_.currentTime()-Eh)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_")){if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el()))return void t.push(r);r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r)}if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((a,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>a,getPositions:()=>{const h=a.getBoundingClientRect();return{boundingClientRect:{x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},center:{x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:h=>!0,focus:()=>a.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,h=this.calculateDistance_(e,l,i);h=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Te.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ge("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Is(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("ClickableComponent",Kn);class Ba extends Kn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ge("div",{className:"vjs-poster"})}crossOrigin(e){if(e===void 0)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e===null||e==="anonymous"||e==="use-credentials"?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ge("picture",{className:"vjs-poster",tabIndex:-1},{},ge("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Wt(this.player_.play()):this.player_.pause())}}Ba.prototype.crossorigin=Ba.prototype.crossOrigin,V.registerComponent("PosterImage",Ba);const At="#222",Ch="#ccc",A_={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Fa(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(s.length!==7)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function ls(s,e,t){try{s.style[e]=t}catch{return}}function wh(s){return s?`${s}px`:""}class x_ extends V{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const a=k.screen.orientation||k,l=k.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const h=this.options_.playerOptions.tracks||[];for(let p=0;p0&&l.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!k.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ls(this.el_,"insetInline",wh(n)),ls(this.el_,"insetBlock",wh(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&ls(a.firstChild,"color",Fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ls(a.firstChild,"backgroundColor",Fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ls(a,"backgroundColor",Fa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ch}, 0 1px ${Ch}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const l=k.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=A_[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof k.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Wt(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const n=()=>r.focus();dr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ah.prototype.controlText_="Play Video",V.registerComponent("BigPlayButton",Ah);class D_ extends ot{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("CloseButton",D_);class xh extends ot{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Wt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}xh.prototype.controlText_="Play",V.registerComponent("PlayToggle",xh);class _i extends V{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ge("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ge("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!=="seeking")&&this.updateContent(e)}updateTextNode_(e=0){e=Xs(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Te.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=re.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}_i.prototype.labelText_="Time",_i.prototype.controlText_="Time",V.registerComponent("TimeDisplay",_i);class Ua extends _i{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ua.prototype.labelText_="Current Time",Ua.prototype.controlText_="Current Time",V.registerComponent("CurrentTimeDisplay",Ua);class qa extends _i{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}qa.prototype.labelText_="Duration",qa.prototype.controlText_="Duration",V.registerComponent("DurationDisplay",qa);class I_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}V.registerComponent("TimeDivider",I_);class ja extends _i{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ge("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ja.prototype.labelText_="Remaining Time",ja.prototype.controlText_="Remaining Time",V.registerComponent("RemainingTimeDisplay",ja);class P_ extends V{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ge("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ge("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(re.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}V.registerComponent("LiveDisplay",P_);class kh extends ot{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ge("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Sr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}kh.prototype.controlText_="Seek to live, currently playing live",V.registerComponent("SeekToLive",kh);var L_=Object.freeze({__proto__:null,clamp:Sr});class Yo extends V{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type!=="touchstart"||Qt||e.preventDefault(),cc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;pc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Sr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Vn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}V.registerComponent("Slider",Yo);const Ha=(s,e)=>Sr(s/e*100,0,100).toFixed(2)+"%";class O_ extends V{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ge("span",{className:"vjs-control-text"}),i=ge("span",{textContent:this.localize("Loaded")}),r=re.createTextNode(": ");return this.percentageEl_=ge("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Ha(n,r);this.percent_!==l&&(this.el_.style.width=l,Is(this.percentageEl_,l),this.percent_=l);for(let h=0;hi.length;h--)this.el_.removeChild(a[h-1]);a.length=i.length})}}V.registerComponent("LoadProgressBar",O_);class N_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=yr(this.el_),n=Di(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,l=a);let p=r.width/2;lr.width&&(p=r.width),p=Math.round(p),this.el_.style.right=`-${p}px`,this.write(i)}write(e){Is(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),h=l-t*l;n=(h<1?"":"-")+Xs(h,l)}else n=Xs(i,a);this.update(e,t,n),r&&r()})}}V.registerComponent("TimeTooltip",N_);class $a extends V{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}$a.prototype.options_={children:[]},mt||Kt||$a.prototype.options_.children.push("timeTooltip"),V.registerComponent("PlayProgressBar",$a);class Dh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}Dh.prototype.options_={children:["timeTooltip"]},V.registerComponent("MouseTimeDisplay",Dh);const Xr=5,Ih=12;class Va extends Yo{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Le(this,this.update),this.update=es(this.update_,Dt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.on(re,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){re.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Dt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(re.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Xs(i,n),Xs(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Di(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){_r(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!_r(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}else i=r*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Wt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Ih)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Ih)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.off(re,"visibilitychange",this.toggleVisibility_),super.dispose()}}Va.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},mt||Kt||Va.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),V.registerComponent("SeekBar",Va);class Ph extends V{constructor(e,t){super(e,t),this.handleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.throttledHandleMouseSeek=es(Le(this,this.handleMouseSeek),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=yr(n);let l=Vn(n,e).x;l=Sr(l,0,1),r&&r.update(a,l),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Wt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ph.prototype.options_={children:["seekBar"]},V.registerComponent("ProgressControl",Ph);class Lh extends ot{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){re.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in k?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof re.exitPictureInPicture=="function"&&super.show()}}Lh.prototype.controlText_="Picture-in-Picture",V.registerComponent("PictureInPictureToggle",Lh);class Oh extends ot{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),re[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Oh.prototype.controlText_="Fullscreen",V.registerComponent("FullscreenToggle",Oh);const R_=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class M_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}V.registerComponent("VolumeLevel",M_);class B_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Di(this.el_),a=Di(this.player_.el()),l=e.width*t;if(!a||!n)return;const h=e.left-a.left+l,p=e.width-l+(a.right-e.right);let g=n.width/2;hn.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Is(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}V.registerComponent("VolumeLevelTooltip",B_);class Nh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Nh.prototype.options_={children:["volumeLevelTooltip"]},V.registerComponent("MouseVolumeLevelDisplay",Nh);class Yr extends Yo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){_r(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Di(i),n=this.vertical();let a=Vn(i,e);a=n?a.y:a.x,a=Sr(a,0,1),t.update(r,a,n)}_r(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},mt||Kt||Yr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yr.prototype.playerEvent="volumechange",V.registerComponent("VolumeBar",Yr);class Rh extends V{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||xi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),R_(this,e),this.throttledHandleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Rh.prototype.options_={children:["volumeBar"]},V.registerComponent("VolumeControl",Rh);const F_=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Mh extends ot{constructor(e,t){super(e,t),F_(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),mt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Hn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Vs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Mh.prototype.controlText_="Mute",V.registerComponent("MuteToggle",Mh);class Bh extends V{constructor(e,t={}){t.inline!==void 0?t.inline=t.inline:t.inline=!0,(t.volumeControl===void 0||xi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Ct(re,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),at(re,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Bh.prototype.options_={children:["muteToggle","volumeControl"]},V.registerComponent("VolumePanel",Bh);class Fh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Fh.prototype.controlText_="Skip Forward",V.registerComponent("SkipForward",Fh);class Uh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;n=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Uh.prototype.controlText_="Skip Backward",V.registerComponent("SkipBackward",Uh);class Mc extends V{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ge(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Ct(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||re.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):e.key!=="ArrowRight"&&e.key!=="ArrowUp"||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}V.registerComponent("Menu",Mc);class Ko extends V{constructor(e,t={}){super(e,t),this.menuButton_=new ot(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=ot.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Ct(re,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Mc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ge("li",{className:"vjs-menu-title",textContent:He(this.options_.title),tabIndex:-1}),i=new V(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof k.Event!="object")try{l=new k.Event("change")}catch{}l||(l=re.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let r=0;r-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}V.registerComponent("OffTextTrackMenuItem",Bc);class Mi extends Qo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Cr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}V.registerComponent("TextTrackButton",Mi);class Fc extends Er{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(He(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(He(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Jo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Uc),e}}Ya.prototype.kinds_=["captions","subtitles"],Ya.prototype.controlText_="Subtitles",V.registerComponent("SubsCapsButton",Ya);class qc extends Er{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;ithis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}_o.prototype.contentElType="button",V.registerComponent("PlaybackRateMenuItem",_o);class jh extends Ko{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ge("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new _o(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}jh.prototype.controlText_="Playback Rate",V.registerComponent("PlaybackRateMenuButton",jh);class jc extends V{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}V.registerComponent("Spacer",jc);class U_ extends jc{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}V.registerComponent("CustomControlSpacer",U_);class Hh extends V{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hh.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},V.registerComponent("ControlBar",Hh);class $h extends Pi{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}$h.prototype.options_=Object.assign({},Pi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),V.registerComponent("ErrorDisplay",$h);class Hc extends V{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ge("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+e[1].replace(/\W+/g,""),i=ge("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}V.registerComponent("TextTrackSelect",Hc);class Ws extends V{constructor(e,t={}){super(e,t);const i=ge("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,h=a.id.replace("%s",this.options_.id_);let p=null;const g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){p=ge("span",{className:l});const w=ge("label",{id:h,className:"vjs-label",textContent:a.label});w.setAttribute("for",g),p.appendChild(w)}const y=new Hc(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(y),this.options_.type==="colors"&&(p.appendChild(y.el()),this.el().appendChild(p))}}createEl(){return ge("fieldset",{className:this.options_.className})}}V.registerComponent("TextTrackFieldset",Ws);class $c extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-colors"})}}V.registerComponent("TextTrackSettingsColors",$c);class Vc extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-font"})}}V.registerComponent("TextTrackSettingsFont",Vc);class zc extends V{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new ot(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new ot(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return ge("div",{className:"vjs-track-settings-controls"})}}V.registerComponent("TrackSettingsControls",zc);const Ka="vjs-text-track-settings",Vh=["#000","Black"],zh=["#00F","Blue"],Wh=["#0FF","Cyan"],Gh=["#0F0","Green"],Xh=["#F0F","Magenta"],Yh=["#F00","Red"],Kh=["#FFF","White"],Qh=["#FF0","Yellow"],Qa=["1","Opaque"],Ja=["0.5","Semi-Transparent"],Jh=["0","Transparent"],As={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vh,Kh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Qa,Ja,Jh],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kh,Vh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Qa,Ja],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Jh,Ja,Qa],className:"vjs-window-opacity vjs-opacity"}};function Wc(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function q_(s,e){return Wc(s.options[s.options.selectedIndex].value,e)}function j_(s,e,t){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),fi(As,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ec(As,(e,t,i)=>{const r=q_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){fi(As,(t,i)=>{j_(this.$(t.selector),e[i],t.parser)})}setDefaults(){fi(As,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(k.localStorage.getItem(Ka))}catch(t){Te.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(Ka,JSON.stringify(e)):k.localStorage.removeItem(Ka)}catch(t){Te.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}V.registerComponent("TextTrackSettings",H_);class $_ extends V{constructor(e,t){let i=t.ResizeObserver||k.ResizeObserver;t.ResizeObserver===null&&(i=!1),super(e,Ie({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||k.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Sc(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const r=this.debouncedHandler_;let n=this.unloadListener_=function(){at(this,"resize",r),at(this,"unload",n),n=null};Ct(this.el_.contentWindow,"unload",n),Ct(this.el_.contentWindow,"resize",r)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}V.registerComponent("ResizeManager",$_);const V_={trackingThreshold:20,liveTolerance:15};class z_ extends V{constructor(e,t){super(e,Ie(V_,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(k.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Dt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}V.registerComponent("LiveTracker",z_);class W_ extends V{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ge("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:ge("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},ge("div",{className:"vjs-title-bar"},{},tc(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];zn(a),n&&Is(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}V.registerComponent("TitleBar",W_);const G_={initialDisplay:4e3,position:[],takeFocus:!1};class X_ extends ot{constructor(e,t){super(e,t=Ie(G_,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ge("button",{},{type:"button",class:this.buildCSSClass()},ge("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}V.registerComponent("TransientButton",X_);const vo=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let i=0;iGc([s.el(),k.HTMLMediaElement.prototype,k.Element.prototype,Y_],"innerHTML"),Zh=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=K_(s),r=n=>(...a)=>{const l=n.apply(e,a);return vo(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ie(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},Q_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Lc(k.Element.prototype.getAttribute.call(this,"src")):""},set(s){return k.Element.prototype.setAttribute.call(this,"src",s),s}}),J_=s=>Gc([s.el(),k.HTMLMediaElement.prototype,Q_],"src"),Z_=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=J_(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ie(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return vo(s)||(s.triggerSourceset(""),Zh(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):vo(s)||Zh(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class he extends fe{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),r||this.el_.hasAttribute("crossorigin")||!Yn(h.src)||(r=!0)):l.push(h))}for(let h=0;h{t=[];for(let n=0;ne.removeEventListener("change",i));const r=()=>{for(let n=0;n{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=xt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[yi.remoteText.getterName]().trigger(h)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let h=0;h{const h=n[l];i.addEventListener(l,h),this.on("dispose",p=>i.removeEventListener(l,h))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){xt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),he.disposeMediaElement(e),e=i}else{e=re.createElement("video");const i=Ie({},this.options_.tag&&ws(this.options_.tag));fr&&this.options_.nativeControlsForTouch===!0||delete i.controls,hc(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&ki(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&jn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Te(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Kt&&Qt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Wt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){he.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=re.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),k.performance&&(e.creationTime=k.performance.now()),e}}un(he,"TEST_VID",function(){if(!Oi())return;const s=re.createElement("video"),e=re.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}),he.isSupported=function(){try{he.TEST_VID.volume=.5}catch{return!1}return!(!he.TEST_VID||!he.TEST_VID.canPlayType)},he.canPlayType=function(s){return he.TEST_VID.canPlayType(s)},he.canPlaySource=function(s,e){return he.canPlayType(s.type)},he.canControlVolume=function(){try{const s=he.TEST_VID.volume;he.TEST_VID.volume=s/2+.1;const e=s!==he.TEST_VID.volume;return e&&mt?(k.setTimeout(()=>{he&&he.prototype&&(he.prototype.featuresVolumeControl=s!==he.TEST_VID.volume)}),!1):e}catch{return!1}},he.canMuteVolume=function(){try{const s=he.TEST_VID.muted;return he.TEST_VID.muted=!s,he.TEST_VID.muted?ki(he.TEST_VID,"muted","muted"):$n(he.TEST_VID,"muted","muted"),s!==he.TEST_VID.muted}catch{return!1}},he.canControlPlaybackRate=function(){if(Kt&&Qt&&hn<58)return!1;try{const s=he.TEST_VID.playbackRate;return he.TEST_VID.playbackRate=s/2+.1,s!==he.TEST_VID.playbackRate}catch{return!1}},he.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(re.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},he.supportsNativeTextTracks=function(){return jn||mt&&Qt},he.supportsNativeVideoTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.videoTracks)},he.supportsNativeAudioTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.audioTracks)},he.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){un(he.prototype,s,()=>he[e](),!0)}),he.prototype.featuresVolumeControl=he.canControlVolume(),he.prototype.movingMediaElementInDOM=!mt,he.prototype.featuresFullscreenResize=!0,he.prototype.featuresProgressEvents=!0,he.prototype.featuresTimeupdateEvents=!0,he.prototype.featuresVideoFrameCallback=!(!he.TEST_VID||!he.TEST_VID.requestVideoFrameCallback),he.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}},he.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e}}),["pause","load","play"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]()}}),fe.withSourceHandlers(he),he.nativeSourceHandler={},he.nativeSourceHandler.canPlayType=function(s){try{return he.TEST_VID.canPlayType(s)}catch{return""}},he.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return he.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Go(s.src);return he.nativeSourceHandler.canPlayType(`video/${t}`)}return""},he.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)},he.nativeSourceHandler.dispose=function(){},he.registerSourceHandler(he.nativeSourceHandler),fe.registerTech("Html5",he);const Xc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Za={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bo=["tiny","xsmall","small","medium","large","xlarge","huge"],tn={};bo.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;tn[s]=`vjs-layout-${e}`});const e0={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ne extends V{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${kt()}`,(t=Object.assign(Ne.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Jd(this.id_),this.fsApi_=ln,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ws(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=Ne.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),$o(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Ct(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ie(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const a=new k.DOMParser().parseFromString(E_,"image/svg+xml");if(a.querySelector("parsererror"))Te.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const l=a.documentElement;l.style.display="none",this.el_.appendChild(l),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new C_(this),this.addClass("vjs-spatial-navigation-enabled")),fr&&this.addClass("vjs-touch-enabled"),mt||this.addClass("vjs-workinghover"),Ne.players[this.id_]=this;const n=uo.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),at(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),at(re,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ne.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),v_(this),ct.names.forEach(e=>{const t=this[ct[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const n=ws(t);if(r){for(e=this.el_=t,t=this.tag=re.createElement("video");e.children.length;)t.appendChild(e.firstChild);ur(e,"video-js")||Vs(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(h=>{try{t[h]=e[h]}catch{}})}t.setAttribute("tabindex","-1"),n.tabindex="-1",Qt&&cn&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(h){r&&h==="class"||e.setAttribute(h,n[h]),r&&t.setAttribute(h,n[h])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>ac[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=bc("vjs-styles-dimensions");const h=ks(".vjs-styles-defaults"),p=ks("head");p.insertBefore(this.styleEl_,h?h.nextSibling:p.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=t.getElementsByTagName("a");for(let h=0;h{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(k.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,p=this.tech_&&this.tech_.el();return void(p&&(l>=0&&(p.width=l),h>=0&&(p.height=h)))}let e,t,i,r;i=this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),a=n[1]/n[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/a:this.videoWidth()||300,t=this.height_!==void 0?this.height_:e*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Tc(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${100*a}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=He(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(fe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ct.names.forEach(h=>{const p=ct[h];a[p.getterName]=this[p.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=fe.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(Le(this,this.handleTechReady_),!0),gh.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Xc.forEach(h=>{this.on(this.tech_,h,p=>this[`handleTech${He(h)}_`](p))}),Object.keys(Za).forEach(h=>{this.on(this.tech_,h,p=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Za[h]}_`].bind(this),event:p}):this[`handleTech${Za[h]}_`](p)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,p)=>this.handleTechFullscreenChange_(h,p)),this.on(this.tech_,"fullscreenerror",(h,p)=>this.handleTechFullscreenError_(h,p)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||i==="Html5"&&this.tag||po(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ct.names.forEach(e=>{const t=ct[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=gh.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Te.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":uo}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(dr(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;return e!=="any"||this.muted()?i=e!=="muted"||this.muted()?this.play():t():(i=this.play(),dr(i)&&(i=i.catch(t))),dr(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=S_(this,t)),this.cache_.source=Ie({},e,{src:t,type:i});const r=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),l=[];for(let h=0;hthis.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.click!==void 0&&this.options_.userActions.click===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Wt(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=re[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in y_)return g_(this.middleware_,this.tech_,e,t);if(e in bh)return vh(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Te(i),i}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in f_)return m_(this.middleware_,this.tech_,e);if(e in bh)return vh(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Te(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Te(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Te(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Wt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(jn||mt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=n=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ft(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return e===void 0?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ft(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ft(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ic(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return e!==void 0?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(p,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(h,p){r(),i(p)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=re[this.fsApi_.exitFullscreen]();return e&&Wt(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=re.documentElement.style.overflow,Ct(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow="hidden",Vs(re.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,at(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow=this.docOrigOverflow,Hn(re.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&k.documentPictureInPicture){const e=re.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ge("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),k.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(_c(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in re&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return k.documentPictureInPicture&&k.documentPictureInPicture.window?(k.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in re?re.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const r=i.tagName.toLowerCase();return i.isContentEditable?!0:r==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=V.getComponent("FullscreenToggle");re[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),V.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),V.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i[l,fe.getTech(l)]).filter(([l,h])=>h?h.isSupported():(Te.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,h,p){let g;return l.some(y=>h.some(w=>{if(g=p(y,w),g)return!0})),g};let r;const n=l=>(h,p)=>l(p,h),a=([l,h],p)=>{if(h.canPlaySource(p,this.options_[l.toLowerCase()]))return{source:p,tech:l}};return r=this.options_.sourceOrder?i(e,t,n(a)):i(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Rc(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),c_(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());p_(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ac(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Wt(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ps(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):this.options_.autoplay=!!e,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(xs("beforeerror").forEach(t=>{const i=t(this,e);Zt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(e===null)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Ue(e),this.addClass("vjs-error"),Te.error(`(CODE:${this.error_.code} ${Ue.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),xs("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Le(this,this.reportUserActivity),n=function(y){y.screenX===t&&y.screenY===i||(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const h=this.getChild("controlBar");let p;!h||mt||Kt||(h.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);const y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ps(this)&&this.trigger("languagechange"))}languages(){return Ie(Ne.prototype.options_.languages,this.languages_)}toJSON(){const e=Ie(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),i=>({kind:i.kind,label:i.label,language:i.language,src:i.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Tn(t.poster)}]),t}return Ie(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=ws(e),r=i["data-setup"];if(ur(e,"vjs-fill")&&(i.fill=!0),ur(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Te.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ct.names.forEach(function(s){const e=ct[s];Ne.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Ne.prototype.crossorigin=Ne.prototype.crossOrigin,Ne.players={};const sr=k.navigator;Ne.prototype.options_={techOrder:fe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sr&&(sr.languages&&sr.languages[0]||sr.userLanguage||sr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},Xc.forEach(function(s){Ne.prototype[`handleTech${He(s)}_`]=function(){return this.trigger(s)}}),V.registerComponent("Player",Ne);const Sn="plugin",vi="activePlugins_",ci={},En=s=>ci.hasOwnProperty(s),sn=s=>En(s)?ci[s]:void 0,Yc=(s,e)=>{s[vi]=s[vi]||{},s[vi][e]=!0},Cn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},t0=function(s,e){const t=function(){Cn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Yc(this,s),Cn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},ed=(s,e)=>(e.prototype.name=s,function(...t){Cn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Cn(this,i.getEventHash()),i});class _t{constructor(e){if(this.constructor===_t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),$o(this),delete this.trigger,wc(this,this.constructor.defaultState),Yc(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ri(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[vi][e]=!1,this.player=this.state=null,t[e]=ed(e,ci[e])}static isBasic(e){const t=typeof e=="string"?sn(e):e;return typeof t=="function"&&!_t.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(En(e))Te.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ne.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ci[e]=t,e!==Sn&&(_t.isBasic(t)?Ne.prototype[e]=t0(e,t):Ne.prototype[e]=ed(e,t)),t}static deregisterPlugin(e){if(e===Sn)throw new Error("Cannot de-register base plugin.");En(e)&&(delete ci[e],delete Ne.prototype[e])}static getPlugins(e=Object.keys(ci)){let t;return e.forEach(i=>{const r=sn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=sn(e);return t&&t.VERSION||""}}function s0(s,e){let t=!1;return function(...i){return t||Te.warn(s),t=!0,e.apply(this,i)}}function Mt(s,e,t,i){return s0(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}_t.getPlugin=sn,_t.BASE_PLUGIN_NAME=Sn,_t.registerPlugin(Sn,_t),Ne.prototype.usingPlugin=function(s){return!!this[vi]&&this[vi][s]===!0},Ne.prototype.hasPlugin=function(s){return!!En(s)};var i0={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Kc=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.getPlayer(s);if(i)return e&&Te.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?ks("#"+Kc(s)):s;if(!Ni(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const n="getRootNode"in r&&r.getRootNode()instanceof k.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&n.contains(r)||Te.warn("The element supplied is not included in the DOM"),(e=e||{}).restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),xs("beforesetup").forEach(l=>{const h=l(r,Ie(e));Zt(h)&&!Array.isArray(h)?e=Ie(e,h):Te.error("please return an object in beforesetup hooks")});const a=V.getComponent("Player");return i=new a(r,e,t),xs("setup").forEach(l=>l(i)),i}if(F.hooks_=hs,F.hooks=xs,F.hook=Fy,F.hookOnce=Uy,F.removeHook=Qd,k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Oi()){let s=ks(".vjs-styles-defaults");if(!s){s=bc("vjs-styles-defaults");const e=ks("head");e&&e.insertBefore(s,e.firstChild),Tc(s,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}go(1,F),F.VERSION=uo,F.options=Ne.prototype.options_,F.getPlayers=()=>Ne.players,F.getPlayer=s=>{const e=Ne.players;let t;if(typeof s=="string"){const i=Kc(s),r=e[i];if(r)return r;t=ks("#"+i)}else t=s;if(Ni(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}},F.getAllPlayers=()=>Object.keys(Ne.players).map(s=>Ne.players[s]).filter(Boolean),F.players=Ne.players,F.getComponent=V.getComponent,F.registerComponent=(s,e)=>(fe.isTech(e)&&Te.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),V.registerComponent.call(V,s,e)),F.getTech=fe.getTech,F.registerTech=fe.registerTech,F.use=d_,Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(F.middleware,"TERMINATOR",{value:bn,writeable:!1,enumerable:!0}),F.browser=ac,F.obj=Hy,F.mergeOptions=Mt(9,"videojs.mergeOptions","videojs.obj.merge",Ie),F.defineLazyProperty=Mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",un),F.bind=Mt(9,"videojs.bind","native Function.prototype.bind",Le),F.registerPlugin=_t.registerPlugin,F.deregisterPlugin=_t.deregisterPlugin,F.plugin=(s,e)=>(Te.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_t.registerPlugin(s,e)),F.getPlugins=_t.getPlugins,F.getPlugin=_t.getPlugin,F.getPluginVersion=_t.getPluginVersion,F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Ie(F.options.languages,{[s]:e}),F.options.languages[s]},F.log=Te,F.createLogger=Jd,F.time=s_,F.createTimeRange=Mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ft),F.createTimeRanges=Mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ft),F.formatTime=Mt(9,"videojs.formatTime","videojs.time.formatTime",Xs),F.setFormatTime=Mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",kc),F.resetFormatTime=Mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dc),F.parseUrl=Mt(9,"videojs.parseUrl","videojs.url.parseUrl",Wo),F.isCrossOrigin=Mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Yn),F.EventTarget=Et,F.any=Ho,F.on=Ct,F.one=Gn,F.off=at,F.trigger=Ri,F.xhr=Md,F.TextTrack=Tr,F.AudioTrack=Oc,F.VideoTrack=Nc,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return Te.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),ch[s].apply(null,arguments)}}),F.computedStyle=Mt(9,"videojs.computedStyle","videojs.dom.computedStyle",Ii),F.dom=ch,F.fn=Ky,F.num=L_,F.str=e_,F.url=u_,F.Error=i0;class r0{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(i){t.enabled_(i)}}),t}}class wn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new r0(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ti,s.qualityLevels.VERSION=Qc,i},td=function(s){return n0(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",td),td.VERSION=Qc;const vt=Mn,An=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function we(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function gt(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function a0(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-i}) +`}return e}const Gt=1/30,Xt=3*Gt,Jc=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i=e})},Kr=function(s,e){return Jc(s,function(t){return t-Gt>=e})},o0=function(s){if(s.length<2)return gt();const e=[];for(let t=1;t{const e=[];if(!s||!s.length)return"";for(let t=0;t "+s.end(t));return e.join(", ")},u0=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Hs=s=>{const e=[];for(let t=0;tn||(t+=e>r&&e<=n?n-e:n-r)}return t},el=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},To=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),ep=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},tp=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},sp=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=ep(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},d0=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(r.start!==void 0)return{result:r.start,precise:!0};if(r.end!==void 0)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],r.end!==void 0)return{result:t+r.end,precise:!0};if(t+=el(s,r),r.start!==void 0)return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},c0=function(s,e){let t,i=0,r=e-s.mediaSequence;for(;ri&&([t,i]=[i,t]),t<0){for(let n=t;nDate.now()},tl=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Qn=function(s){const e=np(s);return!s.disabled&&!e},ap=function(s,e){return e.attributes&&e.attributes[s]},p0=function(s,e,t,i=0){return ap("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-8*i)/e:NaN},So=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>!!Qn(i)&&(i.attributes.BANDWIDTH||0)!(!s&&!e||!s&&e||s&&!e)&&(s===e||!(!s.id||!e.id||s.id!==e.id)||!(!s.resolvedUri||!e.resolvedUri||s.resolvedUri!==e.resolvedUri)||!(!s.uri||!e.uri||s.uri!==e.uri)),id=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},wr=s=>{if(!s||!s.playlists||!s.playlists.length)return id(s,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;eUd(r)))&&!id(s,r=>sl(t,r)))return!1}return!0};var bt={liveEdgeDelay:sp,duration:rp,seekable:function(s,e,t){const i=e||0;let r=sd(s,e,!0,t);return r===null?gt():(r0)for(let p=h-1;p>=0;p--){const g=l[p];if(a+=g.duration,n){if(a<0)continue}else if(a+Gt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(h<0){for(let p=h;p<0;p++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};h=0}for(let p=h;pGt;if(a!==0&&!(y&&a+Gt>=0)||p===l.length-1){if(n){if(a>0)continue}else if(a-Gt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},isEnabled:Qn,isDisabled:function(s){return s.disabled},isExcluded:np,isIncompatible:tl,playlistEnd:sd,isAes:function(s){for(let e=0;e`${s}-${e}`,lp=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,m0=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new of;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(p=>a.addParser(p)),r.forEach(p=>a.addTagMapper(p)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){l.hasOwnProperty(p)&&delete l[p]}),l.segments&&l.segments.forEach(function(p){["parts","preloadHints"].forEach(function(g){p.hasOwnProperty(g)&&delete p[g]})})),!l.targetDuration){let p=10;l.segments&&l.segments.length&&(p=l.segments.reduce((g,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${p}`}),l.targetDuration=p}const h=ep(l);if(h.length&&!l.partTargetDuration){const p=h.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${p}`}),op.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=p}return l},Bi=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},up=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},g0=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];up({playlist:t,id:bi(e,t.uri)}),t.resolvedUri=vt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||op.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},f0=s=>{Bi(s,e=>{e.uri&&(e.resolvedUri=vt(s.uri,e.uri))})},y0=(s,e)=>{const t=bi(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,resolvedUri:k.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},hp=(s,e,t=lp)=>{s.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let h=0;h(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=ze({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=F.Error.NetworkRequestTimeout;else if(l){const h=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},{EventTarget:_0}=F,v0=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=tp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new k.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},b0=(s,e)=>{if(!s)return e;const t=we(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l{!s.resolvedUri&&s.uri&&(s.resolvedUri=vt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=vt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=vt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=vt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))})},pp=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;is===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Eo=(s,e,t=mp)=>{const i=we(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=pp(e);const n=we(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{cp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let g=0;g{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?1e3*n:500*(s.partTargetDuration||s.targetDuration||10)},nd=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class mi extends _0{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new rd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=vt(this.main.uri,e.uri);this.llhls&&(t=v0(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request)return i?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Gs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return m0({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),up({playlist:a,uri:i,id:r});const l=Eo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!l)),n.parsedPlaylist=nd(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new rd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(k.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=k.setTimeout(this.media.bind(this,e,!1),l))}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=An(e.resolvedUri,h),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=k.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Gs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=An(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=nd(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,hp(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=pp(i),i.segments.forEach(r=>{cp(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||k.location.href;this.main=y0(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,h=a.id;if(t){const p=this.createCloneURI_(a.resolvedUri,e),g=bi(r,p),y=this.createCloneAttributes_(r,a.attributes),w=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=w,i.playlists[g]=w,i.playlists[p]=w}else i.playlists.splice(n,1);delete i.playlists[h],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(i.mediaGroups[n]&&i.mediaGroups[n][r]){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((h,p)=>{const g=i.playlists[h.id],y=g.id,w=g.resolvedUri;delete i.playlists[y],delete i.playlists[w]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=bi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=h,i.playlists[a]=h,i.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(r.mediaGroups[n]&&!r.mediaGroups[n][t]){for(const a in r.mediaGroups[n])if(a===i){r.mediaGroups[n][t]={};for(const l in r.mediaGroups[n][a]){const h=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=ze({},h);const p=r.mediaGroups[n][t][l],g=this.createCloneURI_(h.resolvedUri,e);p.resolvedUri=g,p.uri=g,p.playlists=[],h.playlists.forEach((y,w)=>{const E=r.playlists[y.id],I=lp(n,t,l),v=bi(t,I);if(E&&!r.playlists[v]){const L=this.createClonePlaylist_(E,v,e),R=L.resolvedUri;r.playlists[v]=L,r.playlists[R]=L}p.playlists[w]=this.createClonePlaylist_(y,v,e)})}}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),we(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const wo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),e||s.aborted||t.statusCode===200||t.statusCode===206||t.statusCode===0||(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},S0=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},E0=(s,e,t,i)=>{s&&s.size&&s.forEach(r=>{r(e,t,i)})},gp=function(){const s=function e(t,i){t=we({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,h=S0(n,t);n.delete(r);const p=l(h||t,function(y,w){return E0(a,p,y,w),wo(p,y,w,i)}),g=p.abort;return p.abort=function(){return p.aborted=!0,g.apply(p,arguments)},p.uri=t.uri,p.requestType=t.requestType,p.requestTime=Date.now(),p};return s.original=!0,s},C0=function(s){let e;const t=s.offset;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,"bytes="+t+"-"+e},Ao=function(s){const e={};return s.byterange&&(e.Range=C0(s.byterange)),e},w0=function(s,e){return s.start(e)+"-"+s.end(e)},A0=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},x0=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},fp=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];jd(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},xn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},yp=function(s){return s.resolvedUri},_p=s=>{const e=Array.prototype.slice.call(s),t=16;let i,r,n="";for(let a=0;a_p(s),D0=s=>{let e,t="";for(e=0;e{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=s-(e.videoTimingInfo.transmuxedPresentationStart+t);return new Date(e.dateTimeObject.getTime()+1e3*i)},L0=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,O0=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(tnew Date(n.getTime()+1e3*a)?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:bt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},N0=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t,i=0;for(let n=0;ni){if(s>i+r.duration*vp)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:i-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}},R0=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},M0=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=N0(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=P0(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},bp=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(s===void 0||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!M0(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=O0(s,e);if(!l)return a({message:`${s} was not found in the stream`});const h=l.segment,p=R0(h.dateTimeObject,s);if(l.type==="estimate")return t===0?a({message:`${s} is not buffered yet. Try again`}):(i(l.estimatedStart+p),void n.one("seeked",()=>{bp({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})}));const g=h.start+p,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},ad=(s,e)=>{if(s.readyState===4)return e()},F0=(s,e,t,i)=>{let r,n=[],a=!1;const l=function(y,w,E,I){return w.abort(),a=!0,t(y,w,E,I)},h=function(y,w){if(a)return;if(y)return y.metadata=Gs({requestType:i,request:w,error:y}),l(y,w,"",n);const E=w.responseText.substring(n&&n.byteLength||0,w.responseText.length);if(n=vf(n,Hd(E,!0)),r=r||nr(n),n.length<10||r&&n.lengthl(y,w,"",n));const I=Fo(n);return I==="ts"&&n.length<188||!I&&n.length<376?ad(w,()=>l(y,w,"",n)):l(null,w,I,n)},p={uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:w,loaded:E}){return wo(y,null,{statusCode:y.status},h)})}},g=e(p,function(y,w){return wo(g,y,w,h)});return g},{EventTarget:U0}=F,od=function(s,e){if(!mp(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length)||!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t`placeholder-uri-${s}-${e}-${i.attributes.NAME||t}`,j0=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=yy(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return hp(n,e,q0),n},H0=(s,e)=>{Bi(s,(t,i,r,n)=>{e.mediaGroups[i][r]&&n in e.mediaGroups[i][r]||delete s.mediaGroups[i][r][n]})},$0=(s,e,t)=>{let i=!0,r=we(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const p=n.playlists[0].id,g=Eo(r,n.playlists[0],od);g&&(r=g,h in r.mediaGroups[a][l]||(r.mediaGroups[a][l][h]=n),r.mediaGroups[a][l][h].playlists[0]=r.playlists[p],i=!1)}}),H0(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},V0=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,ld=(s,e)=>{const t={};for(const i in s){const r=s[i].sidx;if(r){const n=Fn(r);if(!e[n])break;const a=e[n].sidxInfo;V0(a,r)&&(t[n]=e[n])}}return t},z0=(s,e)=>{let t=ld(s.playlists,e);return Bi(s,(i,r,n,a)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;t=we(t,ld(l,e))}}),t};class xo extends U0{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=It("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error=typeof e!="object"||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const r=e.sidx&&Fn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=k.setTimeout(()=>i(!1),0));const n=An(e.sidx.resolvedUri),a=(h,p)=>{if(this.requestErrored_(h,p,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=p;let w;try{w=Ty(ce(p.response).subarray(8))}catch(E){return E.metadata=Gs({requestType:y,request:p,parseFailure:!0}),void this.requestErrored_(E,p,t)}return g[r]={sidxInfo:e.sidx,sidx:w},Ro(e,w,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=F0(n,this.vhs_.xhr,(h,p,g,y)=>{if(h)return a(h,p);if(!g||g!=="mp4"){const I=g||"unknown";return a({status:p.status,message:`Unsupported ${I} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},p)}const{offset:w,length:E}=e.sidx.byterange;if(y.length>=E+w)return a(h,{response:y.subarray(w,w+E),status:p.status,uri:p.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ao({byterange:e.sidx.byterange})},a)},l)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(k.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>this.load(),i)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=k.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Gs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r))return void(this.state==="HAVE_NOTHING"&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=An(this.mainPlaylistLoader_.srcUrl,r),n?(this.handleMain_(),void this.syncClientServerClock_(()=>e(r,n))):e(r,n)})}syncClientServerClock_(e){const t=_y(this.mainPlaylistLoader_.mainXml_);return t===null?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):t.method==="DIRECT"?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Gs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;n=t.method==="HEAD"?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=j0({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=$0(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(p=>{l.push({id:p.id,bandwidth:p.attributes.BANDWIDTH,resolution:p.attributes.RESOLUTION,codecs:p.attributes.CODECS})});const h={duration:n,isLive:!a,renditions:l};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(k.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=k.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=z0(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=k.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Co(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Je={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const W0=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t-1)},this.trigger=function(u){var c,d,m,f;if(c=o[u])if(arguments.length===2)for(m=c.length,d=0;d>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},L=function(o){return t(U.hdlr,W[o])},v=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,255&o.duration,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=255&o.samplerate),t(U.mdhd,u)},I=function(o){return t(U.mdia,v(o),L(o.type),l(o))},a=function(o){return t(U.mfhd,new Uint8Array([0,0,0,0,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o]))},l=function(o){return t(U.minf,o.type==="video"?t(U.vmhd,te):t(U.smhd,J),i(),M(o))},h=function(o,u){for(var c=[],d=u.length;d--;)c[d]=G(u[d]);return t.apply(null,[U.moof,a(o)].concat(c))},p=function(o){for(var u=o.length,c=[];u--;)c[u]=w(o[u]);return t.apply(null,[U.moov,y(4294967295)].concat(c).concat(g(o)))},g=function(o){for(var u=o.length,c=[];u--;)c[u]=N(o[u]);return t.apply(null,[U.mvex].concat(c))},y=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(U.mvhd,u)},R=function(o){var u,c,d=o.samples||[],m=new Uint8Array(4+d.length);for(c=0;c>>8),f.push(255&d[u].byteLength),f=f.concat(Array.prototype.slice.call(d[u]));for(u=0;u>>8),b.push(255&m[u].byteLength),b=b.concat(Array.prototype.slice.call(m[u]));if(c=[U.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&o.width)>>8,255&o.width,(65280&o.height)>>8,255&o.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(U.avcC,new Uint8Array([1,o.profileIdc,o.profileCompatibility,o.levelIdc,255].concat([d.length],f,[m.length],b))),t(U.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],o.sarRatio){var x=o.sarRatio[0],C=o.sarRatio[1];c.push(t(U.pasp,new Uint8Array([(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x,(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C])))}return t.apply(null,c)},ye=function(o){return t(U.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&o.channelcount)>>8,255&o.channelcount,(65280&o.samplesize)>>8,255&o.samplesize,0,0,0,0,(65280&o.samplerate)>>8,255&o.samplerate,0,0]),r(o))},E=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,0,(4278190080&o.duration)>>24,(16711680&o.duration)>>16,(65280&o.duration)>>8,255&o.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&o.width)>>8,255&o.width,0,0,(65280&o.height)>>8,255&o.height,0,0]);return t(U.tkhd,u)},G=function(o){var u,c,d,m,f,b,x;return u=t(U.tfhd,new Uint8Array([0,0,0,58,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),b=Math.floor(o.baseMediaDecodeTime/We),x=Math.floor(o.baseMediaDecodeTime%We),c=t(U.tfdt,new Uint8Array([1,0,0,0,b>>>24&255,b>>>16&255,b>>>8&255,255&b,x>>>24&255,x>>>16&255,x>>>8&255,255&x])),f=92,o.type==="audio"?(d=z(o,f),t(U.traf,u,c,d)):(m=R(o),d=z(o,m.length+f),t(U.traf,u,c,d,m))},w=function(o){return o.duration=o.duration||4294967295,t(U.trak,E(o),I(o))},N=function(o){var u=new Uint8Array([0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),t(U.trex,u)},me=function(o,u){var c=0,d=0,m=0,f=0;return o.length&&(o[0].duration!==void 0&&(c=1),o[0].size!==void 0&&(d=2),o[0].flags!==void 0&&(m=4),o[0].compositionTimeOffset!==void 0&&(f=8)),[0,0,c|d|m|f,1,(4278190080&o.length)>>>24,(16711680&o.length)>>>16,(65280&o.length)>>>8,255&o.length,(4278190080&u)>>>24,(16711680&u)>>>16,(65280&u)>>>8,255&u]},ve=function(o,u){var c,d,m,f,b,x;for(u+=20+16*(f=o.samples||[]).length,m=me(f,u),(d=new Uint8Array(m.length+16*f.length)).set(m),c=m.length,x=0;x>>24,d[c++]=(16711680&b.duration)>>>16,d[c++]=(65280&b.duration)>>>8,d[c++]=255&b.duration,d[c++]=(4278190080&b.size)>>>24,d[c++]=(16711680&b.size)>>>16,d[c++]=(65280&b.size)>>>8,d[c++]=255&b.size,d[c++]=b.flags.isLeading<<2|b.flags.dependsOn,d[c++]=b.flags.isDependedOn<<6|b.flags.hasRedundancy<<4|b.flags.paddingValue<<1|b.flags.isNonSyncSample,d[c++]=61440&b.flags.degradationPriority,d[c++]=15&b.flags.degradationPriority,d[c++]=(4278190080&b.compositionTimeOffset)>>>24,d[c++]=(16711680&b.compositionTimeOffset)>>>16,d[c++]=(65280&b.compositionTimeOffset)>>>8,d[c++]=255&b.compositionTimeOffset;return t(U.trun,d)},_e=function(o,u){var c,d,m,f,b,x;for(u+=20+8*(f=o.samples||[]).length,m=me(f,u),(c=new Uint8Array(m.length+8*f.length)).set(m),d=m.length,x=0;x>>24,c[d++]=(16711680&b.duration)>>>16,c[d++]=(65280&b.duration)>>>8,c[d++]=255&b.duration,c[d++]=(4278190080&b.size)>>>24,c[d++]=(16711680&b.size)>>>16,c[d++]=(65280&b.size)>>>8,c[d++]=255&b.size;return t(U.trun,c)},z=function(o,u){return o.type==="audio"?_e(o,u):ve(o,u)};var Ge,Ye,rt,Ut,Ke,ts,Ps,Ys,ms={ftyp:n=function(){return t(U.ftyp,H,S,H,A)},mdat:function(o){return t(U.mdat,o)},moof:h,moov:p,initSegment:function(o){var u,c=n(),d=p(o);return(u=new Uint8Array(c.byteLength+d.byteLength)).set(c),u.set(d,c.byteLength),u}},ss=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Oe=function(o,u){var c=ss();return c.dataOffset=u,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},je={groupNalsIntoFrames:function(o){var u,c,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,u=0;u1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},generateSampleTable:function(o,u){var c,d,m,f,b,x=u||0,C=[];for(c=0;cfs.ONE_SECOND_IN_TS/2))){for((f=Ar()[o.samplerate])||(f=u[0].data),b=0;b=c?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c&&(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0)}))},generateSampleTable:function(o){var u,c,d=[];for(u=0;u=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},q.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},q.prototype.addText=function(o){this.rows[this.rowIdx]+=o},q.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var ae=function(o,u,c){this.serviceNum=o,this.text="",this.currentWindow=new q(-1),this.windows=[],this.stream=c,typeof u=="string"&&this.createTextDecoder(u)};ae.prototype.init=function(o,u){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new q(c),typeof u=="function"&&(this.windows[c].beforeRowOverflow=u)},ae.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},ae.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var le=function(o){o=o||{},le.prototype.init.call(this);var u,c=this,d=o.captionServices||{},m={};Object.keys(d).forEach(f=>{u=d[f],/^SERVICE/.test(f)&&(m[f]=u.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(f){f.type===3?(c.new708Packet(),c.add708Bytes(f)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(f))}};le.prototype=new Qs,le.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},le.prototype.add708Bytes=function(o){var u=o.ccData,c=u>>>8,d=255&u;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},le.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,c=null,d=null,m=0,f=u[m++];for(o.seq=f>>6,o.sizeCode=63&f;m>5)===7&&d>0&&(c=f=u[m++]),this.pushServiceBlock(c,m,d),d>0&&(m+=d-1)},le.prototype.pushServiceBlock=function(o,u,c){var d,m=u,f=this.current708Packet.data,b=this.services[o];for(b||(b=this.initService(o,m));m("0"+(255&be).toString(16)).slice(-2)).join("")}if(b?(m=[D,j],o++):m=[D],u.textDecoder_&&!f)d=u.textDecoder_.decode(new Uint8Array(m));else if(b){const de=ue(m);d=String.fromCharCode(parseInt(de,16))}else d=T(C|D);return X.pendingNewLine&&!X.isEmpty()&&X.newLine(this.getPts(o)),X.pendingNewLine=!1,X.addText(d),o},le.prototype.multiByteCharacter=function(o,u){var c=this.current708Packet.data,d=c[o+1],m=c[o+2];return P(d)&&P(m)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},le.prototype.setCurrentWindow=function(o,u){var c=7&this.current708Packet.data[o];return u.setCurrentWindow(c),o},le.prototype.defineWindow=function(o,u){var c=this.current708Packet.data,d=c[o],m=7&d;u.setCurrentWindow(m);var f=u.currentWindow;return d=c[++o],f.visible=(32&d)>>5,f.rowLock=(16&d)>>4,f.columnLock=(8&d)>>3,f.priority=7&d,d=c[++o],f.relativePositioning=(128&d)>>7,f.anchorVertical=127&d,d=c[++o],f.anchorHorizontal=d,d=c[++o],f.anchorPoint=(240&d)>>4,f.rowCount=15&d,d=c[++o],f.columnCount=63&d,d=c[++o],f.windowStyle=(56&d)>>3,f.penStyle=7&d,f.virtualRowCount=f.rowCount+1,o},le.prototype.setWindowAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.winAttr;return d=c[++o],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=c[++o],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=c[++o],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=c[++o],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,o},le.prototype.flushDisplayed=function(o,u){for(var c=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&c.push(u.windows[d].getText());u.endPts=o,u.text=c.join(` + +`),this.pushCaption(u),u.startPts=o},le.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},le.prototype.displayWindows=function(o,u){var c=this.current708Packet.data[++o],d=this.getPts(o);this.flushDisplayed(d,u);for(var m=0;m<8;m++)c&1<>4,m.offset=(12&d)>>2,m.penSize=3&d,d=c[++o],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,o},le.prototype.setPenColor=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penColor;return d=c[++o],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=c[++o],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=c[++o],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,o},le.prototype.setPenLocation=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=c[++o],m.row=15&d,d=c[++o],m.column=63&d,o},le.prototype.reset=function(o,u){var c=this.getPts(o);return this.flushDisplayed(c,u),this.initService(u.serviceNum,o)};var De={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ee=function(o){return o===null?"":(o=De[o]||o,String.fromCharCode(o))},wt=14,qt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],st=function(){for(var o=[],u=wt+1;u--;)o.push({text:"",indent:0,offset:0});return o},Ae=function(o,u){Ae.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(c){var d,m,f,b,x;if((d=32639&c.ccData)!==this.lastControlCode_){if((61440&d)==4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),f=d>>>8,b=255&d,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),m=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=m,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=st();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=st();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=st()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(f,b))x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isExtCharacter(f,b))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isMidRowCode(f,b))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,14&~b||this.addFormatting(c.pts,["i"]),1&~b||this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(f,b)){const D=3&b;this.nonDisplayed_[this.row_].offset=D,this.column_+=D}else if(this.isPAC(f,b)){var C=qt.indexOf(7968&d);if(this.mode_==="rollUp"&&(C-this.rollUpRows_+1<0&&(C=this.rollUpRows_-1),this.setRollUp(c.pts,C)),C!==this.row_&&C>=0&&C<=14&&(this.clearFormatting(c.pts),this.row_=C),1&b&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),!(16&~d)){const D=(14&d)>>1;this.column_=4*D,this.nonDisplayed_[this.row_].indent+=D}this.isColorPAC(b)&&(14&~b||this.addFormatting(c.pts,["i"]))}else this.isNormalChar(f)&&(b===0&&(b=null),x=Ee(f),x+=Ee(b),this[this.mode_](c.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Ae.prototype=new Qs,Ae.prototype.flushDisplayed=function(o){const u=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,m)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{u(m)}d.text.length&&c.push({text:d.text,line:m+1,position:10+Math.min(70,10*d.indent)+2.5*d.offset})}else d==null&&u(m)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},Ae.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=st(),this.nonDisplayed_=st(),this.lastControlCode_=null,this.column_=0,this.row_=wt,this.rollUpRows_=2,this.formatting_=[]},Ae.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ae.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Ae.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Ae.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Ae.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Ae.prototype.isPAC=function(o,u){return o>=this.BASE_&&o=64&&u<=127},Ae.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ae.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ae.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=wt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=st(),this.displayed_=st()),u!==void 0&&u!==this.row_)for(var c=0;c"},"");this[this.mode_](o,c)},Ae.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(c,d){return c+""},"");this.formatting_=[],this[this.mode_](o,u)}},Ae.prototype.popOn=function(o,u){var c=this.nonDisplayed_[this.row_].text;c+=u,this.nonDisplayed_[this.row_].text=c},Ae.prototype.rollUp=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c},Ae.prototype.shiftRowsUp_=function(){var o;for(o=0;ou&&(c=-1);Math.abs(u-o)>_s;)o+=c*Lt;return o},Ht=function(o){var u,c;Ht.prototype.init.call(this),this.type_=o||Ls,this.push=function(d){d.type!=="metadata"?this.type_!==Ls&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=Js(d.dts,c),d.pts=Js(d.pts,c),u=d.dts,this.trigger("data",d)):this.trigger("data",d)},this.flush=function(){c=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ht.prototype=new ns;var Zs,nl={TimestampRolloverStream:Ht,handleRollover:Js},Qp=(o,u,c)=>{if(!o)return-1;for(var d=c;d";o.data[0]===Ir.Utf8&&((u=Dr(o.data,0,d))<0||(o.mimeType=Vi(o.data,d,u),d=u+1,o.pictureType=o.data[d],d++,(c=Dr(o.data,0,d))<0||(o.description=$i(o.data,d,c),d=c+1,o.mimeType===m?o.url=Vi(o.data,d,o.data.length):o.pictureData=o.data.subarray(d,o.data.length))))},"T*":function(o){o.data[0]===Ir.Utf8&&(o.value=$i(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.value=$i(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value)},"W*":function(o){o.url=Vi(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.url=Vi(o.data,u+1,o.data.length).replace(/\0.*$/,""))},PRIV:function(o){var u;for(u=0;u>>2;de*=4,de+=3&ue[7],j.timeStamp=de,x.pts===void 0&&x.dts===void 0&&(x.pts=j.timeStamp,x.dts=j.timeStamp),this.trigger("timestamp",j)}x.frames.push(j),C+=10,C+=D}while(C>>4>1&&(b+=m[b]+1),f.pid===0)f.type="pat",o(m.subarray(b),f),this.trigger("data",f);else if(f.pid===this.pmtPid)for(f.type="pmt",o(m.subarray(b),f),this.trigger("data",f);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,b,f]):this.processPes_(m,b,f)},this.processPes_=function(m,f,b){b.pid===this.programMapTable.video?b.streamType=Ot.H264_STREAM_TYPE:b.pid===this.programMapTable.audio?b.streamType=Ot.ADTS_STREAM_TYPE:b.streamType=this.programMapTable["timed-metadata"][b.pid],b.type="pes",b.data=m.subarray(f),this.trigger("data",b)}},Gi.prototype=new Zn,Gi.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o,u=this,c=!1,d={data:[],size:0},m={data:[],size:0},f={data:[],size:0},b=function(C,D){var j;const X=C[0]<<16|C[1]<<8|C[2];D.data=new Uint8Array,X===1&&(D.packetLength=6+(C[4]<<8|C[5]),D.dataAlignmentIndicator=!!(4&C[6]),192&(j=C[7])&&(D.pts=(14&C[9])<<27|(255&C[10])<<20|(254&C[11])<<12|(255&C[12])<<5|(254&C[13])>>>3,D.pts*=4,D.pts+=(6&C[13])>>>1,D.dts=D.pts,64&j&&(D.dts=(14&C[14])<<27|(255&C[15])<<20|(254&C[16])<<12|(255&C[17])<<5|(254&C[18])>>>3,D.dts*=4,D.dts+=(6&C[18])>>>1)),D.data=C.subarray(9+C[8]))},x=function(C,D,j){var X,ue=new Uint8Array(C.size),de={type:D},be=0,Ce=0,nt=!1;if(C.data.length&&!(C.size<9)){for(de.trackId=C.data[0].pid,be=0;be>5,C=(x=1024*(1+(3&u[D+6])))*im/ul[(60&u[D+2])>>>2],u.byteLength-D>>6&3),channelcount:(1&u[D+2])<<2|(192&u[D+3])>>>6,samplerate:ul[(60&u[D+2])>>>2],samplingfrequencyindex:(60&u[D+2])>>>2,samplesize:16,data:u.subarray(D+7+f,D+m)}),c++,D+=m}else typeof j!="number"&&(j=D),D++;typeof j=="number"&&(this.skipWarn_(j,D),j=null),u=u.subarray(D)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}}).prototype=new sm;var Lr,Or,hl,rm=ia,dl=Fe,nm=function(o){var u=o.byteLength,c=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var m=o.byteLength-u,f=new Uint8Array(4),b=Math.min(4,u);if(b===0)throw new Error("no bytes available");f.set(o.subarray(m,m+b)),c=new DataView(f.buffer).getUint32(0),d=8*b,u-=b},this.skipBits=function(m){var f;d>m?(c<<=m,d-=m):(m-=d,m-=8*(f=Math.floor(m/8)),u-=f,this.loadWord(),c<<=m,d-=m)},this.readBits=function(m){var f=Math.min(d,m),b=c>>>32-f;return(d-=f)>0?c<<=f:u>0&&this.loadWord(),(f=m-f)>0?b<>>m)return c<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Or=function(){var o,u,c=0;Or.prototype.init.call(this),this.push=function(d){var m;u?((m=new Uint8Array(u.byteLength+d.data.byteLength)).set(u),m.set(d.data,u.byteLength),u=m):u=d.data;for(var f=u.byteLength;c3&&this.trigger("data",u.subarray(c+3)),u=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new dl,hl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o,u,c,d,m,f,b,x=new Or;Lr.prototype.init.call(this),o=this,this.push=function(C){C.type==="video"&&(u=C.trackId,c=C.pts,d=C.dts,x.push(C))},x.on("data",function(C){var D={trackId:u,pts:c,dts:d,data:C,nalUnitTypeCode:31&C[0]};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=m(C.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=m(C.subarray(1)),D.config=f(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp"}o.trigger("data",D)}),x.on("done",function(){o.trigger("done")}),x.on("partialdone",function(){o.trigger("partialdone")}),x.on("reset",function(){o.trigger("reset")}),x.on("endedtimeline",function(){o.trigger("endedtimeline")}),this.flush=function(){x.flush()},this.partialFlush=function(){x.partialFlush()},this.reset=function(){x.reset()},this.endTimeline=function(){x.endTimeline()},b=function(C,D){var j,X=8,ue=8;for(j=0;j=0?c:0,(16&o[u+5])>>4?c+20:c+10},pl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=cl(o,u),pl(o,u))},ml=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},lm=function(o,u,c){var d,m="";for(d=u;d=u+2&&!(255&~o[u])&&!(240&~o[u+1])&&(22&o[u+1])==16},parseId3TagSize:cl,parseAdtsSize:function(o,u){var c=(224&o[u+5])>>5,d=o[u+4]<<3;return 6144&o[u+3]|d|c},parseType:function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":!0&o[u]&&!(240&~o[u+1])?"audio":null},parseSampleRate:function(o){for(var u=0;u+5>>2];u++}return null},parseAacTimestamp:function(o){var u,c,d;u=10,64&o[5]&&(u+=4,u+=ml(o.subarray(10,14)));do{if((c=ml(o.subarray(u+4,u+8)))<1)return null;if(String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3])==="PRIV"){d=o.subarray(u+10,u+c+10);for(var m=0;m>>2;return b*=4,b+=3&f[7]}break}}u+=10,u+=c}while(u=3;)if(o[C]!==73||o[C+1]!==68||o[C+2]!==51)if(255&~o[C]||240&~o[C+1])C++;else{if(o.length-C<7||C+(x=gl.parseAdtsSize(o,C))>o.length)break;f={type:"audio",data:o.subarray(C,C+x),pts:u,dts:u},this.trigger("data",f),C+=x}else{if(o.length-C<10||C+(x=gl.parseId3TagSize(o,C))>o.length)break;m={type:"timed-metadata",data:o.subarray(C,C+x)},this.trigger("data",m),C+=x}d=o.length-C,o=d>0?o.subarray(C):new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Fe;var Xi,ti,Nr,Os,hm=ra,dm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],cm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rr=Fe,Yi=ms,Ki=je,Mr=qi,Nt=kr,as=tm,Br=ke,fl=rm,pm=am.H264Stream,mm=hm,gm=na.isLikelyAacData,fm=ke.ONE_SECOND_IN_TS,aa=dm,oa=cm,ym=function(o,u){u.stream=o,this.trigger("log",u)},yl=function(o,u){for(var c=Object.keys(u),d=0;d=-be&&C<=de&&(!D||Ce>C)&&(D=X,Ce=C));return D?D.gop:null},this.alignGopsAtStart_=function(x){var C,D,j,X,ue,de,be,Ce;for(ue=x.byteLength,de=x.nalCount,be=x.duration,C=D=0;Cj.pts?C++:(D++,ue-=X.byteLength,de-=X.nalCount,be-=X.duration);return D===0?x:D===x.length?null:((Ce=x.slice(D)).byteLength=ue,Ce.duration=be,Ce.nalCount=de,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce)},this.alignGopsAtEnd_=function(x){var C,D,j,X,ue,de,be;for(C=b.length-1,D=x.length-1,ue=null,de=!1;C>=0&&D>=0;){if(j=b[C],X=x[D],j.pts===X.pts){de=!0;break}j.pts>X.pts?C--:(C===b.length-1&&(ue=D),D--)}if(!de&&ue===null)return null;if((be=de?D:ue)===0)return x;var Ce=x.slice(be),nt=Ce.reduce(function(Rt,ri){return Rt.byteLength+=ri.byteLength,Rt.duration+=ri.duration,Rt.nalCount+=ri.nalCount,Rt},{byteLength:0,duration:0,nalCount:0});return Ce.byteLength=nt.byteLength,Ce.duration=nt.duration,Ce.nalCount=nt.nalCount,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce},this.alignGopsWith=function(x){b=x}},Xi.prototype=new Rr,Os=function(o,u){this.numberOfTracks=0,this.metadataStream=u,(o=o||{}).remux!==void 0?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Os.prototype.init.call(this),this.push=function(c){return c.content||c.text?this.pendingCaptions.push(c):c.frames?this.pendingMetadata.push(c):(this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),void(c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))))}},Os.prototype=new Rr,Os.prototype.flush=function(o){var u,c,d,m,f=0,b={captions:[],captionStreams:{},metadata:[],info:{}},x=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(x=this.videoTrack.timelineStartInfo.pts,oa.forEach(function(C){b.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,aa.forEach(function(C){b.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?b.type=this.pendingTracks[0].type:b.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Yi.initSegment(this.pendingTracks),b.initSegment=new Uint8Array(d.byteLength),b.initSegment.set(d),b.data=new Uint8Array(this.pendingBytes),m=0;m=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Os.prototype.setRemux=function(o){this.remuxTracks=o},Nr=function(o){var u,c,d=this,m=!0;Nr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="aac",f.metadataStream=new as.MetadataStream,f.aacStream=new mm,f.audioTimestampRolloverStream=new as.TimestampRolloverStream("audio"),f.timedMetadataTimestampRolloverStream=new as.TimestampRolloverStream("timed-metadata"),f.adtsStream=new fl,f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.aacStream,f.aacStream.pipe(f.audioTimestampRolloverStream).pipe(f.adtsStream),f.aacStream.pipe(f.timedMetadataTimestampRolloverStream).pipe(f.metadataStream).pipe(f.coalesceStream),f.metadataStream.on("timestamp",function(b){f.aacStream.setTimestamp(b.timeStamp)}),f.aacStream.on("data",function(b){b.type!=="timed-metadata"&&b.type!=="audio"||f.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u}))}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setupTsPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="ts",f.metadataStream=new as.MetadataStream,f.packetStream=new as.TransportPacketStream,f.parseStream=new as.TransportParseStream,f.elementaryStream=new as.ElementaryStream,f.timestampRolloverStream=new as.TimestampRolloverStream,f.adtsStream=new fl,f.h264Stream=new pm,f.captionStream=new as.CaptionStream(o),f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.packetStream,f.packetStream.pipe(f.parseStream).pipe(f.elementaryStream).pipe(f.timestampRolloverStream),f.timestampRolloverStream.pipe(f.h264Stream),f.timestampRolloverStream.pipe(f.adtsStream),f.timestampRolloverStream.pipe(f.metadataStream).pipe(f.coalesceStream),f.h264Stream.pipe(f.captionStream).pipe(f.coalesceStream),f.elementaryStream.on("data",function(b){var x;if(b.type==="metadata"){for(x=b.tracks.length;x--;)u||b.tracks[x].type!=="video"?c||b.tracks[x].type!=="audio"||((c=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(u=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;u&&!f.videoSegmentStream&&(f.coalesceStream.numberOfTracks++,f.videoSegmentStream=new Xi(u,o),f.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),f.videoSegmentStream.on("timelineStartInfo",function(C){c&&!o.keepOriginalTimestamps&&(c.timelineStartInfo=C,f.audioSegmentStream.setEarliestDts(C.dts-d.baseMediaDecodeTime))}),f.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),f.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),f.videoSegmentStream.on("baseMediaDecodeTime",function(C){c&&f.audioSegmentStream.setVideoBaseMediaDecodeTime(C)}),f.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),f.h264Stream.pipe(f.videoSegmentStream).pipe(f.coalesceStream)),c&&!f.audioSegmentStream&&(f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u})}}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("id3Frame",function(b){b.dispatchType=f.metadataStream.dispatchType,d.trigger("id3Frame",b)}),f.coalesceStream.on("caption",this.trigger.bind(this,"caption")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setBaseMediaDecodeTime=function(f){var b=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=f),c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(c),b.audioTimestampRolloverStream&&b.audioTimestampRolloverStream.discontinuity()),u&&(b.videoSegmentStream&&(b.videoSegmentStream.gopCache_=[]),u.timelineStartInfo.dts=void 0,u.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(u),b.captionStream.reset()),b.timestampRolloverStream&&b.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(f){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(f)},this.setRemux=function(f){var b=this.transmuxPipeline_;o.remux=f,b&&b.coalesceStream&&b.coalesceStream.setRemux(f)},this.alignGopsWith=function(f){u&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(f)},this.getLogTrigger_=function(f){var b=this;return function(x){x.stream=f,b.trigger("log",x)}},this.push=function(f){if(m){var b=gm(f);b&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():b||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(f)},this.flush=function(){m=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Rr;var vl,bl,Tl,Sl,El,ua,Cl,_m={Transmuxer:Nr,VideoSegmentStream:Xi,AudioSegmentStream:ti,AUDIO_PROPERTIES:aa,VIDEO_PROPERTIES:oa,generateSegmentTimingInfo:la},Fr={toUnsigned:function(o){return o>>>0},toHexString:function(o){return("00"+o.toString(16)).slice(-2)}},wl=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3])},vm=Fr.toUnsigned,bm=wl,Al=function(o,u){var c,d,m,f,b,x=[];if(!u.length)return null;for(c=0;c1?c+d:o.byteLength,m===u[0]&&(u.length===1?x.push(o.subarray(c+8,f)):(b=Al(o.subarray(c+8,f),u.slice(1))).length&&(x=x.concat(b))),c=f;return x},xl=Al,Tm=Fr.toUnsigned,Sm=Pe.getUint64,kl=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Sm(o.subarray(4)):u.baseMediaDecodeTime=Tm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},Dl=function(o){return{isLeading:(12&o[0])>>>2,dependsOn:3&o[0],isDependedOn:(192&o[1])>>>6,hasRedundancy:(48&o[1])>>>4,paddingValue:(14&o[1])>>>1,isNonSyncSample:1&o[1],degradationPriority:o[2]<<8|o[3]}},Il=function(o){var u,c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),m=1&c.flags[2],f=4&c.flags[2],b=1&c.flags[1],x=2&c.flags[1],C=4&c.flags[1],D=8&c.flags[1],j=d.getUint32(4),X=8;for(m&&(c.dataOffset=d.getInt32(X),X+=4),f&&j&&(u={flags:Dl(o.subarray(X,X+4))},X+=4,b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u),j--);j--;)u={},b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),C&&(u.flags=Dl(o.subarray(X,X+4)),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u);return c},Pl=function(o){var u,c=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},m=1&d.flags[2],f=2&d.flags[2],b=8&d.flags[2],x=16&d.flags[2],C=32&d.flags[2],D=65536&d.flags[0],j=131072&d.flags[0];return u=8,m&&(u+=4,d.baseDataOffset=c.getUint32(12),u+=4),f&&(d.sampleDescriptionIndex=c.getUint32(u),u+=4),b&&(d.defaultSampleDuration=c.getUint32(u),u+=4),x&&(d.defaultSampleSize=c.getUint32(u),u+=4),C&&(d.defaultSampleFlags=c.getUint32(u)),D&&(d.durationIsEmpty=!0),!m&&j&&(d.baseDataOffsetIsMoof=!0),d},Ll=typeof window<"u"?window:s!==void 0?s:typeof self<"u"?self:{},Em=rs.discardEmulationPreventionBytes,Cm=jt.CaptionStream,Qi=xl,wm=kl,Am=Il,xm=Pl,Ol=Ll,km=function(o,u){for(var c=o,d=0;d0?wm(be[0]).baseMediaDecodeTime:0,nt=Qi(j,["trun"]);u===de&&nt.length>0&&(x=Im(nt,Ce,ue),C=Dm(D,x,de),m[de]||(m[de]={seiNals:[],logs:[]}),m[de].seiNals=m[de].seiNals.concat(C.seiNals),m[de].logs=m[de].logs.concat(C.logs))}),m},Lm=function(o,u,c){if(u===null)return null;var d=Pm(o,u)[u]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:c}},Om=function(){var o,u,c,d,m,f,b=!1;this.isInitialized=function(){return b},this.init=function(x){o=new Cm,b=!0,f=!!x&&x.isPartial,o.on("data",function(C){C.startTime=C.startPts/d,C.endTime=C.endPts/d,m.captions.push(C),m.captionStreams[C.stream]=!0}),o.on("log",function(C){m.logs.push(C)})},this.isNewInit=function(x,C){return!(x&&x.length===0||C&&typeof C=="object"&&Object.keys(C).length===0)&&(c!==x[0]||d!==C[c])},this.parse=function(x,C,D){var j;if(!this.isInitialized()||!C||!D)return null;if(this.isNewInit(C,D))c=C[0],d=D[c];else if(c===null||!d)return u.push(x),null;for(;u.length>0;){var X=u.shift();this.parse(X,C,D)}return(j=Lm(x,c,d))&&j.logs&&(m.logs=m.logs.concat(j.logs)),j!==null&&j.seiNals?(this.pushNals(j.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(x){if(!this.isInitialized()||!x||x.length===0)return null;x.forEach(function(C){o.push(C)})},this.flushStream=function(){if(!this.isInitialized())return null;f?o.partialFlush():o.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;o.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){u=[],c=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Nm=Om,Ur=function(o){for(var u=0,c=String.fromCharCode(o[u]),d="";c!=="\0";)d+=c,u++,c=String.fromCharCode(o[u]);return d+=c},Rm=Pe.getUint64,Mm=function(o){var u,c,d,m,f,b,x,C=4,D=o[0];if(D===0)C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length,d=(j=new DataView(o.buffer)).getUint32(C),C+=4,f=j.getUint32(C),C+=4,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4;else if(D===1){var j;d=(j=new DataView(o.buffer)).getUint32(C),C+=4,m=Rm(o.subarray(C)),C+=8,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4,C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length}var X={scheme_id_uri:u,value:c,timescale:d||1,presentation_time:m,presentation_time_delta:f,event_duration:b,id:x,message_data:new Uint8Array(o.subarray(C,o.byteLength))};return Fm(D,X)?X:void 0},Bm=function(o,u,c,d){return o||o===0?o/u:d+c/u},Fm=function(o,u){var c=u.scheme_id_uri!=="\0",d=o===0&&Nl(u.presentation_time_delta)&&c,m=o===1&&Nl(u.presentation_time)&&c;return!(o>1)&&d||m},Nl=function(o){return o!==void 0||o!==null},Um={parseEmsgBox:Mm,scaleTime:Bm},qr=Fr.toUnsigned,Ji=Fr.toHexString,$e=xl,si=wl,ha=Um,qm=Pl,jm=Il,Hm=kl,$m=Pe.getUint64,da=Ll,Vm=ol.parseId3Frames;vl=function(o){var u={};return $e(o,["moov","trak"]).reduce(function(c,d){var m,f,b,x,C;return(m=$e(d,["tkhd"])[0])?(f=m[0],x=qr(m[b=f===0?12:20]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3]),(C=$e(d,["mdia","mdhd"])[0])?(b=(f=C[0])===0?12:20,c[x]=qr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),c):null):null},u)},bl=function(o,u){var c=$e(u,["moof","traf"]).reduce(function(d,m){var f,b=$e(m,["tfhd"])[0],x=qr(b[4]<<24|b[5]<<16|b[6]<<8|b[7]),C=o[x]||9e4,D=$e(m,["tfdt"])[0],j=new DataView(D.buffer,D.byteOffset,D.byteLength);let X;return typeof(f=D[0]===1?$m(D.subarray(4,12)):j.getUint32(4))=="bigint"?X=f/da.BigInt(C):typeof f!="number"||isNaN(f)||(X=f/C),X11?(b.codec+=".",b.codec+=Ji(ue[9]),b.codec+=Ji(ue[10]),b.codec+=Ji(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=de.subarray(28),si(ue.subarray(4,8))==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+Ji(ue[19]),b.codec+="."+Ji(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var be=$e(d,["mdia","mdhd"])[0];be&&(b.timescale=ua(be)),c.push(b)}),c},Cl=function(o,u=0){return $e(o,["emsg"]).map(c=>{var d=ha.parseEmsgBox(new Uint8Array(c)),m=Vm(d.message_data);return{cueTime:ha.scaleTime(d.presentation_time,d.timescale,d.presentation_time_delta,u),duration:ha.scaleTime(d.event_duration,d.timescale),frames:m}})};var ca={findBox:$e,parseType:si,timescale:vl,startTime:bl,compositionStartTime:Tl,videoTrackIds:Sl,tracks:El,getTimescaleFromMediaHeader:ua,getEmsgID3:Cl},pa=Pt,Rl=function(o){var u=31&o[1];return u<<=8,u|=o[2]},jr=function(o){return!!(64&o[1])},Hr=function(o){var u=0;return(48&o[3])>>>4>1&&(u+=o[4]+1),u},zm=function(o){if(!jr(o))return null;var u=4+Hr(o);if(u>=o.byteLength)return null;var c,d=null;return 192&(c=o[u+7])&&((d={}).pts=(14&o[u+9])<<27|(255&o[u+10])<<20|(254&o[u+11])<<12|(255&o[u+12])<<5|(254&o[u+13])>>>3,d.pts*=4,d.pts+=(6&o[u+13])>>>1,d.dts=d.pts,64&c&&(d.dts=(14&o[u+14])<<27|(255&o[u+15])<<20|(254&o[u+16])<<12|(255&o[u+17])<<5|(254&o[u+18])>>>3,d.dts*=4,d.dts+=(6&o[u+18])>>>1)),d},ma=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wm={parseType:function(o,u){var c=Rl(o);return c===0?"pat":c===u?"pmt":u?"pes":null},parsePat:function(o){var u=jr(o),c=4+Hr(o);return u&&(c+=o[c]+1),(31&o[c+10])<<8|o[c+11]},parsePmt:function(o){var u={},c=jr(o),d=4+Hr(o);if(c&&(d+=o[d]+1),1&o[d+5]){var m;m=3+((15&o[d+1])<<8|o[d+2])-4;for(var f=12+((15&o[d+10])<<8|o[d+11]);f3&&ma(31&c[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(f=!0),f}},Ml=Pt,ii=nl.handleRollover,xe={};xe.ts=Wm,xe.aac=na;var Ns=ke.ONE_SECOND_IN_TS,ut=188,$t=71,Gm=function(o,u){for(var c,d=0,m=ut;m=0;)if(o[x]!==$t||o[C]!==$t&&C!==o.byteLength)x--,C--;else{if(d=o.subarray(x,C),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="audio",c.audio.push(b),D=!0)),D)break;x-=ut,C-=ut}},Xm=function(o,u,c){for(var d,m,f,b,x,C,D,j=0,X=ut,ue=!1,de={data:[],size:0};X=0;)if(o[j]!==$t||o[X]!==$t)j--,X--;else{if(d=o.subarray(j,X),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="video"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="video",c.video.push(b),ue=!0)),ue)break;j-=ut,X-=ut}},Ym=function(o,u){if(o.audio&&o.audio.length){var c=u;(c===void 0||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(f){f.dts=ii(f.dts,c),f.pts=ii(f.pts,c),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns})}if(o.video&&o.video.length){var d=u;if((d===void 0||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(f){f.dts=ii(f.dts,d),f.pts=ii(f.pts,d),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns}),o.firstKeyFrame){var m=o.firstKeyFrame;m.dts=ii(m.dts,d),m.pts=ii(m.pts,d),m.dtsTime=m.dts/Ns,m.ptsTime=m.pts/Ns}}},Km=function(o){for(var u,c=!1,d=0,m=null,f=null,b=0,x=0;o.length-x>=3;){switch(xe.aac.parseType(o,x)){case"timed-metadata":if(o.length-x<10){c=!0;break}if((b=xe.aac.parseId3TagSize(o,x))>o.length){c=!0;break}f===null&&(u=o.subarray(x,x+b),f=xe.aac.parseAacTimestamp(u)),x+=b;break;case"audio":if(o.length-x<7){c=!0;break}if((b=xe.aac.parseAdtsSize(o,x))>o.length){c=!0;break}m===null&&(u=o.subarray(x,x+b),m=xe.aac.parseSampleRate(u)),d++,x+=b;break;default:x++}if(c)return null}if(m===null||f===null)return null;var C=Ns/m;return{audio:[{type:"audio",dts:f,pts:f},{type:"audio",dts:f+1024*d*C,pts:f+1024*d*C}]}},Qm=function(o){var u={pid:null,table:null},c={};for(var d in Gm(o,u),u.table)if(u.table.hasOwnProperty(d))switch(u.table[d]){case Ml.H264_STREAM_TYPE:c.video=[],Xm(o,u,c),c.video.length===0&&delete c.video;break;case Ml.ADTS_STREAM_TYPE:c.audio=[],Bl(o,u,c),c.audio.length===0&&delete c.audio}return c},Jm={inspect:function(o,u){var c;return(c=xe.aac.isLikelyAacData(o)?Km(o):Qm(o))&&(c.audio||c.video)?(Ym(c,u),c):null},parseAudioPes_:Bl};const Zm=function(o,u){u.on("data",function(c){const d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const m=c.data;c.data=m.buffer,o.postMessage({action:"data",segment:c,byteOffset:m.byteOffset,byteLength:m.byteLength},[c.data])}),u.on("done",function(c){o.postMessage({action:"done"})}),u.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),u.on("videoSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),u.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),u.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),u.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("log",function(c){o.postMessage({action:"log",log:c})})};class Fl{constructor(u,c){this.options=c||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _m.Transmuxer(this.options),Zm(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new Nm,this.captionParser.init());const c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(c,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:u,data:c}){const d=ca.startTime(u,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:u}){const c=ca.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:u},[u.buffer])}probeEmsgID3({data:u,offset:c}){const d=ca.getEmsgID3(u,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:c}){const d=typeof c!="number"||isNaN(c)?void 0:c*ke.ONE_SECOND_IN_TS,m=Jm.inspect(u,d);let f=null;m&&(f={hasVideo:m.video&&m.video.length===2||!1,hasAudio:m.audio&&m.audio.length===2||!1},f.hasVideo&&(f.videoStart=m.video[0].ptsTime),f.hasAudio&&(f.audioStart=m.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:f,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const c=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ke.secondsToVideoTs(c)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(ke.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){o.data.action==="init"&&o.data.options?this.messageHandlers=new Fl(self,o.data.options):(this.messageHandlers||(this.messageHandlers=new Fl(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data))}}));var Y0=Sp(X0);const K0=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:h,videoFramePtsTime:p}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const g=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};h!==void 0&&(y.videoFrameDtsTime=h),p!==void 0&&(y.videoFramePtsTime=p),t(y)},Q0=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},J0=(s,e)=>{e.gopInfo=s.data.gopInfo},wp=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:h,onVideoTimingInfo:p,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:E,onDone:I,onEndedTimeline:v,onTransmuxerLog:L,isEndOfTimeline:R,segment:M,triggerSegmentEventFn:O}=s,G={buffer:[]};let N=R;const z=H=>{e.currentTransmux===s&&(H.data.action==="data"&&K0(H,G,a),H.data.action==="trackinfo"&&l(H.data.trackInfo),H.data.action==="gopInfo"&&J0(H,G),H.data.action==="audioTimingInfo"&&h(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&p(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&g(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&y(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&w([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&E(H.data.caption),H.data.action==="endedtimeline"&&(N=!1,v()),H.data.action==="log"&&L(H.data.log),H.data.type==="transmuxed"&&(N||(e.onmessage=null,Q0({transmuxedData:G,callback:I}),Ap(e))))},U=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:qs({segment:M})}};I(null,H)};if(e.onmessage=z,e.onerror=U,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),n!==void 0&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:M}),e.postMessage({action:"push",data:H,byteOffset:S,byteLength:t.byteLength},[H])}R&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ap=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():wp(s.currentTransmux))},ud=(s,e)=>{s.postMessage({action:e}),Ap(s)},hd=(s,e)=>{if(!e.currentTransmux)return e.currentTransmux=s,void ud(e,s);e.transmuxQueue.push(ud.bind(null,e,s))},xp=s=>{if(!s.transmuxer.currentTransmux)return s.transmuxer.currentTransmux=s,void wp(s);s.transmuxer.transmuxQueue.push(s)};var to={reset:s=>{hd("reset",s)},endTimeline:s=>{hd("endTimeline",s)},transmux:xp,createTransmuxer:s=>{const e=new Y0;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e}};const pr=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=ze({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},Yt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ko=s=>{s.forEach(e=>{e.abort()})},Z0=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),e1=s=>{const e=s.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return t.bytesReceived=s.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},il=(s,e)=>{const{requestType:t}=e,i=Gs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:null},dd=(s,e,t,i)=>(r,n)=>{const a=n.response,l=il(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yt.FAILURE,xhr:n},s);const h=new DataView(a),p=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let y=0;y{const t=Fo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Yt.FAILURE,metadata:{mediaType:r}})}pr({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},s.map.tracks[n.type]||(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale))}),e(null))})},t1=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=il(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,kp(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},s1=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=il(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t!=="arraybuffer"&&n.responseText?W0(n.responseText.substring(s.lastReachedChar||0)):n.response;return s.stats=Z0(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},i1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{const I=s.map&&s.map.tracks||{},v=!!(I.audio&&I.video);let L=i.bind(null,s,"audio","start");const R=i.bind(null,s,"audio","end");let M=i.bind(null,s,"video","start");const O=i.bind(null,s,"video","end"),G=()=>xp({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:v,onData:N=>{N.type=N.type==="combined"?"video":N.type,g(s,N)},onTrackInfo:N=>{t&&(v&&(N.isMuxed=!0),t(s,N))},onAudioTimingInfo:N=>{L&&N.start!==void 0&&(L(N.start),L=null),R&&N.end!==void 0&&R(N.end)},onVideoTimingInfo:N=>{M&&N.start!==void 0&&(M(N.start),M=null),O&&N.end!==void 0&&O(N.end)},onVideoSegmentTimingInfo:N=>{const z={pts:{start:N.start.presentation,end:N.end.presentation},dts:{start:N.start.decode,end:N.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),r(N)},onAudioSegmentTimingInfo:N=>{const z={pts:{start:N.start.pts,end:N.end.pts},dts:{start:N.start.dts,end:N.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),n(N)},onId3:(N,z)=>{a(s,N,z)},onCaptions:N=>{l(s,[N])},isEndOfTimeline:h,onEndedTimeline:()=>{p()},onTransmuxerLog:w,onDone:(N,z)=>{y&&(N.type=N.type==="combined"?"video":N.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(z,s,N))},segment:s,triggerSegmentEventFn:E});pr({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:N=>{s.bytes=e=N.data;const z=N.result;z&&(t(s,{hasAudio:z.hasAudio,hasVideo:z.hasVideo,isMuxed:v}),t=null),G()}})},Dp=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=new Uint8Array(e);if(My(I)){s.isFmp4=!0;const{tracks:v}=s.map,L={isFmp4:!0,hasVideo:!!v.video,hasAudio:!!v.audio};v.audio&&v.audio.codec&&v.audio.codec!=="enca"&&(L.audioCodec=v.audio.codec),v.video&&v.video.codec&&v.video.codec!=="encv"&&(L.videoCodec=v.video.codec),v.video&&v.audio&&(L.isMuxed=!0),t(s,L);const R=(M,O)=>{g(s,{data:I,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),O&&O.length&&a(s,O),M&&M.length&&l(s,M),y(null,s,{})};pr({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:M,startTime:O})=>{e=M.buffer,s.bytes=I=M,L.hasAudio&&!L.isMuxed&&i(s,"audio","start",O),L.hasVideo&&i(s,"video","start",O),pr({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:O,callback:({emsgData:G,id3Frames:N})=>{e=G.buffer,s.bytes=I=G,v.video&&G.byteLength&&s.transmuxer?pr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[v.video.id],callback:z=>{e=z.data.buffer,s.bytes=I=z.data,z.logs.forEach(function(U){w(we(U,{stream:"mp4CaptionParser"}))}),R(z.captions,N)}}):R(void 0,N)}})}})}else if(s.transmuxer){if(s.container===void 0&&(s.container=Fo(I)),s.container!=="ts"&&s.container!=="aac")return t(s,{hasAudio:!1,hasVideo:!1}),void y(null,s,{});i1({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})}else y(null,s,{})},Ip=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=p=>{if(p.data.source===s){i.removeEventListener("message",l);const g=p.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};let h;i.onerror=()=>{const p="An error occurred in the decryption worker",g=qs({segment:r}),y={message:p,metadata:{error:new Error(p),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l),h=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(fp({source:s,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},r1=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Ip({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},I=>{e.bytes=I,E({type:"segmentdecryptioncomplete",segment:e}),Dp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})})},n1=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=0,v=!1;return(L,R)=>{if(!v){if(L)return v=!0,ko(s),y(L,R);if(I+=1,I===s.length){const M=function(){if(R.encryptedBytes)return r1({decryptionWorker:e,segment:R,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E});Dp({segment:R,bytes:R.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})};if(R.endOfAllRequests=Date.now(),R.map&&R.map.encryptedBytes&&!R.map.bytes)return E({type:"segmentdecryptionstart",segment:R}),Ip({decryptionWorker:e,id:R.requestId+"-init",encryptedBytes:R.map.encryptedBytes,key:R.map.key,segment:R,doneFn:y},O=>{R.map.bytes=O,E({type:"segmentdecryptioncomplete",segment:R}),kp(R,G=>{if(G)return ko(s),y(G,R);M()})});M()}}}},a1=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},o1=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=we(s.stats,e1(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},l1=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R})=>{const M=[],O=n1({activeXhrs:M,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const S=we(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),A=dd(i,H,O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.key.resolvedUri}});const B=s(S,A);M.push(B)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const B=we(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),$=dd(i,[i.map.key],O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.map.key.resolvedUri}});const W=s(B,$);M.push(W)}const H=we(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map),requestType:"segment-media-initialization"}),S=t1({segment:i,finishProcessingFn:O,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const A=s(H,S);M.push(A)}const G=we(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i),requestType:"segment"}),N=s1({segment:i,finishProcessingFn:O,responseType:G.responseType,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const z=s(G,N);z.addEventListener("progress",o1({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I})),M.push(z);const U={};return M.forEach(H=>{H.addEventListener("loadend",a1({loadendState:U,abortFn:r}))}),()=>ko(M)},u1=It("CodecUtils"),h1=function(s){const e=s.attributes||{};if(e.CODECS)return Vt(e.CODECS)},Pp=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},d1=(s,e)=>{if(!Pp(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},kn=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Fd(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1)return u1(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(e[t]=null);e[t]=e[t][0]}),e},cd=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},mr=function(s,e){const t=e.attributes||{},i=kn(h1(e)||[]);if(Pp(s,e)&&!i.audio&&!d1(s,e)){const r=kn(uf(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Qr=It("PlaylistSelector"),pd=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Dn=function(s,e){if(!s)return"";const t=k.getComputedStyle(s);return t?t[e]:""},Ti=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},rl=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||k.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||k.Number.MAX_VALUE,t-i},c1=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||k.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||k.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let Lp=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let l=s.playlists;bt.isAudioOnly(s)&&(l=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let h=l.map(N=>{let z;const U=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,H=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return z=N.attributes&&N.attributes.BANDWIDTH,z=z||k.Number.MAX_VALUE,{bandwidth:z,width:U,height:H,playlist:N}});Ti(h,(N,z)=>N.bandwidth-z.bandwidth),h=h.filter(N=>!bt.isIncompatible(N.playlist));let p=h.filter(N=>bt.isEnabled(N.playlist));p.length||(p=h.filter(N=>!bt.isDisabled(N.playlist)));const g=p.filter(N=>N.bandwidth*Je.BANDWIDTH_VARIANCEN.bandwidth===y.bandwidth)[0];if(r===!1){const N=w||p[0]||h[0];if(N&&N.playlist){let z="sortedPlaylistReps";return w&&(z="bandwidthBestRep"),p[0]&&(z="enabledPlaylistReps"),Qr(`choosing ${pd(N)} using ${z} with options`,a),N.playlist}return Qr("could not choose a playlist with options",a),null}const E=g.filter(N=>N.width&&N.height);Ti(E,(N,z)=>N.width-z.width);const I=E.filter(N=>N.width===t&&N.height===i);y=I[I.length-1];const v=I.filter(N=>N.bandwidth===y.bandwidth)[0];let L,R,M,O;if(v||(L=E.filter(N=>N.width>t||N.height>i),R=L.filter(N=>N.width===L[0].width&&N.height===L[0].height),y=R[R.length-1],M=R.filter(N=>N.bandwidth===y.bandwidth)[0]),n.leastPixelDiffSelector){const N=E.map(z=>(z.pixelDiff=Math.abs(z.width-t)+Math.abs(z.height-i),z));Ti(N,(z,U)=>z.pixelDiff===U.pixelDiff?U.bandwidth-z.bandwidth:z.pixelDiff-U.pixelDiff),O=N[0]}const G=O||M||v||w||p[0]||h[0];if(G&&G.playlist){let N="sortedPlaylistReps";return O?N="leastPixelDiffRep":M?N="resolutionPlusOneRep":v?N="resolutionBestRep":w?N="bandwidthBestRep":p[0]&&(N="enabledPlaylistReps"),Qr(`choosing ${pd(G)} using ${N} with options`,a),G.playlist}return Qr("could not choose a playlist with options",a),null};const md=function(){let s=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),Lp(this.playlists.main,this.systemBandwidth,parseInt(Dn(this.tech_.el(),"width"),10)*s,parseInt(Dn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},p1=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),Lp(this.playlists.main,e,parseInt(Dn(this.tech_.el(),"width"),10)*i,parseInt(Dn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},m1=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:h}=s,p=e.playlists.filter(E=>!bt.isIncompatible(E));let g=p.filter(bt.isEnabled);g.length||(g=p.filter(E=>!bt.isDisabled(E)));const y=g.filter(bt.hasAttribute.bind(null,"BANDWIDTH")).map(E=>{const I=h.getSyncPoint(E,r,l,t)?1:2;return{playlist:E,rebufferingImpact:bt.estimateSegmentRequestTime(n,i,E)*I-a}}),w=y.filter(E=>E.rebufferingImpact<=0);return Ti(w,(E,I)=>rl(I.playlist,E.playlist)),w.length?w[0]:(Ti(y,(E,I)=>E.rebufferingImpact-I.rebufferingImpact),y[0]||null)},g1=function(){const s=this.playlists.main.playlists.filter(bt.isEnabled);return Ti(s,(e,t)=>rl(e,t)),s.filter(e=>!!mr(this.playlists.main,e).video)[0]||null},f1=s=>{let e,t=0;return s.bytes&&(e=new Uint8Array(s.bytes),s.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),e};function Op(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const y1=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{let n=t,a=t,l=!1;const h=(e.options_.vhs&&e.options_.vhs.captionServices||{})[i];h&&(n=h.label,a=h.language,l=h.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:n,language:a},!1).track}}},_1=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},v1=function(s){Object.defineProperties(s.frame,{id:{get:()=>(F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key)},value:{get:()=>(F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data)},privateData:{get:()=>(F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data)}})},b1=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=k.WebKitDataCue||k.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;!(typeof y!="number"||k.isNaN(y)||y<0)&&y<1/0&&g.frames&&g.frames.length&&g.frames.forEach(w=>{const E=new r(y,y,w.value||w.url||w.data||"");E.frame=w,E.value=w,v1(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let g=0;g{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),p=Object.keys(h).sort((g,y)=>Number(g)-Number(y));p.forEach((g,y)=>{const w=h[g],E=isFinite(i)?i:g,I=Number(p[y+1])||E;w.forEach(v=>{v.endTime=I})})},T1={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},S1=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),E1=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(S1.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:T1[n],data:r[n]},n!=="scte35Out"&&n!=="scte35In"||(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},gd=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},or=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},C1=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},w1=(s,e,t)=>{if(e==null||!s.length)return[];const i=Math.ceil((e-t+3)*js.ONE_SECOND_IN_TS);let r;for(r=0;ri);r++);return s.slice(r)},A1=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(;r=i);r++);return s.slice(0,r).concat(e)},x1=(s,e,t,i)=>{const r=Math.ceil((e-i)*js.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*js.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let h=l+1;for(;h--&&!(s[h].pts<=r););return h=Math.max(h,0),a.splice(h,l-h+1),a},k1=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;rt))return n}return i.length===0?0:i[i.length-1]},ir=1,I1=500,fd=s=>typeof s=="number"&&isFinite(s),Jr=1/60,P1=(s,e,t)=>s==="main"&&e&&t?t.hasAudio||t.hasVideo?e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,L1=(s,e,t)=>{let i=e-Je.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},li=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:h,partIndex:p,timeline:g}=s,y=l.length-1;let w="mediaIndex/partIndex increment";s.getMediaInfoForTime?w=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(w+=` with independent ${s.independent}`);const E=typeof p=="number",I=s.segment.uri?"segment":"pre-segment",v=E?tp({preloadSegment:i})-1:0;return`${I} [${n+h}/${n+y}]`+(E?` part [${p}/${v}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${w}] playlist [${a}]`},yd=s=>`${s}TimingInfo`,O1=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>r||s!==e?s{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!n||n.to!==t}return!1},N1=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!(!i||e.from===-1||t.from===-1||!r)},R1=s=>{s&&(s.pause(),s.resetEverything(),s.load())},M1=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=s.pendingSegment_;if(e&&Do({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&N1(s.timelineChangeController_)){if(M1(s))return void s.timelineChangeController_.trigger("audioTimelineBehind");R1(s)}},B1=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=k.BigInt(n)-k.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),a!==void 0&&a>e&&(e=a)}),typeof e=="bigint"&&e!!s&&Math.round(s)>e+Gt,F1=(s,e)=>{if(e!=="hls")return null;const t=B1({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=_d({segmentDuration:t,maxDuration:2*i}),n=_d({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},qs=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class Io extends F.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=It(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(ze({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(ze({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ss(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,k.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return gt();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=yp(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${eo(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const a=()=>{n--,n===0&&i()};!r&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=x1(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)or(e,t,this.inbandTextTracks_[l]);or(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),I1)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=eo(e)||0,i=Zo(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=D1(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const w=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=w.end?w.end:t,w.parts&&w.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let w,E,I;const v=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${v}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const L=this.getSyncInfoFromMediaSequenceSync_(v);if(!L){const R="No sync info found while using media sequence sync";return this.error({message:R,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(R)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${L.start} --> ${L.end})`),w=L.segmentIndex,E=L.partIndex,I=L.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const L=bt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:v,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=L.segmentIndex,E=L.partIndex,I=L.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${v}`:`currentTime ${v}`,l.mediaIndex=w,l.startOfSegment=I,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const h=a[l.mediaIndex];let p=h&&typeof l.partIndex=="number"&&h.parts&&h.parts[l.partIndex];if(!h||typeof l.partIndex=="number"&&!p)return null;typeof l.partIndex!="number"&&h.parts&&(l.partIndex=0,p=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&p&&!g&&!p.independent)if(l.partIndex===0){const w=a[l.mediaIndex-1],E=w.parts&&w.parts.length&&w.parts[w.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=w.parts.length-1,l.independent="previous segment")}else h.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:h,getMediaInfoForTime:p}=e,g=i.segments[r],y=typeof l=="number"&&g.parts[l],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:t},E=h!==void 0?h:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const I=eo(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(w.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=w1(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return O1(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=bt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=u0(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=m1({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const h=n-a-l.rebufferingImpact;let p=.5;a<=Gt&&(p=1),!l.playlist||l.playlist.uri===this.playlist_.uri||h{r[n.stream]=r[n.stream]||{startTime:1/0,captions:[],endTime:0};const a=r[n.stream];a.startTime=Math.min(a.startTime,n.startTime+i),a.endTime=Math.max(a.endTime,n.endTime+i),a.captions.push(n)}),Object.keys(r).forEach(n=>{const{startTime:a,endTime:l,captions:h}=r[n],p=this.inbandTextTracks_;this.logger_(`adding cues from ${a} -> ${l} for ${n}`),y1(p,this.vhs_.tech_,n),or(a,l,p[n]),_1({captionArray:h,inbandTextTracks:p,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo)&&!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Ss(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[yd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_!=="main"||typeof e.timestampOffset!="number"||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=xn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(a).join(", "));const l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,p=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-l<=ir&&g-p<=ir)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Hs(n).join(", ")}, video buffer: ${Hs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const y=this.currentTime_()-ir;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ir}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=k.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*ir)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(r.code!==dp?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let h=r.byteLength;i&&(l.unshift(i),h+=i.byteLength),n=f1({bytes:h,segments:l})}const a={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Ss(this),void this.loadQueue_.push(()=>{const t=ze({},e,{forceTimestampOffset:!0});ze(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting +${Op(e.uri)} +${li(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=l1({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:h,stream:p})=>{this.logger_(`${li(e)} logged from transmuxer stream ${p} as a ${h}: ${l}`)},triggerSegmentEventFn:({type:l,segment:h,keyInfo:p,trackInfo:g,timingInfo:y})=>{const w={segmentInfo:qs({segment:h})};p&&(w.keyInfo=p),g&&(w.trackInfo=g),y&&(w.timingInfo=y),this.trigger({type:l,metadata:w})}})}trimBackBuffer_(e){const t=L1(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(n||a)return this.logger_(`bad ${n?"segment":"part"} ${li(e)}`),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},U1=["video","audio"],Po=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},q1=(s,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type!=="mediaSource"){if(s!=="mediaSource"&&e.ready()&&e.mediaSource.readyState!=="closed"&&!Po(s,e)){if(i.type!==s){if(t=q1(s,e.queue),t===null)return;i=e.queue[t]}return e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),i.doneFn?void 0:(e.queuePending[s]=null,void Si(s,e))}}else e.updating()||e.mediaSource.readyState==="closed"||(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Si("audio",e),Si("video",e))},Rp=(s,e)=>{const t=e[`${s}Buffer`],i=Np(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Tt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===dp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zt(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Np(s),r=Ei(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(Rp(s,e),zt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Ei(s);if(!zt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(h){l.errorType=F.Error.StreamingCodecsChangeError,l.error=h,h.metadata=l,t.error_=h,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,h)}}},St=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Si(s,e)},vd=(s,e)=>t=>{const i=a0(e[`${s}Buffered`]());if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const r=e.queuePending[s].doneFn;e.queuePending[s]=null,r&&r(e[`${s}Error_`])}Si(s,e)};class Mp extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Si("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=vd("video",this),this.onAudioUpdateEnd_=vd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:Tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:Tt.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?St({type:"mediaSource",sourceUpdater:this,action:Tt.removeSourceBuffer(e),name:"removeSourceBuffer"}):F.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&k.MediaSource&&k.MediaSource.prototype&&typeof k.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return k.SourceBuffer&&k.SourceBuffer.prototype&&typeof k.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?St({type:e,sourceUpdater:this,action:Tt.changeType(t),name:"changeType"}):F.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);const a=t;if(St({type:r,sourceUpdater:this,action:Tt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return zt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:gt()}videoBuffered(){return zt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:gt()}buffered(){const e=zt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():l0(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=cs){St({type:"mediaSource",sourceUpdater:this,action:Tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=cs){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:Tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=cs){this.audioBuffered().length&&this.audioBuffered().end(0)!==0?St({type:"audio",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=cs){this.videoBuffered().length&&this.videoBuffered().end(0)!==0?St({type:"video",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Po("audio",this)&&!Po("video",this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),U1.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Rp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const bd=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),j1=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Td=new Uint8Array(` + +`.split("").map(s=>s.charCodeAt(0)));class H1 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class $1 extends Io{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return gt();const e=this.subtitlesTrack_.cues;return gt([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=Td.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Td,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0||(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){or(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",t),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Yt.TIMEOUT&&this.handleTimeout_(),e.code===Yt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof k.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));n.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message,metadata:{errorType:F.Error.StreamingVttParserError,error:a}})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new k.VTTCue(a.startTime,a.endTime,a.text):a)}),C1(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if(typeof k.WebVTT!="function")throw new H1;typeof k.TextDecoder=="function"?t=new k.TextDecoder("utf8"):(t=k.WebVTT.StringDecoder(),i=!0);const r=new k.WebVTT.Parser(k,k.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=bd(a)),r.parse(a)}let n=e.bytes;i&&(n=bd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/js.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(h=>{const p=h.endTime-h.startTime,g=this.handleRollover_(h.startTime+l,t.time);h.startTime=Math.max(g,0),h.endTime=Math.max(g+p,0)}),!i.syncInfo){const h=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(h,p-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*js.ONE_SECOND_IN_TS;const r=t*js.ONE_SECOND_IN_TS;let n;for(n=r4294967296;)i+=n;return i/js.ONE_SECOND_IN_TS}}const V1=function(s,e){const t=s.cues;for(let i=0;i=r.adStartTime&&e<=r.adEndTime)return r}return null},z1=function(s,e,t=0){if(!s.segments)return;let i,r=t;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Bp{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=` +`,a=i,l=t;this.start_=a,e.forEach((h,p)=>{const g=this.storage_.get(l),y=a,w=y+h.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),I=new Sd({start:y,end:w,appended:E,segmentIndex:p});h.syncInfo=I;let v=a;const L=(h.parts||[]).map((R,M)=>{const O=v,G=v+R.duration,N=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[M]&&g.partsSyncInfo[M].isAppended),z=new Sd({start:O,end:G,appended:N,segmentIndex:p,partIndex:M});return v=G,n+=`Media Sequence: ${l}.${M} | Range: ${O} --> ${G} | Appended: ${N} +`,R.syncInfo=z,z});r.set(l,new W1(I,L)),n+=`${Op(h.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${w} | Appended: ${E} +`,l++,a=w}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Ed extends Bp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const G1=86400,so=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=To(e);r=r||0;for(let h=0;h{let n=null,a=null;r=r||0;const l=To(e);for(let h=0;h=w)&&(a=w,n={time:y,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l=y)&&(a=y,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class X1 extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Bp,i=new Ed(t),r=new Ed(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return so.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:h,strategy:p}=l,{segmentIndex:g,time:y}=h;if(g<0)continue;const w=y,E=w+e.segments[g].duration;if(this.logger_(`Strategy: ${p}. Current time: ${r}. selected segment: ${g}. Time: [${w} -> ${E}]}`),r>=w&&r0&&(r.time*=-1),Math.abs(r.time+cr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;lG1)F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a,l,h=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")h={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=h,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${h.time}] [mapping: ${h.mapping}]`)),a=e.startOfSegment,l=t.end+h.mapping;else{if(!h)return!1;a=t.start+h.mapping,l=t.end+h.mapping}return n&&(n.start=a,n.end=l),(!r.start||ah){let p;p=l<0?i.start-cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:p,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class Y1 extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const K1=Ep(Cp(function(){var s=function(){function I(){this.listeners={}}var v=I.prototype;return v.on=function(L,R){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(R)},v.off=function(L,R){if(!this.listeners[L])return!1;var M=this.listeners[L].indexOf(R);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(M,1),M>-1},v.trigger=function(L){var R=this.listeners[L];if(R)if(arguments.length===2)for(var M=R.length,O=0;O>7))^O]=O;for(G=N=0;!R[G];G^=H||1,N=U[N]||1)for(B=N^N<<1^N<<2^N<<3^N<<4,B=B>>8^255&B^99,R[G]=B,M[B]=G,A=z[S=z[H=z[G]]],W=16843009*A^65537*S^257*H^16843008*G,$=257*z[B]^16843008*B,O=0;O<4;O++)v[O][G]=$=$<<24^$>>>8,L[O][B]=W=W<<24^W>>>8;for(O=0;O<5;O++)v[O]=v[O].slice(0),L[O]=L[O].slice(0);return I};let i=null;class r{constructor(v){let L,R,M;i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];const O=this._tables[0][4],G=this._tables[1],N=v.length;let z=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");const U=v.slice(0),H=[];for(this._key=[U,H],L=N;L<4*N+28;L++)M=U[L-1],(L%N==0||N===8&&L%N==4)&&(M=O[M>>>24]<<24^O[M>>16&255]<<16^O[M>>8&255]<<8^O[255&M],L%N==0&&(M=M<<8^M>>>24^z<<24,z=z<<1^283*(z>>7))),U[L]=U[L-N]^M;for(R=0;L;R++,L--)M=U[3&R?L:L-4],H[R]=L<=4||R<4?M:G[0][O[M>>>24]]^G[1][O[M>>16&255]]^G[2][O[M>>8&255]]^G[3][O[255&M]]}decrypt(v,L,R,M,O,G){const N=this._key[1];let z,U,H,S=v^N[0],A=M^N[1],B=R^N[2],$=L^N[3];const W=N.length/4-2;let te,J=4;const oe=this._tables[1],Q=oe[0],Y=oe[1],ie=oe[2],se=oe[3],ee=oe[4];for(te=0;te>>24]^Y[A>>16&255]^ie[B>>8&255]^se[255&$]^N[J],U=Q[A>>>24]^Y[B>>16&255]^ie[$>>8&255]^se[255&S]^N[J+1],H=Q[B>>>24]^Y[$>>16&255]^ie[S>>8&255]^se[255&A]^N[J+2],$=Q[$>>>24]^Y[S>>16&255]^ie[A>>8&255]^se[255&B]^N[J+3],J+=4,S=z,A=U,B=H;for(te=0;te<4;te++)O[(3&-te)+G]=ee[S>>>24]<<24^ee[A>>16&255]<<16^ee[B>>8&255]<<8^ee[255&$]^N[J++],z=S,S=A,A=B,B=$,$=z}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(v){this.jobs.push(v),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(I){return I<<24|(65280&I)<<8|(16711680&I)>>8|I>>>24},l=function(I,v,L){const R=new Int32Array(I.buffer,I.byteOffset,I.byteLength>>2),M=new r(Array.prototype.slice.call(v)),O=new Uint8Array(I.byteLength),G=new Int32Array(O.buffer);let N,z,U,H,S,A,B,$,W;for(N=L[0],z=L[1],U=L[2],H=L[3],W=0;W{const R=I[L];y(R)?v[L]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:v[L]=R}),v};self.onmessage=function(I){const v=I.data,L=new Uint8Array(v.encrypted.bytes,v.encrypted.byteOffset,v.encrypted.byteLength),R=new Uint32Array(v.key.bytes,v.key.byteOffset,v.key.byteLength/4),M=new Uint32Array(v.iv.bytes,v.iv.byteOffset,v.iv.byteLength/4);new h(L,R,M,function(O,G){self.postMessage(E({source:v.source,decrypted:G}),[G.buffer])})}}));var Q1=Sp(K1);const J1=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Fp=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Up=(s,e)=>{e.activePlaylistLoader=s,s.load()},Z1=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,h=r.lastGroup_;a&&h&&a.id===h.id||(r.lastGroup_=a,r.lastTrack_=n,Fp(t,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(t.resyncLoader(),Up(a.playlistLoader,r)):l&&i.resetEverything()))},e2=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},t2=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),h=n.activePlaylistLoader,p=n.lastTrack_;if((!p||!a||p.id!==a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Fp(i,n),l)){if(l.isMainPlaylist){if(!a||!p||a.id===p.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();return g.media()===y?void 0:(n.logger_(`track change. Switching main audio from ${p.id} to ${a.id}`),t.pause(),r.resetEverything(),void g.fastQualityChange_(y))}if(s==="AUDIO"){if(!l.playlistLoader)return r.setAudio(!0),void r.resetEverything();i.setAudio(!0),r.setAudio(!1)}h!==l.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Up(l.playlistLoader,n)}},In={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,l=t.tracks[a];if(r!==l){F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in t.tracks)t.tracks[h].enabled=t.tracks[h]===l;t.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Cd={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))}},s2={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:h,logger_:p}},mainPlaylistLoader:g}=e,y=wr(g.main);a[s]&&Object.keys(a[s]).length!==0||(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const w in a[s]){l[w]||(l[w]=[]);for(const E in a[s][w]){let I,v=a[s][w][E];if(y?(p(`AUDIO group '${w}' label '${E}' is a main playlist`),v.isMainPlaylist=!0,I=null):I=i==="vhs-json"&&v.playlists?new mi(v.playlists[0],t,n):v.resolvedUri?new mi(v.resolvedUri,t,n):v.playlists&&i==="dash"?new xo(v.playlists[0],t,n,g):null,v=we({id:E,playlistLoader:I},v),Cd[s](s,v.playlistLoader,e),l[w].push(v),h[E]===void 0){const L=new F.AudioTrack({id:E,kind:J1(v),enabled:!1,language:v.language,default:v.default,label:E});h[E]=L}}}r.on("error",In[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:h,tracks:p}},mainPlaylistLoader:g}=e;for(const y in l[s]){h[y]||(h[y]=[]);for(const w in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][w].forced)continue;let E,I=l[s][y][w];if(r==="hls")E=new mi(I.resolvedUri,i,a);else if(r==="dash"){if(!I.playlists.filter(v=>v.excludeUntil!==1/0).length)return;E=new xo(I.playlists[0],i,a,g)}else r==="vhs-json"&&(E=new mi(I.playlists?I.playlists[0]:I.resolvedUri,i,a));if(I=we({id:w,playlistLoader:E},I),Cd[s](s,I.playlistLoader,e),h[y].push(I),p[w]===void 0){const v=t.addRemoteTextTrack({id:w,kind:"subtitles",default:I.default&&I.autoselect,language:I.language,label:w},!1).track;p[w]=v}}}n.on("error",In[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const h=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const p=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(p[g.instreamId]&&(g=we(g,p[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(we({id:l},h)),n[l]===void 0){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=y}}}}},qp=(s,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&wr(e.main))for(let h=0;hh.id===t.id)[0]||null},r2={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},n2=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},a2=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(p=>{s2[p](p,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(p=>{e[p].activeGroup=i2(p,s),e[p].activeTrack=r2[p](p,s),e[p].onGroupChanged=Z1(p,s),e[p].onGroupChanging=e2(p,s),e[p].onTrackChanged=t2(p,s),e[p].getActiveGroup=n2(p,s)});const l=e.AUDIO.activeGroup();if(l){const p=(l.filter(g=>g.default)[0]||l[0]).id;e.AUDIO.tracks[p].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const p in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[p])},o2=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:cs,activeTrack:cs,getActiveGroup:cs,onGroupChanged:cs,onTrackChanged:cs,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class wd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class l2 extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new wd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=It("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=vt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410)return this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(a.status===429){const p=a.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${p} seconds.`),void this.startTTLTimeout_(parseInt(p,10))}return this.logger_(`manifest failed to load ${n}.`),void this.startTTLTimeout_()}let l;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{l=JSON.parse(this.request_.responseText)}catch(p){const g={errorType:F.Error.StreamingContentSteeringParserError,error:p};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new k.URL(e),i=new k.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(k.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new k.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(i=>{for(const r of i)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=k.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){k.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new wd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const u2=10;let us;const h2=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],d2=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},c2=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:h}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const p=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return h(`${p} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!pi(e,t).length;if(!s.endList)return g||typeof s.partTargetDuration!="number"?(h(`${p} as current playlist is live`),!0):(h(`not ${p} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const y=Zo(e,t),w=l?Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Je.MAX_BUFFER_LOW_WATER_LINE;if(aI)&&y>=r){let v=`${p} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(v+=` and next bandwidth > current bandwidth (${E} > ${I})`),h(v),!0}return h(`not ${p} as no switching criteria met`),!1};class p2 extends F.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:h,enableLowInitialPlaylist:p,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:w,leastPixelDiffSelector:E,captionServices:I,experimentalUseMMS:v}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:L}=e;L==null&&(L=1/0),us=a,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=h,this.maxPlaylistRetries=L,this.enableLowInitialPlaylist=p,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:L,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=o2(),v&&k.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new k.ManagedMediaSource,F.log("Using ManagedMediaSource")):k.MediaSource&&(this.mediaSource=new k.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=gt(),this.hasPlayed_=!1,this.syncController_=new X1(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Q1,this.sourceUpdater_=new Mp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Y1,this.keyStatusMap_=new Map;const R={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new xo(t,this.vhs_,we(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new mi(t,this.vhs_,we(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Io(we(R,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Io(we(R,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new $1(we(R,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,N)=>{function z(){r.off("vttjserror",U),G()}function U(){r.off("vttjsloaded",z),N()}r.one("vttjsloaded",z),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const M=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new l2(this.vhs_.xhr,M),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),h2.forEach(G=>{this[G+"_"]=d2.bind(this,G)}),this.logger_=It("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const n=(i.length?i[0].playlists:i.playlists).filter(a=>a.attributes.serviceLocation===r);n.length&&this.mediaTypes_[e].activePlaylistLoader.media(n[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=k.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(k.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const h in l)if(l[h].default){n={label:h};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const h=i[l][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let p=0;p{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),a2({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,t=>{this.player_.trigger(ze({},t))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),us.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return c2({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const t=this.audioSegmentLoader_.pendingSegment_;if(!t||!t.segment||!t.segment.syncInfo)return;const i=t.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:u2}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(t=>{this.mainSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.audioSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.subtitleSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;const i=us.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-r<=Xt;const a=n.end(n.length-1);return a-r<=Xt&&i-a<=Xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Qn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),v=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},v)}let E=!1;r.forEach(I=>{if(I===e)return;const v=I.excludeUntil;v!==void 0&&v!==1/0&&(E=!0,delete I.excludeUntil)}),E&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;l=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const p=t.internal?this.logger_:F.log.warn,g=t.message?" "+t.message:"";p(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=h.targetDuration/2*1e3||5e3,w=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=y;return this.switchMedia_(h,"exclude",a||w)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];!l||e!==a&&e!=="all"||i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=pi(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:us.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null)return;const r=this.mainPlaylistLoader_.main,n=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),i===null||(e=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,l;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=gt([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=mr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||df),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||qu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||qu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a=(p,g)=>p?lr(g):Da(g),l={};let h;if(["video","audio"].forEach(function(p){if(r.hasOwnProperty(p)&&!a(e[p].isFmp4,r[p])){const g=e[p].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(r[p]),p==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){const p=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===p&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${p} as ${h} does not support codec(s): "${r.audio}"`)}if(!Object.keys(l).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const p=[];if(["video","audio"].forEach(g=>{const y=(Vt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(Vt(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.toLowerCase()&&p.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),p.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${p.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const p=Object.keys(l).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${l[y].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:p},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=mr(this.main,r),a=[];!n.audio||Da(n.audio)||lr(n.audio)||a.push(`audio codec ${n.audio}`),!n.video||Da(n.video)||lr(n.video)||a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=kn(Vt(e)),n=cd(r),a=r.video&&Vt(r.video)[0]||null,l=r.audio&&Vt(r.audio)[0]||null;Object.keys(i).forEach(h=>{const p=i[h];if(t.indexOf(p.id)!==-1||p.excludeUntil===1/0)return;t.push(p.id);const g=[],y=mr(this.mainPlaylistLoader_.main,p),w=cd(y);if(y.audio||y.video){if(w!==n&&g.push(`codec count "${w}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Vt(y.video)[0]||null,I=y.audio&&Vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),I&&l&&I.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${I.type}" !== "${l.type}"`)}g.length&&(p.excludeUntil=1/0,this.logger_(`excluding ${p.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),z1(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Je.GOAL_BUFFER_LENGTH,i=Je.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Je.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Je.BUFFER_LOW_WATER_LINE,i=Je.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Je.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Je.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){gd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),E1({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();gd(this.inbandTextTracks_,e,this.tech_),b1({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,t=>{this.trigger(ze({},t))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const r of e.playlists){const n=r.attributes.serviceLocation;if(n&&(i.push(n),!t.has(n)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let r=!1;Object.keys(t).forEach(n=>{const a=t[n],l=this.pathwayAttribute_(a),h=l&&e!==l;a.excludeUntil===1/0&&a.lastExcludeReason_==="content-steering"&&!h&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const p=!a.excludeUntil&&a.excludeUntil!==1/0;!i.has(a.id)&&h&&p&&(i.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(n=>{const a=this.mediaTypes_[n];if(a.activePlaylistLoader){const l=a.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[r,n]of t.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(r));for(const[r,n]of i.entries()){const a=t.get(r);a?this.equalPathwayClones_(a,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(l=>l.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(l=>{this.mainPlaylistLoader_.addClonePathway(n,l)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&h&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=(typeof e=="string"?e:j1(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const m2=(s,e,t)=>i=>{const r=s.main.playlists[e],n=tl(r),a=Qn(r);if(i===void 0)return a;i?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i===a||n||(t(r),i?s.trigger({type:"renditionenabled",metadata:l}):s.trigger({type:"renditiondisabled",metadata:l})),i};class g2{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=mr(r.main(),t),this.playlist=t,this.id=i,this.enabled=m2(e.playlists,t.id,n)}}const f2=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=wr(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!tl(i)).map((i,r)=>new g2(s,i,i.id)):[]}},Ad=["seeking","seeked","pause","playing","error"];class y2 extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],h={};l.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const p=g=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=()=>p("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Ad,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Ad,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=h0(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};return t.trigger({type:"bufferedrangeschanged",metadata:a}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Hs(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(gt([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const w=e.start(0);i=w+(w===e.end(0)?0:Xt)}if(i!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Zc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const r=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,l=r.videoBuffer?r.videoBuffered():null,h=this.media(),p=h.partTargetDuration?h.partTargetDuration:2*(h.targetDuration-Gt),g=[a,l];for(let w=0;w ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Kr(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xt;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const _2={errorInterval:30,getSource(s){return s(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},jp=function(s,e){let t=0,i=0;const r=we(_2,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<1e3*r.errorInterval)s.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&typeof r.getSource=="function")return t=Date.now(),r.getSource.call(s,a);F.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",h)},p=function(g){h(),jp(s,g)};s.on("error",l),s.on("dispose",h),s.reloadSourceOnError=p},v2=function(s){jp(this,s)};var Hp="3.14.2",b2="7.0.3",T2="1.3.0",S2="7.2.0",E2="4.0.2";const qe={PlaylistLoader:mi,Playlist:bt,utils:I0,STANDARD_PLAYLIST_SELECTOR:md,INITIAL_PLAYLIST_SELECTOR:g1,lastBandwidthSelector:md,movingAverageBandwidthSelector:p1,comparePlaylistBandwidth:rl,comparePlaylistResolution:c1,xhr:gp()};Object.keys(Je).forEach(s=>{Object.defineProperty(qe,s,{get:()=>(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Je[s]),set(e){F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0?F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`):Je[s]=e}})});const $p="videojs-vhs",Vp=function(s,e){const t=e.media();let i=-1;for(let r=0;r{s.addQualityLevel(t)}),Vp(s,e.playlists)};qe.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w2=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=kn(Vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Ei(i.video),n=Ei(i.audio),a={};for(const l in s)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof s[l]=="string"&&(a[l].url=s[l]);return we(s,a)},A2=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),x2=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=A2(r,Object.keys(e)),a=[],l=[];return n.forEach(h=>{l.push(new Promise((p,g)=>{s.tech_.one("keysessioncreated",p)})),a.push(new Promise((p,g)=>{s.eme.initializeMediaKeys({keySystems:h},y=>{y?g(y):p()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},k2=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=w2(e,t,i);return!!r&&(s.currentSource().keySystems=r,!(r&&!s.eme)||(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},zp=()=>{if(!k.localStorage)return null;const s=k.localStorage.getItem($p);if(!s)return null;try{return JSON.parse(s)}catch{return null}},D2=s=>{if(!k.localStorage)return!1;let e=zp();e=e?we(e,s):s;try{k.localStorage.setItem($p,JSON.stringify(e))}catch{return!1}return e},I2=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Wp=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Gp=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Xp=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Yp=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};qe.supportsNativeHls=function(){if(!re||!re.createElement)return!1;const s=re.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(s.canPlayType(e))}):!1}(),qe.supportsNativeDash=!!(re&&re.createElement&&F.getTech("Html5").isSupported())&&/maybe|probably/i.test(re.createElement("video").canPlayType("application/dash+xml")),qe.supportsTypeNatively=s=>s==="hls"?qe.supportsNativeHls:s==="dash"&&qe.supportsNativeDash,qe.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},qe.xhr.onRequest=function(s){Wp(qe.xhr,s)},qe.xhr.onResponse=function(s){Gp(qe.xhr,s)},qe.xhr.offRequest=function(s){Xp(qe.xhr,s)},qe.xhr.offResponse=function(s){Yp(qe.xhr,s)};const P2=F.getComponent("Component");class Kp extends P2{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(re,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=re.fullscreenElement||re.webkitFullscreenElement||re.mozFullScreenElement||re.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=we(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=zp();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Je.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Je.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{this.source_[i]!==void 0&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=I2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=qe,this.options_.sourceType=qd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new p2(this.options_);const i=we({liveRangeSafeTimeDelta:Xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new y2(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a!="object"||a.code?typeof a=="string"&&(a={message:a,code:3}):a.code=3,n.error(a)});const r=this.options_.bufferBasedABR?qe.movingAverageBandwidthSelector(.55):qe.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=qe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const h=1e3*a.downlink*1e3;n=h>=l&&n>=l?Math.max(n,h):h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return a=this.throughput>0?1/this.throughput:0,Math.floor(1/(n+a))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Hs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Hs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&D2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f2(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=k.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x2({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=k2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{C2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Vp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Hp,"mux.js":b2,"mpd-parser":T2,"m3u8-parser":S2,"aes-decrypter":E2}}version(){return this.constructor.version()}canChangeType(){return Mp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&k.URL.revokeObjectURL&&(k.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return B0({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return bp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Wp(this.xhr,e)},this.xhr.onResponse=e=>{Gp(this.xhr,e)},this.xhr.offRequest=e=>{Xp(this.xhr,e)},this.xhr.offResponse=e=>{Yp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["gapjumped","playedrangeschanged"];["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.playlistController_.on(t,i=>{this.player_.trigger(ze({},i))})}),e.forEach(t=>{this.playbackWatcher_.on(t,i=>{this.player_.trigger(ze({},i))})})}}const Pn={name:"videojs-http-streaming",VERSION:Hp,canHandleSource(s,e={}){const t=we(F.options,e);return!(!t.vhs.experimentalUseMMS&&!lr("avc1.4d400d,mp4a.40.2",!1))&&Pn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=we(F.options,t);return e.vhs=new Kp(s,e,i),e.vhs.xhr=gp(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=qd(s);if(!t)return"";const i=Pn.getOverrideNative(e);return!qe.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}};lr("avc1.4d400d,mp4a.40.2",!0)&&F.getTech("Html5").registerSourceHandler(Pn,0),F.VhsHandler=Kp,F.VhsSourceHandler=Pn,F.Vhs=qe,F.use||F.registerComponent("Vhs",qe),F.options.vhs=F.options.vhs||{},F.getPlugin&&F.getPlugin("reloadSourceOnError")||F.registerPlugin("reloadSourceOnError",v2);let Re=class extends Lo{constructor(){super(),this._defaultConfigs={autoplay:!1,fluid:!1,fullscreen:!1,loop:!1,muted:!1,preload:"auto",responsive:!1,startTime:0},this._prevPlayingState=!1,this.currentMetadata=null,this.element=null,this.mimeType=null,this.sensorModel=null,this.state="not-ready",this.waitingTimestamp=null,this._initController=()=>{!this._controller&&this.playerUrl&&(this.element=document.createElement("video"),F.log.level("error"),this._controller=F(this.element,this._defaultConfigs),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.ready(this._handleReady),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart),this._controller.on("play",this._handlePlay),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady))},this._handleReady=()=>{this.state="ready"},this._handleCanPlay=()=>{this._prevPlayingState=this.state==="playing",this.state="can-play"},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;const s=this.subtitleTrack?.activeCues[0],e=s.text?JSON.parse(s.text):null;if(!e?.data?.length)return;const t=e.data[0]?.value??[],i=new Map;for(const r of t)Array.isArray(r.value)?r.tagId===90064?i.set(r.tagId,r):r.value.forEach(n=>{i.set(n.tagId,n)}):i.set(r.tagId,r);i.set(ne.EsriVideoWidth,{name:"Video Width",tagId:ne.EsriVideoWidth,value:this._controller?.videoWidth()}),i.set(ne.EsriVideoHeight,{name:"Video Height",tagId:ne.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(i),this.sensorModel=new Mg({videoMetadata:this.currentMetadata})},this._handleDataLoaded=()=>{this.state="data-loaded",this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleDurationChange=()=>this.notifyChange("duration"),this._handleEnded=()=>{if(!this.loop)return this._set("ended",!0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),void(this.state="can-play");this.setCurrentTime(0),this.play()},this._handleError=()=>{tg.getLogger(this).error("video stream error ::",this._controller?.error())},this._handleLoadStart=()=>{this.state="can-play"},this._handleLoadedMetadata=()=>{this.notifyChange("subtitleTrack"),this.notifyChange("buffered")},this._handlePlay=()=>this.notifyChange("ended"),this._handleTimeUpdate=()=>{this.notifyChange("currentTime"),this.notifyChange("buffered"),this.notifyChange("bufferedPercent"),this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime()},this._handleXHRhooksReady=()=>{const s=e=>(e.xhr=new ui,e);this._controller?.tech(!0)?.vhs.xhr.onRequest(s)}}initialize(){this.addHandles([nn(()=>this.playerUrl,s=>{s&&(this._initController(),this.mimeType=xg(s),this._controller?.src({type:this.mimeType,src:this.playerUrl}))},xd),nn(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")})]),this.addHandles(sg(()=>this.subtitleTrack,"cuechange",this._handleCueChange))}destroy(){this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(s){this._controller?.ended(s),this._set("ended",s)}get loop(){return this._controller?.loop()??this._get("loop")??!1}set loop(s){this._controller?.loop(s),this._set("loop",s)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(s){this._controller?.muted(s),this._set("muted",s)}get playerUrl(){return this._controller?.src()||""}set playerUrl(s){this._set("playerUrl",s)}get playing(){return!this.ended&&(this.state==="can-play"?this._prevPlayingState:this.state==="playing")}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(s){this._controller?.playbackRate(s),this._set("rate",s)}get started(){return this._controller?.hasStarted()||!1}get subtitleTrack(){const s=this._controller?.textTracks();return s?.length?Array.from(s).find(e=>e.kind==="subtitles"):null}get waiting(){return!this.waitingTimestamp&&(this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1))}pause(){this._controller?.pause(),this.state="paused"}play(){this._controller?.play(),this.state="playing"}reset(){this._controller&&(this.pause(),this.setCurrentTime(0),this._set("ended",!0))}setCurrentTime(s){const e=kd(s,0,this.duration);this._controller?.currentTime(e),this.notifyChange("currentTime")}};K([Z()],Re.prototype,"buffered",null),K([Z()],Re.prototype,"bufferedPercent",null),K([Z({readOnly:!0})],Re.prototype,"currentTime",null),K([Z()],Re.prototype,"currentMetadata",void 0),K([Z({readOnly:!0})],Re.prototype,"duration",null),K([Z()],Re.prototype,"element",void 0),K([Z({readOnly:!0})],Re.prototype,"ended",null),K([Z()],Re.prototype,"loop",null),K([Z()],Re.prototype,"mimeType",void 0),K([Z()],Re.prototype,"muted",null),K([Z()],Re.prototype,"playerUrl",null),K([Z({readOnly:!0})],Re.prototype,"playing",null),K([Z()],Re.prototype,"rate",null),K([Z()],Re.prototype,"sensorModel",void 0),K([Z({readOnly:!0})],Re.prototype,"started",null),K([Z()],Re.prototype,"state",void 0),K([Z()],Re.prototype,"subtitleTrack",null),K([Z({readOnly:!0})],Re.prototype,"videoHeight",void 0),K([Z({readOnly:!0})],Re.prototype,"videoWidth",void 0),K([Z({readOnly:!0})],Re.prototype,"waiting",null),K([Z()],Re.prototype,"waitingTimestamp",void 0),Re=K([Ds("esri.layers.video.VideoController")],Re);const L2=Re;let pe=class extends ng(og(ig(ag(rg)))){constructor(s){super(s),this._trailPoints=[],this.capabilities=null,this.connectionInfo=null,this.controller=new L2,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCount=null,this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=Zr.WGS84,this.telemetryDisplay=null,this.title=null,this.type="video",this.url=null,this.videoLayersInfo=null,this.videoTimeExtent=null}initialize(){this.telemetryDisplay=new Dd({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([nn(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),nn(()=>this.telemetry?.sensorLocation,s=>this._setSensorTrail(s),xd)])}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this._fetchService(e)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(s,e){return hg(e)}readConnectionInfo(s,e){const t=Object.values(e.connectionUrl);return t?.length&&(this.controller.playerUrl=t[0]),e.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return wg(this.metadata)}get groundControlPoints(){return Cg(this.metadata)}get loop(){return this.controller.loop}set loop(s){this.controller.loop=s}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(s){this.controller.muted=s}get playbackRate(){return this.controller.rate}set playbackRate(s){this.controller.rate=s}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return Eg(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(s,e){return kg(e)}get videoWidth(){return this.controller?.videoWidth}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(s){if(!this.duration)return;const e=kd(s,0,this.duration);this.controller.setCurrentTime(e)}toGround(s,e){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(s,e):null}toVideo(s){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const e=this.controller.sensorModel.transformGeoToImage(s.x,s.y,s.z);return{x:e[0],y:e[1]}}async _fetchService(s){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const e=lg(this.parsedUrl?.path);if(e==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let t=null;const{data:i,ssl:r}=await ro(e.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:s}),n=i;if(this.url=e.url.path,r&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=e?.sublayer;if(a==null&&n.layers?.length&&(a=n.layers[0].id),a==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${e.url.path}/${a}`,t=await ro(this.url,{query:{f:"json",...this.customParameters},signal:s});const l={...n,...t.data};this.sourceJSON=l,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(s){if(!s)return;const e=Sg(s,this._trailPoints);this._trailPoints=[...e];const t=this._trailPoints.map(r=>r.toArray()),i=new rn({hasZ:s.hasZ,paths:[t]});this.telemetry.sensorTrail=i.clone()}};K([Z({readOnly:!0})],pe.prototype,"buffered",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),K([gi("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),K([Z({readOnly:!0})],pe.prototype,"connectionInfo",void 0),K([gi("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),K([Z()],pe.prototype,"controller",void 0),K([Z({type:String})],pe.prototype,"copyright",void 0),K([Z({readOnly:!0,type:Date})],pe.prototype,"created",void 0),K([Z({type:Number})],pe.prototype,"currentTime",null),K([Z({type:String})],pe.prototype,"description",void 0),K([Z({type:Number})],pe.prototype,"duration",null),K([Z({readOnly:!0})],pe.prototype,"elevationSource",void 0),K([Z({type:Boolean})],pe.prototype,"ended",null),K([Z({type:_g})],pe.prototype,"frame",void 0),K([Z({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),K([Z({type:zl})],pe.prototype,"fullExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),K([Z({readOnly:!0})],pe.prototype,"groundControlPoints",null),K([Z({type:zl})],pe.prototype,"initialExtent",void 0),K([Z({readOnly:!0,json:{read:{source:"id"}}})],pe.prototype,"layerId",void 0),K([Z({type:Boolean})],pe.prototype,"loop",null),K([Z({readOnly:!0})],pe.prototype,"metadata",null),K([Z({readOnly:!0})],pe.prototype,"mimeType",null),K([Z({type:Boolean})],pe.prototype,"muted",null),K([Z({type:fg})],pe.prototype,"playbackInfo",void 0),K([Z({type:Number})],pe.prototype,"playbackRate",null),K([Z({type:String})],pe.prototype,"playerUrl",null),K([Z({readOnly:!0})],pe.prototype,"playing",null),K([Z({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),K([Z({readOnly:!0})],pe.prototype,"qualities",void 0),K([Z({readOnly:!0})],pe.prototype,"serviceItemId",void 0),K([Z()],pe.prototype,"sourceJSON",void 0),K([Z({readOnly:!0})],pe.prototype,"sourceQuality",void 0),K([Z({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),K([Z()],pe.prototype,"spatialReference",void 0),K([Z({readOnly:!0,type:String})],pe.prototype,"state",null),K([Z({readOnly:!0,type:no})],pe.prototype,"telemetry",null),K([Z({type:Dd})],pe.prototype,"telemetryDisplay",void 0),K([Z({readOnly:!1,json:{read:{source:"name"}}})],pe.prototype,"title",void 0),K([Z({readOnly:!0})],pe.prototype,"type",void 0),K([Z(ug)],pe.prototype,"url",void 0),K([Z({readOnly:!0})],pe.prototype,"videoElement",null),K([Z({readOnly:!0})],pe.prototype,"videoHeight",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),K([gi("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),K([Z({readOnly:!0,nonNullable:!1,json:{read:{reader:Tg,source:"time"}}})],pe.prototype,"videoTimeExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"videoWidth",null),K([Z({readOnly:!0})],pe.prototype,"waiting",null),pe=K([Ds("esri.layers.VideoLayer")],pe);const rv=pe;export{rv as default}; diff --git a/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-iHSXGJEF.js b/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-iHSXGJEF.js deleted file mode 100644 index 645931ec..00000000 --- a/custom-toc-separator/assets/VideoLayer-Dxs-NJSn-iHSXGJEF.js +++ /dev/null @@ -1,204 +0,0 @@ -import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dk as Wl,hZ as ni,a1 as tg,ai as sg,dg as ga}from"./story-OUarUCIt.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as rg}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as ng}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{Z as ug}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r -`;return s}getResponseHeader(s){return(this._response||this._error)?.getHeader?.(s)??null}open(s,e){switch(this._sendFlag=!1,this._options={},s){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=e,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(s){throw new Error("overrideMimeType not implemented")}send(s){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");const e=this._options;s instanceof URLSearchParams?e.body=s.toString():e.body=s,e.responseType=this.responseType===""?"text":this.responseType==="arraybuffer"?"array-buffer":this.responseType,e.signal=this._abortController?.signal,this.timeout&&(e.timeout=this.timeout),this.withCredentials&&(e.withCredentials=!0),ro(this._url,e).then(t=>{this._response=t,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(t=>{this._sendFlag&&(this._error=t.details,this._updateReadyState(this.DONE),eg(t)?this._dispatchProgressEvent("timeout"):t.name==="AbortError"?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(s,e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[s]=e}_dispatchProgressEvent(s){const e=new ProgressEvent(s,{loaded:0,total:0});this.dispatchEvent(e),this[`on${s}`]?.(e)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(s){if(this._readyState!==s&&(this._readyState=s,s!==this.UNSENT)){const e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}};ui.UNSENT=0,ui.OPENED=1,ui.HEADERS_RECEIVED=2,ui.LOADING=3,ui.DONE=4;let Bt=class extends Ln(Nn){constructor(s){super(s),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(s,e){return e.end!=null?new Date(e.end):null}writeEnd(s,e){e.end=s?s.getTime():null}readStart(s,e){return e.start!=null?new Date(e.start):null}writeStart(s,e){e.start=s?s.getTime():null}};K([Z({type:Number,json:{write:{allowNull:!0}}})],Bt.prototype,"duration",void 0),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"end",void 0),K([gi("end")],Bt.prototype,"readEnd",null),K([io("end")],Bt.prototype,"writeEnd",null),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"start",void 0),K([gi("start")],Bt.prototype,"readStart",null),K([io("start")],Bt.prototype,"writeStart",null),K([Z({type:String})],Bt.prototype,"timezone",void 0),Bt=K([Ds("esri.layers.support.VideoTimeExtent")],Bt);const vg=Bt,_a="application/x-mpegURL",bg="video/mp4",ne={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function Tg(s){const{duration:e,end:t,start:i,timezone:r="UTC"}=s||{};return typeof e!="number"?null:new vg({duration:e||null,end:typeof t=="number"?new Date(t):null,start:typeof i=="number"?new Date(i):null,timezone:r})}function Sg(s,e){const t=[...e],i=t.findIndex(r=>r.equals(s));return i>-1&&t.splice(i),t.push(s),t}function Eg(s){if(!s?.size)return new no;const e=Rg(s),t=Ag(s),i=Pg(s),r=Ng(e,t);return new no({frameCenter:t,frameOutline:i,lineOfSight:r,sensorLocation:e})}function Cg(s){return s?.size?s.get(ne.EsriGroundControlPoints)?.value??null??null:null}function wg(s){return s?.size?s.get(ne.EsriHorizonPixelPack)?.value??null:null}function Ag(s){return Dg(s)??Ig(s)}function xg(s){if(!s)return _a;let e="";const t=new RegExp(/\.(\w{3,4})(?:$|\?)/i),i=s?s.match(t):[];return i?.length?(e=i[0],e.toLowerCase().replaceAll(".","")==="mp4"?bg:_a):_a}function kg(s){const e=s?.layers;return e?.length?e.map(t=>({layerId:t.id,posterUrl:t.poster,sourceType:t.serviceType,title:t.name,type:t.type||"Video Layer"})):[]}function Dg(s){return s&&s.has(ne.EsriFrameCenterLatitude)&&s.has(ne.EsriFrameCenterLongitude)?new Jt({x:s.get(ne.EsriFrameCenterLongitude).value,y:s.get(ne.EsriFrameCenterLatitude).value,z:s.get(ne.FrameCenterElevation).value}):null}function Ig(s){return s&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)?new Jt({x:s.get(ne.FrameCenterLongitude)?.value,y:s.get(ne.FrameCenterLatitude)?.value,z:s.get(ne.FrameCenterElevation)?.value}):null}function Pg(s){if(!s)return null;const e=s.get(ne.EsriFrameOutline)?.value;return e?On.fromJSON(e.geometry):Lg(s)??Og(s)}function Lg(s){if(!(s.has(ne.EsriCornerLatitudePt1)&&s.has(ne.EsriCornerLongitudePt1)&&s.has(ne.EsriCornerLatitudePt2)&&s.has(ne.EsriCornerLongitudePt2)&&s.has(ne.EsriCornerLatitudePt3)&&s.has(ne.EsriCornerLongitudePt3)&&s.has(ne.EsriCornerLatitudePt4)&&s.has(ne.EsriCornerLongitudePt4)))return null;const e=[s.get(ne.EsriCornerLongitudePt1)?.value,s.get(ne.EsriCornerLatitudePt1)?.value],t=[s.get(ne.EsriCornerLongitudePt2)?.value,s.get(ne.EsriCornerLatitudePt2)?.value],i=[s.get(ne.EsriCornerLongitudePt3)?.value,s.get(ne.EsriCornerLatitudePt3)?.value],r=[s.get(ne.EsriCornerLongitudePt4)?.value,s.get(ne.EsriCornerLatitudePt4)?.value];return new On({rings:[[e,t,i,r]]})}function Og(s){if(!(s.has(ne.OffsetCorner1Latitude)&&s.has(ne.OffsetCorner1Longitude)&&s.has(ne.OffsetCorner2Latitude)&&s.has(ne.OffsetCorner2Longitude)&&s.has(ne.OffsetCorner3Latitude)&&s.has(ne.OffsetCorner3Longitude)&&s.has(ne.OffsetCorner4Latitude)&&s.has(ne.OffsetCorner4Longitude)&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)))return null;const e=s.get(ne.FrameCenterLatitude)?.value,t=s.get(ne.FrameCenterLongitude)?.value,i=e+s.get(ne.OffsetCorner1Latitude)?.value,r=t+s.get(ne.OffsetCorner1Longitude)?.value,n=e+s.get(ne.OffsetCorner2Latitude)?.value,a=t+s.get(ne.OffsetCorner2Longitude)?.value,l=e+s.get(ne.OffsetCorner3Latitude)?.value,h=t+s.get(ne.OffsetCorner3Longitude)?.value,p=e+s.get(ne.OffsetCorner4Latitude)?.value,g=t+s.get(ne.OffsetCorner4Longitude)?.value;return new On({rings:[[[r,i],[a,n],[h,l],[g,p]]]})}function Ng(s,e){if(!s||!e)return null;const t=[s.x,s.y,s.z??0],i=[e.x,e.y,e.z??0];return new rn({paths:[[t,i]]})}function Rg(s){if(!s?.size)return null;if(s.has(ne.EsriSensorPosition)){const e=s.get(ne.EsriSensorPosition)?.value;if(e)return Jt.fromJSON(e.geometry)}return s.has(ne.SensorLongitude)&&s.has(ne.SensorLatitude)&&s.has(ne.SensorTrueAltitude)?new Jt({x:s.get(ne.SensorLongitude)?.value,y:s.get(ne.SensorLatitude)?.value,z:s.get(ne.SensorTrueAltitude)?.value}):null}const ft=Math.PI/180;let Qe=class extends Lo{constructor(s){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const i=t[0],r=t[1],n=t[2];return dg(i[0],r[0],n[0],i[1],r[1],n[1],i[2],r[2],n[2])},this._multiplyMat3=(t,i)=>{const r=Gl();return cg(r,t,i),r},this._transposeMat3=t=>{const i=Gl();return pg(i,t),i},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*ft),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*ft)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*ft,this.sensorPitchAngle*ft,this.sensorRollAngle*ft),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*ft),i=Math.cos(this.sensorLatitude*ft),r=Math.sin(this.sensorLongitude*ft),n=Math.cos(this.sensorLongitude*ft);return this._createMat3FromValues([[-t*n,-r,-i*n],[-t*r,n,-i*r],[i,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*ft,this.platformPitchAngle*ft,this.platformRollAngle*ft),this._extractValues=t=>{this.imageWidth=t.get(ne.EsriVideoWidth)?.value,this.imageHeight=t.get(ne.EsriVideoHeight)?.value;const i=t.get(ne.SensorEllipsoidHeight)?.value;this.sensorAltitude=i??t.get(ne.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(ne.SensorLatitude)?.value,this.sensorLongitude=t.get(ne.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(ne.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(ne.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(ne.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(ne.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(ne.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(ne.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(ne.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(ne.PlatformRollAngle)?.value,this.averageElevation=t.get(ne.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,i,r)=>{const n=Math.cos(t),a=Math.sin(t),l=Math.cos(i),h=Math.sin(i),p=Math.cos(r),g=Math.sin(r);return this._createMat3FromValues([[n*l,n*h*g-p*a,a*g+n*p*h],[l*a,n*p+a*h*g,p*a*h-n*g],[-h,l*g,l*p]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),i=this._calculateCameraFovReverse(),r=this._calculateCameraLook(),n=this._calculateImageDimensionsForward(),a=this._calculateImageDimensionsReverse(),l=this._calculatePlatformPositionMatrix(),h=this._calculatePlatformOrientation(),p=this._multiplyMat3(this._multiplyMat3(l,h),r);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(p,t),n);const g=this._multiplyMat3(a,i);this._earthToImageTransform=this._multiplyMat3(g,this._transposeMat3(p)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const i=t.get(ne.EsriVideoWidth)?.value??0,r=t.get(ne.EsriVideoHeight)?.value??0;if(i<=0||r<=0)return!1;const n=t.get(ne.SensorEllipsoidHeight)?.value,a=t.get(ne.SensorTrueAltitude)?.value,l=t.get(ne.SensorLatitude)?.value,h=t.get(ne.SensorLongitude)?.value;if(n==null&&a==null||l==null||h==null)return!1;const p=t.get(ne.PlatformHeadingAngle)?.value,g=t.get(ne.PlatformPitchAngle)?.value,y=t.get(ne.PlatformRollAngle)?.value;if(p==null||g==null||y==null)return!1;const w=t.get(ne.SensorHorizontalFOV)?.value,E=t.get(ne.SensorVerticalFOV)?.value;if(w==null||E==null)return!1;const I=t.get(ne.SensorAzimuthAngle)?.value,v=t.get(ne.SensorElevationAngle)?.value,L=t.get(ne.SensorRollAngle)?.value;return I!=null&&v!=null&&L!=null},this._projectPointToECEF=(t,i,r)=>{const n=[];return Yl([t,i,r],Zr.WGS84,0,n,ya,0),new Jt({x:n[0],y:n[1],z:n[2],spatialReference:ya})},this._projectImageVectorToEllipsoid=(t,i)=>{const r=Wl.semiMajorAxis+i,n=Wl.semiMinorAxis+i,a=n/r,l=r/n,{x:h,y:p,z:g}=this._platformPositionEcef,y=g??this.averageElevation,w=ni(h,p,l*y),E=fa(t,t),I=fa(t,w),v=fa(w,w)-r*r,L=(-I-Math.sqrt(I*I-E*v))/E;if(L<0)return[NaN,NaN,NaN];const R=ga();return mg(R,w,t,L),R[2]=R[2]*a,R};const e=s?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(s,e,t){const i=this._platformPositionEcef;if(!i)return[0,0];const{x:r,y:n,z:a}=i,l=ni(r,n,a),h=this._projectPointToECEF(s,e,t||this.averageElevation),p=ga(),g=ni(h.x,h.y,h.z);gg(p,g,l),Xl(p,p,this._earthToImageTransform);const y=p[0],w=p[1],E=p[2];let I=ni(NaN,NaN,NaN);return isNaN(E)||(I=ni(y/E,w/E,E/E)),[I[0],I[1]]}transformImageToGeo(s,e){const t=ni(s,e,1),i=ga();Xl(i,t,this._imageToEarthTransform);const r=this._projectImageVectorToEllipsoid(i,this.averageElevation);let n;if(!isNaN(r[0])){const a=[];Yl([r[0],r[1],r[2]],ya,0,a,Zr.WGS84,0),n=new Jt({x:a[0],y:a[1],z:a[2],spatialReference:Zr.WGS84})}return n}};K([Z()],Qe.prototype,"averageElevation",void 0),K([Z()],Qe.prototype,"imageHeight",void 0),K([Z()],Qe.prototype,"imageWidth",void 0),K([Z({readOnly:!0})],Qe.prototype,"metadataSupportsTransforms",void 0),K([Z()],Qe.prototype,"platformHeadingAngle",void 0),K([Z()],Qe.prototype,"platformPitchAngle",void 0),K([Z()],Qe.prototype,"platformRollAngle",void 0),K([Z()],Qe.prototype,"sensorHeadingAngle",void 0),K([Z()],Qe.prototype,"sensorAltitude",void 0),K([Z()],Qe.prototype,"sensorHorizontalFieldOfView",void 0),K([Z()],Qe.prototype,"sensorLatitude",void 0),K([Z()],Qe.prototype,"sensorLongitude",void 0),K([Z()],Qe.prototype,"sensorPitchAngle",void 0),K([Z()],Qe.prototype,"sensorRollAngle",void 0),K([Z()],Qe.prototype,"sensorVerticalFieldOfView",void 0),K([Z()],Qe.prototype,"vttMetadata",void 0),Qe=K([Ds("esri.layers.video.VideoCameraSensorModel")],Qe);const Mg=Qe;var Kl,Ql;function Rn(){return Ql?Kl:(Ql=1,s=typeof window<"u"?window:an!==void 0?an:typeof self<"u"?self:{},Kl=s);var s}const k=vr(Rn());var Jl,Zl,va,eu,ba,tu,su,iu,ru,nu,au,ou,lu,uu,Ta,hu,Sa,du,Ea,cu,Ca,pu,mu,gu,fu,yu;function Id(){if(Zl)return Jl;Zl=1;var s=Array.prototype.slice;function e(t,i){for(("length"in t)||(t=[t]),t=s.call(t);t.length;){var r=t.shift(),n=i(r);if(n)return n;r.childNodes&&r.childNodes.length&&(t=s.call(r.childNodes).concat(t))}}return Jl=e}function Bg(){if(eu)return va;function s(e,t){if(!(this instanceof s))return new s(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}return eu=1,va=s,s.prototype.nodeType=8,s.prototype.nodeName="#comment",s.prototype.toString=function(){return"[object Comment]"},va}function Fg(){if(tu)return ba;function s(e,t){if(!(this instanceof s))return new s(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}return tu=1,ba=s,s.prototype.type="DOMTextNode",s.prototype.nodeType=3,s.prototype.nodeName="#text",s.prototype.toString=function(){return this.data},s.prototype.replaceData=function(e,t,i){var r=this.data,n=r.substring(0,e),a=r.substring(e+t,r.length);this.data=n+i+a,this.length=this.data.length},ba}function Pd(){if(iu)return su;function s(e){var t=this,i=e.type;e.target||(e.target=t),t.listeners||(t.listeners={});var r=t.listeners[i];if(r)return r.forEach(function(n){e.currentTarget=t,typeof n=="function"?n(e):n.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}return iu=1,su=s}function Ld(){if(nu)return ru;function s(e,t){var i=this;i.listeners||(i.listeners={}),i.listeners[e]||(i.listeners[e]=[]),i.listeners[e].indexOf(t)===-1&&i.listeners[e].push(t)}return nu=1,ru=s}function Od(){if(ou)return au;function s(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],n=r.indexOf(t);n!==-1&&r.splice(n,1)}}return ou=1,au=s}function Ug(){if(uu)return lu;uu=1;var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function e(g){switch(g.nodeType){case 3:return h(g.data);case 8:return"";default:return t(g)}}function t(g){var y=[],w=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),y.push("<"+w+l(g)+n(g)),s.indexOf(w)>-1?y.push(" />"):(y.push(">"),g.childNodes.length?y.push.apply(y,g.childNodes.map(e)):g.textContent||g.innerText?y.push(h(g.textContent||g.innerText)):g.innerHTML&&y.push(g.innerHTML),y.push("")),y.join("")}function i(g,y){var w=typeof g[y];return y==="style"&&Object.keys(g.style).length>0||g.hasOwnProperty(y)&&(w==="string"||w==="boolean"||w==="number")&&y!=="nodeName"&&y!=="className"&&y!=="tagName"&&y!=="textContent"&&y!=="innerText"&&y!=="namespaceURI"&&y!=="innerHTML"}function r(g){if(typeof g=="string")return g;var y="";return Object.keys(g).forEach(function(w){var E=g[w];w=w.replace(/[A-Z]/g,function(I){return"-"+I.toLowerCase()}),y+=w+":"+E+";"}),y}function n(g){var y=g.dataset,w=[];for(var E in y)w.push({name:"data-"+E,value:y[E]});return w.length?a(w):""}function a(g){var y=[];return g.forEach(function(w){var E=w.name,I=w.value;E==="style"&&(I=r(I)),y.push(E+'="'+p(I)+'"')}),y.length?" "+y.join(" "):""}function l(g){var y=[];for(var w in g)i(g,w)&&y.push({name:w,value:g[w]});for(var E in g._attributes)for(var I in g._attributes[E]){var v=g._attributes[E][I],L=(v.prefix?v.prefix+":":"")+I;y.push({name:L,value:v.value})}return g.className&&y.push({name:"class",value:g.className}),y.length?a(y):""}function h(g){var y="";return typeof g=="string"?y=g:g&&(y=g.toString()),y.replace(/&/g,"&").replace(//g,">")}function p(g){return h(g).replace(/"/g,""")}return lu=e}function Nd(){if(hu)return Ta;hu=1;var s=Id(),e=Pd(),t=Ld(),i=Od(),r=Ug(),n="http://www.w3.org/1999/xhtml";function a(l,h,p){if(!(this instanceof a))return new a(l);var g=p===void 0?n:p||null;this.tagName=g===n?String(l).toUpperCase():l,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=h||null,this.namespaceURI=g,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}return Ta=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(l){return l.parentNode&&l.parentNode.removeChild(l),this.childNodes.push(l),l.parentNode=this,l},a.prototype.replaceChild=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=this.childNodes.indexOf(h);return h.parentNode=null,this.childNodes[p]=l,l.parentNode=this,h},a.prototype.removeChild=function(l){var h=this.childNodes.indexOf(l);return this.childNodes.splice(h,1),l.parentNode=null,l},a.prototype.insertBefore=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=h==null?-1:this.childNodes.indexOf(h);return p>-1?this.childNodes.splice(p,0,l):this.childNodes.push(l),l.parentNode=this,l},a.prototype.setAttributeNS=function(l,h,p){var g=null,y=h,w=h.indexOf(":");w>-1&&(g=h.substr(0,w),y=h.substr(w+1)),this.tagName==="INPUT"&&h==="type"?this.type=p:(this._attributes[l]||(this._attributes[l]={}))[y]={value:p,prefix:g}},a.prototype.getAttributeNS=function(l,h){var p=this._attributes[l],g=p&&p[h]&&p[h].value;return this.tagName==="INPUT"&&h==="type"?this.type:typeof g!="string"?null:g},a.prototype.removeAttributeNS=function(l,h){var p=this._attributes[l];p&&delete p[h]},a.prototype.hasAttributeNS=function(l,h){var p=this._attributes[l];return!!p&&h in p},a.prototype.setAttribute=function(l,h){return this.setAttributeNS(null,l,h)},a.prototype.getAttribute=function(l){return this.getAttributeNS(null,l)},a.prototype.removeAttribute=function(l){return this.removeAttributeNS(null,l)},a.prototype.hasAttribute=function(l){return this.hasAttributeNS(null,l)},a.prototype.removeEventListener=i,a.prototype.addEventListener=t,a.prototype.dispatchEvent=e,a.prototype.focus=function(){},a.prototype.toString=function(){return r(this)},a.prototype.getElementsByClassName=function(l){var h=l.split(" "),p=[];return s(this,function(g){if(g.nodeType===1){var y=(g.className||"").split(" ");h.every(function(w){return y.indexOf(w)!==-1})&&p.push(g)}}),p},a.prototype.getElementsByTagName=function(l){l=l.toLowerCase();var h=[];return s(this.childNodes,function(p){p.nodeType!==1||l!=="*"&&p.tagName.toLowerCase()!==l||h.push(p)}),h},a.prototype.contains=function(l){return s(this,function(h){return l===h})||!1},Ta}function qg(){if(du)return Sa;du=1;var s=Nd();function e(t){if(!(this instanceof e))return new e;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}return Sa=e,e.prototype.type="DocumentFragment",e.prototype.nodeType=11,e.prototype.nodeName="#document-fragment",e.prototype.appendChild=s.prototype.appendChild,e.prototype.replaceChild=s.prototype.replaceChild,e.prototype.removeChild=s.prototype.removeChild,e.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")},Sa}function jg(){if(cu)return Ea;function s(e){}return cu=1,Ea=s,s.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},s.prototype.preventDefault=function(){},Ea}function Hg(){if(pu)return Ca;pu=1;var s=Id(),e=Bg(),t=Fg(),i=Nd(),r=qg(),n=jg(),a=Pd(),l=Ld(),h=Od();function p(){if(!(this instanceof p))return new p;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}Ca=p;var g=p.prototype;return g.createTextNode=function(y){return new t(y,this)},g.createElementNS=function(y,w){var E=y===null?null:String(y);return new i(w,this,E)},g.createElement=function(y){return new i(y,this)},g.createDocumentFragment=function(){return new r(this)},g.createEvent=function(y){return new n(y)},g.createComment=function(y){return new e(y,this)},g.getElementById=function(y){return y=String(y),s(this.childNodes,function(w){if(String(w.id)===y)return w})||null},g.getElementsByClassName=i.prototype.getElementsByClassName,g.getElementsByTagName=i.prototype.getElementsByTagName,g.contains=i.prototype.contains,g.removeEventListener=h,g.addEventListener=l,g.dispatchEvent=a,Ca}function $g(){if(gu)return mu;gu=1;var s=Hg();return mu=new s}function Rd(){if(yu)return fu;yu=1;var s,e=an!==void 0?an:typeof window<"u"?window:{},t=$g();return typeof document<"u"?s=document:(s=e["__GLOBAL_DOCUMENT_CACHE@4"])||(s=e["__GLOBAL_DOCUMENT_CACHE@4"]=t),fu=s}const re=vr(Rd());var _u,wa,vu,bu,Tu,Su,Eu,Cu,wu,Au,$r={exports:{}},xu={exports:{}};function Vg(){return _u||(_u=1,function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,r){if(i){if(typeof i=="string")return t(i,r);var n=Object.prototype.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(i,r):void 0}}function t(i,r){(r==null||r>i.length)&&(r=i.length);for(var n=0,a=new Array(r);n=400&&n.statusCode<=599){var l=a;if(i)if(s.TextDecoder){var h=e(n.headers&&n.headers["content-type"]);try{l=new TextDecoder(h).decode(a)}catch{}}else l=String.fromCharCode.apply(null,new Uint8Array(a));t({cause:l})}else t(null,a)}}}function Yg(){if(Au)return $r.exports;Au=1;var s=Rn(),e=Vg(),t=zg(),i=Wg(),r=Gg();p.httpHandler=Xg(),p.requestInterceptorsStorage=new i,p.responseInterceptorsStorage=new i,p.retryManager=new r;var n=function(E){var I={};return E&&E.trim().split(` -`).forEach(function(v){var L=v.indexOf(":"),R=v.slice(0,L).trim().toLowerCase(),M=v.slice(L+1).trim();I[R]===void 0?I[R]=M:Array.isArray(I[R])?I[R].push(M):I[R]=[I[R],M]}),I};function a(E,I){for(var v=0;v0&&(S=setTimeout(function(){if(!U){U=!0,H.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",G(Q)}},E.timeout)),H.setRequestHeader)for(z in W)W.hasOwnProperty(z)&&H.setRequestHeader(z,W[z]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(H.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(H),H.send($||null),H}function y(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}function w(){}return $r.exports=p,$r.exports.default=p,p.XMLHttpRequest=s.XMLHttpRequest||w,p.XDomainRequest="withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){p[E==="delete"?"del":E]=function(I,v,L){return(v=h(I,v,L)).method=E.toUpperCase(),g(v)}}),$r.exports}const Md=vr(Yg());var ku,Du,Iu,Pu,Lu,Ou,Nu,Aa={exports:{}};function Kg(){if(Du)return ku;Du=1;var s=Rd(),e=Object.create||function(){function S(){}return function(A){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=A,new S}}();function t(S,A){this.name="ParsingError",this.code=S.code,this.message=A||S.message}function i(S){function A($,W,te,J){return 3600*(0|$)+60*(0|W)+(0|te)+(0|J)/1e3}var B=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?A(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?A(B[1],B[2],0,B[4]):A(0,B[1],B[2],B[4]):null}function r(){this.values=e(null)}function n(S,A,B,$){var W=$?S.split($):[S];for(var te in W)if(typeof W[te]=="string"){var J=W[te].split(B);J.length===2&&A(J[0].trim(),J[1].trim())}}function a(S,A,B){var $=S;function W(){var oe=i(S);if(oe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+$);return S=S.replace(/^[^\sa-zA-Z-]+/,""),oe}function te(oe,Q){var Y=new r;n(oe,function(ie,se){switch(ie){case"region":for(var ee=B.length-1;ee>=0;ee--)if(B[ee].id===se){Y.set(ie,B[ee].region);break}break;case"vertical":Y.alt(ie,se,["rl","lr"]);break;case"line":var ye=se.split(","),_e=ye[0];Y.integer(ie,_e),Y.percent(ie,_e)&&Y.set("snapToLines",!1),Y.alt(ie,_e,["auto"]),ye.length===2&&Y.alt("lineAlign",ye[1],["start","center","end"]);break;case"position":ye=se.split(","),Y.percent(ie,ye[0]),ye.length===2&&Y.alt("positionAlign",ye[1],["start","center","end"]);break;case"size":Y.percent(ie,se);break;case"align":Y.alt(ie,se,["start","center","end","left","right"])}},/:/,/\s/),Q.region=Y.get("region",null),Q.vertical=Y.get("vertical","");try{Q.line=Y.get("line","auto")}catch{}Q.lineAlign=Y.get("lineAlign","start"),Q.snapToLines=Y.get("snapToLines",!0),Q.size=Y.get("size",100);try{Q.align=Y.get("align","center")}catch{Q.align=Y.get("align","middle")}try{Q.position=Y.get("position","auto")}catch{Q.position=Y.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=Y.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function J(){S=S.replace(/^\s+/,"")}if(J(),A.startTime=W(),J(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+$);S=S.substr(3),J(),A.endTime=W(),J(),te(S,A)}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(S,A){this.get(S)||A===""||(this.values[S]=A)},get:function(S,A,B){return B?this.has(S)?this.values[S]:A[B]:this.has(S)?this.values[S]:A},has:function(S){return S in this.values},alt:function(S,A,B){for(var $=0;$=0&&A<=100)&&(this.set(S,A),!0)}};var l=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},p={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function w(S,A){function B(){if(!A)return null;function _e(me){return A=A.substr(me.length),me}var ve=A.match(/^([^<]*)(<[^>]*>?)?/);return _e(ve[1]?ve[1]:ve[2])}function $(_e){return l.innerHTML=_e,_e=l.textContent,l.textContent="",_e}function W(_e,ve){return!y[ve.localName]||y[ve.localName]===_e.localName}function te(_e,ve){var me=h[_e];if(!me)return null;var Fe=S.document.createElement(me),et=g[_e];return et&&ve&&(Fe[et]=ve.trim()),Fe}for(var J,oe=S.document.createElement("div"),Q=oe,Y=[];(J=B())!==null;)if(J[0]!=="<")Q.appendChild(S.document.createTextNode($(J)));else{if(J[1]==="/"){Y.length&&Y[Y.length-1]===J.substr(2).replace(">","")&&(Y.pop(),Q=Q.parentNode);continue}var ie,se=i(J.substr(1,J.length-2));if(se){ie=S.document.createProcessingInstruction("timestamp",se),Q.appendChild(ie);continue}var ee=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||!(ie=te(ee[1],ee[3]))||!W(Q,ie))continue;if(ee[2]){var ye=ee[2].split(".");ye.forEach(function(_e){var ve=/^bg_/.test(_e),me=ve?_e.slice(3):_e;if(p.hasOwnProperty(me)){var Fe=ve?"background-color":"color",et=p[me];ie.style[Fe]=et}}),ie.className=ye.join(" ")}Y.push(ee[1]),Q.appendChild(ie),Q=ie}return oe}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function I(S){for(var A=0;A=B[0]&&S<=B[1])return!0}return!1}function v(S){var A=[],B="";if(!S||!S.childNodes)return"ltr";function $(J,oe){for(var Q=oe.childNodes.length-1;Q>=0;Q--)J.push(oe.childNodes[Q])}function W(J){if(!J||!J.length)return null;var oe=J.pop(),Q=oe.textContent||oe.innerText;if(Q){var Y=Q.match(/^.*(\n|\r)/);return Y?(J.length=0,Y[0]):Q}return oe.tagName==="ruby"?W(J):oe.childNodes?($(J,oe),W(J)):void 0}for($(A,S);B=W(A);)for(var te=0;te=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var A=S.track,B=A.textTrackList,$=0,W=0;WYe&&(et=new O(me),We=Ye),me=new O(Pe)}return et||Pe}var te=new O(A),J=A.cue,oe=L(J),Q=[];if(J.snapToLines){var Y;switch(J.vertical){case"":Q=["+y","-y"],Y="height";break;case"rl":Q=["+x","-x"],Y="width";break;case"lr":Q=["-x","+x"],Y="width"}var ie=te.lineHeight,se=ie*Math.round(oe),ee=B[Y]+ie,ye=Q[0];Math.abs(se)>ee&&(se=se<0?-1:1,se*=Math.ceil(ee/ie)*ie),oe<0&&(se+=J.vertical===""?B.height:B.width,Q=Q.reverse()),te.move(ye,se)}else{var _e=te.lineHeight/B.height*100;switch(J.lineAlign){case"center":oe-=_e/2;break;case"end":oe-=_e}switch(J.vertical){case"":A.applyStyles({top:A.formatStyle(oe,"%")});break;case"rl":A.applyStyles({left:A.formatStyle(oe,"%")});break;case"lr":A.applyStyles({right:A.formatStyle(oe,"%")})}Q=["+y","-x","+x","-y"],te=new O(A)}var ve=W(te,Q);A.move(ve.toCSSCompatValues(B))}function N(){}R.prototype.applyStyles=function(S,A){for(var B in A=A||this.div,S)S.hasOwnProperty(B)&&(A.style[B]=S[B])},R.prototype.formatStyle=function(S,A){return S===0?0:S+A},M.prototype=e(R.prototype),M.prototype.constructor=M,O.prototype.move=function(S,A){switch(A=A!==void 0?A:this.lineHeight,S){case"+x":this.left+=A,this.right+=A;break;case"-x":this.left-=A,this.right-=A;break;case"+y":this.top+=A,this.bottom+=A;break;case"-y":this.top-=A,this.bottom-=A}},O.prototype.overlaps=function(S){return this.leftS.left&&this.topS.top},O.prototype.overlapsAny=function(S){for(var A=0;A=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},O.prototype.overlapsOppositeAxis=function(S,A){switch(A){case"+x":return this.leftS.right;case"+y":return this.topS.bottom}},O.prototype.intersectPercentage=function(S){return Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left))*Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top))/(this.height*this.width)},O.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(S){var A=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,B=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,$=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;return{left:(S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S).left,right:S.right,top:S.top||$,height:S.height||A,bottom:S.bottom||$+(S.height||A),width:S.width||B}},N.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},N.convertCueToDOMTree=function(S,A){return S&&A?w(S,A):null};var z=.05,U="sans-serif",H="1.5%";return N.processCues=function(S,A,B){if(!S||!A||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var $=S.document.createElement("div");function W(Y){for(var ie=0;ie")===-1){A.cue.id=J;continue}case"CUE":try{a(J,A.cue,A.regionList)}catch(ie){A.reportOrThrowError(ie),A.cue=null,A.state="BADCUE";continue}A.state="CUETEXT";continue;case"CUETEXT":var Y=J.indexOf("-->")!==-1;if(!J||Y&&(Q=!0)){A.oncue&&A.oncue(A.cue),A.cue=null,A.state="ID";continue}A.cue.text&&(A.cue.text+=` -`),A.cue.text+=J.replace(/\u2028/g,` -`).replace(/u2029/g,` -`);continue;case"BADCUE":J||(A.state="ID");continue}}}catch(ie){A.reportOrThrowError(ie),A.state==="CUETEXT"&&A.cue&&A.oncue&&A.oncue(A.cue),A.cue=null,A.state=A.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=` - -`,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(A){S.reportOrThrowError(A)}return S.onflush&&S.onflush(),this}},ku=N}function Qg(){if(Pu)return Iu;Pu=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){return typeof a=="string"&&!!e[a.toLowerCase()]&&a.toLowerCase()}function r(a){return typeof a=="string"&&!!t[a.toLowerCase()]&&a.toLowerCase()}function n(a,l,h){this.hasBeenReset=!1;var p="",g=!1,y=a,w=l,E=h,I=null,v="",L=!0,R="auto",M="start",O="auto",G="auto",N=100,z="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return p},set:function(U){p=""+U}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(U){g=!!U}},startTime:{enumerable:!0,get:function(){return y},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");y=U,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return w},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");w=U,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(U){E=""+U,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return I},set:function(U){I=U,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return v},set:function(U){var H=i(U);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");v=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return L},set:function(U){L=!!U,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return R},set:function(U){if(typeof U!="number"&&U!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");R=U,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return M},set:function(U){var H=r(U);H?(M=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");O=U,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return G},set:function(U){var H=r(U);H?(G=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");N=U,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return z},set:function(U){var H=r(U);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");z=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Iu=n}function Jg(){if(Ou)return Lu;Ou=1;var s={"":!0,up:!0};function e(r){return typeof r=="string"&&!!s[r.toLowerCase()]&&r.toLowerCase()}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,h=0,p=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return p},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");p=y}},viewportAnchorX:{enumerable:!0,get:function(){return h},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");h=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var w=e(y);w===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=w}}})}return Lu=i}function Zg(){if(Nu)return Aa.exports;Nu=1;var s=Rn(),e=Aa.exports={WebVTT:Kg(),VTTCue:Qg(),VTTRegion:Jg()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Aa.exports}const Ru=vr(Zg());function ze(){return ze=Object.assign?Object.assign.bind():function(s){for(var e=1;e-1},e.trigger=function(t){var i=this.listeners[t];if(i)if(arguments.length===2)for(var r=i.length,n=0;n-1;t=this.buffer.indexOf(` -`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const sf=" ",xa=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},rf=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ht=function(s){const e={};if(!s)return e;const t=s.split(rf());let i,r=t.length;for(;r--;)t[r]!==""&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),e[i[0]]=i[1]);return e},Bu=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class nf extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((r,n)=>{const a=n(e);return a===e?r:r.concat([a])},[e]).forEach(r=>{for(let n=0;nn),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const af=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),bs=function(s){const e={};return Object.keys(s).forEach(function(t){e[af(t)]=s[t]}),e},ka=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&3*t,h=i&&2*i;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]{a.uri||!a.parts&&!a.preloadHints||(!a.map&&r&&(a.map=r),!a.key&&n&&(a.key=n),a.timeline||typeof y!="number"||(a.timeline=y),this.manifest.preloadSegment=a)}),this.parseStream.on("data",function(v){let L,R;if(t.manifest.definitions){for(const M in t.manifest.definitions)if(v.uri&&(v.uri=v.uri.replace(`{$${M}}`,t.manifest.definitions[M])),v.attributes)for(const O in v.attributes)typeof v.attributes[O]=="string"&&(v.attributes[O]=v.attributes[O].replace(`{$${M}}`,t.manifest.definitions[M]))}({tag(){({version(){v.version&&(this.manifest.version=v.version)},"allow-cache"(){this.manifest.allowCache=v.allowed,"allowed"in v||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const M={};"length"in v&&(a.byterange=M,M.length=v.length,"offset"in v||(v.offset=w)),"offset"in v&&(a.byterange=M,M.offset=v.offset),w=M.offset+M.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),v.title&&(a.title=v.title),v.duration>0&&(a.duration=v.duration),v.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(v.attributes)if(v.attributes.METHOD!=="NONE")if(v.attributes.URI){if(v.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:v.attributes});if(v.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:v.attributes.URI});if(v.attributes.KEYFORMAT===g)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(v.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(v.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),v.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):v.attributes.KEYID&&v.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:v.attributes.KEYFORMAT,keyId:v.attributes.KEYID.substring(2)},pssh:Bd(v.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));v.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:v.attributes.METHOD||"AES-128",uri:v.attributes.URI},v.attributes.IV!==void 0&&(n.iv=v.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(v.number)?this.manifest.mediaSequence=v.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+v.number})},"discontinuity-sequence"(){isFinite(v.number)?(this.manifest.discontinuitySequence=v.number,y=v.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+v.number})},"playlist-type"(){/VOD|EVENT/.test(v.playlistType)?this.manifest.playlistType=v.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+v.playlist})},map(){r={},v.uri&&(r.uri=v.uri),v.byterange&&(r.byterange=v.byterange),n&&(r.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,v.attributes?(a.attributes||(a.attributes={}),ze(a.attributes,v.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(v.attributes&&v.attributes.TYPE&&v.attributes["GROUP-ID"]&&v.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const M=this.manifest.mediaGroups[v.attributes.TYPE];M[v.attributes["GROUP-ID"]]=M[v.attributes["GROUP-ID"]]||{},L=M[v.attributes["GROUP-ID"]],R={default:/yes/i.test(v.attributes.DEFAULT)},R.default?R.autoselect=!0:R.autoselect=/yes/i.test(v.attributes.AUTOSELECT),v.attributes.LANGUAGE&&(R.language=v.attributes.LANGUAGE),v.attributes.URI&&(R.uri=v.attributes.URI),v.attributes["INSTREAM-ID"]&&(R.instreamId=v.attributes["INSTREAM-ID"]),v.attributes.CHARACTERISTICS&&(R.characteristics=v.attributes.CHARACTERISTICS),v.attributes.FORCED&&(R.forced=/yes/i.test(v.attributes.FORCED)),L[v.attributes.NAME]=R},discontinuity(){y+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=v.dateTimeString,this.manifest.dateTimeObject=v.dateTimeObject),a.dateTimeString=v.dateTimeString,a.dateTimeObject=v.dateTimeObject;const{lastProgramDateTime:M}=this;this.lastProgramDateTime=new Date(v.dateTimeString).getTime(),M===null&&this.manifest.segments.reduceRight((O,G)=>(G.programDateTime=O-1e3*G.duration,G.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(v.duration)||v.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+v.duration}):(this.manifest.targetDuration=v.duration,ka.call(this,this.manifest))},start(){v.attributes&&!isNaN(v.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:v.attributes["TIME-OFFSET"],precise:v.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){a.cueOut=v.data},"cue-out-cont"(){a.cueOutCont=v.data},"cue-in"(){a.cueIn=v.data},skip(){this.manifest.skip=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",v.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const M=this.manifest.segments.length,O=bs(v.attributes);a.parts=a.parts||[],a.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=E),E=O.byterange.offset+O.byterange.length);const G=a.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${G} for segment #${M}`,v.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((N,z)=>{N.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${z} lacks required attribute(s): LAST-PART`})})},"server-control"(){const M=this.manifest.serverControl=bs(v.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),M.canSkipDateranges&&!M.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const M=this.manifest.segments.length,O=bs(v.attributes),G=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=G?E:0,G&&(E=O.byterange.offset+O.byterange.length)));const N=a.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${N} for segment #${M}`,v.attributes,["TYPE","URI"]),O.type)for(let z=0;zz.id===O.id);this.manifest.dateRanges[N]=ze(this.manifest.dateRanges[N],O),I[O.id]=ze(I[O.id],O),this.manifest.dateRanges.pop()}else I[O.id]=O},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=bs(v.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",v.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const M=(O,G)=>{O in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`}):this.manifest.definitions[O]=G};if("QUERYPARAM"in v.attributes){if("NAME"in v.attributes||"IMPORT"in v.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const O=this.params.get(v.attributes.QUERYPARAM);return O?void M(v.attributes.QUERYPARAM,decodeURIComponent(O)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${v.attributes.QUERYPARAM}`})}return"NAME"in v.attributes?"IMPORT"in v.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in v.attributes&&typeof v.attributes.VALUE=="string"?void M(v.attributes.NAME,v.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${v.attributes.NAME}`}):"IMPORT"in v.attributes?this.mainDefinitions[v.attributes.IMPORT]?void M(v.attributes.IMPORT,this.mainDefinitions[v.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${v.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:v.attributes,uri:v.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",v.attributes,["BANDWIDTH","URI"])}}[v.tagType]||h).call(t)},uri(){a.uri=v.uri,i.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=y,r&&(a.map=r),E=0,this.lastProgramDateTime!==null&&(a.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*a.duration),a={}},comment(){},custom(){v.segment?(a.custom=a.custom||{},a.custom[v.customType]=v.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[v.customType]=v.data)}})[v.type].call(t)})}requiredCompatibilityversion(e,t){(ep&&(h-=p,h-=p,h-=it(2))}return Number(h)},_f=function(s,e){var t={}.le,i=t!==void 0&&t;(typeof s!="bigint"&&typeof s!="number"||typeof s=="number"&&s!=s)&&(s=0),s=it(s);for(var r=gf(s),n=new Uint8Array(new ArrayBuffer(r)),a=0;a=e.length&&h.call(e,function(p,g){return p===(l[g]?l[g]&s[n+g]:s[n+g])})},bf=function(s,e,t){e.forEach(function(i){for(var r in s.mediaGroups[i])for(var n in s.mediaGroups[i][r]){var a=s.mediaGroups[i][r][n];t(a,i,r,n)}})},Zi={},os={},Ms={};function Bn(){if(ju)return Ms;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var h=0;h=0))throw new $(A,new Error(_.tagName+"@"+P));for(var ae=T.length-1;q"&&">")||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}function _e(_,T){if(T(_))return!0;if(_=_.firstChild)do if(_e(_,T))return!0;while(_=_.nextSibling)}function ve(){this.ownerDocument=this}function me(_,T,P){_&&_._inc++,P.namespaceURI===t.XMLNS&&(T._nsMap[P.prefix?P.localName:""]=P.value)}function Fe(_,T,P,q){_&&_._inc++,P.namespaceURI===t.XMLNS&&delete T._nsMap[P.prefix?P.localName:""]}function et(_,T,P){if(_&&_._inc){_._inc++;var q=T.childNodes;if(P)q[q.length++]=P;else{for(var ae=T.firstChild,le=0;ae;)q[le++]=ae,ae=ae.nextSibling;q.length=le,delete q[q.length]}}}function Pe(_,T){var P=T.previousSibling,q=T.nextSibling;return P?P.nextSibling=q:_.firstChild=q,q?q.previousSibling=P:_.lastChild=P,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,et(_.ownerDocument,_),T}function We(_){return _&&(_.nodeType===ee.DOCUMENT_NODE||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.ELEMENT_NODE)}function Ge(_){return _&&(rt(_)||Ut(_)||Ye(_)||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.COMMENT_NODE||_.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Ye(_){return _&&_.nodeType===ee.DOCUMENT_TYPE_NODE}function rt(_){return _&&_.nodeType===ee.ELEMENT_NODE}function Ut(_){return _&&_.nodeType===ee.TEXT_NODE}function Ke(_,T){var P=_.childNodes||[];if(e(P,rt)||Ye(T))return!1;var q=e(P,Ye);return!(T&&q&&P.indexOf(q)>P.indexOf(T))}function ts(_,T){var P=_.childNodes||[];function q(le){return rt(le)&&le!==T}if(e(P,q))return!1;var ae=e(P,Ye);return!(T&&ae&&P.indexOf(ae)>P.indexOf(T))}function Ps(_,T,P){if(!We(_))throw new $(S,"Unexpected parent node type "+_.nodeType);if(P&&P.parentNode!==_)throw new $(A,"child not in parent");if(!Ge(T)||Ye(T)&&_.nodeType!==ee.DOCUMENT_NODE)throw new $(S,"Unexpected node type "+T.nodeType+" for parent node type "+_.nodeType)}function Ys(_,T,P){var q=_.childNodes||[],ae=T.childNodes||[];if(T.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var le=ae.filter(rt);if(le.length>1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!Ke(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!Ke(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,Ye))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)1||e(ae,Ut))throw new $(S,"More than one element or text in fragment");if(le.length===1&&!ts(_,P))throw new $(S,"Element in fragment can not be inserted before doctype")}if(rt(T)&&!ts(_,P))throw new $(S,"Only one element can be added and only after doctype");if(Ye(T)){if(e(q,function(Ee){return Ye(Ee)&&Ee!==P}))throw new $(S,"Only one doctype is allowed");var De=e(q,rt);if(P&&q.indexOf(De)=0;jt--)if((Pt=ae[jt]).prefix===""&&Pt.namespace===_.namespaceURI){st=Pt.namespace;break}}if(st!==_.namespaceURI)for(jt=ae.length-1;jt>=0;jt--){var Pt;if((Pt=ae[jt]).namespace===_.namespaceURI){Pt.prefix&&(qt=Pt.prefix+":"+wt);break}}}T.push("<",qt);for(var ns=0;ns"),P&&/^script$/i.test(wt))for(;Ee;)Ee.data?T.push(Ee.data):rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;else for(;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;T.push("")}else T.push("/>");return;case O:case N:for(Ee=_.firstChild;Ee;)rs(Ee,T,P,q,ae.slice()),Ee=Ee.nextSibling;return;case w:return Hi(T,_.name,_.value);case E:return T.push(_.data.replace(/[<&>]/g,ye));case I:return T.push("");case M:return T.push("");case G:var Js=_.publicId,Ht=_.systemId;if(T.push("");else if(Ht&&Ht!=".")T.push(" SYSTEM ",Ht,">");else{var Zs=_.internalSubset;Zs&&T.push(" [",Zs,"]"),T.push(">")}return;case R:return T.push("");case v:return T.push("&",_.nodeName,";");default:T.push("??",_.nodeName)}}function Qs(_,T,P){var q;switch(T.nodeType){case y:(q=T.cloneNode(!1)).ownerDocument=_;case N:break;case w:P=!0}if(q||(q=T.cloneNode(!1)),q.ownerDocument=_,q.parentNode=null,P)for(var ae=T.firstChild;ae;)q.appendChild(Qs(_,ae,P)),ae=ae.nextSibling;return q}function ys(_,T,P){var q=new T.constructor;for(var ae in T)if(Object.prototype.hasOwnProperty.call(T,ae)){var le=T[ae];typeof le!="object"&&le!=q[ae]&&(q[ae]=le)}switch(T.childNodes&&(q.childNodes=new W),q.ownerDocument=_,q.nodeType){case y:var De=T.attributes,Ee=q.attributes=new oe,wt=De.length;Ee._ownerElement=q;for(var qt=0;qt=0&&_0},lookupPrefix:function(_){for(var T=this;T;){var P=T._nsMap;if(P){for(var q in P)if(Object.prototype.hasOwnProperty.call(P,q)&&P[q]===_)return q}T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(_){for(var T=this;T;){var P=T._nsMap;if(P&&Object.prototype.hasOwnProperty.call(P,_))return P[_];T=T.nodeType==w?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(_){return this.lookupPrefix(_)==null}},h(g,ee),h(g,ee.prototype),ve.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,T){if(_.nodeType==N){for(var P=_.firstChild;P;){var q=P.nextSibling;this.insertBefore(P,T),P=q}return _}return ss(this,_,T),_.ownerDocument=this,this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),Pe(this,_)},replaceChild:function(_,T){ss(this,_,T,ms),_.ownerDocument=this,T&&this.removeChild(T),rt(_)&&(this.documentElement=_)},importNode:function(_,T){return Qs(this,_,T)},getElementById:function(_){var T=null;return _e(this.documentElement,function(P){if(P.nodeType==y&&P.getAttribute("id")==_)return T=P,!0}),T},getElementsByClassName:function(_){var T=a(_);return new te(this,function(P){var q=[];return T.length>0&&_e(P.documentElement,function(ae){if(ae!==P&&ae.nodeType===y){var le=ae.getAttribute("class");if(le){var De=_===le;if(!De){var Ee=a(le);De=T.every(l(Ee))}De&&q.push(ae)}}}),q})},createElement:function(_){var T=new je;return T.ownerDocument=this,T.nodeName=_,T.tagName=_,T.localName=_,T.childNodes=new W,(T.attributes=new oe)._ownerElement=T,T},createDocumentFragment:function(){var _=new Ks;return _.ownerDocument=this,_.childNodes=new W,_},createTextNode:function(_){var T=new Se;return T.ownerDocument=this,T.appendData(_),T},createComment:function(_){var T=new Fi;return T.ownerDocument=this,T.appendData(_),T},createCDATASection:function(_){var T=new Ui;return T.ownerDocument=this,T.appendData(_),T},createProcessingInstruction:function(_,T){var P=new qi;return P.ownerDocument=this,P.tagName=P.nodeName=P.target=_,P.nodeValue=P.data=T,P},createAttribute:function(_){var T=new lt;return T.ownerDocument=this,T.name=_,T.nodeName=_,T.localName=_,T.specified=!0,T},createEntityReference:function(_){var T=new fs;return T.ownerDocument=this,T.nodeName=_,T},createElementNS:function(_,T){var P=new je,q=T.split(":"),ae=P.attributes=new oe;return P.childNodes=new W,P.ownerDocument=this,P.nodeName=T,P.tagName=T,P.namespaceURI=_,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,ae._ownerElement=P,P},createAttributeNS:function(_,T){var P=new lt,q=T.split(":");return P.ownerDocument=this,P.nodeName=T,P.name=T,P.namespaceURI=_,P.specified=!0,q.length==2?(P.prefix=q[0],P.localName=q[1]):P.localName=T,P}},p(ve,ee),je.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var T=this.getAttributeNode(_);return T&&T.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,T){var P=this.ownerDocument.createAttribute(_);P.value=P.nodeValue=""+T,this.setAttributeNode(P)},removeAttribute:function(_){var T=this.getAttributeNode(_);T&&this.removeAttributeNode(T)},appendChild:function(_){return _.nodeType===N?this.insertBefore(_,null):Oe(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);P&&this.removeAttributeNode(P)},hasAttributeNS:function(_,T){return this.getAttributeNodeNS(_,T)!=null},getAttributeNS:function(_,T){var P=this.getAttributeNodeNS(_,T);return P&&P.value||""},setAttributeNS:function(_,T,P){var q=this.ownerDocument.createAttributeNS(_,T);q.value=q.nodeValue=""+P,this.setAttributeNode(q)},getAttributeNodeNS:function(_,T){return this.attributes.getNamedItemNS(_,T)},getElementsByTagName:function(_){return new te(this,function(T){var P=[];return _e(T,function(q){q===T||q.nodeType!=y||_!=="*"&&q.tagName!=_||P.push(q)}),P})},getElementsByTagNameNS:function(_,T){return new te(this,function(P){var q=[];return _e(P,function(ae){ae===P||ae.nodeType!==y||_!=="*"&&ae.namespaceURI!==_||T!=="*"&&ae.localName!=T||q.push(ae)}),q})}},ve.prototype.getElementsByTagName=je.prototype.getElementsByTagName,ve.prototype.getElementsByTagNameNS=je.prototype.getElementsByTagNameNS,p(je,ee),lt.prototype.nodeType=w,p(lt,ee),is.prototype={data:"",substringData:function(_,T){return this.data.substring(_,_+T)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,T){this.replaceData(_,0,T)},appendChild:function(_){throw new Error(H[S])},deleteData:function(_,T){this.replaceData(_,T,"")},replaceData:function(_,T,P){P=this.data.substring(0,_)+P+this.data.substring(_+T),this.nodeValue=this.data=P,this.length=P.length}},p(is,ee),Se.prototype={nodeName:"#text",nodeType:E,splitText:function(_){var T=this.data,P=T.substring(_);T=T.substring(0,_),this.data=this.nodeValue=T,this.length=T.length;var q=this.ownerDocument.createTextNode(P);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},p(Se,is),Fi.prototype={nodeName:"#comment",nodeType:M},p(Fi,is),Ui.prototype={nodeName:"#cdata-section",nodeType:I},p(Ui,is),gs.prototype.nodeType=G,p(gs,ee),ke.prototype.nodeType=z,p(ke,ee),Ar.prototype.nodeType=L,p(Ar,ee),fs.prototype.nodeType=v,p(fs,ee),Ks.prototype.nodeName="#document-fragment",Ks.prototype.nodeType=N,p(Ks,ee),qi.prototype.nodeType=R,p(qi,ee),xr.prototype.serializeToString=function(_,T,P){return kr.call(_,T,P)},ee.prototype.toString=kr;try{if(Object.defineProperty){let _=function(T){switch(T.nodeType){case y:case N:var P=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&P.push(_(T)),T=T.nextSibling;return P.join("");default:return T.nodeValue}};Object.defineProperty(te.prototype,"length",{get:function(){return J(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return _(this)},set:function(T){switch(this.nodeType){case y:case N:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),tt=function(T,P,q){T["$$"+P]=q}}}catch{}return os.DocumentType=gs,os.DOMException=$,os.DOMImplementation=se,os.Element=je,os.Node=ee,os.NodeList=W,os.XMLSerializer=xr,os}var $u,er={},Vu={};function Tf(){return $u||($u=1,s=Vu,e=Bn().freeze,s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES),Vu;var s,e}var zu,Wu,Gu,zr={};function Sf(){if(zu)return zr;zu=1;var s=Bn().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,h=4,p=5,g=6,y=7;function w(S,A){this.message=S,this.locator=A,Error.captureStackTrace&&Error.captureStackTrace(this,w)}function E(){}function I(S,A,B,$,W){function te(Oe){if(Oe>65535){var je=55296+((Oe-=65536)>>10),lt=56320+(1023&Oe);return String.fromCharCode(je,lt)}return String.fromCharCode(Oe)}function J(Oe){var je=Oe.slice(1,-1);return Object.hasOwnProperty.call(B,je)?B[je]:je.charAt(0)==="#"?te(parseInt(je.substr(1).replace("x","0x"))):(W.error("entity not found:"+Oe),Oe)}function oe(Oe){if(Oe>ve){var je=S.substring(ve,Oe).replace(/&#?\w+;/g,J);ee&&Q(ve),$.characters(je,0,Oe-ve),ve=Oe}}function Q(Oe,je){for(;Oe>=ie&&(je=se.exec(S));)Y=je.index,ie=Y+je[0].length,ee.lineNumber++;ee.columnNumber=Oe-Y+1}for(var Y=0,ie=0,se=/.*(?:\r\n?|\n)|.*$/g,ee=$.locator,ye=[{currentNSMap:A}],_e={},ve=0;;){try{var me=S.indexOf("<",ve);if(me<0){if(!S.substr(ve).match(/^\s*$/)){var Fe=$.doc,et=Fe.createTextNode(S.substr(ve));Fe.appendChild(et),$.currentElement=et}return}switch(me>ve&&oe(me),S.charAt(me+1)){case"/":var Pe=S.indexOf(">",me+3),We=S.substring(me+2,Pe).replace(/[ \t\n\r]+$/g,""),Ge=ye.pop();Pe<0?(We=S.substring(me+2).replace(/[\s<].*/,""),W.error("end tag name: "+We+" is not complete:"+Ge.tagName),Pe=me+1+We.length):We.match(/\sve?ve=Pe:oe(Math.max(me,ve)+1)}}function v(S,A){return A.lineNumber=S.lineNumber,A.columnNumber=S.columnNumber,A}function L(S,A,B,$,W,te){function J(ee,ye,_e){B.attributeNames.hasOwnProperty(ee)&&te.fatalError("Attribute "+ee+" redefined"),B.addValue(ee,ye.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,W),_e)}for(var oe,Q=++A,Y=r;;){var ie=S.charAt(Q);switch(ie){case"=":if(Y===n)oe=S.slice(A,Q),Y=l;else{if(Y!==a)throw new Error("attribute equal must after attrName");Y=l}break;case"'":case'"':if(Y===l||Y===n){if(Y===n&&(te.warning('attribute value must after "="'),oe=S.slice(A,Q)),A=Q+1,!((Q=S.indexOf(ie,A))>0))throw new Error("attribute value no end '"+ie+"' match");J(oe,se=S.slice(A,Q),A-1),Y=p}else{if(Y!=h)throw new Error('attribute value must after "="');J(oe,se=S.slice(A,Q),A),te.warning('attribute "'+oe+'" missed start quot('+ie+")!!"),A=Q+1,Y=p}break;case"/":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:Y=y,B.closed=!0;case h:case n:break;case a:B.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return te.error("unexpected end of input"),Y==r&&B.setTagName(S.slice(A,Q)),Q;case">":switch(Y){case r:B.setTagName(S.slice(A,Q));case p:case g:case y:break;case h:case n:(se=S.slice(A,Q)).slice(-1)==="/"&&(B.closed=!0,se=se.slice(0,-1));case a:Y===a&&(se=oe),Y==h?(te.warning('attribute "'+se+'" missed quot(")!'),J(oe,se,A)):(s.isHTML($[""])&&se.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),J(se,se,A));break;case l:throw new Error("attribute value missed!!")}return Q;case"€":ie=" ";default:if(ie<=" ")switch(Y){case r:B.setTagName(S.slice(A,Q)),Y=g;break;case n:oe=S.slice(A,Q),Y=a;break;case h:var se=S.slice(A,Q);te.warning('attribute "'+se+'" missed quot(")!!'),J(oe,se,A);case p:Y=g}else switch(Y){case a:B.tagName,s.isHTML($[""])&&oe.match(/^(?:disabled|checked|selected)$/i)||te.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),J(oe,oe,A),A=Q,Y=n;break;case p:te.warning('attribute space is required"'+oe+'"!!');case g:Y=n,A=Q;break;case l:Y=h,A=Q;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Q++}}function R(S,A,B){for(var $=S.tagName,W=null,te=S.length;te--;){var J=S[te],oe=J.qName,Q=J.value;if((ee=oe.indexOf(":"))>0)var Y=J.prefix=oe.slice(0,ee),ie=oe.slice(ee+1),se=Y==="xmlns"&&ie;else ie=oe,Y=null,se=oe==="xmlns"&&"";J.localName=ie,se!==!1&&(W==null&&(W={},G(B,B={})),B[se]=W[se]=Q,J.uri=s.XMLNS,A.startPrefixMapping(se,Q))}for(te=S.length;te--;)(Y=(J=S[te]).prefix)&&(Y==="xml"&&(J.uri=s.XML),Y!=="xmlns"&&(J.uri=B[Y||""]));var ee;(ee=$.indexOf(":"))>0?(Y=S.prefix=$.slice(0,ee),ie=S.localName=$.slice(ee+1)):(Y=null,ie=S.localName=$);var ye=S.uri=B[Y||""];if(A.startElement(ye,ie,$,S),!S.closed)return S.currentNSMap=B,S.localNSMap=W,!0;if(A.endElement(ye,ie,$),W)for(Y in W)Object.prototype.hasOwnProperty.call(W,Y)&&A.endPrefixMapping(Y)}function M(S,A,B,$,W){if(/^(?:script|textarea)$/i.test(B)){var te=S.indexOf("",A),J=S.substring(A+1,te);if(/[&<]/.test(J))return/^script$/i.test(B)?(W.characters(J,0,J.length),te):(J=J.replace(/&#?\w+;/g,$),W.characters(J,0,J.length),te)}return A+1}function O(S,A,B,$){var W=$[B];return W==null&&((W=S.lastIndexOf(""))",A+4))>A?(B.comment(S,A+4,W-A-4),W+3):($.error("Unclosed comment"),-1):-1;if(S.substr(A+3,6)=="CDATA["){var W=S.indexOf("]]>",A+9);return B.startCDATA(),B.characters(S,A+9,W-A-9),B.endCDATA(),W+3}var te=H(S,A),J=te.length;if(J>1&&/!doctype/i.test(te[0][0])){var oe=te[1][0],Q=!1,Y=!1;J>3&&(/^public$/i.test(te[2][0])?(Q=te[3][0],Y=J>4&&te[4][0]):/^system$/i.test(te[2][0])&&(Y=te[3][0]));var ie=te[J-1];return B.startDTD(oe,Q,Y),B.endDTD(),ie.index+ie[0].length}return-1}function z(S,A,B){var $=S.indexOf("?>",A);if($){var W=S.substring(A,$).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return W?(W[0].length,B.processingInstruction(W[1],W[2]),$+2):-1}return-1}function U(){this.attributeNames={}}function H(S,A){var B,$=[],W=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(W.lastIndex=A,W.exec(S);B=W.exec(S);)if($.push(B),B[1])return $}return w.prototype=new Error,w.prototype.name=w.name,E.prototype={parse:function(S,A,B){var $=this.domBuilder;$.startDocument(),G(A,A={}),I(S,A,B,$,this.errorHandler),$.endDocument()}},U.prototype={setTagName:function(S){if(!i.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,A,B){if(!i.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:A,offset:B}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}},zr.XMLReader=E,zr.ParseError=w,zr}function Ef(){if(Wu)return er;Wu=1;var s=Bn(),e=$d(),t=Tf(),i=Sf(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function h(L){return L.replace(/\r[\n\u0085]/g,` -`).replace(/[\r\u0085\u2028]/g,` -`)}function p(L){this.options=L||{locator:{}}}function g(L,R,M){if(!L){if(R instanceof y)return R;L=R}var O={},G=L instanceof Function;function N(z){var U=L[z];!U&&G&&(U=L.length==2?function(H){L(z,H)}:L),O[z]=U&&function(H){U("[xmldom "+z+"] "+H+E(M))}||function(){}}return M=M||{},N("warning"),N("error"),N("fatalError"),O}function y(){this.cdata=!1}function w(L,R){R.lineNumber=L.lineNumber,R.columnNumber=L.columnNumber}function E(L){if(L)return` -@`+(L.systemId||"")+"#[line:"+L.lineNumber+",col:"+L.columnNumber+"]"}function I(L,R,M){return typeof L=="string"?L.substr(R,M):L.length>=R+M||R?new java.lang.String(L,R,M)+"":L}function v(L,R){L.currentElement?L.currentElement.appendChild(R):L.doc.appendChild(R)}return p.prototype.parseFromString=function(L,R){var M=this.options,O=new l,G=M.domBuilder||new y,N=M.errorHandler,z=M.locator,U=M.xmlns||{},H=/\/x?html?$/.test(R),S=H?t.HTML_ENTITIES:t.XML_ENTITIES;z&&G.setDocumentLocator(z),O.errorHandler=g(N,G,z),O.domBuilder=M.domBuilder||G,H&&(U[""]=n.HTML),U.xml=U.xml||n.XML;var A=M.normalizeLineEndings||h;return L&&typeof L=="string"?O.parse(A(L),U,S):O.errorHandler.error("invalid doc source"),G.doc},y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(L,R,M,O){var G=this.doc,N=G.createElementNS(L,M||R),z=O.length;v(this,N),this.currentElement=N,this.locator&&w(this.locator,N);for(var U=0;U!!s&&typeof s=="object",Ze=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Xu(e[i])&&Xu(t[i])?e[i]=Ze(e[i],t[i]):e[i]=t[i]}),e),{}),Vd=s=>Object.keys(s).map(e=>s[e]),Af=(s,e)=>{const t=[];for(let i=s;is.reduce((e,t)=>e.concat(t),[]),zd=s=>{if(!s.length)return[];const e=[];for(let t=0;ts.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),kf=(s,e)=>Vd(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var wi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const gr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:Mn(s||"",e)};if(t||i){const n=(t||i).split("-");let a,l=k.BigInt?k.BigInt(n[0]):parseInt(n[0],10),h=k.BigInt?k.BigInt(n[1]):parseInt(n[1],10);l{let e;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,`${s.offset}-${e}`},Yu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),If={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=Yu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:h=1/0}=s,p=Yu(s.endNumber),g=(e+t)/1e3,y=i+a,w=g+l-y,E=Math.ceil(w*r/n),I=Math.floor((g-y-h)*r/n),v=Math.floor((g-y)*r/n);return{start:Math.max(0,I),end:typeof p=="number"?p:Math.min(E,v)}}},Pf=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},No=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=If[e](s),h=Af(a,l).map(Pf(s));if(e==="static"){const p=h.length-1,g=typeof r=="number"?r:n;h[p].duration=g-t/i*p}return h},Wd=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:h}=s;if(!e)throw new Error(wi.NO_BASE_URL);const p=gr({baseUrl:e,source:t.sourceURL,range:t.range}),g=gr({baseUrl:e,source:e,indexRange:r});if(g.map=p,h){const y=No(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},Ro=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,h=e.timescale,p=e.references.filter(L=>L.referenceType!==1),g=[],y=s.endList?"static":"dynamic",w=s.sidx.timeline;let E,I=w,v=s.mediaSequence||0;E=typeof e.firstOffset=="bigint"?k.BigInt(l)+e.firstOffset:l+e.firstOffset;for(let L=0;Lkf(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Nf=(s,e)=>{for(let t=0;t{let e=[];return bf(s,Lf,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},Qu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},Rf=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=Nf(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--);r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),Qu({playlist:i,mediaSequence:r.segments[a].number})})},Mf=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Ku(s)),i=e.playlists.concat(Ku(e));return e.timelineStarts=Gd([s.timelineStarts,e.timelineStarts]),Rf({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Fn=s=>s&&s.uri+"-"+Df(s.byterange),Ia=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=Vd(i.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=xf(i.segments||[],"discontinuity"),i))},Mo=(s,e)=>{const t=Fn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ro(s,i,s.sidx.resolvedUri),s},Bf=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Mo(s[t],e);return s},Ff=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Uf=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{e===void 0&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},qf=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"";let p=a.attributes.label||"main";if(h&&!a.attributes.label){const y=l?` (${l})`:"";p=`${a.attributes.lang}${y}`}n[p]||(n[p]={language:h,autoselect:!0,default:l==="main",playlists:[],uri:""});const g=Mo(Ff(a,t),e);return n[p].playlists.push(g),i===void 0&&l==="main"&&(i=a,i.default=!0),n},{});return i||(r[Object.keys(r)[0]].default=!0),r},jf=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(Uf(i),e)),t},{}),Hf=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),$f=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},Vf=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",zf=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",Wf=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Gf=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Ju=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Xf=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:h,minimumUpdatePeriod:p}=s[0].attributes,g=Ia(s.filter(Vf)).map($f),y=Ia(s.filter(zf)),w=Ia(s.filter(Wf)),E=s.map(G=>G.attributes.captionServices).filter(Boolean),I={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Bf(g,i)};p>=0&&(I.minimumUpdatePeriod=1e3*p),e&&(I.locations=e),t&&(I.contentSteering=t),l==="dynamic"&&(I.suggestedPresentationDelay=h),n&&n.length>0&&(I.eventStream=n);const v=I.playlists.length===0,L=y.length?qf(y,i,v):null,R=w.length?jf(w,i):null,M=g.concat(Ju(L),Ju(R)),O=M.map(({timelineStarts:G})=>G);return I.timelineStarts=Gd(O),Gf(M,I.timelineStarts),L&&(I.mediaGroups.AUDIO.audio=L),R&&(I.mediaGroups.SUBTITLES.subs=R),E.length&&(I.mediaGroups["CLOSED-CAPTIONS"].cc=Hf(E)),r?Mf({oldManifest:r,newManifest:I}):I},Yf=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:h=0}=s,p=(i+r)/1e3+h-(n+l);return Math.ceil((p*a-e)/t)},Xd=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:h}=s,p=[];let g=-1;for(let y=0;yg&&(g=v),I<0){const O=y+1;L=O===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?Yf(s,g,E):(n*a-g)/E:(e[O].t-g)/E}else L=I+1;const R=l+p.length+L;let M=l+p.length;for(;M(e,t,i,r)=>{if(e==="$$")return"$";if(s[t]===void 0)return e;const n=""+s[t];return t==="RepresentationID"?n:(r=i?parseInt(r,10):1,n.length>=r?n:`${new Array(r-n.length+1).join("0")}${n}`)},Zu=(s,e)=>s.replace(Kf,Qf(e)),Jf=(s,e)=>s.duration||e?s.duration?No(s):Xd(s,e):[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}],Zf=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=gr({baseUrl:s.baseUrl,source:Zu(i.sourceURL,t),range:i.range});return Jf(s,e).map(n=>{t.Number=n.number,t.Time=n.time;const a=Zu(s.media||"",t),l=s.timescale||1,h=s.presentationTimeOffset||0,p=s.periodStart+(n.time-h)/l;return{uri:a,timeline:n.timeline,duration:n.duration,resolvedUri:Mn(s.baseUrl||"",a),map:r,number:n.number,presentationTime:p}})},ey=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=gr({baseUrl:t,source:i.sourceURL,range:i.range}),n=gr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ty=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(wi.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>ey(s,l));let a;return t&&(a=No(s)),e&&(a=Xd(s,e)),a.map((l,h)=>{if(n[h]){const p=n[h],g=s.timescale||1,y=s.presentationTimeOffset||0;return p.timeline=l.timeline,p.duration=l.duration,p.number=l.number,p.presentationTime=r+(l.time-y)/g,p}}).filter(l=>l)},sy=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Zf,t=Ze(s,e.template)):e.base?(i=Wd,t=Ze(s,e.base)):e.list&&(i=ty,t=Ze(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},iy=s=>s.map(sy),Be=(s,e)=>zd(s.childNodes).filter(({tagName:t})=>t===e),br=s=>s.textContent.trim(),ry=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),ai=s=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!e)return 0;const[t,i,r,n,a,l]=e.slice(1);return parseFloat(t||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(r||0)*86400+parseFloat(n||0)*3600+parseFloat(a||0)*60+parseFloat(l||0)},ny=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),eh={mediaPresentationDuration:s=>ai(s),availabilityStartTime:s=>ny(s)/1e3,minimumUpdatePeriod:s=>ai(s),suggestedPresentationDelay:s=>ai(s),type:s=>s,timeShiftBufferDepth:s=>ai(s),start:s=>ai(s),width:s=>parseInt(s,10),height:s=>parseInt(s,10),bandwidth:s=>parseInt(s,10),frameRate:s=>ry(s),startNumber:s=>parseInt(s,10),timescale:s=>parseInt(s,10),presentationTimeOffset:s=>parseInt(s,10),duration(s){const e=parseInt(s,10);return isNaN(e)?ai(s):e},d:s=>parseInt(s,10),t:s=>parseInt(s,10),r:s=>parseInt(s,10),presentationTime:s=>parseInt(s,10),DEFAULT:s=>s},Xe=s=>s&&s.attributes?zd(s.attributes).reduce((e,t)=>{const i=eh[t.name]||eh.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ay={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Un=(s,e)=>e.length?Ci(s.map(function(t){return e.map(function(i){const r=br(i),n=Mn(t.baseUrl,r),a=Ze(Xe(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Bo=s=>{const e=Be(s,"SegmentTemplate")[0],t=Be(s,"SegmentList")[0],i=t&&Be(t,"SegmentURL").map(y=>Ze({tag:"SegmentURL"},Xe(y))),r=Be(s,"SegmentBase")[0],n=t||e,a=n&&Be(n,"SegmentTimeline")[0],l=t||r||e,h=l&&Be(l,"Initialization")[0],p=e&&Xe(e);p&&h?p.initialization=h&&Xe(h):p&&p.initialization&&(p.initialization={sourceURL:p.initialization});const g={template:p,segmentTimeline:a&&Be(a,"S").map(y=>Xe(y)),list:t&&Ze(Xe(t),{segmentUrls:i,initialization:Xe(h)}),base:r&&Ze(Xe(r),{initialization:Xe(h)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},oy=(s,e,t)=>i=>{const r=Be(i,"BaseURL"),n=Un(e,r),a=Ze(s,Xe(i)),l=Bo(i);return n.map(h=>({segmentInfo:Ze(t,l),attributes:Ze(a,h)}))},ly=s=>s.reduce((e,t)=>{const i=Xe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=ay[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Be(t,"cenc:pssh")[0];if(n){const a=br(n);e[r].pssh=a&&Bd(a)}}return e},{}),uy=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(n=>{const[a,l]=n.split(":");a==="lang"?t.language=l:a==="er"?t.easyReader=Number(l):a==="war"?t.aspectRatio=Number(l):a==="3D"&&(t["3D"]=Number(l))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})},hy=s=>Ci(Be(s.node,"EventStream").map(e=>{const t=Xe(e),i=t.schemeIdUri;return Be(e,"Event").map(r=>{const n=Xe(r),a=n.presentationTime||0,l=t.timescale||1,h=n.duration||0,p=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:p,end:p+h/l,messageData:br(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),dy=(s,e,t)=>i=>{const r=Xe(i),n=Un(e,Be(i,"BaseURL")),a=Be(i,"Role")[0],l={role:Xe(a)};let h=Ze(s,r,l);const p=Be(i,"Accessibility")[0],g=uy(Xe(p));g&&(h=Ze(h,{captionServices:g}));const y=Be(i,"Label")[0];if(y&&y.childNodes.length){const L=y.childNodes[0].nodeValue.trim();h=Ze(h,{label:L})}const w=ly(Be(i,"ContentProtection"));Object.keys(w).length&&(h=Ze(h,{contentProtection:w}));const E=Bo(i),I=Be(i,"Representation"),v=Ze(t,E);return Ci(I.map(oy(h,n,v)))},cy=(s,e)=>(t,i)=>{const r=Un(e,Be(t.node,"BaseURL")),n=Ze(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Be(t.node,"AdaptationSet"),l=Bo(t.node);return Ci(a.map(dy(n,r,l)))},py=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=Ze({serverURL:br(s[0])},Xe(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},my=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:e||t!=="static"?null:0,gy=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Be(s,"Period");if(!a.length)throw new Error(wi.INVALID_NUMBER_OF_PERIOD);const l=Be(s,"Location"),h=Xe(s),p=Un([{baseUrl:t}],Be(s,"BaseURL")),g=Be(s,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=i,h.clientOffset=r,l.length&&(h.locations=l.map(br));const y=[];return a.forEach((w,E)=>{const I=Xe(w),v=y[E-1];I.start=my({attributes:I,priorPeriodAttributes:v?v.attributes:null,mpdType:h.type}),y.push({node:w,attributes:I})}),{locations:h.locations,contentSteeringInfo:py(g,n),representationInfo:Ci(y.map(cy(h,p))),eventStream:Ci(y.map(hy))}},Yd=s=>{if(s==="")throw new Error(wi.DASH_EMPTY_MANIFEST);const e=new wf.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(wi.DASH_INVALID_XML);return i},fy=s=>{const e=Be(s,"UTCTiming")[0];if(!e)return null;const t=Xe(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(wi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},yy=(s,e={})=>{const t=gy(Yd(s),e),i=iy(t.representationInfo);return Xf({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_y=s=>fy(Yd(s));var th,sh,ih,rh;function vy(){if(sh)return th;sh=1;var s=Math.pow(2,32);return th={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))0;r+=12,n--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i}}const Ty=vr(by());var Sy=ce([73,68,51]),Ey=function(s,e){e===void 0&&(e=0);var t=(s=ce(s))[e+5],i=s[e+6]<<21|s[e+7]<<14|s[e+8]<<7|s[e+9];return(16&t)>>4?i+20:i+10},nr=function s(e,t){return t===void 0&&(t=0),(e=ce(e)).length-t<10||!Me(e,Sy,{offset:t})?t:s(e,t+=Ey(e,t))},nh=function(s){return typeof s=="string"?Hd(s):s},Cy=function(s){return Array.isArray(s)?s.map(function(e){return nh(e)}):[nh(s)]},wy=function s(e,t,i){i===void 0&&(i=!1),t=Cy(t),e=ce(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,l=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(i)break;h=e.length}var p=e.subarray(n+8,h);Me(l,t[0])&&(t.length===1?r.push(p):r.push.apply(r,s(p,t.slice(1),i))),n=h}return r},Wr={EBML:ce([26,69,223,163]),DocType:ce([66,130]),Segment:ce([24,83,128,103]),SegmentInfo:ce([21,73,169,102]),Tracks:ce([22,84,174,107]),Track:ce([174]),TrackNumber:ce([215]),DefaultDuration:ce([35,227,131]),TrackEntry:ce([174]),TrackType:ce([131]),FlagDefault:ce([136]),CodecID:ce([134]),CodecPrivate:ce([99,162]),VideoTrack:ce([224]),AudioTrack:ce([225]),Cluster:ce([31,67,182,117]),Timestamp:ce([231]),TimestampScale:ce([42,215,177]),BlockGroup:ce([160]),BlockDuration:ce([155]),Block:ce([161]),SimpleBlock:ce([163])},oo=[128,64,32,16,8,4,2,1],Ay=function(s){for(var e=1,t=0;t=t.length)return t.length;var r=on(t,i,!1);if(Me(e.bytes,r.bytes))return i;var n=on(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},oh=function s(e,t){t=xy(t),e=ce(e);var i=[];if(!t.length)return i;for(var r=0;re.length?e.length:l+a.value,p=e.subarray(l,h);Me(t[0],n.bytes)&&(t.length===1?i.push(p):i=i.concat(s(p,t.slice(1)))),r+=n.length+a.length+p.length}return i},Dy=ce([0,0,0,1]),Iy=ce([0,0,1]),Py=ce([0,0,3]),Ly=function(s){for(var e=[],t=1;t>1&63),t.indexOf(h)!==-1&&(r=n+l),n+=l+(e==="h264"?1:2)}else n++}return s.subarray(0,0)},Oy=function(s,e,t){return Kd(s,"h264",e,t)},Ny=function(s,e,t){return Kd(s,"h265",e,t)},dt={webm:ce([119,101,98,109]),matroska:ce([109,97,116,114,111,115,107,97]),flac:ce([102,76,97,67]),ogg:ce([79,103,103,83]),ac3:ce([11,119]),riff:ce([82,73,70,70]),avi:ce([65,86,73]),wav:ce([87,65,86,69]),"3gp":ce([102,116,121,112,51,103]),mp4:ce([102,116,121,112]),fmp4:ce([115,116,121,112]),mov:ce([102,116,121,112,113,116]),moov:ce([109,111,111,118]),moof:ce([109,111,111,102])},Ai={aac:function(s){var e=nr(s);return Me(s,[255,16],{offset:e,mask:[255,22]})},mp3:function(s){var e=nr(s);return Me(s,[255,2],{offset:e,mask:[255,6]})},webm:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.webm)},mkv:function(s){var e=oh(s,[Wr.EBML,Wr.DocType])[0];return Me(e,dt.matroska)},mp4:function(s){return!Ai["3gp"](s)&&!Ai.mov(s)&&(!(!Me(s,dt.mp4,{offset:4})&&!Me(s,dt.fmp4,{offset:4}))||!(!Me(s,dt.moof,{offset:4})&&!Me(s,dt.moov,{offset:4}))||void 0)},mov:function(s){return Me(s,dt.mov,{offset:4})},"3gp":function(s){return Me(s,dt["3gp"],{offset:4})},ac3:function(s){var e=nr(s);return Me(s,dt.ac3,{offset:e})},ts:function(s){if(s.length<189&&s.length>=1)return s[0]===71;for(var e=0;e+1880};function By(){if(uh)return lh;uh=1;var s,e,t,i,r,n,a,l=9e4;return r=function(h,p){return s(i(h,p))},n=function(h,p){return e(t(h),p)},a=function(h,p,g){return t(g?h:h-p)},lh={ONE_SECOND_IN_TS:l,secondsToVideoTs:s=function(h){return h*l},secondsToAudioTs:e=function(h,p){return h*p},videoTsToSeconds:t=function(h){return h/l},audioTsToSeconds:i=function(h,p){return h/p},audioTsToVideoTs:r,videoTsToAudioTs:n,metadataTsToSeconds:a}}var js=By(),uo="8.18.1";const hs={},xs=function(s,e){return hs[s]=hs[s]||[],e&&(hs[s]=hs[s].concat(e)),hs[s]},Fy=function(s,e){xs(s,e)},Qd=function(s,e){const t=xs(s).indexOf(e);return!(t<=-1)&&(hs[s]=hs[s].slice(),hs[s].splice(t,1),!0)},Uy=function(s,e){xs(s,[].concat(e).map(t=>{const i=(...r)=>(Qd(s,i),t(...r));return i}))},ln={prefixed:!0},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],hh=en[0];let ar;for(let s=0;s(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let h=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(h=`%c${s}`,n.unshift(t)),n.unshift(h+":"),yt){yt.push([].concat(n));const g=yt.length-1e3;yt.splice(0,g>0?g:0)}if(!k.console)return;let p=k.console[i];p||i!=="debug"||(p=k.console.info||k.console.log),p&&a&&l.test(i)&&p[Array.isArray(n)?"apply":"call"](k.console,n)};function ho(s,e=":",t=""){let i,r="info";function n(...a){i("log",r,a)}return i=qy(s,n,t),n.createLogger=(a,l,h)=>{const p=l!==void 0?l:e;return ho(`${s} ${p} ${a}`,p,h!==void 0?h:t)},n.createNewLogger=(a,l,h)=>ho(a,l,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>yt?[].concat(yt):[],n.history.filter=a=>(yt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{yt&&(yt.length=0)},n.history.disable=()=>{yt!==null&&(yt.length=0,yt=null)},n.history.enable=()=>{yt===null&&(yt=[])},n.error=(...a)=>i("error",r,a),n.warn=(...a)=>i("warn",r,a),n.debug=(...a)=>i("debug",r,a),n}const Te=ho("VIDEOJS"),Jd=Te.createLogger,jy=Object.prototype.toString,Zd=function(s){return Zt(s)?Object.keys(s):[]};function fi(s,e){Zd(s).forEach(t=>e(s[t],t))}function ec(s,e,t=0){return Zd(s).reduce((i,r)=>e(i,s[r],r),t)}function Zt(s){return!!s&&typeof s=="object"}function xi(s){return Zt(s)&&jy.call(s)==="[object Object]"&&s.constructor===Object}function Ie(...s){const e={};return s.forEach(t=>{t&&fi(t,(i,r)=>{xi(i)?(xi(e[r])||(e[r]={}),e[r]=Ie(e[r],i)):e[r]=i})}),e}function tc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function un(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var Hy=Object.freeze({__proto__:null,each:fi,reduce:ec,isObject:Zt,isPlain:xi,merge:Ie,values:tc,defineLazyProperty:un});let sc,Uo=!1,ic=null,Kt=!1,rc=!1,hi=!1,di=!1,Qt=!1,co=null,hn=null;const $y=!!(k.cast&&k.cast.framework&&k.cast.framework.CastReceiverContext);let nc=null,dn=!1,cn=!1,pn=!1,qn=!1,mn=!1,gn=!1,fn=!1;const fr=!!(Oi()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch)),Ts=k.navigator&&k.navigator.userAgentData;if(Ts&&Ts.platform&&Ts.brands&&(Kt=Ts.platform==="Android",hi=!!Ts.brands.find(s=>s.brand==="Microsoft Edge"),di=!!Ts.brands.find(s=>s.brand==="Chromium"),Qt=!hi&&di,co=hn=(Ts.brands.find(s=>s.brand==="Chromium")||{}).version||null,cn=Ts.platform==="Windows"),!di){const s=k.navigator&&k.navigator.userAgent||"";Uo=/iPod/i.test(s),ic=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Kt=/Android/i.test(s),sc=function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),rc=/Firefox/i.test(s),hi=/Edg/i.test(s),di=/Chrome/i.test(s)||/CriOS/i.test(s),Qt=!hi&&di,co=hn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),nc=function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t}(),mn=/Tizen/i.test(s),gn=/Web0S/i.test(s),fn=mn||gn,dn=/Safari/i.test(s)&&!Qt&&!Kt&&!hi&&!fn,cn=/Windows/i.test(s),pn=/iPad/i.test(s)||dn&&fr&&!/iPhone/i.test(s),qn=/iPhone/i.test(s)&&!pn}const mt=qn||pn||Uo,jn=(dn||mt)&&!Qt;var ac=Object.freeze({__proto__:null,get IS_IPOD(){return Uo},get IOS_VERSION(){return ic},get IS_ANDROID(){return Kt},get ANDROID_VERSION(){return sc},get IS_FIREFOX(){return rc},get IS_EDGE(){return hi},get IS_CHROMIUM(){return di},get IS_CHROME(){return Qt},get CHROMIUM_VERSION(){return co},get CHROME_VERSION(){return hn},IS_CHROMECAST_RECEIVER:$y,get IE_VERSION(){return nc},get IS_SAFARI(){return dn},get IS_WINDOWS(){return cn},get IS_IPAD(){return pn},get IS_IPHONE(){return qn},get IS_TIZEN(){return mn},get IS_WEBOS(){return gn},get IS_SMART_TV(){return fn},TOUCH_ENABLED:fr,IS_IOS:mt,IS_ANY_SAFARI:jn});function dh(s){return typeof s=="string"&&!!s.trim()}function Vy(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Oi(){return re===k.document}function Ni(s){return Zt(s)&&s.nodeType===1}function oc(){try{return k.parent!==k.self}catch{return!0}}function lc(s){return function(e,t){if(!dh(e))return re[s](null);dh(t)&&(t=re.querySelector(t));const i=Ni(t)?t:re;return i[s]&&i[s](e)}}function ge(s="div",e={},t={},i){const r=re.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Is(r,a):r[n]===a&&n!=="tabIndex"||(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&qo(r,i),r}function Is(s,e){return s.textContent===void 0?s.innerText=e:s.textContent=e,s}function po(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ur(s,e){return Vy(e),s.classList.contains(e)}function Vs(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Hn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Te.warn("removeClass was called with an element that doesn't exist"),null)}function uc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function hc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i==null||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function ws(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function dc(s,e){return s.getAttribute(e)}function ki(s,e,t){s.setAttribute(e,t)}function $n(s,e){s.removeAttribute(e)}function cc(){re.body.focus(),re.onselectstart=function(){return!1}}function pc(){re.onselectstart=function(){return!0}}function Di(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Ii(s,"height"))),t.width||(t.width=parseFloat(Ii(s,"width"))),t}}function yr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==re[ln.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Vn(s,e){const t={x:0,y:0};if(mt){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=Ii(g,"transform");if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);t.x+=w[4],t.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);t.x+=w[12],t.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&k.WebKitCSSMatrix){const w=k.getComputedStyle(g.assignedSlot.parentElement).transform,E=new k.WebKitCSSMatrix(w);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}const i={},r=yr(e.target),n=yr(s),a=n.width,l=n.height;let h=e.offsetY-(n.top-r.top),p=e.offsetX-(n.left-r.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,mt&&(p-=t.x,h-=t.y)),i.y=1-Math.max(0,Math.min(1,h/l)),i.x=Math.max(0,Math.min(1,p/a)),i}function mc(s){return Zt(s)&&s.nodeType===3}function zn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function gc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>(typeof e=="function"&&(e=e()),Ni(e)||mc(e)?e:typeof e=="string"&&/\S/.test(e)?re.createTextNode(e):void 0)).filter(e=>e)}function qo(s,e){return gc(e).forEach(t=>s.appendChild(t)),s}function fc(s,e){return qo(zn(s),e)}function _r(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0||s.button===0&&s.buttons===1}const ks=lc("querySelector"),yc=lc("querySelectorAll");function Ii(s,e){if(!s||!e)return"";if(typeof k.getComputedStyle=="function"){let t;try{t=k.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function _c(s){[...re.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=re.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const t=re.createElement("link");t.rel="stylesheet",t.type=e.type,t.media=e.media.mediaText,t.href=e.href,s.document.head.appendChild(t)}})}var ch=Object.freeze({__proto__:null,isReal:Oi,isEl:Ni,isInFrame:oc,createEl:ge,textContent:Is,prependTo:po,hasClass:ur,addClass:Vs,removeClass:Hn,toggleClass:uc,setAttributes:hc,getAttributes:ws,getAttribute:dc,setAttribute:ki,removeAttribute:$n,blockTextSelection:cc,unblockTextSelection:pc,getBoundingClientRect:Di,findPosition:yr,getPointerPosition:Vn,isTextNode:mc,emptyEl:zn,normalizeContent:gc,appendContent:qo,insertContent:fc,isSingleLeftClick:_r,$:ks,$$:yc,computedStyle:Ii,copyStyleSheetsToWindow:_c});let mo,vc=!1;const zy=function(){if(mo.options.autoSetup===!1)return;const s=Array.prototype.slice.call(re.getElementsByTagName("video")),e=Array.prototype.slice.call(re.getElementsByTagName("audio")),t=Array.prototype.slice.call(re.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function at(s,e,t){if(!pt.has(s))return;const i=pt.get(s);if(!i.handlers)return;if(Array.isArray(e))return jo(at,s,e,t);const r=function(a,l){i.handlers[l]=[],ph(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n)if(t){if(t.guid)for(let a=0;a=e&&(s(...i),t=r)}},Sc=function(s,e,t,i=k){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,h=arguments;let p=function(){r=null,p=null,t||s.apply(l,h)};!r&&t&&s.apply(l,h),i.clearTimeout(r),r=i.setTimeout(p,e)};return a.cancel=n,a};var Ky=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Dt,bind_:Le,throttle:es,debounce:Sc});let tr;class Et{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ct(this,e,t),this.addEventListener=i}off(e,t){at(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Gn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ho(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Wn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ri(this,e)}queueTrigger(e){tr||(tr=new Map);const t=e.type||e;let i=tr.get(this);i||(i=new Map,tr.set(this,i));const r=i.get(t);i.delete(t),k.clearTimeout(r);const n=k.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tr.delete(this)),this.trigger(e)},0);i.set(t,n)}}Et.prototype.allowedEvents_={},Et.prototype.addEventListener=Et.prototype.on,Et.prototype.removeEventListener=Et.prototype.off,Et.prototype.dispatchEvent=Et.prototype.trigger;const Xn=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,ps=s=>s instanceof Et||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),Qy=(s,e)=>{ps(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},yo=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,yn=(s,e,t)=>{if(!s||!s.nodeName&&!ps(s))throw new Error(`Invalid target for ${Xn(e)}#${t}; must be a DOM node or evented object.`)},Ec=(s,e,t)=>{if(!yo(s))throw new Error(`Invalid event type for ${Xn(e)}#${t}; must be a non-empty string or array.`)},Cc=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Xn(e)}#${t}; must be a function.`)},Pa=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),yn(r,s,t),Ec(n,s,t),Cc(a,s,t),a=Le(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Bs=(s,e,t,i)=>{yn(s,s,e),s.nodeName?Yy[e](s,t,i):s[e](t,i)},Jy={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"on");if(Bs(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Bs(this,"on","dispose",n),Bs(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"one");if(e)Bs(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"any");if(e)Bs(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Bs(t,"any",i,n)}},off(s,e,t){if(!s||yo(s))at(this.eventBusEl_,s,e);else{const i=s,r=e;yn(i,this,"off"),Ec(r,this,"off"),Cc(t,this,"off"),t=Le(this,t),this.off("dispose",t),i.nodeName?(at(i,r,t),at(i,"dispose",t)):ps(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){yn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!yo(t))throw new Error(`Invalid event type for ${Xn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ri(this.eventBusEl_,s,e)}};function $o(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ge("span",{className:"vjs-event-bus"});return Object.assign(s,Jy),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&pt.has(i)&&pt.delete(i)}),k.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const Zy={state:{},setState(s){let e;return typeof s=="function"&&(s=s()),fi(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ps(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function wc(s,e){return Object.assign(s,Zy),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ps(s)&&s.on("statechanged",s.handleStateChanged),s}const hr=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},He=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Ac=function(s,e){return He(s)===He(e)};var e_=Object.freeze({__proto__:null,toLowerCase:hr,toTitleCase:He,titleCaseEquals:Ac});class V{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ie({},this.options_),t=this.options_=Ie(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${kt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&($o(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),wc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ie(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ge(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],h=n&&n[l];let p=i;return a&&a[e]?p=a[e]:h&&h[e]&&(p=h[e]),t&&(p=p.replace(/\{(\d+)\}/g,function(g,y){const w=t[y-1];let E=w;return w===void 0&&(E=g),E})),p}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[He(e.name())]=null,this.childNameIndex_[hr(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let h=a.opts;if(t[l]!==void 0&&(h=t[l]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const p=this.addChild(l,h);p&&(this[l]=p)};let r;const n=V.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,h;return typeof a=="string"?(l=a,h=e[l]||this.options_[l]||{}):(l=a.name,h=a),{name:l,opts:h}}).filter(a=>{const l=V.getComponent(a.opts.componentClass||He(a.name));return l&&!n.isTech(l)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ks(e,t||this.contentEl())}$$(e,t){return yc(e,t||this.contentEl())}hasClass(e){return ur(this.el_,e)}addClass(...e){Vs(this.el_,...e)}removeClass(...e){Hn(this.el_,...e)}toggleClass(e,t){uc(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return dc(this.el_,e)}setAttribute(e,t){ki(this.el_,e,t)}removeAttribute(e){$n(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:this.el_.style[e]=t==="auto"?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+He(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ii(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${He(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key==="Tab"||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=k.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const h=l.touches[0].pageX-t.pageX,p=l.touches[0].pageY-t.pageY;Math.sqrt(h*h+p*p)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&k.performance.now()-e{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),k.clearTimeout(e)),e}setInterval(e,t){e=Le(this,e),this.clearTimersOnDispose_();const i=k.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),k.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Le(this,e),t=k.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Le(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),k.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=k.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!!t(n.parentElement)&&!(!t(n)||n.style.opacity==="0"||k.getComputedStyle(n).height==="0px"||k.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(re.documentElement.clientWidth||k.innerWidth)||a.y<0||a.y>(re.documentElement.clientHeight||k.innerHeight))return!1;let l=re.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(!l.parentNode)return!1;l=l.parentNode}}return e||(e=this.el()),!(!r(e)||!i(e)||e.parentElement&&!(e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=V.getComponent("Tech"),r=i&&i.isTech(t),n=V===t||V.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw l=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=He(e),V.components_||(V.components_={});const a=V.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,h=Object.keys(l);if(l&&h.length>0&&h.map(p=>l[p]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return V.components_[e]=t,V.components_[hr(e)]=t,t}static getComponent(e){if(e&&V.components_)return V.components_[e]}}function t_(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function mh(s,e,t,i){return t_(s,i,t.length-1),t[i][e]}function La(s){let e;return e=s===void 0||s.length===0?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:mh.bind(null,"start",0,s),end:mh.bind(null,"end",1,s)},k.Symbol&&k.Symbol.iterator&&(e[k.Symbol.iterator]=()=>(s||[]).values()),e}function Ft(s,e){return Array.isArray(s)?La(s):s===void 0||e===void 0?La():La([[s,e]])}V.registerComponent("Component",V);const xc=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Vo=xc;function kc(s){Vo=s}function Dc(){Vo=xc}function Xs(s,e=s){return Vo(s,e)}var s_=Object.freeze({__proto__:null,createTimeRanges:Ft,createTimeRange:Ft,setFormatTime:kc,resetFormatTime:Dc,formatTime:Xs});function Ic(s,e){let t,i,r=0;if(!e)return 0;s&&s.length||(s=Ft(0,0));for(let n=0;ne&&(i=e),r+=i-t;return r/e}function Ue(s){if(s instanceof Ue)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Zt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ue.defaultMessages[this.code]||"")}function dr(s){return s!=null&&typeof s.then=="function"}function Wt(s){dr(s)&&s.then(null,e=>{})}Ue.prototype.code=0,Ue.prototype.message="",Ue.prototype.status=null,Ue.prototype.metadata=null,Ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Ue.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Ue.MEDIA_ERR_CUSTOM=0,Ue.prototype.MEDIA_ERR_CUSTOM=0,Ue.MEDIA_ERR_ABORTED=1,Ue.prototype.MEDIA_ERR_ABORTED=1,Ue.MEDIA_ERR_NETWORK=2,Ue.prototype.MEDIA_ERR_NETWORK=2,Ue.MEDIA_ERR_DECODE=3,Ue.prototype.MEDIA_ERR_DECODE=3,Ue.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Ue.MEDIA_ERR_ENCRYPTED=5,Ue.prototype.MEDIA_ERR_ENCRYPTED=5;const Oa=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(s[t]&&(e[t]=s[t]),e),{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var gh={textTracksToJson:function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const r=Oa(i.track);return i.src&&(r.src=i.src),r}).concat(Array.prototype.filter.call(s.textTracks(),function(i){return t.indexOf(i)===-1}).map(Oa))},jsonToTextTracks:function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()},trackToJson_:Oa};const Na="vjs-modal-dialog";class Pi extends V{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ge("div",{className:`${Na}-content`},{role:"document"}),this.descEl_=ge("p",{className:`${Na}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Is(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Na} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),fc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),zn(this.contentEl()),this.trigger("modalempty")}content(e){return e!==void 0&&(this.content_=e),this.content_}conditionalFocus_(){const e=re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable())return e.preventDefault(),void this.close();if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof k.HTMLAnchorElement||t instanceof k.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof k.HTMLInputElement||t instanceof k.HTMLSelectElement||t instanceof k.HTMLTextAreaElement||t instanceof k.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof k.HTMLIFrameElement||t instanceof k.HTMLObjectElement||t instanceof k.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Pi.prototype.options_={pauseOnOpen:!0,temporary:!0},V.registerComponent("ModalDialog",Pi);class Li extends Et{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},ps(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ma=function(s,e){for(let t=0;t=0;t--)if(e[t].selected){Ma(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ma(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Pc extends Li{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class n_{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;tt[r],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Wo=function(s){return new URL(s,re.baseURI)},Lc=function(s){return new URL(s,re.baseURI).href},Go=function(s){if(typeof s=="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(e)return e.pop().toLowerCase()}return""},Yn=function(s,e=k.location){return Wo(s).origin!==e.origin};var u_=Object.freeze({__proto__:null,parseUrl:Wo,getAbsoluteURL:Lc,getFileExtension:Go,isCrossOrigin:Yn});const yh=function(s,e){const t=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>Te.error(r)),k.console&&k.console.groupEnd&&k.console.groupEnd()),t.flush()},_h=function(s,e){const t={uri:s},i=Yn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Md(t,Le(this,function(n,a,l){if(n)return Te.error(n,a);e.loaded_=!0,typeof k.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type!=="vttjserror")return yh(l,e);Te.error(`vttjs failed to load, stopping trying to process ${e.src}`)}):yh(l,e)}))};class Tr extends zo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ie(e,{kind:l_[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=fh[t.mode]||"disabled";const r=t.default;t.kind!=="metadata"&&t.kind!=="chapters"||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new _n(this.cues_),a=new _n(this.activeCues_);let l=!1;this.timeupdateHandler=Le(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(p){fh[p]&&i!==p&&(i=p,this.preload_||i==="disabled"||this.cues.length!==0||_h(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const p=this.tech_.currentTime(),g=[];for(let y=0,w=this.cues.length;y=p&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let y=0;yi,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Nc extends zo{constructor(e={}){const t=Ie(e,{kind:a_[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(r){typeof r=="boolean"&&r!==i&&(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ds extends Et{constructor(e={}){let t;super();const i=new Tr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=ds.NONE,i.addEventListener("loadeddata",()=>{t=ds.LOADED,this.trigger({type:"load",target:this})})}}ds.prototype.allowedEvents_={load:"load"},ds.NONE=0,ds.LOADING=1,ds.LOADED=2,ds.ERROR=3;const xt={audio:{ListClass:i_,TrackClass:Oc,capitalName:"Audio"},video:{ListClass:r_,TrackClass:Nc,capitalName:"Video"},text:{ListClass:Pc,TrackClass:Tr,capitalName:"Text"}};Object.keys(xt).forEach(function(s){xt[s].getterName=`${s}Tracks`,xt[s].privateName=`${s}Tracks_`});const yi={remoteText:{ListClass:Pc,TrackClass:Tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:n_,TrackClass:ds,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ct=Object.assign({},xt,yi);function h_(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ct.text.TrackClass(r);return n.addTrack(a),a}yi.names=Object.keys(yi),xt.names=Object.keys(xt),ct.names=[].concat(yi.names).concat(xt.names);class fe extends V{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ct.names.forEach(i=>{const r=ct[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:e.nativeCaptions!==!0&&e.nativeTextTracks!==!0||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ct.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Le(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ft(0,0)}bufferedPercent(){return Ic(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(xt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Ue(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ft(0,0):Ft()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){xt.names.forEach(e=>{const t=xt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!k.WebVTT)if(re.body.contains(this.el())){if(!this.options_["vtt.js"]&&xi(Ru)&&Object.keys(Ru).length>0)return void this.trigger("vttjsloaded");const e=re.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;lthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=kt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return fe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof fe||e instanceof fe||e===fe}static registerTech(e,t){if(fe.techs_||(fe.techs_={}),!fe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!fe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!fe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=He(e),fe.techs_[e]=t,fe.techs_[hr(e)]=t,e!=="Tech"&&fe.defaultTechOrder_.push(e),t}static getTech(e){if(e)return fe.techs_&&fe.techs_[e]?fe.techs_[e]:(e=He(e),k&&k.videojs&&k.videojs[e]?(Te.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),k.videojs[e]):void 0)}}ct.names.forEach(function(s){const e=ct[s];fe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),fe.prototype.featuresVolumeControl=!0,fe.prototype.featuresMuteControl=!0,fe.prototype.featuresFullscreenResize=!1,fe.prototype.featuresPlaybackRate=!1,fe.prototype.featuresProgressEvents=!1,fe.prototype.featuresSourceset=!1,fe.prototype.featuresTimeupdateEvents=!1,fe.prototype.featuresNativeTextTracks=!1,fe.prototype.featuresVideoFrameCallback=!1,fe.withSourceHandlers=function(s){s.registerSourceHandler=function(e,t){let i=s.sourceHandlers;i||(i=s.sourceHandlers=[]),t===void 0&&(t=i.length),i.splice(t,0,e)},s.canPlayType=function(e){const t=s.sourceHandlers||[];let i;for(let r=0;rUs(e,zs[e.type],t,s),1)}function p_(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function m_(s,e,t){return s.reduceRight(Xo(t),e[t]())}function g_(s,e,t,i){return e[t](s.reduce(Xo(t),i))}function vh(s,e,t,i=null){const r="call"+He(t),n=s.reduce(Xo(r),i),a=n===bn,l=a?null:e[t](n);return __(s,t,l,a),l}const f_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},y_={setCurrentTime:1,setMuted:1,setVolume:1},bh={play:1,pause:1};function Xo(s){return(e,t)=>e===bn?bn:t[s]?t[s](e):e}function __(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function v_(s){vn.hasOwnProperty(s.id())&&delete vn[s.id()]}function b_(s,e){const t=vn[s.id()];let i=null;if(t==null)return i=e(s),vn[s.id()]=[[e,i]],i;for(let r=0;r{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`;const Sh=mn?10009:gn?461:8,oi={codes:{play:415,pause:19,ff:417,rw:412,back:Sh},names:{415:"play",19:"pause",417:"ff",412:"rw",[Sh]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!(!this.names[s.keyCode]||this.names[s.keyCode]!==e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Eh=5;class C_ extends Et{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(oi.isEventKey(t,"play")||oi.isEventKey(t,"pause")||oi.isEventKey(t,"ff")||oi.isEventKey(t,"rw")){t.preventDefault();const i=oi.getEventName(t);this.performMediaAction_(i)}else oi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Eh);break;case"rw":this.userSeek_(this.player_.currentTime()-Eh)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||i)&&t||(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_")){if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el()))return void t.push(r);r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r)}if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((a,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>a,getPositions:()=>{const h=a.getBoundingClientRect();return{boundingClientRect:{x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},center:{x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:h=>!0,focus:()=>a.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,h=this.calculateDistance_(e,l,i);h=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Te.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ge("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Is(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("ClickableComponent",Kn);class Ba extends Kn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ge("div",{className:"vjs-poster"})}crossOrigin(e){if(e===void 0)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;e===null||e==="anonymous"||e==="use-credentials"?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ge("picture",{className:"vjs-poster",tabIndex:-1},{},ge("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Wt(this.player_.play()):this.player_.pause())}}Ba.prototype.crossorigin=Ba.prototype.crossOrigin,V.registerComponent("PosterImage",Ba);const At="#222",Ch="#ccc",A_={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Fa(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(s.length!==7)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function ls(s,e,t){try{s.style[e]=t}catch{return}}function wh(s){return s?`${s}px`:""}class x_ extends V{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Le(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const a=k.screen.orientation||k,l=k.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const h=this.options_.playerOptions.tracks||[];for(let p=0;p0&&l.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!k.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),ls(this.el_,"insetInline",wh(n)),ls(this.el_,"insetBlock",wh(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&ls(a.firstChild,"color",Fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ls(a.firstChild,"backgroundColor",Fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ls(a,"backgroundColor",Fa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ch}, 0 1px ${Ch}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const l=k.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=A_[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof k.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;ithis.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Wt(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const n=()=>r.focus();dr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ah.prototype.controlText_="Play Video",V.registerComponent("BigPlayButton",Ah);class D_ extends ot{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}V.registerComponent("CloseButton",D_);class xh extends ot{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Wt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}xh.prototype.controlText_="Play",V.registerComponent("PlayToggle",xh);class _i extends V{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ge("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ge("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||e.type!=="seeking")&&this.updateContent(e)}updateTextNode_(e=0){e=Xs(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Te.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=re.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}_i.prototype.labelText_="Time",_i.prototype.controlText_="Time",V.registerComponent("TimeDisplay",_i);class Ua extends _i{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ua.prototype.labelText_="Current Time",Ua.prototype.controlText_="Current Time",V.registerComponent("CurrentTimeDisplay",Ua);class qa extends _i{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}qa.prototype.labelText_="Duration",qa.prototype.controlText_="Duration",V.registerComponent("DurationDisplay",qa);class I_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}V.registerComponent("TimeDivider",I_);class ja extends _i{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ge("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ja.prototype.labelText_="Remaining Time",ja.prototype.controlText_="Remaining Time",V.registerComponent("RemainingTimeDisplay",ja);class P_ extends V{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ge("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ge("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(re.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}V.registerComponent("LiveDisplay",P_);class kh extends ot{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ge("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Sr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}kh.prototype.controlText_="Seek to live, currently playing live",V.registerComponent("SeekToLive",kh);var L_=Object.freeze({__proto__:null,clamp:Sr});class Yo extends V{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type!=="touchstart"||Qt||e.preventDefault(),cc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;pc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Sr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Vn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}V.registerComponent("Slider",Yo);const Ha=(s,e)=>Sr(s/e*100,0,100).toFixed(2)+"%";class O_ extends V{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ge("span",{className:"vjs-control-text"}),i=ge("span",{textContent:this.localize("Loaded")}),r=re.createTextNode(": ");return this.percentageEl_=ge("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Ha(n,r);this.percent_!==l&&(this.el_.style.width=l,Is(this.percentageEl_,l),this.percent_=l);for(let h=0;hi.length;h--)this.el_.removeChild(a[h-1]);a.length=i.length})}}V.registerComponent("LoadProgressBar",O_);class N_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=yr(this.el_),n=Di(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,l=a);let p=r.width/2;lr.width&&(p=r.width),p=Math.round(p),this.el_.style.right=`-${p}px`,this.write(i)}write(e){Is(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),h=l-t*l;n=(h<1?"":"-")+Xs(h,l)}else n=Xs(i,a);this.update(e,t,n),r&&r()})}}V.registerComponent("TimeTooltip",N_);class $a extends V{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}$a.prototype.options_={children:[]},mt||Kt||$a.prototype.options_.children.push("timeTooltip"),V.registerComponent("PlayProgressBar",$a);class Dh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}Dh.prototype.options_={children:["timeTooltip"]},V.registerComponent("MouseTimeDisplay",Dh);const Xr=5,Ih=12;class Va extends Yo{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Le(this,this.update),this.update=es(this.update_,Dt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.on(re,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){re.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Dt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(re.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Xs(i,n),Xs(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Di(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){_r(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!_r(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}else i=r*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Wt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Ih)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Ih)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.off(re,"visibilitychange",this.toggleVisibility_),super.dispose()}}Va.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},mt||Kt||Va.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),V.registerComponent("SeekBar",Va);class Ph extends V{constructor(e,t){super(e,t),this.handleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.throttledHandleMouseSeek=es(Le(this,this.handleMouseSeek),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=yr(n);let l=Vn(n,e).x;l=Sr(l,0,1),r&&r.update(a,l),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Wt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ph.prototype.options_={children:["seekBar"]},V.registerComponent("ProgressControl",Ph);class Lh extends ot{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){re.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in k?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof re.exitPictureInPicture=="function"&&super.show()}}Lh.prototype.controlText_="Picture-in-Picture",V.registerComponent("PictureInPictureToggle",Lh);class Oh extends ot{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),re[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Oh.prototype.controlText_="Fullscreen",V.registerComponent("FullscreenToggle",Oh);const R_=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class M_ extends V{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}V.registerComponent("VolumeLevel",M_);class B_ extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Di(this.el_),a=Di(this.player_.el()),l=e.width*t;if(!a||!n)return;const h=e.left-a.left+l,p=e.width-l+(a.right-e.right);let g=n.width/2;hn.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Is(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}V.registerComponent("VolumeLevelTooltip",B_);class Nh extends V{constructor(e,t){super(e,t),this.update=es(Le(this,this.update),Dt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Nh.prototype.options_={children:["volumeLevelTooltip"]},V.registerComponent("MouseVolumeLevelDisplay",Nh);class Yr extends Yo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){_r(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Di(i),n=this.vertical();let a=Vn(i,e);a=n?a.y:a.x,a=Sr(a,0,1),t.update(r,a,n)}_r(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},mt||Kt||Yr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yr.prototype.playerEvent="volumechange",V.registerComponent("VolumeBar",Yr);class Rh extends V{constructor(e,t={}){t.vertical=t.vertical||!1,(t.volumeBar===void 0||xi(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),R_(this,e),this.throttledHandleMouseMove=es(Le(this,this.handleMouseMove),Dt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Rh.prototype.options_={children:["volumeBar"]},V.registerComponent("VolumeControl",Rh);const F_=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Mh extends ot{constructor(e,t){super(e,t),F_(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),mt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Hn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Vs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Mh.prototype.controlText_="Mute",V.registerComponent("MuteToggle",Mh);class Bh extends V{constructor(e,t={}){t.inline!==void 0?t.inline=t.inline:t.inline=!0,(t.volumeControl===void 0||xi(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Ct(re,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),at(re,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Bh.prototype.options_={children:["muteToggle","volumeControl"]},V.registerComponent("VolumePanel",Bh);class Fh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Fh.prototype.controlText_="Skip Forward",V.registerComponent("SkipForward",Fh);class Uh extends ot{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;n=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Uh.prototype.controlText_="Skip Backward",V.registerComponent("SkipBackward",Uh);class Mc extends V{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ge(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Ct(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||re.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):e.key!=="ArrowRight"&&e.key!=="ArrowUp"||(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}V.registerComponent("Menu",Mc);class Ko extends V{constructor(e,t={}){super(e,t),this.menuButton_=new ot(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=ot.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Ct(re,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Mc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ge("li",{className:"vjs-menu-title",textContent:He(this.options_.title),tabIndex:-1}),i=new V(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof k.Event!="object")try{l=new k.Event("change")}catch{}l||(l=re.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let r=0;r-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}V.registerComponent("OffTextTrackMenuItem",Bc);class Mi extends Qo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Cr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}V.registerComponent("TextTrackButton",Mi);class Fc extends Er{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(He(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(He(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Jo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Uc),e}}Ya.prototype.kinds_=["captions","subtitles"],Ya.prototype.controlText_="Subtitles",V.registerComponent("SubsCapsButton",Ya);class qc extends Er{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;ithis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}_o.prototype.contentElType="button",V.registerComponent("PlaybackRateMenuItem",_o);class jh extends Ko{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ge("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new _o(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}jh.prototype.controlText_="Playback Rate",V.registerComponent("PlaybackRateMenuButton",jh);class jc extends V{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}V.registerComponent("Spacer",jc);class U_ extends jc{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}V.registerComponent("CustomControlSpacer",U_);class Hh extends V{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hh.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},V.registerComponent("ControlBar",Hh);class $h extends Pi{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}$h.prototype.options_=Object.assign({},Pi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),V.registerComponent("ErrorDisplay",$h);class Hc extends V{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ge("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+e[1].replace(/\W+/g,""),i=ge("option",{id:t,value:this.localize(e[0]),textContent:e[1]});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}V.registerComponent("TextTrackSelect",Hc);class Ws extends V{constructor(e,t={}){super(e,t);const i=ge("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,h=a.id.replace("%s",this.options_.id_);let p=null;const g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){p=ge("span",{className:l});const w=ge("label",{id:h,className:"vjs-label",textContent:a.label});w.setAttribute("for",g),p.appendChild(w)}const y=new Hc(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(y),this.options_.type==="colors"&&(p.appendChild(y.el()),this.el().appendChild(p))}}createEl(){return ge("fieldset",{className:this.options_.className})}}V.registerComponent("TextTrackFieldset",Ws);class $c extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-colors"})}}V.registerComponent("TextTrackSettingsColors",$c);class Vc extends V{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ws(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ws(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ws(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-font"})}}V.registerComponent("TextTrackSettingsFont",Vc);class zc extends V{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new ot(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new ot(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return ge("div",{className:"vjs-track-settings-controls"})}}V.registerComponent("TrackSettingsControls",zc);const Ka="vjs-text-track-settings",Vh=["#000","Black"],zh=["#00F","Blue"],Wh=["#0FF","Cyan"],Gh=["#0F0","Green"],Xh=["#F0F","Magenta"],Yh=["#F00","Red"],Kh=["#FFF","White"],Qh=["#FF0","Yellow"],Qa=["1","Opaque"],Ja=["0.5","Semi-Transparent"],Jh=["0","Transparent"],As={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vh,Kh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Qa,Ja,Jh],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kh,Vh,Yh,Gh,zh,Qh,Xh,Wh],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Qa,Ja],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Jh,Ja,Qa],className:"vjs-window-opacity vjs-opacity"}};function Wc(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function q_(s,e){return Wc(s.options[s.options.selectedIndex].value,e)}function j_(s,e,t){if(e){for(let i=0;i{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),fi(As,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ec(As,(e,t,i)=>{const r=q_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){fi(As,(t,i)=>{j_(this.$(t.selector),e[i],t.parser)})}setDefaults(){fi(As,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(k.localStorage.getItem(Ka))}catch(t){Te.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(Ka,JSON.stringify(e)):k.localStorage.removeItem(Ka)}catch(t){Te.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}V.registerComponent("TextTrackSettings",H_);class $_ extends V{constructor(e,t){let i=t.ResizeObserver||k.ResizeObserver;t.ResizeObserver===null&&(i=!1),super(e,Ie({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||k.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Sc(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const r=this.debouncedHandler_;let n=this.unloadListener_=function(){at(this,"resize",r),at(this,"unload",n),n=null};Ct(this.el_.contentWindow,"unload",n),Ct(this.el_.contentWindow,"resize",r)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}V.registerComponent("ResizeManager",$_);const V_={trackingThreshold:20,liveTolerance:15};class z_ extends V{constructor(e,t){super(e,Ie(V_,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=i=>this.handlePlay(i),this.handleFirstTimeupdate_=i=>this.handleFirstTimeupdate(i),this.handleSeeked_=i=>this.handleSeeked(i),this.seekToLiveEdge_=i=>this.seekToLiveEdge(i),this.reset_(),this.on(this.player_,"durationchange",i=>this.handleDurationchange(i)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(k.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Dt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}V.registerComponent("LiveTracker",z_);class W_ extends V{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ge("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:ge("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},ge("div",{className:"vjs-title-bar"},{},tc(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];zn(a),n&&Is(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}V.registerComponent("TitleBar",W_);const G_={initialDisplay:4e3,position:[],takeFocus:!1};class X_ extends ot{constructor(e,t){super(e,t=Ie(G_,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ge("button",{},{type:"button",class:this.buildCSSClass()},ge("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}V.registerComponent("TransientButton",X_);const vo=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let i=0;iGc([s.el(),k.HTMLMediaElement.prototype,k.Element.prototype,Y_],"innerHTML"),Zh=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=K_(s),r=n=>(...a)=>{const l=n.apply(e,a);return vo(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ie(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},Q_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Lc(k.Element.prototype.getAttribute.call(this,"src")):""},set(s){return k.Element.prototype.setAttribute.call(this,"src",s),s}}),J_=s=>Gc([s.el(),k.HTMLMediaElement.prototype,Q_],"src"),Z_=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=J_(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ie(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return vo(s)||(s.triggerSourceset(""),Zh(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):vo(s)||Zh(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class he extends fe{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),r||this.el_.hasAttribute("crossorigin")||!Yn(h.src)||(r=!0)):l.push(h))}for(let h=0;h{t=[];for(let n=0;ne.removeEventListener("change",i));const r=()=>{for(let n=0;n{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=xt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[yi.remoteText.getterName]().trigger(h)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let h=0;h{const h=n[l];i.addEventListener(l,h),this.on("dispose",p=>i.removeEventListener(l,h))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){xt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),he.disposeMediaElement(e),e=i}else{e=re.createElement("video");const i=Ie({},this.options_.tag&&ws(this.options_.tag));fr&&this.options_.nativeControlsForTouch===!0||delete i.controls,hc(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}this.options_.preload!==void 0&&ki(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&jn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Te(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Kt&&Qt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Wt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){he.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=re.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),k.performance&&(e.creationTime=k.performance.now()),e}}un(he,"TEST_VID",function(){if(!Oi())return;const s=re.createElement("video"),e=re.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}),he.isSupported=function(){try{he.TEST_VID.volume=.5}catch{return!1}return!(!he.TEST_VID||!he.TEST_VID.canPlayType)},he.canPlayType=function(s){return he.TEST_VID.canPlayType(s)},he.canPlaySource=function(s,e){return he.canPlayType(s.type)},he.canControlVolume=function(){try{const s=he.TEST_VID.volume;he.TEST_VID.volume=s/2+.1;const e=s!==he.TEST_VID.volume;return e&&mt?(k.setTimeout(()=>{he&&he.prototype&&(he.prototype.featuresVolumeControl=s!==he.TEST_VID.volume)}),!1):e}catch{return!1}},he.canMuteVolume=function(){try{const s=he.TEST_VID.muted;return he.TEST_VID.muted=!s,he.TEST_VID.muted?ki(he.TEST_VID,"muted","muted"):$n(he.TEST_VID,"muted","muted"),s!==he.TEST_VID.muted}catch{return!1}},he.canControlPlaybackRate=function(){if(Kt&&Qt&&hn<58)return!1;try{const s=he.TEST_VID.playbackRate;return he.TEST_VID.playbackRate=s/2+.1,s!==he.TEST_VID.playbackRate}catch{return!1}},he.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(re.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(re.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(re.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},he.supportsNativeTextTracks=function(){return jn||mt&&Qt},he.supportsNativeVideoTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.videoTracks)},he.supportsNativeAudioTracks=function(){return!(!he.TEST_VID||!he.TEST_VID.audioTracks)},he.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){un(he.prototype,s,()=>he[e](),!0)}),he.prototype.featuresVolumeControl=he.canControlVolume(),he.prototype.movingMediaElementInDOM=!mt,he.prototype.featuresFullscreenResize=!0,he.prototype.featuresProgressEvents=!0,he.prototype.featuresTimeupdateEvents=!0,he.prototype.featuresVideoFrameCallback=!(!he.TEST_VID||!he.TEST_VID.requestVideoFrameCallback),he.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}},he.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){he.prototype["set"+He(s)]=function(e){this.el_[s]=e}}),["pause","load","play"].forEach(function(s){he.prototype[s]=function(){return this.el_[s]()}}),fe.withSourceHandlers(he),he.nativeSourceHandler={},he.nativeSourceHandler.canPlayType=function(s){try{return he.TEST_VID.canPlayType(s)}catch{return""}},he.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return he.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Go(s.src);return he.nativeSourceHandler.canPlayType(`video/${t}`)}return""},he.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)},he.nativeSourceHandler.dispose=function(){},he.registerSourceHandler(he.nativeSourceHandler),fe.registerTech("Html5",he);const Xc=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Za={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bo=["tiny","xsmall","small","medium","large","xlarge","huge"],tn={};bo.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;tn[s]=`vjs-layout-${e}`});const e0={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ne extends V{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${kt()}`,(t=Object.assign(Ne.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Jd(this.id_),this.fsApi_=ln,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ws(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=Ne.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),$o(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Ct(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ie(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const a=new k.DOMParser().parseFromString(E_,"image/svg+xml");if(a.querySelector("parsererror"))Te.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const l=a.documentElement;l.style.display="none",this.el_.appendChild(l),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new C_(this),this.addClass("vjs-spatial-navigation-enabled")),fr&&this.addClass("vjs-touch-enabled"),mt||this.addClass("vjs-workinghover"),Ne.players[this.id_]=this;const n=uo.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),at(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),at(re,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ne.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),v_(this),ct.names.forEach(e=>{const t=this[ct[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const n=ws(t);if(r){for(e=this.el_=t,t=this.tag=re.createElement("video");e.children.length;)t.appendChild(e.firstChild);ur(e,"video-js")||Vs(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(h=>{try{t[h]=e[h]}catch{}})}t.setAttribute("tabindex","-1"),n.tabindex="-1",Qt&&cn&&(t.setAttribute("role","application"),n.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(h){r&&h==="class"||e.setAttribute(h,n[h]),r&&t.setAttribute(h,n[h])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>ac[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=bc("vjs-styles-dimensions");const h=ks(".vjs-styles-defaults"),p=ks("head");p.insertBefore(this.styleEl_,h?h.nextSibling:p.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=t.getElementsByTagName("a");for(let h=0;h{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(k.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,p=this.tech_&&this.tech_.el();return void(p&&(l>=0&&(p.width=l),h>=0&&(p.height=h)))}let e,t,i,r;i=this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),a=n[1]/n[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/a:this.videoWidth()||300,t=this.height_!==void 0?this.height_:e*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Tc(this.styleEl_,` - .${r} { - width: ${e}px; - height: ${t}px; - } - - .${r}.vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: ${100*a}%; - } - `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=He(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(fe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ct.names.forEach(h=>{const p=ct[h];a[p.getterName]=this[p.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=fe.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(Le(this,this.handleTechReady_),!0),gh.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Xc.forEach(h=>{this.on(this.tech_,h,p=>this[`handleTech${He(h)}_`](p))}),Object.keys(Za).forEach(h=>{this.on(this.tech_,h,p=>{this.tech_.playbackRate()===0&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Za[h]}_`].bind(this),event:p}):this[`handleTech${Za[h]}_`](p)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,p)=>this.handleTechFullscreenChange_(h,p)),this.on(this.tech_,"fullscreenerror",(h,p)=>this.handleTechFullscreenError_(h,p)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||i==="Html5"&&this.tag||po(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ct.names.forEach(e=>{const t=ct[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=gh.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Te.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. -See https://github.com/videojs/video.js/issues/2617 for more info. -`),this.tech_}version(){return{"video.js":uo}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(dr(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;return e!=="any"||this.muted()?i=e!=="muted"||this.muted()?this.play():t():(i=this.play(),dr(i)&&(i=i.catch(t))),dr(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=S_(this,t)),this.cache_.source=Ie({},e,{src:t,type:i});const r=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),l=[];for(let h=0;hthis.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.click!==void 0&&this.options_.userActions.click===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Wt(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=re[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in y_)return g_(this.middleware_,this.tech_,e,t);if(e in bh)return vh(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Te(i),i}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in f_)return m_(this.middleware_,this.tech_,e);if(e in bh)return vh(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Te(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Te(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Te(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Wt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(jn||mt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=n=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ft(0,0)}scrubbing(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return e===void 0?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ft(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ft(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ic(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return e!==void 0?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(p,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(h,p){r(),i(p)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=re[this.fsApi_.exitFullscreen]();return e&&Wt(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=re.documentElement.style.overflow,Ct(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow="hidden",Vs(re.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,at(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow=this.docOrigOverflow,Hn(re.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&k.documentPictureInPicture){const e=re.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ge("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),k.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(_c(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in re&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return k.documentPictureInPicture&&k.documentPictureInPicture.window?(k.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in re?re.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const r=i.tagName.toLowerCase();return i.isContentEditable?!0:r==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=V.getComponent("FullscreenToggle");re[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),V.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),V.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i[l,fe.getTech(l)]).filter(([l,h])=>h?h.isSupported():(Te.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,h,p){let g;return l.some(y=>h.some(w=>{if(g=p(y,w),g)return!0})),g};let r;const n=l=>(h,p)=>l(p,h),a=([l,h],p)=>{if(h.canPlaySource(p,this.options_[l.toLowerCase()]))return{source:p,tech:l}};return r=this.options_.sourceOrder?i(e,t,n(a)):i(t,e,a),r||!1}handleSrc_(e,t){if(e===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Rc(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),c_(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());p_(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Ac(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Wt(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ps(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):this.options_.autoplay=!!e,t=t===void 0?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(xs("beforeerror").forEach(t=>{const i=t(this,e);Zt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(e===null)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Ue(e),this.addClass("vjs-error"),Te.error(`(CODE:${this.error_.code} ${Ue.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),xs("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Le(this,this.reportUserActivity),n=function(y){y.screenX===t&&y.screenY===i||(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const h=this.getChild("controlBar");let p;!h||mt||Kt||(h.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);const y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ps(this)&&this.trigger("languagechange"))}languages(){return Ie(Ne.prototype.options_.languages,this.languages_)}toJSON(){const e=Ie(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),i=>({kind:i.kind,label:i.label,language:i.language,src:i.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Tn(t.poster)}]),t}return Ie(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=ws(e),r=i["data-setup"];if(ur(e,"vjs-fill")&&(i.fill=!0),ur(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Te.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ct.names.forEach(function(s){const e=ct[s];Ne.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Ne.prototype.crossorigin=Ne.prototype.crossOrigin,Ne.players={};const sr=k.navigator;Ne.prototype.options_={techOrder:fe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sr&&(sr.languages&&sr.languages[0]||sr.userLanguage||sr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1},Xc.forEach(function(s){Ne.prototype[`handleTech${He(s)}_`]=function(){return this.trigger(s)}}),V.registerComponent("Player",Ne);const Sn="plugin",vi="activePlugins_",ci={},En=s=>ci.hasOwnProperty(s),sn=s=>En(s)?ci[s]:void 0,Yc=(s,e)=>{s[vi]=s[vi]||{},s[vi][e]=!0},Cn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},t0=function(s,e){const t=function(){Cn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Yc(this,s),Cn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},ed=(s,e)=>(e.prototype.name=s,function(...t){Cn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Cn(this,i.getEventHash()),i});class _t{constructor(e){if(this.constructor===_t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),$o(this),delete this.trigger,wc(this,this.constructor.defaultState),Yc(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ri(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[vi][e]=!1,this.player=this.state=null,t[e]=ed(e,ci[e])}static isBasic(e){const t=typeof e=="string"?sn(e):e;return typeof t=="function"&&!_t.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(En(e))Te.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ne.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ci[e]=t,e!==Sn&&(_t.isBasic(t)?Ne.prototype[e]=t0(e,t):Ne.prototype[e]=ed(e,t)),t}static deregisterPlugin(e){if(e===Sn)throw new Error("Cannot de-register base plugin.");En(e)&&(delete ci[e],delete Ne.prototype[e])}static getPlugins(e=Object.keys(ci)){let t;return e.forEach(i=>{const r=sn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=sn(e);return t&&t.VERSION||""}}function s0(s,e){let t=!1;return function(...i){return t||Te.warn(s),t=!0,e.apply(this,i)}}function Mt(s,e,t,i){return s0(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}_t.getPlugin=sn,_t.BASE_PLUGIN_NAME=Sn,_t.registerPlugin(Sn,_t),Ne.prototype.usingPlugin=function(s){return!!this[vi]&&this[vi][s]===!0},Ne.prototype.hasPlugin=function(s){return!!En(s)};var i0={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Kc=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.getPlayer(s);if(i)return e&&Te.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?ks("#"+Kc(s)):s;if(!Ni(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const n="getRootNode"in r&&r.getRootNode()instanceof k.ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&n.contains(r)||Te.warn("The element supplied is not included in the DOM"),(e=e||{}).restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),xs("beforesetup").forEach(l=>{const h=l(r,Ie(e));Zt(h)&&!Array.isArray(h)?e=Ie(e,h):Te.error("please return an object in beforesetup hooks")});const a=V.getComponent("Player");return i=new a(r,e,t),xs("setup").forEach(l=>l(i)),i}if(F.hooks_=hs,F.hooks=xs,F.hook=Fy,F.hookOnce=Uy,F.removeHook=Qd,k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Oi()){let s=ks(".vjs-styles-defaults");if(!s){s=bc("vjs-styles-defaults");const e=ks("head");e&&e.insertBefore(s,e.firstChild),Tc(s,` - .video-js { - width: 300px; - height: 150px; - } - - .vjs-fluid:not(.vjs-audio-only-mode) { - padding-top: 56.25% - } - `)}}go(1,F),F.VERSION=uo,F.options=Ne.prototype.options_,F.getPlayers=()=>Ne.players,F.getPlayer=s=>{const e=Ne.players;let t;if(typeof s=="string"){const i=Kc(s),r=e[i];if(r)return r;t=ks("#"+i)}else t=s;if(Ni(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}},F.getAllPlayers=()=>Object.keys(Ne.players).map(s=>Ne.players[s]).filter(Boolean),F.players=Ne.players,F.getComponent=V.getComponent,F.registerComponent=(s,e)=>(fe.isTech(e)&&Te.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),V.registerComponent.call(V,s,e)),F.getTech=fe.getTech,F.registerTech=fe.registerTech,F.use=d_,Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(F.middleware,"TERMINATOR",{value:bn,writeable:!1,enumerable:!0}),F.browser=ac,F.obj=Hy,F.mergeOptions=Mt(9,"videojs.mergeOptions","videojs.obj.merge",Ie),F.defineLazyProperty=Mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",un),F.bind=Mt(9,"videojs.bind","native Function.prototype.bind",Le),F.registerPlugin=_t.registerPlugin,F.deregisterPlugin=_t.deregisterPlugin,F.plugin=(s,e)=>(Te.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_t.registerPlugin(s,e)),F.getPlugins=_t.getPlugins,F.getPlugin=_t.getPlugin,F.getPluginVersion=_t.getPluginVersion,F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Ie(F.options.languages,{[s]:e}),F.options.languages[s]},F.log=Te,F.createLogger=Jd,F.time=s_,F.createTimeRange=Mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ft),F.createTimeRanges=Mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ft),F.formatTime=Mt(9,"videojs.formatTime","videojs.time.formatTime",Xs),F.setFormatTime=Mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",kc),F.resetFormatTime=Mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dc),F.parseUrl=Mt(9,"videojs.parseUrl","videojs.url.parseUrl",Wo),F.isCrossOrigin=Mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Yn),F.EventTarget=Et,F.any=Ho,F.on=Ct,F.one=Gn,F.off=at,F.trigger=Ri,F.xhr=Md,F.TextTrack=Tr,F.AudioTrack=Oc,F.VideoTrack=Nc,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return Te.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),ch[s].apply(null,arguments)}}),F.computedStyle=Mt(9,"videojs.computedStyle","videojs.dom.computedStyle",Ii),F.dom=ch,F.fn=Ky,F.num=L_,F.str=e_,F.url=u_,F.Error=i0;class r0{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(i){t.enabled_(i)}}),t}}class wn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new r0(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ti,s.qualityLevels.VERSION=Qc,i},td=function(s){return n0(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",td),td.VERSION=Qc;const vt=Mn,An=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function we(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function gt(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function a0(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: -`;for(let t=0;t ${r}. Duration (${r-i}) -`}return e}const Gt=1/30,Xt=3*Gt,Jc=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i=e})},Kr=function(s,e){return Jc(s,function(t){return t-Gt>=e})},o0=function(s){if(s.length<2)return gt();const e=[];for(let t=1;t{const e=[];if(!s||!s.length)return"";for(let t=0;t "+s.end(t));return e.join(", ")},u0=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Hs=s=>{const e=[];for(let t=0;tn||(t+=e>r&&e<=n?n-e:n-r)}return t},el=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},To=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),ep=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},tp=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},sp=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=ep(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},d0=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(r.start!==void 0)return{result:r.start,precise:!0};if(r.end!==void 0)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],r.end!==void 0)return{result:t+r.end,precise:!0};if(t+=el(s,r),r.start!==void 0)return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},c0=function(s,e){let t,i=0,r=e-s.mediaSequence;for(;ri&&([t,i]=[i,t]),t<0){for(let n=t;nDate.now()},tl=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Qn=function(s){const e=np(s);return!s.disabled&&!e},ap=function(s,e){return e.attributes&&e.attributes[s]},p0=function(s,e,t,i=0){return ap("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-8*i)/e:NaN},So=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>!!Qn(i)&&(i.attributes.BANDWIDTH||0)!(!s&&!e||!s&&e||s&&!e)&&(s===e||!(!s.id||!e.id||s.id!==e.id)||!(!s.resolvedUri||!e.resolvedUri||s.resolvedUri!==e.resolvedUri)||!(!s.uri||!e.uri||s.uri!==e.uri)),id=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},wr=s=>{if(!s||!s.playlists||!s.playlists.length)return id(s,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;eUd(r)))&&!id(s,r=>sl(t,r)))return!1}return!0};var bt={liveEdgeDelay:sp,duration:rp,seekable:function(s,e,t){const i=e||0;let r=sd(s,e,!0,t);return r===null?gt():(r0)for(let p=h-1;p>=0;p--){const g=l[p];if(a+=g.duration,n){if(a<0)continue}else if(a+Gt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(h<0){for(let p=h;p<0;p++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};h=0}for(let p=h;pGt;if(a!==0&&!(y&&a+Gt>=0)||p===l.length-1){if(n){if(a>0)continue}else if(a-Gt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+cr({defaultDuration:s.targetDuration,durationList:l,startIndex:h,endIndex:p})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},isEnabled:Qn,isDisabled:function(s){return s.disabled},isExcluded:np,isIncompatible:tl,playlistEnd:sd,isAes:function(s){for(let e=0;e`${s}-${e}`,lp=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,m0=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new of;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(p=>a.addParser(p)),r.forEach(p=>a.addTagMapper(p)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){l.hasOwnProperty(p)&&delete l[p]}),l.segments&&l.segments.forEach(function(p){["parts","preloadHints"].forEach(function(g){p.hasOwnProperty(g)&&delete p[g]})})),!l.targetDuration){let p=10;l.segments&&l.segments.length&&(p=l.segments.reduce((g,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${p}`}),l.targetDuration=p}const h=ep(l);if(h.length&&!l.partTargetDuration){const p=h.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${p}`}),op.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=p}return l},Bi=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},up=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},g0=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];up({playlist:t,id:bi(e,t.uri)}),t.resolvedUri=vt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||op.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},f0=s=>{Bi(s,e=>{e.uri&&(e.resolvedUri=vt(s.uri,e.uri))})},y0=(s,e)=>{const t=bi(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,resolvedUri:k.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},hp=(s,e,t=lp)=>{s.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let h=0;h(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=ze({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=F.Error.NetworkRequestTimeout;else if(l){const h=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},{EventTarget:_0}=F,v0=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=tp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new k.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},b0=(s,e)=>{if(!s)return e;const t=we(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l{!s.resolvedUri&&s.uri&&(s.resolvedUri=vt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=vt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=vt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=vt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))})},pp=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;is===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,Eo=(s,e,t=mp)=>{const i=we(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=pp(e);const n=we(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{cp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let g=0;g{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?1e3*n:500*(s.partTargetDuration||s.targetDuration||10)},nd=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class mi extends _0{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new rd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=vt(this.main.uri,e.uri);this.llhls&&(t=v0(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request)return i?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Gs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return m0({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),up({playlist:a,uri:i,id:r});const l=Eo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!l)),n.parsedPlaylist=nd(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new rd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(k.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=k.setTimeout(this.media.bind(this,e,!1),l))}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=An(e.resolvedUri,h),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=k.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=k.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Gs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=An(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=nd(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,hp(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=pp(i),i.segments.forEach(r=>{cp(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||k.location.href;this.main=y0(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,h=a.id;if(t){const p=this.createCloneURI_(a.resolvedUri,e),g=bi(r,p),y=this.createCloneAttributes_(r,a.attributes),w=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=w,i.playlists[g]=w,i.playlists[p]=w}else i.playlists.splice(n,1);delete i.playlists[h],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(i.mediaGroups[n]&&i.mediaGroups[n][r]){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((h,p)=>{const g=i.playlists[h.id],y=g.id,w=g.resolvedUri;delete i.playlists[y],delete i.playlists[w]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=bi(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=h,i.playlists[a]=h,i.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(r.mediaGroups[n]&&!r.mediaGroups[n][t]){for(const a in r.mediaGroups[n])if(a===i){r.mediaGroups[n][t]={};for(const l in r.mediaGroups[n][a]){const h=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=ze({},h);const p=r.mediaGroups[n][t][l],g=this.createCloneURI_(h.resolvedUri,e);p.resolvedUri=g,p.uri=g,p.playlists=[],h.playlists.forEach((y,w)=>{const E=r.playlists[y.id],I=lp(n,t,l),v=bi(t,I);if(E&&!r.playlists[v]){const L=this.createClonePlaylist_(E,v,e),R=L.resolvedUri;r.playlists[v]=L,r.playlists[R]=L}p.playlists[w]=this.createClonePlaylist_(y,v,e)})}}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),we(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const wo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),e||s.aborted||t.statusCode===200||t.statusCode===206||t.statusCode===0||(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},S0=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},E0=(s,e,t,i)=>{s&&s.size&&s.forEach(r=>{r(e,t,i)})},gp=function(){const s=function e(t,i){t=we({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,h=S0(n,t);n.delete(r);const p=l(h||t,function(y,w){return E0(a,p,y,w),wo(p,y,w,i)}),g=p.abort;return p.abort=function(){return p.aborted=!0,g.apply(p,arguments)},p.uri=t.uri,p.requestType=t.requestType,p.requestTime=Date.now(),p};return s.original=!0,s},C0=function(s){let e;const t=s.offset;return e=typeof s.offset=="bigint"||typeof s.length=="bigint"?k.BigInt(s.offset)+k.BigInt(s.length)-k.BigInt(1):s.offset+s.length-1,"bytes="+t+"-"+e},Ao=function(s){const e={};return s.byterange&&(e.Range=C0(s.byterange)),e},w0=function(s,e){return s.start(e)+"-"+s.end(e)},A0=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},x0=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},fp=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];jd(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},xn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},yp=function(s){return s.resolvedUri},_p=s=>{const e=Array.prototype.slice.call(s),t=16;let i,r,n="";for(let a=0;a_p(s),D0=s=>{let e,t="";for(e=0;e{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=s-(e.videoTimingInfo.transmuxedPresentationStart+t);return new Date(e.dateTimeObject.getTime()+1e3*i)},L0=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,O0=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(tnew Date(n.getTime()+1e3*a)?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:bt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},N0=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t,i=0;for(let n=0;ni){if(s>i+r.duration*vp)return null;t=r}return{segment:t,estimatedStart:t.videoTimingInfo?t.videoTimingInfo.transmuxedPresentationStart:i-t.duration,type:t.videoTimingInfo?"accurate":"estimate"}},R0=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},M0=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=N0(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=P0(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},bp=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(s===void 0||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!M0(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=O0(s,e);if(!l)return a({message:`${s} was not found in the stream`});const h=l.segment,p=R0(h.dateTimeObject,s);if(l.type==="estimate")return t===0?a({message:`${s} is not buffered yet. Try again`}):(i(l.estimatedStart+p),void n.one("seeked",()=>{bp({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})}));const g=h.start+p,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},ad=(s,e)=>{if(s.readyState===4)return e()},F0=(s,e,t,i)=>{let r,n=[],a=!1;const l=function(y,w,E,I){return w.abort(),a=!0,t(y,w,E,I)},h=function(y,w){if(a)return;if(y)return y.metadata=Gs({requestType:i,request:w,error:y}),l(y,w,"",n);const E=w.responseText.substring(n&&n.byteLength||0,w.responseText.length);if(n=vf(n,Hd(E,!0)),r=r||nr(n),n.length<10||r&&n.lengthl(y,w,"",n));const I=Fo(n);return I==="ts"&&n.length<188||!I&&n.length<376?ad(w,()=>l(y,w,"",n)):l(null,w,I,n)},p={uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:w,loaded:E}){return wo(y,null,{statusCode:y.status},h)})}},g=e(p,function(y,w){return wo(g,y,w,h)});return g},{EventTarget:U0}=F,od=function(s,e){if(!mp(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length)||!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t`placeholder-uri-${s}-${e}-${i.attributes.NAME||t}`,j0=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=yy(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return hp(n,e,q0),n},H0=(s,e)=>{Bi(s,(t,i,r,n)=>{e.mediaGroups[i][r]&&n in e.mediaGroups[i][r]||delete s.mediaGroups[i][r][n]})},$0=(s,e,t)=>{let i=!0,r=we(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const p=n.playlists[0].id,g=Eo(r,n.playlists[0],od);g&&(r=g,h in r.mediaGroups[a][l]||(r.mediaGroups[a][l][h]=n),r.mediaGroups[a][l][h].playlists[0]=r.playlists[p],i=!1)}}),H0(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},V0=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,ld=(s,e)=>{const t={};for(const i in s){const r=s[i].sidx;if(r){const n=Fn(r);if(!e[n])break;const a=e[n].sidxInfo;V0(a,r)&&(t[n]=e[n])}}return t},z0=(s,e)=>{let t=ld(s.playlists,e);return Bi(s,(i,r,n,a)=>{if(i.playlists&&i.playlists.length){const l=i.playlists;t=we(t,ld(l,e))}}),t};class xo extends U0{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=It("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error=typeof e!="object"||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const r=e.sidx&&Fn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=k.setTimeout(()=>i(!1),0));const n=An(e.sidx.resolvedUri),a=(h,p)=>{if(this.requestErrored_(h,p,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=p;let w;try{w=Ty(ce(p.response).subarray(8))}catch(E){return E.metadata=Gs({requestType:y,request:p,parseFailure:!0}),void this.requestErrored_(E,p,t)}return g[r]={sidxInfo:e.sidx,sidx:w},Ro(e,w,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=F0(n,this.vhs_.xhr,(h,p,g,y)=>{if(h)return a(h,p);if(!g||g!=="mp4"){const I=g||"unknown";return a({status:p.status,message:`Unsupported ${I} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},p)}const{offset:w,length:E}=e.sidx.byterange;if(y.length>=E+w)return a(h,{response:y.subarray(w,w+E),status:p.status,uri:p.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ao({byterange:e.sidx.byterange})},a)},l)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(k.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(()=>this.load(),i)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=k.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Gs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r))return void(this.state==="HAVE_NOTHING"&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=An(this.mainPlaylistLoader_.srcUrl,r),n?(this.handleMain_(),void this.syncClientServerClock_(()=>e(r,n))):e(r,n)})}syncClientServerClock_(e){const t=_y(this.mainPlaylistLoader_.mainXml_);return t===null?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):t.method==="DIRECT"?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Gs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;n=t.method==="HEAD"?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:t});try{i=j0({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=$0(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(p=>{l.push({id:p.id,bandwidth:p.attributes.BANDWIDTH,resolution:p.attributes.RESOLUTION,codecs:p.attributes.CODECS})});const h={duration:n,isLive:!a,renditions:l};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(k.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;t===0&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=k.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=z0(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=k.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Co(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Je={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const W0=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t-1)},this.trigger=function(u){var c,d,m,f;if(c=o[u])if(arguments.length===2)for(m=c.length,d=0;d>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},L=function(o){return t(U.hdlr,W[o])},v=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,255&o.duration,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=255&o.samplerate),t(U.mdhd,u)},I=function(o){return t(U.mdia,v(o),L(o.type),l(o))},a=function(o){return t(U.mfhd,new Uint8Array([0,0,0,0,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o]))},l=function(o){return t(U.minf,o.type==="video"?t(U.vmhd,te):t(U.smhd,J),i(),M(o))},h=function(o,u){for(var c=[],d=u.length;d--;)c[d]=G(u[d]);return t.apply(null,[U.moof,a(o)].concat(c))},p=function(o){for(var u=o.length,c=[];u--;)c[u]=w(o[u]);return t.apply(null,[U.moov,y(4294967295)].concat(c).concat(g(o)))},g=function(o){for(var u=o.length,c=[];u--;)c[u]=N(o[u]);return t.apply(null,[U.mvex].concat(c))},y=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(U.mvhd,u)},R=function(o){var u,c,d=o.samples||[],m=new Uint8Array(4+d.length);for(c=0;c>>8),f.push(255&d[u].byteLength),f=f.concat(Array.prototype.slice.call(d[u]));for(u=0;u>>8),b.push(255&m[u].byteLength),b=b.concat(Array.prototype.slice.call(m[u]));if(c=[U.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&o.width)>>8,255&o.width,(65280&o.height)>>8,255&o.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(U.avcC,new Uint8Array([1,o.profileIdc,o.profileCompatibility,o.levelIdc,255].concat([d.length],f,[m.length],b))),t(U.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],o.sarRatio){var x=o.sarRatio[0],C=o.sarRatio[1];c.push(t(U.pasp,new Uint8Array([(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x,(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C])))}return t.apply(null,c)},ye=function(o){return t(U.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&o.channelcount)>>8,255&o.channelcount,(65280&o.samplesize)>>8,255&o.samplesize,0,0,0,0,(65280&o.samplerate)>>8,255&o.samplerate,0,0]),r(o))},E=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,0,(4278190080&o.duration)>>24,(16711680&o.duration)>>16,(65280&o.duration)>>8,255&o.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&o.width)>>8,255&o.width,0,0,(65280&o.height)>>8,255&o.height,0,0]);return t(U.tkhd,u)},G=function(o){var u,c,d,m,f,b,x;return u=t(U.tfhd,new Uint8Array([0,0,0,58,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),b=Math.floor(o.baseMediaDecodeTime/We),x=Math.floor(o.baseMediaDecodeTime%We),c=t(U.tfdt,new Uint8Array([1,0,0,0,b>>>24&255,b>>>16&255,b>>>8&255,255&b,x>>>24&255,x>>>16&255,x>>>8&255,255&x])),f=92,o.type==="audio"?(d=z(o,f),t(U.traf,u,c,d)):(m=R(o),d=z(o,m.length+f),t(U.traf,u,c,d,m))},w=function(o){return o.duration=o.duration||4294967295,t(U.trak,E(o),I(o))},N=function(o){var u=new Uint8Array([0,0,0,0,(4278190080&o.id)>>24,(16711680&o.id)>>16,(65280&o.id)>>8,255&o.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),t(U.trex,u)},me=function(o,u){var c=0,d=0,m=0,f=0;return o.length&&(o[0].duration!==void 0&&(c=1),o[0].size!==void 0&&(d=2),o[0].flags!==void 0&&(m=4),o[0].compositionTimeOffset!==void 0&&(f=8)),[0,0,c|d|m|f,1,(4278190080&o.length)>>>24,(16711680&o.length)>>>16,(65280&o.length)>>>8,255&o.length,(4278190080&u)>>>24,(16711680&u)>>>16,(65280&u)>>>8,255&u]},ve=function(o,u){var c,d,m,f,b,x;for(u+=20+16*(f=o.samples||[]).length,m=me(f,u),(d=new Uint8Array(m.length+16*f.length)).set(m),c=m.length,x=0;x>>24,d[c++]=(16711680&b.duration)>>>16,d[c++]=(65280&b.duration)>>>8,d[c++]=255&b.duration,d[c++]=(4278190080&b.size)>>>24,d[c++]=(16711680&b.size)>>>16,d[c++]=(65280&b.size)>>>8,d[c++]=255&b.size,d[c++]=b.flags.isLeading<<2|b.flags.dependsOn,d[c++]=b.flags.isDependedOn<<6|b.flags.hasRedundancy<<4|b.flags.paddingValue<<1|b.flags.isNonSyncSample,d[c++]=61440&b.flags.degradationPriority,d[c++]=15&b.flags.degradationPriority,d[c++]=(4278190080&b.compositionTimeOffset)>>>24,d[c++]=(16711680&b.compositionTimeOffset)>>>16,d[c++]=(65280&b.compositionTimeOffset)>>>8,d[c++]=255&b.compositionTimeOffset;return t(U.trun,d)},_e=function(o,u){var c,d,m,f,b,x;for(u+=20+8*(f=o.samples||[]).length,m=me(f,u),(c=new Uint8Array(m.length+8*f.length)).set(m),d=m.length,x=0;x>>24,c[d++]=(16711680&b.duration)>>>16,c[d++]=(65280&b.duration)>>>8,c[d++]=255&b.duration,c[d++]=(4278190080&b.size)>>>24,c[d++]=(16711680&b.size)>>>16,c[d++]=(65280&b.size)>>>8,c[d++]=255&b.size;return t(U.trun,c)},z=function(o,u){return o.type==="audio"?_e(o,u):ve(o,u)};var Ge,Ye,rt,Ut,Ke,ts,Ps,Ys,ms={ftyp:n=function(){return t(U.ftyp,H,S,H,A)},mdat:function(o){return t(U.mdat,o)},moof:h,moov:p,initSegment:function(o){var u,c=n(),d=p(o);return(u=new Uint8Array(c.byteLength+d.byteLength)).set(c),u.set(d,c.byteLength),u}},ss=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Oe=function(o,u){var c=ss();return c.dataOffset=u,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},je={groupNalsIntoFrames:function(o){var u,c,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,u=0;u1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},generateSampleTable:function(o,u){var c,d,m,f,b,x=u||0,C=[];for(c=0;cfs.ONE_SECOND_IN_TS/2))){for((f=Ar()[o.samplerate])||(f=u[0].data),b=0;b=c?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c&&(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0)}))},generateSampleTable:function(o){var u,c,d=[];for(u=0;u=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},q.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},q.prototype.addText=function(o){this.rows[this.rowIdx]+=o},q.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var ae=function(o,u,c){this.serviceNum=o,this.text="",this.currentWindow=new q(-1),this.windows=[],this.stream=c,typeof u=="string"&&this.createTextDecoder(u)};ae.prototype.init=function(o,u){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new q(c),typeof u=="function"&&(this.windows[c].beforeRowOverflow=u)},ae.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},ae.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var le=function(o){o=o||{},le.prototype.init.call(this);var u,c=this,d=o.captionServices||{},m={};Object.keys(d).forEach(f=>{u=d[f],/^SERVICE/.test(f)&&(m[f]=u.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(f){f.type===3?(c.new708Packet(),c.add708Bytes(f)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(f))}};le.prototype=new Qs,le.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},le.prototype.add708Bytes=function(o){var u=o.ccData,c=u>>>8,d=255&u;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},le.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,c=null,d=null,m=0,f=u[m++];for(o.seq=f>>6,o.sizeCode=63&f;m>5)===7&&d>0&&(c=f=u[m++]),this.pushServiceBlock(c,m,d),d>0&&(m+=d-1)},le.prototype.pushServiceBlock=function(o,u,c){var d,m=u,f=this.current708Packet.data,b=this.services[o];for(b||(b=this.initService(o,m));m("0"+(255&be).toString(16)).slice(-2)).join("")}if(b?(m=[D,j],o++):m=[D],u.textDecoder_&&!f)d=u.textDecoder_.decode(new Uint8Array(m));else if(b){const de=ue(m);d=String.fromCharCode(parseInt(de,16))}else d=T(C|D);return X.pendingNewLine&&!X.isEmpty()&&X.newLine(this.getPts(o)),X.pendingNewLine=!1,X.addText(d),o},le.prototype.multiByteCharacter=function(o,u){var c=this.current708Packet.data,d=c[o+1],m=c[o+2];return P(d)&&P(m)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},le.prototype.setCurrentWindow=function(o,u){var c=7&this.current708Packet.data[o];return u.setCurrentWindow(c),o},le.prototype.defineWindow=function(o,u){var c=this.current708Packet.data,d=c[o],m=7&d;u.setCurrentWindow(m);var f=u.currentWindow;return d=c[++o],f.visible=(32&d)>>5,f.rowLock=(16&d)>>4,f.columnLock=(8&d)>>3,f.priority=7&d,d=c[++o],f.relativePositioning=(128&d)>>7,f.anchorVertical=127&d,d=c[++o],f.anchorHorizontal=d,d=c[++o],f.anchorPoint=(240&d)>>4,f.rowCount=15&d,d=c[++o],f.columnCount=63&d,d=c[++o],f.windowStyle=(56&d)>>3,f.penStyle=7&d,f.virtualRowCount=f.rowCount+1,o},le.prototype.setWindowAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.winAttr;return d=c[++o],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=c[++o],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=c[++o],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=c[++o],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,o},le.prototype.flushDisplayed=function(o,u){for(var c=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&c.push(u.windows[d].getText());u.endPts=o,u.text=c.join(` - -`),this.pushCaption(u),u.startPts=o},le.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},le.prototype.displayWindows=function(o,u){var c=this.current708Packet.data[++o],d=this.getPts(o);this.flushDisplayed(d,u);for(var m=0;m<8;m++)c&1<>4,m.offset=(12&d)>>2,m.penSize=3&d,d=c[++o],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,o},le.prototype.setPenColor=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penColor;return d=c[++o],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=c[++o],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=c[++o],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,o},le.prototype.setPenLocation=function(o,u){var c=this.current708Packet.data,d=c[o],m=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=c[++o],m.row=15&d,d=c[++o],m.column=63&d,o},le.prototype.reset=function(o,u){var c=this.getPts(o);return this.flushDisplayed(c,u),this.initService(u.serviceNum,o)};var De={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ee=function(o){return o===null?"":(o=De[o]||o,String.fromCharCode(o))},wt=14,qt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],st=function(){for(var o=[],u=wt+1;u--;)o.push({text:"",indent:0,offset:0});return o},Ae=function(o,u){Ae.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(c){var d,m,f,b,x;if((d=32639&c.ccData)!==this.lastControlCode_){if((61440&d)==4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),f=d>>>8,b=255&d,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),m=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=m,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=st();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=st();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=st()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(f,b))x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isExtCharacter(f,b))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),x=Ee((f=(3&f)<<8)|b),this[this.mode_](c.pts,x),this.column_++;else if(this.isMidRowCode(f,b))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,14&~b||this.addFormatting(c.pts,["i"]),1&~b||this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(f,b)){const D=3&b;this.nonDisplayed_[this.row_].offset=D,this.column_+=D}else if(this.isPAC(f,b)){var C=qt.indexOf(7968&d);if(this.mode_==="rollUp"&&(C-this.rollUpRows_+1<0&&(C=this.rollUpRows_-1),this.setRollUp(c.pts,C)),C!==this.row_&&C>=0&&C<=14&&(this.clearFormatting(c.pts),this.row_=C),1&b&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),!(16&~d)){const D=(14&d)>>1;this.column_=4*D,this.nonDisplayed_[this.row_].indent+=D}this.isColorPAC(b)&&(14&~b||this.addFormatting(c.pts,["i"]))}else this.isNormalChar(f)&&(b===0&&(b=null),x=Ee(f),x+=Ee(b),this[this.mode_](c.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Ae.prototype=new Qs,Ae.prototype.flushDisplayed=function(o){const u=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,m)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{u(m)}d.text.length&&c.push({text:d.text,line:m+1,position:10+Math.min(70,10*d.indent)+2.5*d.offset})}else d==null&&u(m)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},Ae.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=st(),this.nonDisplayed_=st(),this.lastControlCode_=null,this.column_=0,this.row_=wt,this.rollUpRows_=2,this.formatting_=[]},Ae.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ae.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Ae.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Ae.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Ae.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Ae.prototype.isPAC=function(o,u){return o>=this.BASE_&&o=64&&u<=127},Ae.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ae.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ae.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=wt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=st(),this.displayed_=st()),u!==void 0&&u!==this.row_)for(var c=0;c"},"");this[this.mode_](o,c)},Ae.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(c,d){return c+""},"");this.formatting_=[],this[this.mode_](o,u)}},Ae.prototype.popOn=function(o,u){var c=this.nonDisplayed_[this.row_].text;c+=u,this.nonDisplayed_[this.row_].text=c},Ae.prototype.rollUp=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c},Ae.prototype.shiftRowsUp_=function(){var o;for(o=0;ou&&(c=-1);Math.abs(u-o)>_s;)o+=c*Lt;return o},Ht=function(o){var u,c;Ht.prototype.init.call(this),this.type_=o||Ls,this.push=function(d){d.type!=="metadata"?this.type_!==Ls&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=Js(d.dts,c),d.pts=Js(d.pts,c),u=d.dts,this.trigger("data",d)):this.trigger("data",d)},this.flush=function(){c=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ht.prototype=new ns;var Zs,nl={TimestampRolloverStream:Ht,handleRollover:Js},Qp=(o,u,c)=>{if(!o)return-1;for(var d=c;d";o.data[0]===Ir.Utf8&&((u=Dr(o.data,0,d))<0||(o.mimeType=Vi(o.data,d,u),d=u+1,o.pictureType=o.data[d],d++,(c=Dr(o.data,0,d))<0||(o.description=$i(o.data,d,c),d=c+1,o.mimeType===m?o.url=Vi(o.data,d,o.data.length):o.pictureData=o.data.subarray(d,o.data.length))))},"T*":function(o){o.data[0]===Ir.Utf8&&(o.value=$i(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.value=$i(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value)},"W*":function(o){o.url=Vi(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===Ir.Utf8&&(u=Dr(o.data,0,1))!==-1&&(o.description=$i(o.data,1,u),o.url=Vi(o.data,u+1,o.data.length).replace(/\0.*$/,""))},PRIV:function(o){var u;for(u=0;u>>2;de*=4,de+=3&ue[7],j.timeStamp=de,x.pts===void 0&&x.dts===void 0&&(x.pts=j.timeStamp,x.dts=j.timeStamp),this.trigger("timestamp",j)}x.frames.push(j),C+=10,C+=D}while(C>>4>1&&(b+=m[b]+1),f.pid===0)f.type="pat",o(m.subarray(b),f),this.trigger("data",f);else if(f.pid===this.pmtPid)for(f.type="pmt",o(m.subarray(b),f),this.trigger("data",f);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,b,f]):this.processPes_(m,b,f)},this.processPes_=function(m,f,b){b.pid===this.programMapTable.video?b.streamType=Ot.H264_STREAM_TYPE:b.pid===this.programMapTable.audio?b.streamType=Ot.ADTS_STREAM_TYPE:b.streamType=this.programMapTable["timed-metadata"][b.pid],b.type="pes",b.data=m.subarray(f),this.trigger("data",b)}},Gi.prototype=new Zn,Gi.STREAM_TYPES={h264:27,adts:15},Pr=function(){var o,u=this,c=!1,d={data:[],size:0},m={data:[],size:0},f={data:[],size:0},b=function(C,D){var j;const X=C[0]<<16|C[1]<<8|C[2];D.data=new Uint8Array,X===1&&(D.packetLength=6+(C[4]<<8|C[5]),D.dataAlignmentIndicator=!!(4&C[6]),192&(j=C[7])&&(D.pts=(14&C[9])<<27|(255&C[10])<<20|(254&C[11])<<12|(255&C[12])<<5|(254&C[13])>>>3,D.pts*=4,D.pts+=(6&C[13])>>>1,D.dts=D.pts,64&j&&(D.dts=(14&C[14])<<27|(255&C[15])<<20|(254&C[16])<<12|(255&C[17])<<5|(254&C[18])>>>3,D.dts*=4,D.dts+=(6&C[18])>>>1)),D.data=C.subarray(9+C[8]))},x=function(C,D,j){var X,ue=new Uint8Array(C.size),de={type:D},be=0,Ce=0,nt=!1;if(C.data.length&&!(C.size<9)){for(de.trackId=C.data[0].pid,be=0;be>5,C=(x=1024*(1+(3&u[D+6])))*im/ul[(60&u[D+2])>>>2],u.byteLength-D>>6&3),channelcount:(1&u[D+2])<<2|(192&u[D+3])>>>6,samplerate:ul[(60&u[D+2])>>>2],samplingfrequencyindex:(60&u[D+2])>>>2,samplesize:16,data:u.subarray(D+7+f,D+m)}),c++,D+=m}else typeof j!="number"&&(j=D),D++;typeof j=="number"&&(this.skipWarn_(j,D),j=null),u=u.subarray(D)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}}).prototype=new sm;var Lr,Or,hl,rm=ia,dl=Fe,nm=function(o){var u=o.byteLength,c=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var m=o.byteLength-u,f=new Uint8Array(4),b=Math.min(4,u);if(b===0)throw new Error("no bytes available");f.set(o.subarray(m,m+b)),c=new DataView(f.buffer).getUint32(0),d=8*b,u-=b},this.skipBits=function(m){var f;d>m?(c<<=m,d-=m):(m-=d,m-=8*(f=Math.floor(m/8)),u-=f,this.loadWord(),c<<=m,d-=m)},this.readBits=function(m){var f=Math.min(d,m),b=c>>>32-f;return(d-=f)>0?c<<=f:u>0&&this.loadWord(),(f=m-f)>0?b<>>m)return c<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(Or=function(){var o,u,c=0;Or.prototype.init.call(this),this.push=function(d){var m;u?((m=new Uint8Array(u.byteLength+d.data.byteLength)).set(u),m.set(d.data,u.byteLength),u=m):u=d.data;for(var f=u.byteLength;c3&&this.trigger("data",u.subarray(c+3)),u=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new dl,hl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o,u,c,d,m,f,b,x=new Or;Lr.prototype.init.call(this),o=this,this.push=function(C){C.type==="video"&&(u=C.trackId,c=C.pts,d=C.dts,x.push(C))},x.on("data",function(C){var D={trackId:u,pts:c,dts:d,data:C,nalUnitTypeCode:31&C[0]};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=m(C.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=m(C.subarray(1)),D.config=f(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp"}o.trigger("data",D)}),x.on("done",function(){o.trigger("done")}),x.on("partialdone",function(){o.trigger("partialdone")}),x.on("reset",function(){o.trigger("reset")}),x.on("endedtimeline",function(){o.trigger("endedtimeline")}),this.flush=function(){x.flush()},this.partialFlush=function(){x.partialFlush()},this.reset=function(){x.reset()},this.endTimeline=function(){x.endTimeline()},b=function(C,D){var j,X=8,ue=8;for(j=0;j=0?c:0,(16&o[u+5])>>4?c+20:c+10},pl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=cl(o,u),pl(o,u))},ml=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},lm=function(o,u,c){var d,m="";for(d=u;d=u+2&&!(255&~o[u])&&!(240&~o[u+1])&&(22&o[u+1])==16},parseId3TagSize:cl,parseAdtsSize:function(o,u){var c=(224&o[u+5])>>5,d=o[u+4]<<3;return 6144&o[u+3]|d|c},parseType:function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":!0&o[u]&&!(240&~o[u+1])?"audio":null},parseSampleRate:function(o){for(var u=0;u+5>>2];u++}return null},parseAacTimestamp:function(o){var u,c,d;u=10,64&o[5]&&(u+=4,u+=ml(o.subarray(10,14)));do{if((c=ml(o.subarray(u+4,u+8)))<1)return null;if(String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3])==="PRIV"){d=o.subarray(u+10,u+c+10);for(var m=0;m>>2;return b*=4,b+=3&f[7]}break}}u+=10,u+=c}while(u=3;)if(o[C]!==73||o[C+1]!==68||o[C+2]!==51)if(255&~o[C]||240&~o[C+1])C++;else{if(o.length-C<7||C+(x=gl.parseAdtsSize(o,C))>o.length)break;f={type:"audio",data:o.subarray(C,C+x),pts:u,dts:u},this.trigger("data",f),C+=x}else{if(o.length-C<10||C+(x=gl.parseId3TagSize(o,C))>o.length)break;m={type:"timed-metadata",data:o.subarray(C,C+x)},this.trigger("data",m),C+=x}d=o.length-C,o=d>0?o.subarray(C):new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Fe;var Xi,ti,Nr,Os,hm=ra,dm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],cm=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rr=Fe,Yi=ms,Ki=je,Mr=qi,Nt=kr,as=tm,Br=ke,fl=rm,pm=am.H264Stream,mm=hm,gm=na.isLikelyAacData,fm=ke.ONE_SECOND_IN_TS,aa=dm,oa=cm,ym=function(o,u){u.stream=o,this.trigger("log",u)},yl=function(o,u){for(var c=Object.keys(u),d=0;d=-be&&C<=de&&(!D||Ce>C)&&(D=X,Ce=C));return D?D.gop:null},this.alignGopsAtStart_=function(x){var C,D,j,X,ue,de,be,Ce;for(ue=x.byteLength,de=x.nalCount,be=x.duration,C=D=0;Cj.pts?C++:(D++,ue-=X.byteLength,de-=X.nalCount,be-=X.duration);return D===0?x:D===x.length?null:((Ce=x.slice(D)).byteLength=ue,Ce.duration=be,Ce.nalCount=de,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce)},this.alignGopsAtEnd_=function(x){var C,D,j,X,ue,de,be;for(C=b.length-1,D=x.length-1,ue=null,de=!1;C>=0&&D>=0;){if(j=b[C],X=x[D],j.pts===X.pts){de=!0;break}j.pts>X.pts?C--:(C===b.length-1&&(ue=D),D--)}if(!de&&ue===null)return null;if((be=de?D:ue)===0)return x;var Ce=x.slice(be),nt=Ce.reduce(function(Rt,ri){return Rt.byteLength+=ri.byteLength,Rt.duration+=ri.duration,Rt.nalCount+=ri.nalCount,Rt},{byteLength:0,duration:0,nalCount:0});return Ce.byteLength=nt.byteLength,Ce.duration=nt.duration,Ce.nalCount=nt.nalCount,Ce.pts=Ce[0].pts,Ce.dts=Ce[0].dts,Ce},this.alignGopsWith=function(x){b=x}},Xi.prototype=new Rr,Os=function(o,u){this.numberOfTracks=0,this.metadataStream=u,(o=o||{}).remux!==void 0?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Os.prototype.init.call(this),this.push=function(c){return c.content||c.text?this.pendingCaptions.push(c):c.frames?this.pendingMetadata.push(c):(this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),void(c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))))}},Os.prototype=new Rr,Os.prototype.flush=function(o){var u,c,d,m,f=0,b={captions:[],captionStreams:{},metadata:[],info:{}},x=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(x=this.videoTrack.timelineStartInfo.pts,oa.forEach(function(C){b.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,aa.forEach(function(C){b.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?b.type=this.pendingTracks[0].type:b.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Yi.initSegment(this.pendingTracks),b.initSegment=new Uint8Array(d.byteLength),b.initSegment.set(d),b.data=new Uint8Array(this.pendingBytes),m=0;m=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Os.prototype.setRemux=function(o){this.remuxTracks=o},Nr=function(o){var u,c,d=this,m=!0;Nr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="aac",f.metadataStream=new as.MetadataStream,f.aacStream=new mm,f.audioTimestampRolloverStream=new as.TimestampRolloverStream("audio"),f.timedMetadataTimestampRolloverStream=new as.TimestampRolloverStream("timed-metadata"),f.adtsStream=new fl,f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.aacStream,f.aacStream.pipe(f.audioTimestampRolloverStream).pipe(f.adtsStream),f.aacStream.pipe(f.timedMetadataTimestampRolloverStream).pipe(f.metadataStream).pipe(f.coalesceStream),f.metadataStream.on("timestamp",function(b){f.aacStream.setTimestamp(b.timeStamp)}),f.aacStream.on("data",function(b){b.type!=="timed-metadata"&&b.type!=="audio"||f.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u}))}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setupTsPipeline=function(){var f={};this.transmuxPipeline_=f,f.type="ts",f.metadataStream=new as.MetadataStream,f.packetStream=new as.TransportPacketStream,f.parseStream=new as.TransportParseStream,f.elementaryStream=new as.ElementaryStream,f.timestampRolloverStream=new as.TimestampRolloverStream,f.adtsStream=new fl,f.h264Stream=new pm,f.captionStream=new as.CaptionStream(o),f.coalesceStream=new Os(o,f.metadataStream),f.headOfPipeline=f.packetStream,f.packetStream.pipe(f.parseStream).pipe(f.elementaryStream).pipe(f.timestampRolloverStream),f.timestampRolloverStream.pipe(f.h264Stream),f.timestampRolloverStream.pipe(f.adtsStream),f.timestampRolloverStream.pipe(f.metadataStream).pipe(f.coalesceStream),f.h264Stream.pipe(f.captionStream).pipe(f.coalesceStream),f.elementaryStream.on("data",function(b){var x;if(b.type==="metadata"){for(x=b.tracks.length;x--;)u||b.tracks[x].type!=="video"?c||b.tracks[x].type!=="audio"||((c=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(u=b.tracks[x]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;u&&!f.videoSegmentStream&&(f.coalesceStream.numberOfTracks++,f.videoSegmentStream=new Xi(u,o),f.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),f.videoSegmentStream.on("timelineStartInfo",function(C){c&&!o.keepOriginalTimestamps&&(c.timelineStartInfo=C,f.audioSegmentStream.setEarliestDts(C.dts-d.baseMediaDecodeTime))}),f.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),f.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),f.videoSegmentStream.on("baseMediaDecodeTime",function(C){c&&f.audioSegmentStream.setVideoBaseMediaDecodeTime(C)}),f.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),f.h264Stream.pipe(f.videoSegmentStream).pipe(f.coalesceStream)),c&&!f.audioSegmentStream&&(f.coalesceStream.numberOfTracks++,f.audioSegmentStream=new ti(c,o),f.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),f.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),f.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),f.adtsStream.pipe(f.audioSegmentStream).pipe(f.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!c,hasVideo:!!u})}}),f.coalesceStream.on("data",this.trigger.bind(this,"data")),f.coalesceStream.on("id3Frame",function(b){b.dispatchType=f.metadataStream.dispatchType,d.trigger("id3Frame",b)}),f.coalesceStream.on("caption",this.trigger.bind(this,"caption")),f.coalesceStream.on("done",this.trigger.bind(this,"done")),yl(this,f)},this.setBaseMediaDecodeTime=function(f){var b=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=f),c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(c),b.audioTimestampRolloverStream&&b.audioTimestampRolloverStream.discontinuity()),u&&(b.videoSegmentStream&&(b.videoSegmentStream.gopCache_=[]),u.timelineStartInfo.dts=void 0,u.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(u),b.captionStream.reset()),b.timestampRolloverStream&&b.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(f){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(f)},this.setRemux=function(f){var b=this.transmuxPipeline_;o.remux=f,b&&b.coalesceStream&&b.coalesceStream.setRemux(f)},this.alignGopsWith=function(f){u&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(f)},this.getLogTrigger_=function(f){var b=this;return function(x){x.stream=f,b.trigger("log",x)}},this.push=function(f){if(m){var b=gm(f);b&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():b||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(f)},this.flush=function(){m=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Rr;var vl,bl,Tl,Sl,El,ua,Cl,_m={Transmuxer:Nr,VideoSegmentStream:Xi,AudioSegmentStream:ti,AUDIO_PROPERTIES:aa,VIDEO_PROPERTIES:oa,generateSegmentTimingInfo:la},Fr={toUnsigned:function(o){return o>>>0},toHexString:function(o){return("00"+o.toString(16)).slice(-2)}},wl=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3])},vm=Fr.toUnsigned,bm=wl,Al=function(o,u){var c,d,m,f,b,x=[];if(!u.length)return null;for(c=0;c1?c+d:o.byteLength,m===u[0]&&(u.length===1?x.push(o.subarray(c+8,f)):(b=Al(o.subarray(c+8,f),u.slice(1))).length&&(x=x.concat(b))),c=f;return x},xl=Al,Tm=Fr.toUnsigned,Sm=Pe.getUint64,kl=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Sm(o.subarray(4)):u.baseMediaDecodeTime=Tm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},Dl=function(o){return{isLeading:(12&o[0])>>>2,dependsOn:3&o[0],isDependedOn:(192&o[1])>>>6,hasRedundancy:(48&o[1])>>>4,paddingValue:(14&o[1])>>>1,isNonSyncSample:1&o[1],degradationPriority:o[2]<<8|o[3]}},Il=function(o){var u,c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),m=1&c.flags[2],f=4&c.flags[2],b=1&c.flags[1],x=2&c.flags[1],C=4&c.flags[1],D=8&c.flags[1],j=d.getUint32(4),X=8;for(m&&(c.dataOffset=d.getInt32(X),X+=4),f&&j&&(u={flags:Dl(o.subarray(X,X+4))},X+=4,b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u),j--);j--;)u={},b&&(u.duration=d.getUint32(X),X+=4),x&&(u.size=d.getUint32(X),X+=4),C&&(u.flags=Dl(o.subarray(X,X+4)),X+=4),D&&(c.version===1?u.compositionTimeOffset=d.getInt32(X):u.compositionTimeOffset=d.getUint32(X),X+=4),c.samples.push(u);return c},Pl=function(o){var u,c=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:c.getUint32(4)},m=1&d.flags[2],f=2&d.flags[2],b=8&d.flags[2],x=16&d.flags[2],C=32&d.flags[2],D=65536&d.flags[0],j=131072&d.flags[0];return u=8,m&&(u+=4,d.baseDataOffset=c.getUint32(12),u+=4),f&&(d.sampleDescriptionIndex=c.getUint32(u),u+=4),b&&(d.defaultSampleDuration=c.getUint32(u),u+=4),x&&(d.defaultSampleSize=c.getUint32(u),u+=4),C&&(d.defaultSampleFlags=c.getUint32(u)),D&&(d.durationIsEmpty=!0),!m&&j&&(d.baseDataOffsetIsMoof=!0),d},Ll=typeof window<"u"?window:s!==void 0?s:typeof self<"u"?self:{},Em=rs.discardEmulationPreventionBytes,Cm=jt.CaptionStream,Qi=xl,wm=kl,Am=Il,xm=Pl,Ol=Ll,km=function(o,u){for(var c=o,d=0;d0?wm(be[0]).baseMediaDecodeTime:0,nt=Qi(j,["trun"]);u===de&&nt.length>0&&(x=Im(nt,Ce,ue),C=Dm(D,x,de),m[de]||(m[de]={seiNals:[],logs:[]}),m[de].seiNals=m[de].seiNals.concat(C.seiNals),m[de].logs=m[de].logs.concat(C.logs))}),m},Lm=function(o,u,c){if(u===null)return null;var d=Pm(o,u)[u]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:c}},Om=function(){var o,u,c,d,m,f,b=!1;this.isInitialized=function(){return b},this.init=function(x){o=new Cm,b=!0,f=!!x&&x.isPartial,o.on("data",function(C){C.startTime=C.startPts/d,C.endTime=C.endPts/d,m.captions.push(C),m.captionStreams[C.stream]=!0}),o.on("log",function(C){m.logs.push(C)})},this.isNewInit=function(x,C){return!(x&&x.length===0||C&&typeof C=="object"&&Object.keys(C).length===0)&&(c!==x[0]||d!==C[c])},this.parse=function(x,C,D){var j;if(!this.isInitialized()||!C||!D)return null;if(this.isNewInit(C,D))c=C[0],d=D[c];else if(c===null||!d)return u.push(x),null;for(;u.length>0;){var X=u.shift();this.parse(X,C,D)}return(j=Lm(x,c,d))&&j.logs&&(m.logs=m.logs.concat(j.logs)),j!==null&&j.seiNals?(this.pushNals(j.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(x){if(!this.isInitialized()||!x||x.length===0)return null;x.forEach(function(C){o.push(C)})},this.flushStream=function(){if(!this.isInitialized())return null;f?o.partialFlush():o.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;o.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){u=[],c=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Nm=Om,Ur=function(o){for(var u=0,c=String.fromCharCode(o[u]),d="";c!=="\0";)d+=c,u++,c=String.fromCharCode(o[u]);return d+=c},Rm=Pe.getUint64,Mm=function(o){var u,c,d,m,f,b,x,C=4,D=o[0];if(D===0)C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length,d=(j=new DataView(o.buffer)).getUint32(C),C+=4,f=j.getUint32(C),C+=4,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4;else if(D===1){var j;d=(j=new DataView(o.buffer)).getUint32(C),C+=4,m=Rm(o.subarray(C)),C+=8,b=j.getUint32(C),C+=4,x=j.getUint32(C),C+=4,C+=(u=Ur(o.subarray(C))).length,C+=(c=Ur(o.subarray(C))).length}var X={scheme_id_uri:u,value:c,timescale:d||1,presentation_time:m,presentation_time_delta:f,event_duration:b,id:x,message_data:new Uint8Array(o.subarray(C,o.byteLength))};return Fm(D,X)?X:void 0},Bm=function(o,u,c,d){return o||o===0?o/u:d+c/u},Fm=function(o,u){var c=u.scheme_id_uri!=="\0",d=o===0&&Nl(u.presentation_time_delta)&&c,m=o===1&&Nl(u.presentation_time)&&c;return!(o>1)&&d||m},Nl=function(o){return o!==void 0||o!==null},Um={parseEmsgBox:Mm,scaleTime:Bm},qr=Fr.toUnsigned,Ji=Fr.toHexString,$e=xl,si=wl,ha=Um,qm=Pl,jm=Il,Hm=kl,$m=Pe.getUint64,da=Ll,Vm=ol.parseId3Frames;vl=function(o){var u={};return $e(o,["moov","trak"]).reduce(function(c,d){var m,f,b,x,C;return(m=$e(d,["tkhd"])[0])?(f=m[0],x=qr(m[b=f===0?12:20]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3]),(C=$e(d,["mdia","mdhd"])[0])?(b=(f=C[0])===0?12:20,c[x]=qr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),c):null):null},u)},bl=function(o,u){var c=$e(u,["moof","traf"]).reduce(function(d,m){var f,b=$e(m,["tfhd"])[0],x=qr(b[4]<<24|b[5]<<16|b[6]<<8|b[7]),C=o[x]||9e4,D=$e(m,["tfdt"])[0],j=new DataView(D.buffer,D.byteOffset,D.byteLength);let X;return typeof(f=D[0]===1?$m(D.subarray(4,12)):j.getUint32(4))=="bigint"?X=f/da.BigInt(C):typeof f!="number"||isNaN(f)||(X=f/C),X11?(b.codec+=".",b.codec+=Ji(ue[9]),b.codec+=Ji(ue[10]),b.codec+=Ji(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=de.subarray(28),si(ue.subarray(4,8))==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+Ji(ue[19]),b.codec+="."+Ji(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var be=$e(d,["mdia","mdhd"])[0];be&&(b.timescale=ua(be)),c.push(b)}),c},Cl=function(o,u=0){return $e(o,["emsg"]).map(c=>{var d=ha.parseEmsgBox(new Uint8Array(c)),m=Vm(d.message_data);return{cueTime:ha.scaleTime(d.presentation_time,d.timescale,d.presentation_time_delta,u),duration:ha.scaleTime(d.event_duration,d.timescale),frames:m}})};var ca={findBox:$e,parseType:si,timescale:vl,startTime:bl,compositionStartTime:Tl,videoTrackIds:Sl,tracks:El,getTimescaleFromMediaHeader:ua,getEmsgID3:Cl},pa=Pt,Rl=function(o){var u=31&o[1];return u<<=8,u|=o[2]},jr=function(o){return!!(64&o[1])},Hr=function(o){var u=0;return(48&o[3])>>>4>1&&(u+=o[4]+1),u},zm=function(o){if(!jr(o))return null;var u=4+Hr(o);if(u>=o.byteLength)return null;var c,d=null;return 192&(c=o[u+7])&&((d={}).pts=(14&o[u+9])<<27|(255&o[u+10])<<20|(254&o[u+11])<<12|(255&o[u+12])<<5|(254&o[u+13])>>>3,d.pts*=4,d.pts+=(6&o[u+13])>>>1,d.dts=d.pts,64&c&&(d.dts=(14&o[u+14])<<27|(255&o[u+15])<<20|(254&o[u+16])<<12|(255&o[u+17])<<5|(254&o[u+18])>>>3,d.dts*=4,d.dts+=(6&o[u+18])>>>1)),d},ma=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wm={parseType:function(o,u){var c=Rl(o);return c===0?"pat":c===u?"pmt":u?"pes":null},parsePat:function(o){var u=jr(o),c=4+Hr(o);return u&&(c+=o[c]+1),(31&o[c+10])<<8|o[c+11]},parsePmt:function(o){var u={},c=jr(o),d=4+Hr(o);if(c&&(d+=o[d]+1),1&o[d+5]){var m;m=3+((15&o[d+1])<<8|o[d+2])-4;for(var f=12+((15&o[d+10])<<8|o[d+11]);f3&&ma(31&c[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(f=!0),f}},Ml=Pt,ii=nl.handleRollover,xe={};xe.ts=Wm,xe.aac=na;var Ns=ke.ONE_SECOND_IN_TS,ut=188,$t=71,Gm=function(o,u){for(var c,d=0,m=ut;m=0;)if(o[x]!==$t||o[C]!==$t&&C!==o.byteLength)x--,C--;else{if(d=o.subarray(x,C),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="audio",c.audio.push(b),D=!0)),D)break;x-=ut,C-=ut}},Xm=function(o,u,c){for(var d,m,f,b,x,C,D,j=0,X=ut,ue=!1,de={data:[],size:0};X=0;)if(o[j]!==$t||o[X]!==$t)j--,X--;else{if(d=o.subarray(j,X),xe.ts.parseType(d,u.pid)==="pes"&&(m=xe.ts.parsePesType(d,u.table),f=xe.ts.parsePayloadUnitStartIndicator(d),m==="video"&&f&&(b=xe.ts.parsePesTime(d))&&(b.type="video",c.video.push(b),ue=!0)),ue)break;j-=ut,X-=ut}},Ym=function(o,u){if(o.audio&&o.audio.length){var c=u;(c===void 0||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(f){f.dts=ii(f.dts,c),f.pts=ii(f.pts,c),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns})}if(o.video&&o.video.length){var d=u;if((d===void 0||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(f){f.dts=ii(f.dts,d),f.pts=ii(f.pts,d),f.dtsTime=f.dts/Ns,f.ptsTime=f.pts/Ns}),o.firstKeyFrame){var m=o.firstKeyFrame;m.dts=ii(m.dts,d),m.pts=ii(m.pts,d),m.dtsTime=m.dts/Ns,m.ptsTime=m.pts/Ns}}},Km=function(o){for(var u,c=!1,d=0,m=null,f=null,b=0,x=0;o.length-x>=3;){switch(xe.aac.parseType(o,x)){case"timed-metadata":if(o.length-x<10){c=!0;break}if((b=xe.aac.parseId3TagSize(o,x))>o.length){c=!0;break}f===null&&(u=o.subarray(x,x+b),f=xe.aac.parseAacTimestamp(u)),x+=b;break;case"audio":if(o.length-x<7){c=!0;break}if((b=xe.aac.parseAdtsSize(o,x))>o.length){c=!0;break}m===null&&(u=o.subarray(x,x+b),m=xe.aac.parseSampleRate(u)),d++,x+=b;break;default:x++}if(c)return null}if(m===null||f===null)return null;var C=Ns/m;return{audio:[{type:"audio",dts:f,pts:f},{type:"audio",dts:f+1024*d*C,pts:f+1024*d*C}]}},Qm=function(o){var u={pid:null,table:null},c={};for(var d in Gm(o,u),u.table)if(u.table.hasOwnProperty(d))switch(u.table[d]){case Ml.H264_STREAM_TYPE:c.video=[],Xm(o,u,c),c.video.length===0&&delete c.video;break;case Ml.ADTS_STREAM_TYPE:c.audio=[],Bl(o,u,c),c.audio.length===0&&delete c.audio}return c},Jm={inspect:function(o,u){var c;return(c=xe.aac.isLikelyAacData(o)?Km(o):Qm(o))&&(c.audio||c.video)?(Ym(c,u),c):null},parseAudioPes_:Bl};const Zm=function(o,u){u.on("data",function(c){const d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const m=c.data;c.data=m.buffer,o.postMessage({action:"data",segment:c,byteOffset:m.byteOffset,byteLength:m.byteLength},[c.data])}),u.on("done",function(c){o.postMessage({action:"done"})}),u.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),u.on("videoSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(c){const d={start:{decode:ke.videoTsToSeconds(c.start.dts),presentation:ke.videoTsToSeconds(c.start.pts)},end:{decode:ke.videoTsToSeconds(c.end.dts),presentation:ke.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:ke.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=ke.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),u.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),u.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),u.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ke.videoTsToSeconds(c.start),end:ke.videoTsToSeconds(c.end)}})}),u.on("log",function(c){o.postMessage({action:"log",log:c})})};class Fl{constructor(u,c){this.options=c||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _m.Transmuxer(this.options),Zm(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new Nm,this.captionParser.init());const c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(c,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:u,data:c}){const d=ca.startTime(u,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:u}){const c=ca.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:u},[u.buffer])}probeEmsgID3({data:u,offset:c}){const d=ca.getEmsgID3(u,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:c}){const d=typeof c!="number"||isNaN(c)?void 0:c*ke.ONE_SECOND_IN_TS,m=Jm.inspect(u,d);let f=null;m&&(f={hasVideo:m.video&&m.video.length===2||!1,hasAudio:m.audio&&m.audio.length===2||!1},f.hasVideo&&(f.videoStart=m.video[0].ptsTime),f.hasAudio&&(f.audioStart=m.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:f,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const c=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ke.secondsToVideoTs(c)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(ke.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){o.data.action==="init"&&o.data.options?this.messageHandlers=new Fl(self,o.data.options):(this.messageHandlers||(this.messageHandlers=new Fl(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data))}}));var Y0=Sp(X0);const K0=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:h,videoFramePtsTime:p}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const g=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};h!==void 0&&(y.videoFrameDtsTime=h),p!==void 0&&(y.videoFramePtsTime=p),t(y)},Q0=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},J0=(s,e)=>{e.gopInfo=s.data.gopInfo},wp=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:h,onVideoTimingInfo:p,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:E,onDone:I,onEndedTimeline:v,onTransmuxerLog:L,isEndOfTimeline:R,segment:M,triggerSegmentEventFn:O}=s,G={buffer:[]};let N=R;const z=H=>{e.currentTransmux===s&&(H.data.action==="data"&&K0(H,G,a),H.data.action==="trackinfo"&&l(H.data.trackInfo),H.data.action==="gopInfo"&&J0(H,G),H.data.action==="audioTimingInfo"&&h(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&p(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&g(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&y(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&w([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&E(H.data.caption),H.data.action==="endedtimeline"&&(N=!1,v()),H.data.action==="log"&&L(H.data.log),H.data.type==="transmuxed"&&(N||(e.onmessage=null,Q0({transmuxedData:G,callback:I}),Ap(e))))},U=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:qs({segment:M})}};I(null,H)};if(e.onmessage=z,e.onerror=U,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),n!==void 0&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:M}),e.postMessage({action:"push",data:H,byteOffset:S,byteLength:t.byteLength},[H])}R&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ap=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():wp(s.currentTransmux))},ud=(s,e)=>{s.postMessage({action:e}),Ap(s)},hd=(s,e)=>{if(!e.currentTransmux)return e.currentTransmux=s,void ud(e,s);e.transmuxQueue.push(ud.bind(null,e,s))},xp=s=>{if(!s.transmuxer.currentTransmux)return s.transmuxer.currentTransmux=s,void wp(s);s.transmuxer.transmuxQueue.push(s)};var to={reset:s=>{hd("reset",s)},endTimeline:s=>{hd("endTimeline",s)},transmux:xp,createTransmuxer:s=>{const e=new Y0;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e}};const pr=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=ze({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},Yt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ko=s=>{s.forEach(e=>{e.abort()})},Z0=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),e1=s=>{const e=s.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return t.bytesReceived=s.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},il=(s,e)=>{const{requestType:t}=e,i=Gs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:null},dd=(s,e,t,i)=>(r,n)=>{const a=n.response,l=il(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yt.FAILURE,xhr:n},s);const h=new DataView(a),p=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let y=0;y{const t=Fo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Yt.FAILURE,metadata:{mediaType:r}})}pr({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},s.map.tracks[n.type]||(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale))}),e(null))})},t1=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=il(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,kp(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},s1=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=il(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t!=="arraybuffer"&&n.responseText?W0(n.responseText.substring(s.lastReachedChar||0)):n.response;return s.stats=Z0(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},i1=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{const I=s.map&&s.map.tracks||{},v=!!(I.audio&&I.video);let L=i.bind(null,s,"audio","start");const R=i.bind(null,s,"audio","end");let M=i.bind(null,s,"video","start");const O=i.bind(null,s,"video","end"),G=()=>xp({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:v,onData:N=>{N.type=N.type==="combined"?"video":N.type,g(s,N)},onTrackInfo:N=>{t&&(v&&(N.isMuxed=!0),t(s,N))},onAudioTimingInfo:N=>{L&&N.start!==void 0&&(L(N.start),L=null),R&&N.end!==void 0&&R(N.end)},onVideoTimingInfo:N=>{M&&N.start!==void 0&&(M(N.start),M=null),O&&N.end!==void 0&&O(N.end)},onVideoSegmentTimingInfo:N=>{const z={pts:{start:N.start.presentation,end:N.end.presentation},dts:{start:N.start.decode,end:N.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),r(N)},onAudioSegmentTimingInfo:N=>{const z={pts:{start:N.start.pts,end:N.end.pts},dts:{start:N.start.dts,end:N.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:z}),n(N)},onId3:(N,z)=>{a(s,N,z)},onCaptions:N=>{l(s,[N])},isEndOfTimeline:h,onEndedTimeline:()=>{p()},onTransmuxerLog:w,onDone:(N,z)=>{y&&(N.type=N.type==="combined"?"video":N.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(z,s,N))},segment:s,triggerSegmentEventFn:E});pr({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:N=>{s.bytes=e=N.data;const z=N.result;z&&(t(s,{hasAudio:z.hasAudio,hasVideo:z.hasVideo,isMuxed:v}),t=null),G()}})},Dp=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=new Uint8Array(e);if(My(I)){s.isFmp4=!0;const{tracks:v}=s.map,L={isFmp4:!0,hasVideo:!!v.video,hasAudio:!!v.audio};v.audio&&v.audio.codec&&v.audio.codec!=="enca"&&(L.audioCodec=v.audio.codec),v.video&&v.video.codec&&v.video.codec!=="encv"&&(L.videoCodec=v.video.codec),v.video&&v.audio&&(L.isMuxed=!0),t(s,L);const R=(M,O)=>{g(s,{data:I,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),O&&O.length&&a(s,O),M&&M.length&&l(s,M),y(null,s,{})};pr({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:M,startTime:O})=>{e=M.buffer,s.bytes=I=M,L.hasAudio&&!L.isMuxed&&i(s,"audio","start",O),L.hasVideo&&i(s,"video","start",O),pr({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:O,callback:({emsgData:G,id3Frames:N})=>{e=G.buffer,s.bytes=I=G,v.video&&G.byteLength&&s.transmuxer?pr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[v.video.id],callback:z=>{e=z.data.buffer,s.bytes=I=z.data,z.logs.forEach(function(U){w(we(U,{stream:"mp4CaptionParser"}))}),R(z.captions,N)}}):R(void 0,N)}})}})}else if(s.transmuxer){if(s.container===void 0&&(s.container=Fo(I)),s.container!=="ts"&&s.container!=="aac")return t(s,{hasAudio:!1,hasVideo:!1}),void y(null,s,{});i1({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})}else y(null,s,{})},Ip=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=p=>{if(p.data.source===s){i.removeEventListener("message",l);const g=p.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};let h;i.onerror=()=>{const p="An error occurred in the decryption worker",g=qs({segment:r}),y={message:p,metadata:{error:new Error(p),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l),h=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(fp({source:s,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},r1=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Ip({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},I=>{e.bytes=I,E({type:"segmentdecryptioncomplete",segment:e}),Dp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})})},n1=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})=>{let I=0,v=!1;return(L,R)=>{if(!v){if(L)return v=!0,ko(s),y(L,R);if(I+=1,I===s.length){const M=function(){if(R.encryptedBytes)return r1({decryptionWorker:e,segment:R,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E});Dp({segment:R,bytes:R.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:E})};if(R.endOfAllRequests=Date.now(),R.map&&R.map.encryptedBytes&&!R.map.bytes)return E({type:"segmentdecryptionstart",segment:R}),Ip({decryptionWorker:e,id:R.requestId+"-init",encryptedBytes:R.map.encryptedBytes,key:R.map.key,segment:R,doneFn:y},O=>{R.map.bytes=O,E({type:"segmentdecryptioncomplete",segment:R}),kp(R,G=>{if(G)return ko(s),y(G,R);M()})});M()}}}},a1=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},o1=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=we(s.stats,e1(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},l1=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R})=>{const M=[],O=n1({activeXhrs:M,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I,doneFn:v,onTransmuxerLog:L,triggerSegmentEventFn:R});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const S=we(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),A=dd(i,H,O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.key.resolvedUri}});const B=s(S,A);M.push(B)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const B=we(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),$=dd(i,[i.map.key],O,R);R({type:"segmentkeyloadstart",segment:i,keyInfo:{uri:i.map.key.resolvedUri}});const W=s(B,$);M.push(W)}const H=we(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map),requestType:"segment-media-initialization"}),S=t1({segment:i,finishProcessingFn:O,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const A=s(H,S);M.push(A)}const G=we(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i),requestType:"segment"}),N=s1({segment:i,finishProcessingFn:O,responseType:G.responseType,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:i});const z=s(G,N);z.addEventListener("progress",o1({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:E,dataFn:I})),M.push(z);const U={};return M.forEach(H=>{H.addEventListener("loadend",a1({loadendState:U,abortFn:r}))}),()=>ko(M)},u1=It("CodecUtils"),h1=function(s){const e=s.attributes||{};if(e.CODECS)return Vt(e.CODECS)},Pp=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},d1=(s,e)=>{if(!Pp(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},kn=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Fd(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1)return u1(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(e[t]=null);e[t]=e[t][0]}),e},cd=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},mr=function(s,e){const t=e.attributes||{},i=kn(h1(e)||[]);if(Pp(s,e)&&!i.audio&&!d1(s,e)){const r=kn(uf(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Qr=It("PlaylistSelector"),pd=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Dn=function(s,e){if(!s)return"";const t=k.getComputedStyle(s);return t?t[e]:""},Ti=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},rl=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||k.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||k.Number.MAX_VALUE,t-i},c1=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||k.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||k.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let Lp=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let l=s.playlists;bt.isAudioOnly(s)&&(l=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let h=l.map(N=>{let z;const U=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,H=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return z=N.attributes&&N.attributes.BANDWIDTH,z=z||k.Number.MAX_VALUE,{bandwidth:z,width:U,height:H,playlist:N}});Ti(h,(N,z)=>N.bandwidth-z.bandwidth),h=h.filter(N=>!bt.isIncompatible(N.playlist));let p=h.filter(N=>bt.isEnabled(N.playlist));p.length||(p=h.filter(N=>!bt.isDisabled(N.playlist)));const g=p.filter(N=>N.bandwidth*Je.BANDWIDTH_VARIANCEN.bandwidth===y.bandwidth)[0];if(r===!1){const N=w||p[0]||h[0];if(N&&N.playlist){let z="sortedPlaylistReps";return w&&(z="bandwidthBestRep"),p[0]&&(z="enabledPlaylistReps"),Qr(`choosing ${pd(N)} using ${z} with options`,a),N.playlist}return Qr("could not choose a playlist with options",a),null}const E=g.filter(N=>N.width&&N.height);Ti(E,(N,z)=>N.width-z.width);const I=E.filter(N=>N.width===t&&N.height===i);y=I[I.length-1];const v=I.filter(N=>N.bandwidth===y.bandwidth)[0];let L,R,M,O;if(v||(L=E.filter(N=>N.width>t||N.height>i),R=L.filter(N=>N.width===L[0].width&&N.height===L[0].height),y=R[R.length-1],M=R.filter(N=>N.bandwidth===y.bandwidth)[0]),n.leastPixelDiffSelector){const N=E.map(z=>(z.pixelDiff=Math.abs(z.width-t)+Math.abs(z.height-i),z));Ti(N,(z,U)=>z.pixelDiff===U.pixelDiff?U.bandwidth-z.bandwidth:z.pixelDiff-U.pixelDiff),O=N[0]}const G=O||M||v||w||p[0]||h[0];if(G&&G.playlist){let N="sortedPlaylistReps";return O?N="leastPixelDiffRep":M?N="resolutionPlusOneRep":v?N="resolutionBestRep":w?N="bandwidthBestRep":p[0]&&(N="enabledPlaylistReps"),Qr(`choosing ${pd(G)} using ${N} with options`,a),G.playlist}return Qr("could not choose a playlist with options",a),null};const md=function(){let s=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),Lp(this.playlists.main,this.systemBandwidth,parseInt(Dn(this.tech_.el(),"width"),10)*s,parseInt(Dn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},p1=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&k.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),Lp(this.playlists.main,e,parseInt(Dn(this.tech_.el(),"width"),10)*i,parseInt(Dn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},m1=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:h}=s,p=e.playlists.filter(E=>!bt.isIncompatible(E));let g=p.filter(bt.isEnabled);g.length||(g=p.filter(E=>!bt.isDisabled(E)));const y=g.filter(bt.hasAttribute.bind(null,"BANDWIDTH")).map(E=>{const I=h.getSyncPoint(E,r,l,t)?1:2;return{playlist:E,rebufferingImpact:bt.estimateSegmentRequestTime(n,i,E)*I-a}}),w=y.filter(E=>E.rebufferingImpact<=0);return Ti(w,(E,I)=>rl(I.playlist,E.playlist)),w.length?w[0]:(Ti(y,(E,I)=>E.rebufferingImpact-I.rebufferingImpact),y[0]||null)},g1=function(){const s=this.playlists.main.playlists.filter(bt.isEnabled);return Ti(s,(e,t)=>rl(e,t)),s.filter(e=>!!mr(this.playlists.main,e).video)[0]||null},f1=s=>{let e,t=0;return s.bytes&&(e=new Uint8Array(s.bytes),s.segments.forEach(i=>{e.set(i,t),t+=i.byteLength})),e};function Op(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const y1=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{let n=t,a=t,l=!1;const h=(e.options_.vhs&&e.options_.vhs.captionServices||{})[i];h&&(n=h.label,a=h.language,l=h.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:n,language:a},!1).track}}},_1=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},v1=function(s){Object.defineProperties(s.frame,{id:{get:()=>(F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key)},value:{get:()=>(F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data)},privateData:{get:()=>(F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data)}})},b1=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=k.WebKitDataCue||k.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;!(typeof y!="number"||k.isNaN(y)||y<0)&&y<1/0&&g.frames&&g.frames.length&&g.frames.forEach(w=>{const E=new r(y,y,w.value||w.url||w.data||"");E.frame=w,E.value=w,v1(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let g=0;g{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),p=Object.keys(h).sort((g,y)=>Number(g)-Number(y));p.forEach((g,y)=>{const w=h[g],E=isFinite(i)?i:g,I=Number(p[y+1])||E;w.forEach(v=>{v.endTime=I})})},T1={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},S1=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),E1=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=k.WebKitDataCue||k.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(S1.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:T1[n],data:r[n]},n!=="scte35Out"&&n!=="scte35In"||(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},gd=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},or=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},C1=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},w1=(s,e,t)=>{if(e==null||!s.length)return[];const i=Math.ceil((e-t+3)*js.ONE_SECOND_IN_TS);let r;for(r=0;ri);r++);return s.slice(r)},A1=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(;r=i);r++);return s.slice(0,r).concat(e)},x1=(s,e,t,i)=>{const r=Math.ceil((e-i)*js.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*js.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let h=l+1;for(;h--&&!(s[h].pts<=r););return h=Math.max(h,0),a.splice(h,l-h+1),a},k1=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;rt))return n}return i.length===0?0:i[i.length-1]},ir=1,I1=500,fd=s=>typeof s=="number"&&isFinite(s),Jr=1/60,P1=(s,e,t)=>s==="main"&&e&&t?t.hasAudio||t.hasVideo?e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,L1=(s,e,t)=>{let i=e-Je.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},li=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:h,partIndex:p,timeline:g}=s,y=l.length-1;let w="mediaIndex/partIndex increment";s.getMediaInfoForTime?w=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(w+=` with independent ${s.independent}`);const E=typeof p=="number",I=s.segment.uri?"segment":"pre-segment",v=E?tp({preloadSegment:i})-1:0;return`${I} [${n+h}/${n+y}]`+(E?` part [${p}/${v}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${w}] playlist [${a}]`},yd=s=>`${s}TimingInfo`,O1=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>r||s!==e?s{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!n||n.to!==t}return!1},N1=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!(!i||e.from===-1||t.from===-1||!r)},R1=s=>{s&&(s.pause(),s.resetEverything(),s.load())},M1=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=s.pendingSegment_;if(e&&Do({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&N1(s.timelineChangeController_)){if(M1(s))return void s.timelineChangeController_.trigger("audioTimelineBehind");R1(s)}},B1=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=k.BigInt(n)-k.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),a!==void 0&&a>e&&(e=a)}),typeof e=="bigint"&&e!!s&&Math.round(s)>e+Gt,F1=(s,e)=>{if(e!=="hls")return null;const t=B1({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=_d({segmentDuration:t,maxDuration:2*i}),n=_d({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},qs=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class Io extends F.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=It(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(ze({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(ze({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ss(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ss(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,k.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return gt();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=yp(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: -currentTime: ${this.currentTime_()} -bufferedEnd: ${eo(this.buffered_())} -`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const a=()=>{n--,n===0&&i()};!r&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=x1(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)or(e,t,this.inbandTextTracks_[l]);or(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),I1)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=eo(e)||0,i=Zo(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=D1(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const w=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=w.end?w.end:t,w.parts&&w.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let w,E,I;const v=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: -For TargetTime: ${v}. -CurrentTime: ${this.currentTime_()} -BufferedEnd: ${t} -Fetch At Buffer: ${this.fetchAtBuffer_} -`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const L=this.getSyncInfoFromMediaSequenceSync_(v);if(!L){const R="No sync info found while using media sequence sync";return this.error({message:R,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(R)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${L.start} --> ${L.end})`),w=L.segmentIndex,E=L.partIndex,I=L.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const L=bt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:v,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=L.segmentIndex,E=L.partIndex,I=L.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${v}`:`currentTime ${v}`,l.mediaIndex=w,l.startOfSegment=I,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const h=a[l.mediaIndex];let p=h&&typeof l.partIndex=="number"&&h.parts&&h.parts[l.partIndex];if(!h||typeof l.partIndex=="number"&&!p)return null;typeof l.partIndex!="number"&&h.parts&&(l.partIndex=0,p=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&p&&!g&&!p.independent)if(l.partIndex===0){const w=a[l.mediaIndex-1],E=w.parts&&w.parts.length&&w.parts[w.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=w.parts.length-1,l.independent="previous segment")}else h.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:h,getMediaInfoForTime:p}=e,g=i.segments[r],y=typeof l=="number"&&g.parts[l],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:t},E=h!==void 0?h:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const I=eo(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(w.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=w1(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return O1(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=bt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=u0(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=m1({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const h=n-a-l.rebufferingImpact;let p=.5;a<=Gt&&(p=1),!l.playlist||l.playlist.uri===this.playlist_.uri||h{r[n.stream]=r[n.stream]||{startTime:1/0,captions:[],endTime:0};const a=r[n.stream];a.startTime=Math.min(a.startTime,n.startTime+i),a.endTime=Math.max(a.endTime,n.endTime+i),a.captions.push(n)}),Object.keys(r).forEach(n=>{const{startTime:a,endTime:l,captions:h}=r[n],p=this.inbandTextTracks_;this.logger_(`adding cues from ${a} -> ${l} for ${n}`),y1(p,this.vhs_.tech_,n),or(a,l,p[n]),_1({captionArray:h,inbandTextTracks:p,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo)&&!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Ss(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[yd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_!=="main"||typeof e.timestampOffset!="number"||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=xn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(a).join(", "));const l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,p=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-l<=ir&&g-p<=ir)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Hs(n).join(", ")}, video buffer: ${Hs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const y=this.currentTime_()-ir;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${ir}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=k.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*ir)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(r.code!==dp?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let h=r.byteLength;i&&(l.unshift(i),h+=i.byteLength),n=f1({bytes:h,segments:l})}const a={segmentInfo:qs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Ss(this),void this.loadQueue_.push(()=>{const t=ze({},e,{forceTimestampOffset:!0});ze(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting -${Op(e.uri)} -${li(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=l1({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:h,stream:p})=>{this.logger_(`${li(e)} logged from transmuxer stream ${p} as a ${h}: ${l}`)},triggerSegmentEventFn:({type:l,segment:h,keyInfo:p,trackInfo:g,timingInfo:y})=>{const w={segmentInfo:qs({segment:h})};p&&(w.keyInfo=p),g&&(w.trackInfo=g),y&&(w.timingInfo=y),this.trigger({type:l,metadata:w})}})}trimBackBuffer_(e){const t=L1(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,a=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(n||a)return this.logger_(`bad ${n?"segment":"part"} ${li(e)}`),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},U1=["video","audio"],Po=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},q1=(s,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type!=="mediaSource"){if(s!=="mediaSource"&&e.ready()&&e.mediaSource.readyState!=="closed"&&!Po(s,e)){if(i.type!==s){if(t=q1(s,e.queue),t===null)return;i=e.queue[t]}return e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),i.doneFn?void 0:(e.queuePending[s]=null,void Si(s,e))}}else e.updating()||e.mediaSource.readyState==="closed"||(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Si("audio",e),Si("video",e))},Rp=(s,e)=>{const t=e[`${s}Buffer`],i=Np(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Tt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===dp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zt(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Np(s),r=Ei(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(Rp(s,e),zt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Ei(s);if(!zt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(h){l.errorType=F.Error.StreamingCodecsChangeError,l.error=h,h.metadata=l,t.error_=h,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,h)}}},St=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Si(s,e)},vd=(s,e)=>t=>{const i=a0(e[`${s}Buffered`]());if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,i),e.queuePending[s]){const r=e.queuePending[s].doneFn;e.queuePending[s]=null,r&&r(e[`${s}Error_`])}Si(s,e)};class Mp extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Si("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=vd("video",this),this.onAudioUpdateEnd_=vd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:Tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:Tt.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?St({type:"mediaSource",sourceUpdater:this,action:Tt.removeSourceBuffer(e),name:"removeSourceBuffer"}):F.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&k.MediaSource&&k.MediaSource.prototype&&typeof k.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return k.SourceBuffer&&k.SourceBuffer.prototype&&typeof k.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?St({type:e,sourceUpdater:this,action:Tt.changeType(t),name:"changeType"}):F.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);const a=t;if(St({type:r,sourceUpdater:this,action:Tt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return zt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:gt()}videoBuffered(){return zt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:gt()}buffered(){const e=zt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():l0(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=cs){St({type:"mediaSource",sourceUpdater:this,action:Tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=cs){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:Tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=cs){this.audioBuffered().length&&this.audioBuffered().end(0)!==0?St({type:"audio",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=cs){this.videoBuffered().length&&this.videoBuffered().end(0)!==0?St({type:"video",sourceUpdater:this,action:Tt.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Po("audio",this)&&!Po("video",this))}audioTimestampOffset(e){return e!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return e!==void 0&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),U1.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Rp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const bd=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),j1=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Td=new Uint8Array(` - -`.split("").map(s=>s.charCodeAt(0)));class H1 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class $1 extends Io{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return gt();const e=this.subtitlesTrack_.cues;return gt([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=xn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=Td.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Td,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return e===void 0||(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){or(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",t),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Yt.TIMEOUT&&this.handleTimeout_(),e.code===Yt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof k.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));n.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message,metadata:{errorType:F.Error.StreamingVttParserError,error:a}})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new k.VTTCue(a.startTime,a.endTime,a.text):a)}),C1(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if(typeof k.WebVTT!="function")throw new H1;typeof k.TextDecoder=="function"?t=new k.TextDecoder("utf8"):(t=k.WebVTT.StringDecoder(),i=!0);const r=new k.WebVTT.Parser(k,k.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=bd(a)),r.parse(a)}let n=e.bytes;i&&(n=bd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/js.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(h=>{const p=h.endTime-h.startTime,g=this.handleRollover_(h.startTime+l,t.time);h.startTime=Math.max(g,0),h.endTime=Math.max(g+p,0)}),!i.syncInfo){const h=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(h,p-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*js.ONE_SECOND_IN_TS;const r=t*js.ONE_SECOND_IN_TS;let n;for(n=r4294967296;)i+=n;return i/js.ONE_SECOND_IN_TS}}const V1=function(s,e){const t=s.cues;for(let i=0;i=r.adStartTime&&e<=r.adEndTime)return r}return null},z1=function(s,e,t=0){if(!s.segments)return;let i,r=t;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Bp{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=` -`,a=i,l=t;this.start_=a,e.forEach((h,p)=>{const g=this.storage_.get(l),y=a,w=y+h.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),I=new Sd({start:y,end:w,appended:E,segmentIndex:p});h.syncInfo=I;let v=a;const L=(h.parts||[]).map((R,M)=>{const O=v,G=v+R.duration,N=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[M]&&g.partsSyncInfo[M].isAppended),z=new Sd({start:O,end:G,appended:N,segmentIndex:p,partIndex:M});return v=G,n+=`Media Sequence: ${l}.${M} | Range: ${O} --> ${G} | Appended: ${N} -`,R.syncInfo=z,z});r.set(l,new W1(I,L)),n+=`${Op(h.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${w} | Appended: ${E} -`,l++,a=w}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Ed extends Bp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const i=this.parent_.getSyncInfoForMediaSequence(e);return i?i.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const G1=86400,so=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=To(e);r=r||0;for(let h=0;h{let n=null,a=null;r=r||0;const l=To(e);for(let h=0;h=w)&&(a=w,n={time:y,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l=y)&&(a=y,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class X1 extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Bp,i=new Ed(t),r=new Ed(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return so.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:h,strategy:p}=l,{segmentIndex:g,time:y}=h;if(g<0)continue;const w=y,E=w+e.segments[g].duration;if(this.logger_(`Strategy: ${p}. Current time: ${r}. selected segment: ${g}. Time: [${w} -> ${E}]}`),r>=w&&r0&&(r.time*=-1),Math.abs(r.time+cr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;lG1)F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&n.start!==void 0){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].time}mappingForTimeline(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a,l,h=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")h={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=h,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${h.time}] [mapping: ${h.mapping}]`)),a=e.startOfSegment,l=t.end+h.mapping;else{if(!h)return!1;a=t.start+h.mapping,l=t.end+h.mapping}return n&&(n.start=a,n.end=l),(!r.start||ah){let p;p=l<0?i.start-cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:p,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class Y1 extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const K1=Ep(Cp(function(){var s=function(){function I(){this.listeners={}}var v=I.prototype;return v.on=function(L,R){this.listeners[L]||(this.listeners[L]=[]),this.listeners[L].push(R)},v.off=function(L,R){if(!this.listeners[L])return!1;var M=this.listeners[L].indexOf(R);return this.listeners[L]=this.listeners[L].slice(0),this.listeners[L].splice(M,1),M>-1},v.trigger=function(L){var R=this.listeners[L];if(R)if(arguments.length===2)for(var M=R.length,O=0;O>7))^O]=O;for(G=N=0;!R[G];G^=H||1,N=U[N]||1)for(B=N^N<<1^N<<2^N<<3^N<<4,B=B>>8^255&B^99,R[G]=B,M[B]=G,A=z[S=z[H=z[G]]],W=16843009*A^65537*S^257*H^16843008*G,$=257*z[B]^16843008*B,O=0;O<4;O++)v[O][G]=$=$<<24^$>>>8,L[O][B]=W=W<<24^W>>>8;for(O=0;O<5;O++)v[O]=v[O].slice(0),L[O]=L[O].slice(0);return I};let i=null;class r{constructor(v){let L,R,M;i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];const O=this._tables[0][4],G=this._tables[1],N=v.length;let z=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");const U=v.slice(0),H=[];for(this._key=[U,H],L=N;L<4*N+28;L++)M=U[L-1],(L%N==0||N===8&&L%N==4)&&(M=O[M>>>24]<<24^O[M>>16&255]<<16^O[M>>8&255]<<8^O[255&M],L%N==0&&(M=M<<8^M>>>24^z<<24,z=z<<1^283*(z>>7))),U[L]=U[L-N]^M;for(R=0;L;R++,L--)M=U[3&R?L:L-4],H[R]=L<=4||R<4?M:G[0][O[M>>>24]]^G[1][O[M>>16&255]]^G[2][O[M>>8&255]]^G[3][O[255&M]]}decrypt(v,L,R,M,O,G){const N=this._key[1];let z,U,H,S=v^N[0],A=M^N[1],B=R^N[2],$=L^N[3];const W=N.length/4-2;let te,J=4;const oe=this._tables[1],Q=oe[0],Y=oe[1],ie=oe[2],se=oe[3],ee=oe[4];for(te=0;te>>24]^Y[A>>16&255]^ie[B>>8&255]^se[255&$]^N[J],U=Q[A>>>24]^Y[B>>16&255]^ie[$>>8&255]^se[255&S]^N[J+1],H=Q[B>>>24]^Y[$>>16&255]^ie[S>>8&255]^se[255&A]^N[J+2],$=Q[$>>>24]^Y[S>>16&255]^ie[A>>8&255]^se[255&B]^N[J+3],J+=4,S=z,A=U,B=H;for(te=0;te<4;te++)O[(3&-te)+G]=ee[S>>>24]<<24^ee[A>>16&255]<<16^ee[B>>8&255]<<8^ee[255&$]^N[J++],z=S,S=A,A=B,B=$,$=z}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(v){this.jobs.push(v),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(I){return I<<24|(65280&I)<<8|(16711680&I)>>8|I>>>24},l=function(I,v,L){const R=new Int32Array(I.buffer,I.byteOffset,I.byteLength>>2),M=new r(Array.prototype.slice.call(v)),O=new Uint8Array(I.byteLength),G=new Int32Array(O.buffer);let N,z,U,H,S,A,B,$,W;for(N=L[0],z=L[1],U=L[2],H=L[3],W=0;W{const R=I[L];y(R)?v[L]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:v[L]=R}),v};self.onmessage=function(I){const v=I.data,L=new Uint8Array(v.encrypted.bytes,v.encrypted.byteOffset,v.encrypted.byteLength),R=new Uint32Array(v.key.bytes,v.key.byteOffset,v.key.byteLength/4),M=new Uint32Array(v.iv.bytes,v.iv.byteOffset,v.iv.byteLength/4);new h(L,R,M,function(O,G){self.postMessage(E({source:v.source,decrypted:G}),[G.buffer])})}}));var Q1=Sp(K1);const J1=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Fp=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Up=(s,e)=>{e.activePlaylistLoader=s,s.load()},Z1=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,h=r.lastGroup_;a&&h&&a.id===h.id||(r.lastGroup_=a,r.lastTrack_=n,Fp(t,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(t.resyncLoader(),Up(a.playlistLoader,r)):l&&i.resetEverything()))},e2=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},t2=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),h=n.activePlaylistLoader,p=n.lastTrack_;if((!p||!a||p.id!==a.id)&&(n.lastGroup_=l,n.lastTrack_=a,Fp(i,n),l)){if(l.isMainPlaylist){if(!a||!p||a.id===p.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();return g.media()===y?void 0:(n.logger_(`track change. Switching main audio from ${p.id} to ${a.id}`),t.pause(),r.resetEverything(),void g.fastQualityChange_(y))}if(s==="AUDIO"){if(!l.playlistLoader)return r.setAudio(!0),void r.resetEverything();i.setAudio(!0),r.setAudio(!1)}h!==l.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Up(l.playlistLoader,n)}},In={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,l=t.tracks[a];if(r!==l){F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in t.tracks)t.tracks[h].enabled=t.tracks[h]===l;t.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Cd={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",In[s](s,t))}},s2={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:h,logger_:p}},mainPlaylistLoader:g}=e,y=wr(g.main);a[s]&&Object.keys(a[s]).length!==0||(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const w in a[s]){l[w]||(l[w]=[]);for(const E in a[s][w]){let I,v=a[s][w][E];if(y?(p(`AUDIO group '${w}' label '${E}' is a main playlist`),v.isMainPlaylist=!0,I=null):I=i==="vhs-json"&&v.playlists?new mi(v.playlists[0],t,n):v.resolvedUri?new mi(v.resolvedUri,t,n):v.playlists&&i==="dash"?new xo(v.playlists[0],t,n,g):null,v=we({id:E,playlistLoader:I},v),Cd[s](s,v.playlistLoader,e),l[w].push(v),h[E]===void 0){const L=new F.AudioTrack({id:E,kind:J1(v),enabled:!1,language:v.language,default:v.default,label:E});h[E]=L}}}r.on("error",In[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:h,tracks:p}},mainPlaylistLoader:g}=e;for(const y in l[s]){h[y]||(h[y]=[]);for(const w in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][w].forced)continue;let E,I=l[s][y][w];if(r==="hls")E=new mi(I.resolvedUri,i,a);else if(r==="dash"){if(!I.playlists.filter(v=>v.excludeUntil!==1/0).length)return;E=new xo(I.playlists[0],i,a,g)}else r==="vhs-json"&&(E=new mi(I.playlists?I.playlists[0]:I.resolvedUri,i,a));if(I=we({id:w,playlistLoader:E},I),Cd[s](s,I.playlistLoader,e),h[y].push(I),p[w]===void 0){const v=t.addRemoteTextTrack({id:w,kind:"subtitles",default:I.default&&I.autoselect,language:I.language,label:w},!1).track;p[w]=v}}}n.on("error",In[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const h=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const p=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(p[g.instreamId]&&(g=we(g,p[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(we({id:l},h)),n[l]===void 0){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=y}}}}},qp=(s,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&wr(e.main))for(let h=0;hh.id===t.id)[0]||null},r2={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},n2=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},a2=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(p=>{s2[p](p,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(p=>{e[p].activeGroup=i2(p,s),e[p].activeTrack=r2[p](p,s),e[p].onGroupChanged=Z1(p,s),e[p].onGroupChanging=e2(p,s),e[p].onTrackChanged=t2(p,s),e[p].getActiveGroup=n2(p,s)});const l=e.AUDIO.activeGroup();if(l){const p=(l.filter(g=>g.default)[0]||l[0]).id;e.AUDIO.tracks[p].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",h),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",h),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const p in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[p])},o2=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:cs,activeTrack:cs,getActiveGroup:cs,onGroupChanged:cs,onTrackChanged:cs,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class wd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class l2 extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new wd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=It("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=vt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410)return this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(a.status===429){const p=a.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${p} seconds.`),void this.startTTLTimeout_(parseInt(p,10))}return this.logger_(`manifest failed to load ${n}.`),void this.startTTLTimeout_()}let l;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{l=JSON.parse(this.request_.responseText)}catch(p){const g={errorType:F.Error.StreamingContentSteeringParserError,error:p};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new k.URL(e),i=new k.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(k.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new k.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(i=>{for(const r of i)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=k.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){k.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new wd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const u2=10;let us;const h2=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],d2=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},c2=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:h}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const p=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return h(`${p} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!pi(e,t).length;if(!s.endList)return g||typeof s.partTargetDuration!="number"?(h(`${p} as current playlist is live`),!0):(h(`not ${p} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const y=Zo(e,t),w=l?Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Je.MAX_BUFFER_LOW_WATER_LINE;if(aI)&&y>=r){let v=`${p} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(v+=` and next bandwidth > current bandwidth (${E} > ${I})`),h(v),!0}return h(`not ${p} as no switching criteria met`),!1};class p2 extends F.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:h,enableLowInitialPlaylist:p,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:w,leastPixelDiffSelector:E,captionServices:I,experimentalUseMMS:v}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:L}=e;L==null&&(L=1/0),us=a,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=h,this.maxPlaylistRetries=L,this.enableLowInitialPlaylist=p,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:L,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=o2(),v&&k.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new k.ManagedMediaSource,F.log("Using ManagedMediaSource")):k.MediaSource&&(this.mediaSource=new k.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=gt(),this.hasPlayed_=!1,this.syncController_=new X1(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Q1,this.sourceUpdater_=new Mp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Y1,this.keyStatusMap_=new Map;const R={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new xo(t,this.vhs_,we(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new mi(t,this.vhs_,we(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Io(we(R,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Io(we(R,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new $1(we(R,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,N)=>{function z(){r.off("vttjserror",U),G()}function U(){r.off("vttjsloaded",z),N()}r.one("vttjsloaded",z),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const M=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new l2(this.vhs_.xhr,M),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),h2.forEach(G=>{this[G+"_"]=d2.bind(this,G)}),this.logger_=It("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const n=(i.length?i[0].playlists:i.playlists).filter(a=>a.attributes.serviceLocation===r);n.length&&this.mediaTypes_[e].activePlaylistLoader.media(n[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=k.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(k.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const h in l)if(l[h].default){n={label:h};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const h=i[l][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let p=0;p{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),a2({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,t=>{this.player_.trigger(ze({},t))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),us.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return c2({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const t=this.audioSegmentLoader_.pendingSegment_;if(!t||!t.segment||!t.segment.syncInfo)return;const i=t.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:u2}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(t=>{this.mainSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.audioSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))}),this.subtitleSegmentLoader_.on(t,i=>{this.player_.trigger(ze({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;const i=us.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-r<=Xt;const a=n.end(n.length-1);return a-r<=Xt&&i-a<=Xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Qn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),v=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},v)}let E=!1;r.forEach(I=>{if(I===e)return;const v=I.excludeUntil;v!==void 0&&v!==1/0&&(E=!0,delete I.excludeUntil)}),E&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;l=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const p=t.internal?this.logger_:F.log.warn,g=t.message?" "+t.message:"";p(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=h.targetDuration/2*1e3||5e3,w=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=y;return this.switchMedia_(h,"exclude",a||w)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];!l||e!==a&&e!=="all"||i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=pi(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:us.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null)return;const r=this.mainPlaylistLoader_.main,n=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),i===null||(e=us.Playlist.seekable(t,i,us.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,l;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=gt([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=mr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||df),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||qu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||qu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a=(p,g)=>p?lr(g):Da(g),l={};let h;if(["video","audio"].forEach(function(p){if(r.hasOwnProperty(p)&&!a(e[p].isFmp4,r[p])){const g=e[p].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(r[p]),p==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){const p=t.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===p&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${p} as ${h} does not support codec(s): "${r.audio}"`)}if(!Object.keys(l).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const p=[];if(["video","audio"].forEach(g=>{const y=(Vt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(Vt(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.toLowerCase()&&p.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),p.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${p.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const p=Object.keys(l).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${l[y].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:p},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=mr(this.main,r),a=[];!n.audio||Da(n.audio)||lr(n.audio)||a.push(`audio codec ${n.audio}`),!n.video||Da(n.video)||lr(n.video)||a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=kn(Vt(e)),n=cd(r),a=r.video&&Vt(r.video)[0]||null,l=r.audio&&Vt(r.audio)[0]||null;Object.keys(i).forEach(h=>{const p=i[h];if(t.indexOf(p.id)!==-1||p.excludeUntil===1/0)return;t.push(p.id);const g=[],y=mr(this.mainPlaylistLoader_.main,p),w=cd(y);if(y.audio||y.video){if(w!==n&&g.push(`codec count "${w}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Vt(y.video)[0]||null,I=y.audio&&Vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),I&&l&&I.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${I.type}" !== "${l.type}"`)}g.length&&(p.excludeUntil=1/0,this.logger_(`excluding ${p.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),z1(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Je.GOAL_BUFFER_LENGTH,i=Je.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Je.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Je.BUFFER_LOW_WATER_LINE,i=Je.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Je.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Je.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Je.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){gd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),E1({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();gd(this.inbandTextTracks_,e,this.tech_),b1({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,t=>{this.trigger(ze({},t))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const r of e.playlists){const n=r.attributes.serviceLocation;if(n&&(i.push(n),!t.has(n)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let r=!1;Object.keys(t).forEach(n=>{const a=t[n],l=this.pathwayAttribute_(a),h=l&&e!==l;a.excludeUntil===1/0&&a.lastExcludeReason_==="content-steering"&&!h&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const p=!a.excludeUntil&&a.excludeUntil!==1/0;!i.has(a.id)&&h&&p&&(i.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(n=>{const a=this.mediaTypes_[n];if(a.activePlaylistLoader){const l=a.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[r,n]of t.entries())i.get(r)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(r));for(const[r,n]of i.entries()){const a=t.get(r);a?this.equalPathwayClones_(a,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(l=>l.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(l=>{this.mainPlaylistLoader_.addClonePathway(n,l)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&h&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=(typeof e=="string"?e:j1(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const m2=(s,e,t)=>i=>{const r=s.main.playlists[e],n=tl(r),a=Qn(r);if(i===void 0)return a;i?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i===a||n||(t(r),i?s.trigger({type:"renditionenabled",metadata:l}):s.trigger({type:"renditiondisabled",metadata:l})),i};class g2{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=mr(r.main(),t),this.playlist=t,this.id=i,this.enabled=m2(e.playlists,t.id,n)}}const f2=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=wr(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!tl(i)).map((i,r)=>new g2(s,i,i.id)):[]}},Ad=["seeking","seeked","pause","playing","error"];class y2 extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],h={};l.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const p=g=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=()=>p("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Ad,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Ad,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=h0(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};return t.trigger({type:"bufferedrangeschanged",metadata:a}),void this.resetSegmentDownloads_(e)}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Hs(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(gt([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const w=e.start(0);i=w+(w===e.end(0)?0:Xt)}if(i!==void 0)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Zc(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const r=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,l=r.videoBuffer?r.videoBuffered():null,h=this.media(),p=h.partTargetDuration?h.partTargetDuration:2*(h.targetDuration-Gt),g=[a,l];for(let w=0;w ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=Kr(r,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xt;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const _2={errorInterval:30,getSource(s){return s(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},jp=function(s,e){let t=0,i=0;const r=we(_2,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<1e3*r.errorInterval)s.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&typeof r.getSource=="function")return t=Date.now(),r.getSource.call(s,a);F.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",h)},p=function(g){h(),jp(s,g)};s.on("error",l),s.on("dispose",h),s.reloadSourceOnError=p},v2=function(s){jp(this,s)};var Hp="3.14.2",b2="7.0.3",T2="1.3.0",S2="7.2.0",E2="4.0.2";const qe={PlaylistLoader:mi,Playlist:bt,utils:I0,STANDARD_PLAYLIST_SELECTOR:md,INITIAL_PLAYLIST_SELECTOR:g1,lastBandwidthSelector:md,movingAverageBandwidthSelector:p1,comparePlaylistBandwidth:rl,comparePlaylistResolution:c1,xhr:gp()};Object.keys(Je).forEach(s=>{Object.defineProperty(qe,s,{get:()=>(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Je[s]),set(e){F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0?F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`):Je[s]=e}})});const $p="videojs-vhs",Vp=function(s,e){const t=e.media();let i=-1;for(let r=0;r{s.addQualityLevel(t)}),Vp(s,e.playlists)};qe.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w2=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=kn(Vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Ei(i.video),n=Ei(i.audio),a={};for(const l in s)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof s[l]=="string"&&(a[l].url=s[l]);return we(s,a)},A2=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),x2=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=A2(r,Object.keys(e)),a=[],l=[];return n.forEach(h=>{l.push(new Promise((p,g)=>{s.tech_.one("keysessioncreated",p)})),a.push(new Promise((p,g)=>{s.eme.initializeMediaKeys({keySystems:h},y=>{y?g(y):p()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},k2=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=w2(e,t,i);return!!r&&(s.currentSource().keySystems=r,!(r&&!s.eme)||(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},zp=()=>{if(!k.localStorage)return null;const s=k.localStorage.getItem($p);if(!s)return null;try{return JSON.parse(s)}catch{return null}},D2=s=>{if(!k.localStorage)return!1;let e=zp();e=e?we(e,s):s;try{k.localStorage.setItem($p,JSON.stringify(e))}catch{return!1}return e},I2=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,Wp=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Gp=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Xp=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Yp=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};qe.supportsNativeHls=function(){if(!re||!re.createElement)return!1;const s=re.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(s.canPlayType(e))}):!1}(),qe.supportsNativeDash=!!(re&&re.createElement&&F.getTech("Html5").isSupported())&&/maybe|probably/i.test(re.createElement("video").canPlayType("application/dash+xml")),qe.supportsTypeNatively=s=>s==="hls"?qe.supportsNativeHls:s==="dash"&&qe.supportsNativeDash,qe.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},qe.xhr.onRequest=function(s){Wp(qe.xhr,s)},qe.xhr.onResponse=function(s){Gp(qe.xhr,s)},qe.xhr.offRequest=function(s){Xp(qe.xhr,s)},qe.xhr.offResponse=function(s){Yp(qe.xhr,s)};const P2=F.getComponent("Component");class Kp extends P2{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(re,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=re.fullscreenElement||re.webkitFullscreenElement||re.mozFullScreenElement||re.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=we(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=zp();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Je.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Je.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{this.source_[i]!==void 0&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=I2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=qe,this.options_.sourceType=qd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new p2(this.options_);const i=we({liveRangeSafeTimeDelta:Xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new y2(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a!="object"||a.code?typeof a=="string"&&(a={message:a,code:3}):a.code=3,n.error(a)});const r=this.options_.bufferBasedABR?qe.movingAverageBandwidthSelector(.55):qe.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=qe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const h=1e3*a.downlink*1e3;n=h>=l&&n>=l?Math.max(n,h):h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return a=this.throughput>0?1/this.throughput:0,Math.floor(1/(n+a))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Hs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Hs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&D2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f2(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=k.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x2({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=k2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{C2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Vp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Hp,"mux.js":b2,"mpd-parser":T2,"m3u8-parser":S2,"aes-decrypter":E2}}version(){return this.constructor.version()}canChangeType(){return Mp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&k.URL.revokeObjectURL&&(k.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return B0({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return bp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Wp(this.xhr,e)},this.xhr.onResponse=e=>{Gp(this.xhr,e)},this.xhr.offRequest=e=>{Xp(this.xhr,e)},this.xhr.offResponse=e=>{Yp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["gapjumped","playedrangeschanged"];["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.playlistController_.on(t,i=>{this.player_.trigger(ze({},i))})}),e.forEach(t=>{this.playbackWatcher_.on(t,i=>{this.player_.trigger(ze({},i))})})}}const Pn={name:"videojs-http-streaming",VERSION:Hp,canHandleSource(s,e={}){const t=we(F.options,e);return!(!t.vhs.experimentalUseMMS&&!lr("avc1.4d400d,mp4a.40.2",!1))&&Pn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=we(F.options,t);return e.vhs=new Kp(s,e,i),e.vhs.xhr=gp(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=qd(s);if(!t)return"";const i=Pn.getOverrideNative(e);return!qe.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}};lr("avc1.4d400d,mp4a.40.2",!0)&&F.getTech("Html5").registerSourceHandler(Pn,0),F.VhsHandler=Kp,F.VhsSourceHandler=Pn,F.Vhs=qe,F.use||F.registerComponent("Vhs",qe),F.options.vhs=F.options.vhs||{},F.getPlugin&&F.getPlugin("reloadSourceOnError")||F.registerPlugin("reloadSourceOnError",v2);let Re=class extends Lo{constructor(){super(),this._defaultConfigs={autoplay:!1,fluid:!1,fullscreen:!1,loop:!1,muted:!1,preload:"auto",responsive:!1,startTime:0},this._prevPlayingState=!1,this.currentMetadata=null,this.element=null,this.mimeType=null,this.sensorModel=null,this.state="not-ready",this.waitingTimestamp=null,this._initController=()=>{!this._controller&&this.playerUrl&&(this.element=document.createElement("video"),F.log.level("error"),this._controller=F(this.element,this._defaultConfigs),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.ready(this._handleReady),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart),this._controller.on("play",this._handlePlay),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady))},this._handleReady=()=>{this.state="ready"},this._handleCanPlay=()=>{this._prevPlayingState=this.state==="playing",this.state="can-play"},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;const s=this.subtitleTrack?.activeCues[0],e=s.text?JSON.parse(s.text):null;if(!e?.data?.length)return;const t=e.data[0]?.value??[],i=new Map;for(const r of t)Array.isArray(r.value)?r.tagId===90064?i.set(r.tagId,r):r.value.forEach(n=>{i.set(n.tagId,n)}):i.set(r.tagId,r);i.set(ne.EsriVideoWidth,{name:"Video Width",tagId:ne.EsriVideoWidth,value:this._controller?.videoWidth()}),i.set(ne.EsriVideoHeight,{name:"Video Height",tagId:ne.EsriVideoHeight,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(i),this.sensorModel=new Mg({videoMetadata:this.currentMetadata})},this._handleDataLoaded=()=>{this.state="data-loaded",this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleDurationChange=()=>this.notifyChange("duration"),this._handleEnded=()=>{if(!this.loop)return this._set("ended",!0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),void(this.state="can-play");this.setCurrentTime(0),this.play()},this._handleError=()=>{tg.getLogger(this).error("video stream error ::",this._controller?.error())},this._handleLoadStart=()=>{this.state="can-play"},this._handleLoadedMetadata=()=>{this.notifyChange("subtitleTrack"),this.notifyChange("buffered")},this._handlePlay=()=>this.notifyChange("ended"),this._handleTimeUpdate=()=>{this.notifyChange("currentTime"),this.notifyChange("buffered"),this.notifyChange("bufferedPercent"),this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime()},this._handleXHRhooksReady=()=>{const s=e=>(e.xhr=new ui,e);this._controller?.tech(!0)?.vhs.xhr.onRequest(s)}}initialize(){this.addHandles([nn(()=>this.playerUrl,s=>{s&&(this._initController(),this.mimeType=xg(s),this._controller?.src({type:this.mimeType,src:this.playerUrl}))},xd),nn(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")})]),this.addHandles(sg(()=>this.subtitleTrack,"cuechange",this._handleCueChange))}destroy(){this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(s){this._controller?.ended(s),this._set("ended",s)}get loop(){return this._controller?.loop()??this._get("loop")??!1}set loop(s){this._controller?.loop(s),this._set("loop",s)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(s){this._controller?.muted(s),this._set("muted",s)}get playerUrl(){return this._controller?.src()||""}set playerUrl(s){this._set("playerUrl",s)}get playing(){return!this.ended&&(this.state==="can-play"?this._prevPlayingState:this.state==="playing")}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(s){this._controller?.playbackRate(s),this._set("rate",s)}get started(){return this._controller?.hasStarted()||!1}get subtitleTrack(){const s=this._controller?.textTracks();return s?.length?Array.from(s).find(e=>e.kind==="subtitles"):null}get waiting(){return!this.waitingTimestamp&&(this.waitingTimestamp===this.currentTime||(this.waitingTimestamp=null,!1))}pause(){this._controller?.pause(),this.state="paused"}play(){this._controller?.play(),this.state="playing"}reset(){this._controller&&(this.pause(),this.setCurrentTime(0),this._set("ended",!0))}setCurrentTime(s){const e=kd(s,0,this.duration);this._controller?.currentTime(e),this.notifyChange("currentTime")}};K([Z()],Re.prototype,"buffered",null),K([Z()],Re.prototype,"bufferedPercent",null),K([Z({readOnly:!0})],Re.prototype,"currentTime",null),K([Z()],Re.prototype,"currentMetadata",void 0),K([Z({readOnly:!0})],Re.prototype,"duration",null),K([Z()],Re.prototype,"element",void 0),K([Z({readOnly:!0})],Re.prototype,"ended",null),K([Z()],Re.prototype,"loop",null),K([Z()],Re.prototype,"mimeType",void 0),K([Z()],Re.prototype,"muted",null),K([Z()],Re.prototype,"playerUrl",null),K([Z({readOnly:!0})],Re.prototype,"playing",null),K([Z()],Re.prototype,"rate",null),K([Z()],Re.prototype,"sensorModel",void 0),K([Z({readOnly:!0})],Re.prototype,"started",null),K([Z()],Re.prototype,"state",void 0),K([Z()],Re.prototype,"subtitleTrack",null),K([Z({readOnly:!0})],Re.prototype,"videoHeight",void 0),K([Z({readOnly:!0})],Re.prototype,"videoWidth",void 0),K([Z({readOnly:!0})],Re.prototype,"waiting",null),K([Z()],Re.prototype,"waitingTimestamp",void 0),Re=K([Ds("esri.layers.video.VideoController")],Re);const L2=Re;let pe=class extends ng(og(ig(ag(rg)))){constructor(s){super(s),this._trailPoints=[],this.capabilities=null,this.connectionInfo=null,this.controller=new L2,this.copyright=null,this.created=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCount=null,this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=Zr.WGS84,this.telemetryDisplay=null,this.title=null,this.type="video",this.url=null,this.videoLayersInfo=null,this.videoTimeExtent=null}initialize(){this.telemetryDisplay=new Dd({frame:!1,frameCenter:!1,frameOutline:!0,lineOfSight:!0,sensorLocation:!0,sensorTrail:!0}),this.addHandles([nn(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),nn(()=>this.telemetry?.sensorLocation,s=>this._setSensorTrail(s),xd)])}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this._fetchService(e)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(s,e){return hg(e)}readConnectionInfo(s,e){const t=Object.values(e.connectionUrl);return t?.length&&(this.controller.playerUrl=t[0]),e.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return wg(this.metadata)}get groundControlPoints(){return Cg(this.metadata)}get loop(){return this.controller.loop}set loop(s){this.controller.loop=s}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(s){this.controller.muted=s}get playbackRate(){return this.controller.rate}set playbackRate(s){this.controller.rate=s}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get state(){return this.controller.state}get telemetry(){return Eg(this.metadata)}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(s,e){return kg(e)}get videoWidth(){return this.controller?.videoWidth}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(s){if(!this.duration)return;const e=kd(s,0,this.duration);this.controller.setCurrentTime(e)}toGround(s,e){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(s,e):null}toVideo(s){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const e=this.controller.sensorModel.transformGeoToImage(s.x,s.y,s.z);return{x:e[0],y:e[1]}}async _fetchService(s){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const e=lg(this.parsedUrl?.path);if(e==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let t=null;const{data:i,ssl:r}=await ro(e.url.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:s}),n=i;if(this.url=e.url.path,r&&(this.url=this.url.replace(/^http:/i,"https:")),!n?.currentVersion)return n.currentVersion="11.2",this.sourceJSON=n,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let a=e?.sublayer;if(a==null&&n.layers?.length&&(a=n.layers[0].id),a==null)throw new Vl("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");this.url=`${e.url.path}/${a}`,t=await ro(this.url,{query:{f:"json",...this.customParameters},signal:s});const l={...n,...t.data};this.sourceJSON=l,this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(s){if(!s)return;const e=Sg(s,this._trailPoints);this._trailPoints=[...e];const t=this._trailPoints.map(r=>r.toArray()),i=new rn({hasZ:s.hasZ,paths:[t]});this.telemetry.sensorTrail=i.clone()}};K([Z({readOnly:!0})],pe.prototype,"buffered",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"capabilities",void 0),K([gi("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsUpdate"])],pe.prototype,"readCapabilitiesFromService",null),K([Z({readOnly:!0})],pe.prototype,"connectionInfo",void 0),K([gi("connectionInfo",["connectionUrl"])],pe.prototype,"readConnectionInfo",null),K([Z()],pe.prototype,"controller",void 0),K([Z({type:String})],pe.prototype,"copyright",void 0),K([Z({readOnly:!0,type:Date})],pe.prototype,"created",void 0),K([Z({type:Number})],pe.prototype,"currentTime",null),K([Z({type:String})],pe.prototype,"description",void 0),K([Z({type:Number})],pe.prototype,"duration",null),K([Z({readOnly:!0})],pe.prototype,"elevationSource",void 0),K([Z({type:Boolean})],pe.prototype,"ended",null),K([Z({type:_g})],pe.prototype,"frame",void 0),K([Z({readOnly:!0,type:Number})],pe.prototype,"frameCount",void 0),K([Z({type:zl})],pe.prototype,"fullExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"frameHorizonPoints",null),K([Z({readOnly:!0})],pe.prototype,"groundControlPoints",null),K([Z({type:zl})],pe.prototype,"initialExtent",void 0),K([Z({readOnly:!0,json:{read:{source:"id"}}})],pe.prototype,"layerId",void 0),K([Z({type:Boolean})],pe.prototype,"loop",null),K([Z({readOnly:!0})],pe.prototype,"metadata",null),K([Z({readOnly:!0})],pe.prototype,"mimeType",null),K([Z({type:Boolean})],pe.prototype,"muted",null),K([Z({type:fg})],pe.prototype,"playbackInfo",void 0),K([Z({type:Number})],pe.prototype,"playbackRate",null),K([Z({type:String})],pe.prototype,"playerUrl",null),K([Z({readOnly:!0})],pe.prototype,"playing",null),K([Z({readOnly:!0,json:{read:{source:"poster"}}})],pe.prototype,"posterUrl",void 0),K([Z({readOnly:!0})],pe.prototype,"qualities",void 0),K([Z({readOnly:!0})],pe.prototype,"serviceItemId",void 0),K([Z()],pe.prototype,"sourceJSON",void 0),K([Z({readOnly:!0})],pe.prototype,"sourceQuality",void 0),K([Z({readOnly:!0,json:{name:"serviceType"}})],pe.prototype,"sourceType",void 0),K([Z()],pe.prototype,"spatialReference",void 0),K([Z({readOnly:!0,type:String})],pe.prototype,"state",null),K([Z({readOnly:!0,type:no})],pe.prototype,"telemetry",null),K([Z({type:Dd})],pe.prototype,"telemetryDisplay",void 0),K([Z({readOnly:!1,json:{read:{source:"name"}}})],pe.prototype,"title",void 0),K([Z({readOnly:!0})],pe.prototype,"type",void 0),K([Z(ug)],pe.prototype,"url",void 0),K([Z({readOnly:!0})],pe.prototype,"videoElement",null),K([Z({readOnly:!0})],pe.prototype,"videoHeight",null),K([Z({readOnly:!0,json:{read:!1}})],pe.prototype,"videoLayersInfo",void 0),K([gi("service","videoLayersInfo",["id","name","poster","serviceType","type"])],pe.prototype,"readLayerInfosFromService",null),K([Z({readOnly:!0,nonNullable:!1,json:{read:{reader:Tg,source:"time"}}})],pe.prototype,"videoTimeExtent",void 0),K([Z({readOnly:!0})],pe.prototype,"videoWidth",null),K([Z({readOnly:!0})],pe.prototype,"waiting",null),pe=K([Ds("esri.layers.VideoLayer")],pe);const rv=pe;export{rv as default}; diff --git a/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-CHXecHV8.js b/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-CHXecHV8.js new file mode 100644 index 00000000..7c2d314f --- /dev/null +++ b/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-CHXecHV8.js @@ -0,0 +1 @@ +import{ar as I,bi as v,d$ as $,d_ as q,e0 as U,aA as F,ah as M,aL as b,v as C,S as V,i as k,au as j,aF as B,L as J,hT as K,l as N,as as z,w as R}from"./story-DT1Ep1ux.js";import Z from"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import{a as W}from"./TelemetryDisplay-Bq2PXfI8-C3u5XocC.js";import{A as Q}from"./OverlayContainer-BEHcBpu0-CdVlAClg.js";import{o as tt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{K as g}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{T as et}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{X as it,A as rt,Y as st}from"./LayerView-Bish-E63-B3VRdVIM.js";import{G as ot}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as nt,V as at}from"./Texture-BCt2hphT-B6HwLstV.js";import{d as lt}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{X as mt}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import"./main-BTdHgocv.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";const x=2;class ht extends et{constructor(t){super(),this.element=t,this._handles=new j,this.isWrapAround=!1,this.perspectiveTransform=tt(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(B(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?E=S:D>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([k("esri.views.2d.layers.VideoLayerView2D")],d);const ui=d;export{ui as default}; diff --git a/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-DFhz_K4x.js b/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-DFhz_K4x.js deleted file mode 100644 index 16eed491..00000000 --- a/custom-toc-separator/assets/VideoLayerView2D-CLcxq4ZA-DFhz_K4x.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as I,bi as v,d$ as $,d_ as q,e0 as U,aA as F,ah as M,aL as b,v as C,S as V,i as k,au as j,aF as B,L as J,hT as K,l as N,as as z,w as R}from"./story-OUarUCIt.js";import Z from"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import{a as W}from"./TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js";import{A as Q}from"./OverlayContainer-BEHcBpu0-GxFD4tE3.js";import{o as tt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{K as g}from"./projection-BA9M1R7d-Cytmrlsd.js";import{T as et}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{X as it,A as rt,Y as st}from"./LayerView-Bish-E63-DehQ-_Za.js";import{G as ot}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as nt,V as at}from"./Texture-BCt2hphT-Bv29bzNX.js";import{d as lt}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{X as mt}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import"./main-lj2zzr_L.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";const x=2;class ht extends et{constructor(t){super(),this.element=t,this._handles=new j,this.isWrapAround=!1,this.perspectiveTransform=tt(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(B(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?E=S:D>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([k("esri.views.2d.layers.VideoLayerView2D")],d);const ui=d;export{ui as default}; diff --git a/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-8AAkij1t.js b/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-8AAkij1t.js deleted file mode 100644 index 713be2eb..00000000 --- a/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-8AAkij1t.js +++ /dev/null @@ -1 +0,0 @@ -import{bA as C,d8 as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as M,dA as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./story-OUarUCIt.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js";import{c as g}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import{y as Q}from"./Analysis-BPgJ-FCw-DzBMoBqT.js";import{X as W}from"./projection-BA9M1R7d-Cytmrlsd.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as te}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./main-lj2zzr_L.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import"./lineSegment-CcqvCARM-CznIGfdF.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=M.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=A(V)*z,_=R(m)*S*(1-A(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function A(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:M.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const De=n;export{De as default}; diff --git a/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-CmEty2pX.js b/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-CmEty2pX.js new file mode 100644 index 00000000..768a4d49 --- /dev/null +++ b/custom-toc-separator/assets/ViewshedLayer-BYX-h7eL-CmEty2pX.js @@ -0,0 +1 @@ +import{bA as C,d8 as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as M,dA as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./story-DT1Ep1ux.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-ChL-ugTO.js";import{c as g}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import{y as Q}from"./Analysis-BPgJ-FCw-Y4Lx0iev.js";import{X as W}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as te}from"./Layer-ChoECxvZ-ocw70508.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./main-BTdHgocv.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-B4r28WKg.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-D5uXMAZI.js";import"./lineSegment-CcqvCARM-CJhaINhC.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=M.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=A(V)*z,_=R(m)*S*(1-A(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function A(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:M.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const De=n;export{De as default}; diff --git a/custom-toc-separator/assets/VoxelLayer-KL84GttA-BEmbBHI5.js b/custom-toc-separator/assets/VoxelLayer-KL84GttA-BEmbBHI5.js deleted file mode 100644 index cb0e163e..00000000 --- a/custom-toc-separator/assets/VoxelLayer-KL84GttA-BEmbBHI5.js +++ /dev/null @@ -1 +0,0 @@ -import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dg as at}from"./story-OUarUCIt.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{D as ht}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import{a as gt}from"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as bt}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{W as xt}from"./SceneService-BZqGtWmG-Dbvqi9tG.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as W}from"./Field-C6hA1tZj-DY7R6puO.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import{c as z}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import{C as It}from"./persistable-C6RBwzJi-BbuVIS8Z.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import{w as Tt}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./main-lj2zzr_L.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-CYtArgCw.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(g){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(e,this.tilt);this._set("normal",i),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(this.orientation,e);this._set("normal",i),this._set("tilt",e)}};t([o({type:Boolean,json:{write:!0}})],R.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"label",void 0),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:ot}},write:{enabled:!0,isRequired:!0}}}),It({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[he],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:Ft,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new We,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new fe("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else q.getLogger(this).error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(r!=null){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else q.getLogger(this).error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ti=l;export{Ti as default}; diff --git a/custom-toc-separator/assets/VoxelLayer-KL84GttA-CEFleBBB.js b/custom-toc-separator/assets/VoxelLayer-KL84GttA-CEFleBBB.js new file mode 100644 index 00000000..f60fc54a --- /dev/null +++ b/custom-toc-separator/assets/VoxelLayer-KL84GttA-CEFleBBB.js @@ -0,0 +1 @@ +import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dg as at}from"./story-DT1Ep1ux.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{D as ht}from"./Layer-ChoECxvZ-ocw70508.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import{a as gt}from"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as bt}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{W as xt}from"./SceneService-BZqGtWmG-CobyO2zX.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as W}from"./Field-C6hA1tZj-aKnzhZ32.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-CygrHAJu.js";import{c as z}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import{C as It}from"./persistable-C6RBwzJi-DSWzGhuz.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-Cqne66qw.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-BFc609ot.js";import{w as Tt}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./main-BTdHgocv.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-iZLDgXmu.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(g){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(e,this.tilt);this._set("normal",i),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(this.orientation,e);this._set("normal",i),this._set("tilt",e)}};t([o({type:Boolean,json:{write:!0}})],R.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"label",void 0),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:ot}},write:{enabled:!0,isRequired:!0}}}),It({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[he],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:Ft,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new We,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new fe("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)q.getLogger(this).error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else q.getLogger(this).error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(r!=null){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else q.getLogger(this).error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ti=l;export{Ti as default}; diff --git a/custom-toc-separator/assets/WFSLayer-DKnx5V8b-BX03R8vP.js b/custom-toc-separator/assets/WFSLayer-DKnx5V8b-BX03R8vP.js deleted file mode 100644 index fae1931e..00000000 --- a/custom-toc-separator/assets/WFSLayer-DKnx5V8b-BX03R8vP.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,S as r,i as R,J as C,bT as O,dL as E,dK as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cl as G}from"./story-OUarUCIt.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{m as V,u as K}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{m as Z}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as B}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{q as z}from"./workers-PiCjreoO-mU03Z-E4.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-CK9z1afv.js";import{O as se}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{u as ae}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import{E as de}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import{C as ue}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{y as T}from"./Field-C6hA1tZj-DY7R6puO.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-ZDnYoHJW.js";import{b as y}from"./Query-BrwMGK8U-gUIs0TS1.js";import{w as Ce}from"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./main-lj2zzr_L.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./geojson-CNt_qtQf-DAI1_86C.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(Z(B))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:K,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Kt=i;export{Kt as default}; diff --git a/custom-toc-separator/assets/WFSLayer-DKnx5V8b-Daej1uTs.js b/custom-toc-separator/assets/WFSLayer-DKnx5V8b-Daej1uTs.js new file mode 100644 index 00000000..c88d5519 --- /dev/null +++ b/custom-toc-separator/assets/WFSLayer-DKnx5V8b-Daej1uTs.js @@ -0,0 +1 @@ +import{v as t,S as r,i as R,J as C,bT as O,dL as E,dK as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cl as G}from"./story-DT1Ep1ux.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{m as V,u as K}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{m as Z}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as B}from"./Layer-ChoECxvZ-ocw70508.js";import{q as z}from"./workers-PiCjreoO-DrDY4oeh.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-DEeOUKXZ.js";import{O as se}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{u as ae}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import{E as de}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import{C as ue}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{y as T}from"./Field-C6hA1tZj-aKnzhZ32.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-DxpYAQDw.js";import{b as y}from"./Query-BrwMGK8U-FWeI_AU8.js";import{w as Ce}from"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./main-BTdHgocv.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./geojson-CNt_qtQf-DS1EMYq7.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(Z(B))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:K,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Kt=i;export{Kt as default}; diff --git a/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-PD7FA-0K.js b/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-PD7FA-0K.js deleted file mode 100644 index b4d0eb5b..00000000 --- a/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-PD7FA-0K.js +++ /dev/null @@ -1 +0,0 @@ -import{o as y,$ as c,cl as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./story-OUarUCIt.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{I as b}from"./FeatureStore-Co2V0sVE-BIksXSjO.js";import{f as j,h as $}from"./queryUtils-Brxu6254-BZ9oWgik.js";import{Z as O}from"./QueryEngine-CH5uUhZK-B7KHLDgB.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-DAI1_86C.js";import{F as N}from"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-CK9z1afv.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./main-lj2zzr_L.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-OMiRxUp-.js";import"./PooledRBush-DbfAmeLn-D1-Igyfv.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./utils-HtkT8Fn3-CjrLkz9Y.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-uR3F5VAW.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./utils-tNxq3jkf-CgPuWip3.js";import"./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./Field-C6hA1tZj-DY7R6puO.js";const x="esri.layers.WFSLayer";class Ut{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:o,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:a,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(o,a,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=a,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=o,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const o of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",o.message,o.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,o=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const a=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||a.push(i)}else{const i=Math.min(n,o),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,a)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:o,maxPageCount:s,errors:a}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const o=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:o,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:o,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:o,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const a of n)a.geometry!=null&&(a.geometry=P($(q(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=o??1;for(const a of n){const i={};N(this._fieldsIndex,i,a.attributes,!0),a.attributes=i,i[this._objectIdField]==null&&(a.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let o=0;or.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Ut as default}; diff --git a/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-qDf43AIU.js b/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-qDf43AIU.js new file mode 100644 index 00000000..3cf3eda1 --- /dev/null +++ b/custom-toc-separator/assets/WFSSourceWorker-CI7-tY7M-qDf43AIU.js @@ -0,0 +1 @@ +import{o as y,$ as c,cl as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./story-DT1Ep1ux.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{I as b}from"./FeatureStore-Co2V0sVE-IoB-sC2w.js";import{f as j,h as $}from"./queryUtils-Brxu6254-qwN-s2Og.js";import{Z as O}from"./QueryEngine-CH5uUhZK-CYBqfWM0.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-DS1EMYq7.js";import{F as N}from"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-DEeOUKXZ.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./main-BTdHgocv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-vTEQb1N7.js";import"./PooledRBush-DbfAmeLn-BhVBo5wc.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./utils-HtkT8Fn3-CoByYob7.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-C4YRMtgK.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./utils-tNxq3jkf-CYo4DtRj.js";import"./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./Field-C6hA1tZj-aKnzhZ32.js";const x="esri.layers.WFSLayer";class Ut{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:o,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:a,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(o,a,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=a,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=o,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const o of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",o.message,o.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,o=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const a=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||a.push(i)}else{const i=Math.min(n,o),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,a)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:o,maxPageCount:s,errors:a}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const o=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:o,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:o,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:o,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const a of n)a.geometry!=null&&(a.geometry=P($(q(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=o??1;for(const a of n){const i={};N(this._fieldsIndex,i,a.attributes,!0),a.attributes=i,i[this._objectIdField]==null&&(a.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let o=0;or.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Ut as default}; diff --git a/custom-toc-separator/assets/WGLContainer-LxgEo4I_-CgyWo1Fc.js b/custom-toc-separator/assets/WGLContainer-LxgEo4I_-CgyWo1Fc.js new file mode 100644 index 00000000..f3f0e6bf --- /dev/null +++ b/custom-toc-separator/assets/WGLContainer-LxgEo4I_-CgyWo1Fc.js @@ -0,0 +1,3619 @@ +import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./story-DT1Ep1ux.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{r as k}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-BId56203.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-XRkD8ADC.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{s as Rt}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-B6HwLstV.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; +void main() { +gl_FragColor = u_color; +}`,"background.vert":`attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform mediump vec2 u_coord_range; +uniform mediump float u_depth; +void main() { +vec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0); +gl_Position = vec4(v_pos.xy, 0.0, 1.0); +}`},bitBlit:{"bitBlit.frag":`uniform lowp sampler2D u_tex; +uniform lowp float u_opacity; +varying mediump vec2 v_uv; +void main() { +lowp vec4 color = texture2D(u_tex, v_uv); +gl_FragColor = color * u_opacity; +}`,"bitBlit.vert":`attribute vec2 a_pos; +attribute vec2 a_tex; +varying mediump vec2 v_uv; +void main(void) { +gl_Position = vec4(a_pos , 0.0, 1.0); +v_uv = a_tex; +}`},debug:{overlay:{"overlay.frag":`precision mediump float; +varying vec4 v_color; +void main(void) { +gl_FragColor = v_color; +}`,"overlay.vert":`attribute vec3 a_PositionAndFlags; +uniform mat3 u_dvsMat3; +uniform vec4 u_colors[4]; +uniform float u_opacities[4]; +varying vec4 v_color; +void main(void) { +vec2 position = a_PositionAndFlags.xy; +float flags = a_PositionAndFlags.z; +int colorIndex = int(mod(flags, 4.0)); +vec4 color; +for (int i = 0; i < 4; i++) { +color = u_colors[i]; +if (i == colorIndex) { +break; +} +} +int opacityIndex = int(mod(floor(flags / 4.0), 4.0)); +float opacity; +for (int i = 0; i < 4; i++) { +opacity = u_opacities[i]; +if (i == opacityIndex) { +break; +} +} +v_color = color * opacity; +gl_Position = vec4((u_dvsMat3 * vec3(position, 1.0)).xy, 0.0, 1.0); +}`}},dot:{dot:{"dot.frag":`precision mediump float; +varying vec4 v_color; +varying float v_dotRatio; +varying float v_invEdgeRatio; +uniform highp float u_tileZoomFactor; +void main() +{ +float dist = length(gl_PointCoord - vec2(.5, .5)) * 2.; +float alpha = smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.); +gl_FragColor = v_color * alpha; +}`,"dot.vert":`precision highp float; +attribute vec2 a_pos; +uniform sampler2D u_texture; +uniform highp mat3 u_dvsMat3; +uniform highp float u_tileZoomFactor; +uniform highp float u_dotSize; +uniform highp float u_pixelRatio; +varying vec2 v_pos; +varying vec4 v_color; +varying float v_dotRatio; +varying float v_invEdgeRatio; +const float EPSILON = 0.000001; +void main() +{ +mat3 tileToTileTexture = mat3( 1., 0., 0., +0., -1., 0., +0., 1., 1. ); +vec3 texCoords = tileToTileTexture * vec3(a_pos.xy / 512., 1.); +v_color = texture2D(u_texture, texCoords.xy); +float smoothEdgeWidth = max(u_dotSize / 2., 1.) ; +float z = 0.; +z += 2.0 * step(v_color.a, EPSILON); +gl_PointSize = (smoothEdgeWidth + u_dotSize); +gl_Position = vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.); +v_dotRatio = u_dotSize / gl_PointSize; +v_invEdgeRatio = -1. / ( smoothEdgeWidth / gl_PointSize ); +gl_PointSize *= (u_pixelRatio * u_tileZoomFactor); +}`}},filtering:{"bicubic.glsl":`vec4 computeWeights(float v) { +float b = 1.0 / 6.0; +float v2 = v * v; +float v3 = v2 * v; +float w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0); +float w1 = b * (3.0 * v3 - 6.0 * v2 + 4.0); +float w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0); +float w3 = b * v3; +return vec4(w0, w1, w2, w3); +} +vec4 bicubicOffsetsAndWeights(float v) { +vec4 w = computeWeights(v); +float g0 = w.x + w.y; +float g1 = w.z + w.w; +float h0 = 1.0 - (w.y / g0) + v; +float h1 = 1.0 + (w.w / g1) - v; +return vec4(h0, h1, g0, g1); +} +vec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 eX = vec2(1.0 / texSize.x, 0.0); +vec2 eY = vec2(0.0, 1.0 / texSize.y); +vec2 texel = coords * texSize - 0.5; +vec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz; +vec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz; +vec2 coords10 = coords + hgX.x * eX; +vec2 coords00 = coords - hgX.y * eX; +vec2 coords11 = coords10 + hgY.x * eY; +vec2 coords01 = coords00 + hgY.x * eY; +coords10 = coords10 - hgY.y * eY; +coords00 = coords00 - hgY.y * eY; +vec4 color00 = texture2D(sampler, coords00); +vec4 color10 = texture2D(sampler, coords10); +vec4 color01 = texture2D(sampler, coords01); +vec4 color11 = texture2D(sampler, coords11); +color00 = mix(color00, color01, hgY.z); +color10 = mix(color10, color11, hgY.z); +color00 = mix(color00, color10, hgX.z); +return color00; +}`,"bilinear.glsl":`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 texelStart = floor(coords * texSize); +vec2 coord0 = texelStart / texSize; +vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; +vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; +vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; +vec4 color0 = texture2D(sampler, coord0); +vec4 color1 = texture2D(sampler, coord1); +vec4 color2 = texture2D(sampler, coord2); +vec4 color3 = texture2D(sampler, coord3); +vec2 blend = fract(coords * texSize); +vec4 color01 = mix(color0, color1, blend.x); +vec4 color23 = mix(color2, color3, blend.x); +vec4 color = mix(color01, color23, blend.y); +#ifdef NNEDGE +float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); +color = color * alpha + (1.0 - alpha) * texture2D(sampler, coords); +#endif +return color; +}`,"epx.glsl":`vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) { +vec2 invSize = 1.0 / texSize; +vec2 texel = coords * texSize; +vec2 texel_i = floor(texel); +vec2 texel_frac = fract(texel); +vec4 colorP = texture2D(sampler, texel_i * invSize); +vec4 colorP1 = vec4(colorP); +vec4 colorP2 = vec4(colorP); +vec4 colorP3 = vec4(colorP); +vec4 colorP4 = vec4(colorP); +vec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize); +vec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize); +vec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize); +vec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize); +if (colorC == colorA && colorC != colorD && colorA != colorB) { +colorP1 = colorA; +} +if (colorA == colorB && colorA != colorC && colorB != colorD) { +colorP2 = colorB; +} +if (colorD == colorC && colorD != colorB && colorC != colorA) { +colorP3 = colorC; +} +if (colorB == colorD && colorB != colorA && colorD != colorC) { +colorP4 = colorD; +} +vec4 colorP12 = mix(colorP1, colorP2, texel_frac.x); +vec4 colorP34 = mix(colorP1, colorP2, texel_frac.x); +return mix(colorP12, colorP34, texel_frac.y); +}`},heatmap:{heatmapResolve:{"heatmapResolve.frag":`precision highp float; +#ifdef HEATMAP_PRECISION_HALF_FLOAT +#define COMPRESSION_FACTOR 4.0 +#else +#define COMPRESSION_FACTOR 1.0 +#endif +uniform sampler2D u_texture; +uniform sampler2D u_gradient; +uniform vec2 u_densityMinAndInvRange; +uniform float u_densityNormalization; +varying vec2 v_uv; +void main() { +vec4 data = texture2D(u_texture, v_uv); +float density = data.r * COMPRESSION_FACTOR; +density *= u_densityNormalization; +density = (density - u_densityMinAndInvRange.x) * u_densityMinAndInvRange.y; +vec4 color = texture2D(u_gradient, vec2(density, 0.5)); +gl_FragColor = vec4(color.rgb * color.a, color.a); +}`,"heatmapResolve.vert":`precision highp float; +attribute vec2 a_pos; +varying vec2 v_uv; +void main() { +v_uv = a_pos; +gl_Position = vec4(a_pos * 2.0 - 1.0, 1., 1.); +}`}},highlight:{"blur.frag":`varying mediump vec2 v_texcoord; +uniform mediump vec4 u_direction; +uniform mediump mat4 u_channelSelector; +uniform mediump float u_sigma; +uniform sampler2D u_texture; +mediump float gauss1(mediump vec2 dir) { +return exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma)); +} +mediump vec4 selectChannel(mediump vec4 sample) { +return u_channelSelector * sample; +} +void accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) { +mediump float w = gauss1(i * u_direction.xy); +tot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w; +weight += w; +} +void main(void) { +mediump float tot = 0.0; +mediump float weight = 0.0; +accumGauss1(-5.0, tot, weight); +accumGauss1(-4.0, tot, weight); +accumGauss1(-3.0, tot, weight); +accumGauss1(-2.0, tot, weight); +accumGauss1(-1.0, tot, weight); +accumGauss1(0.0, tot, weight); +accumGauss1(1.0, tot, weight); +accumGauss1(2.0, tot, weight); +accumGauss1(3.0, tot, weight); +accumGauss1(4.0, tot, weight); +accumGauss1(5.0, tot, weight); +gl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight); +}`,"highlight.frag":`varying mediump vec2 v_texcoord; +uniform sampler2D u_texture; +uniform mediump float u_sigma; +uniform sampler2D u_shade; +uniform mediump vec2 u_minMaxDistance; +mediump float estimateDistance() { +mediump float y = texture2D(u_texture, v_texcoord)[3]; +const mediump float y0 = 0.5; +mediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma); +mediump float d = (y - y0) / m0; +return d; +} +mediump vec4 shade(mediump float d) { +mediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x); +mappedDistance = clamp(mappedDistance, 0.0, 1.0); +return texture2D(u_shade, vec2(mappedDistance, 0.5)); +} +void main(void) { +mediump float d = estimateDistance(); +gl_FragColor = shade(d); +}`,"textured.vert":`attribute mediump vec2 a_position; +attribute mediump vec2 a_texcoord; +varying mediump vec2 v_texcoord; +void main(void) { +gl_Position = vec4(a_position, 0.0, 1.0); +v_texcoord = a_texcoord; +}`},materials:{"attributeData.glsl":`uniform highp sampler2D filterFlags; +uniform highp sampler2D animation; +uniform highp sampler2D gpgpu; +uniform highp sampler2D visualVariableData; +uniform highp sampler2D dataDriven0; +uniform highp sampler2D dataDriven1; +uniform highp sampler2D dataDriven2; +uniform float size; +highp vec2 getAttributeDataCoords(in highp vec3 id) { +highp vec3 texel = unpackDisplayIdTexel(id); +highp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256); +highp float col = mod(u32, size); +highp float row = (u32 - col) / size; +highp float u = col / size; +highp float v = row / size; +return vec2(u, v); +} +highp vec2 getAttributeDataTextureCoords(in highp vec3 id) { +return (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(size)); +} +highp vec4 getFilterData(in highp vec3 id) { +vec2 coords = getAttributeDataCoords(id); +return texture2D(filterFlags, coords); +} +highp vec4 getAnimation(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(animation, coords); +} +highp vec4 getVisualVariableData(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(visualVariableData, coords); +} +highp vec4 getDataDriven0(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven0, coords); +} +highp vec4 getDataDriven1(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven1, coords); +} +highp vec4 getGPGPU(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(gpgpu, coords); +} +highp vec4 getDataDriven2(in highp vec3 id) { +highp vec2 coords = getAttributeDataCoords(id); +return texture2D(dataDriven2, coords); +} +float u88VVToFloat(in vec2 v) { +bool isMagic = v.x == 255.0 && v.y == 255.0; +if (isMagic) { +return NAN_MAGIC_NUMBER; +} +return (v.x + v.y * float(0x100)) - 32768.0; +}`,"barycentric.glsl":`float inTriangle(vec3 bary) { +vec3 absBary = abs(bary); +return step((absBary.x + absBary.y + absBary.z), 1.05); +} +vec3 xyToBarycentric(in vec2 pos, in vec2 v0, in vec2 v1, in vec2 v2) { +mat3 xyToBarycentricMat3 = mat3( +v1.x * v2.y - v2.x * v1.y, v2.x * v0.y - v0.x * v2.y, v0.x * v1.y - v1.x * v0.y, +v1.y - v2.y, v2.y - v0.y, v0.y - v1.y, +v2.x - v1.x, v0.x - v2.x, v1.x - v0.x +); +float A2 = v0.x * (v1.y - v2.y) + v1.x * (v2.y - v0.y) + v2.x * (v0.y - v1.y); +return (1. / A2) * xyToBarycentricMat3 * vec3(1., pos); +}`,"constants.glsl":`const float C_DEG_TO_RAD = 3.14159265359 / 180.0; +const float C_256_TO_RAD = 3.14159265359 / 128.0; +const float C_RAD_TO_DEG = 180.0 / 3.141592654; +const float POSITION_PRECISION = 1.0 / 8.0; +const float FILL_POSITION_PRECISION = 1.0 / 1.0; +const float SOFT_EDGE_RATIO = 1.0; +const float THIN_LINE_WIDTH_FACTOR = 1.1; +const float THIN_LINE_HALF_WIDTH = 1.0; +const float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0; +const float OFFSET_PRECISION = 1.0 / 8.0; +const float OUTLINE_SCALE = 1.0 / 5.0; +const float SDF_FONT_SIZE = 24.0; +const float MAX_SDF_DISTANCE = 8.0; +const float PLACEMENT_PADDING = 8.0; +const float EPSILON = 0.00001; +const float EPSILON_HITTEST = 0.05; +const int MAX_FILTER_COUNT = 2; +const int ATTR_VV_SIZE = 0; +const int ATTR_VV_COLOR = 1; +const int ATTR_VV_OPACITY = 2; +const int ATTR_VV_ROTATION = 3; +const highp float NAN_MAGIC_NUMBER = 1e-30; +const int BITSET_GENERIC_LOCK_COLOR = 1; +const int BITSET_GENERIC_CONSIDER_ALPHA_ONLY = 4; +const int BITSET_MARKER_ALIGNMENT_MAP = 0; +const int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2; +const int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3; +const int BITSET_TYPE_FILL_OUTLINE = 0; +const int BITSET_FILL_RANDOM_PATTERN_OFFSET = 2; +const int BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR = 3; +const int BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR = 5; +const int BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR = 6; +const int BITSET_LINE_SCALE_DASH = 2;`,fill:{"common.glsl":`#include +#ifdef PATTERN +uniform mediump vec2 u_mosaicSize; +varying mediump float v_sampleAlphaOnly; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +uniform lowp vec4 u_isActive[ 2 ]; +uniform highp float u_dotValue; +uniform highp float u_tileDotsOverArea; +uniform highp float u_dotTextureDotCount; +uniform mediump float u_tileZoomFactor; +#endif +varying highp vec3 v_id; +varying lowp vec4 v_color; +varying lowp float v_opacity; +varying mediump vec4 v_aux1; +#ifdef PATTERN +varying mediump vec2 v_tileTextureCoord; +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +varying lowp float v_isOutline; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +varying highp vec2 v_dotTextureCoords; +varying highp vec4 v_dotThresholds[ 2 ]; +#endif`,"fill.frag":`precision highp float; +#include +#include +#include +#ifdef PATTERN +uniform lowp sampler2D u_texture; +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +uniform mediump mat4 u_dotColors[ 2 ]; +uniform sampler2D u_dotTextures[ 2 ]; +uniform vec4 u_dotBackgroundColor; +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#include +#include +lowp vec4 drawLine() { +float v_lineWidth = v_aux1.x; +vec2 v_normal = v_aux1.yz; +LineData inputs = LineData( +v_color, +v_normal, +v_lineWidth, +v_opacity, +v_id +); +return shadeLine(inputs); +} +#endif +lowp vec4 drawFill() { +lowp vec4 out_color = vec4(0.); +#ifdef HITTEST +out_color = v_color; +#elif defined(PATTERN) +mediump vec4 v_tlbr = v_aux1; +mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +if (v_sampleAlphaOnly > 0.5) { +color.rgb = vec3(color.a); +} +out_color = v_opacity * v_color * color; +#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY && !defined(HIGHLIGHT) +vec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords); +vec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords); +vec4 difference0 = v_dotThresholds[0] - textureThresholds0; +vec4 difference1 = v_dotThresholds[1] - textureThresholds1; +#ifdef DD_DOT_BLENDING +vec4 isPositive0 = step(0.0, difference0); +vec4 isPositive1 = step(0.0, difference1); +float weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1); +float lessThanEqZero = step(weightSum, 0.0); +float greaterThanZero = 1.0 - lessThanEqZero ; +float divisor = (weightSum + lessThanEqZero); +vec4 weights0 = difference0 * isPositive0 / divisor; +vec4 weights1 = difference1 * isPositive1 / divisor; +vec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1; +vec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor; +#else +float diffMax = max(max4(difference0), max4(difference1)); +float lessThanZero = step(diffMax, 0.0); +float greaterOrEqZero = 1.0 - lessThanZero; +vec4 isMax0 = step(diffMax, difference0); +vec4 isMax1 = step(diffMax, difference1); +vec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1; +vec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor; +#endif +out_color = preEffectColor; +#else +out_color = v_opacity * v_color; +#endif +#ifdef HIGHLIGHT +out_color.a = 1.0; +#endif +return out_color; +} +void main() { +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +if (v_isOutline > 0.5) { +gl_FragColor = drawLine(); +} else { +gl_FragColor = drawFill(); +} +#else +gl_FragColor = drawFill(); +#endif +}`,"fill.vert":`#include +#define PACKED_LINE +precision highp float; +attribute float a_bitset; +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +attribute float a_inverseArea; +vec4 a_color = vec4(0.0, 0.0, 0.0, 1.0); +vec2 a_zoomRange = vec2(0.0, 10000.0); +#else +attribute vec4 a_color; +attribute vec4 a_aux2; +attribute vec4 a_aux3; +#ifndef SYMBOLOGY_TYPE_IS_SIMPLE_LIKE +attribute vec4 a_aux1; +attribute vec2 a_zoomRange; +#else +vec2 a_zoomRange = vec2(0.0, 10000.0); +#endif +#endif +uniform vec2 u_tileOffset; +uniform vec2 u_maxIntNumOfCrossing; +#include +#include +#include +#include +const float INV_SCALE_COMPRESSION_FACTOR = 1.0 / 128.0; +const float MAX_REPRESENTABLE_INT = 16777216.0; +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +vec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) { +return featureAttrOverFeatureArea * (1.0 / dotValue) * (1.0 / tileDotsOverArea); +} +#endif +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#include +#include +void drawLine(out lowp vec4 out_color, out highp vec3 out_pos) { +LineData outputs = buildLine( +out_pos, +a_id, +a_pos, +a_color, +(a_aux3.xy - 128.) / 16., +(a_aux3.zw - 128.) / 16., +0., +a_aux2.z / 16., +a_bitset, +vec4(0.), +vec2(0.), +a_aux2.w / 16. +); +v_id = outputs.id; +v_opacity = outputs.opacity; +v_aux1 = vec4(outputs.lineHalfWidth, outputs.normal, 0.); +out_color = outputs.color; +} +#endif +void drawFill(out lowp vec4 out_color, out highp vec3 out_pos) { +float a_bitSet = a_bitset; +out_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); +v_opacity = getOpacity(); +v_id = norm(a_id); +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +mat3 tileToTileNormalized = mat3( 2. / 512., 0., 0., +0., -2. / 512., 0., +-1., 1., 1. ); +out_pos = tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.); +#else +out_pos = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); +#endif +#ifdef PATTERN +vec4 a_tlbr = a_aux1; +float a_width = a_aux2.x; +float a_height = a_aux2.y; +vec2 a_offset = a_aux2.zw; +vec2 a_scale = a_aux3.xy; +float a_angle = a_aux3.z; +if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR) > 0.5) { +a_width *= INV_SCALE_COMPRESSION_FACTOR; +} +if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR) > 0.5) { +a_height *= INV_SCALE_COMPRESSION_FACTOR; +} +vec2 scale = INV_SCALE_COMPRESSION_FACTOR * a_scale; +float width = u_zoomFactor * a_width * scale.x; +float height = u_zoomFactor * a_height * scale.y; +float angle = C_256_TO_RAD * a_angle; +float sinA = sin(angle); +float cosA = cos(angle); +float dx = 0.0; +float dy = 0.0; +if (getBit(a_bitset, BITSET_FILL_RANDOM_PATTERN_OFFSET) > 0.5) { +float id = rgba2float(vec4(a_id, 0.0)); +dx = rand(vec2(id, 0.0)); +dy = rand(vec2(0.0, id)); +} +mat3 patternMatrix = mat3(cosA / width, sinA / height, 0, +-sinA / width, cosA / height, 0, +dx, dy, 1); +vec2 patternSize = vec2(a_width, a_height); +vec2 numPatternsPerMaxInt = vec2(MAX_REPRESENTABLE_INT) / patternSize; +vec2 maxIntCrossingOffsetCorrection = patternSize * fract(u_maxIntNumOfCrossing * numPatternsPerMaxInt); +vec2 tileOffset = u_tileOffset + maxIntCrossingOffsetCorrection - 0.5 * patternSize; +tileOffset = vec2(tileOffset.x * cosA - tileOffset.y * sinA, tileOffset.x * sinA + tileOffset.y * cosA); +tileOffset = mod(tileOffset, patternSize); +vec2 symbolOffset = u_zoomFactor * scale * vec2(a_offset - tileOffset) / vec2(width, height); +v_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset; +v_aux1 = a_tlbr / u_mosaicSize.xyxy; +v_sampleAlphaOnly = getBit(a_bitset, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); +if (getBit(a_bitSet, BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR) > 0.5) { +#ifdef VV_COLOR +v_sampleAlphaOnly *= (1.0 - float(isNan(VV_ADATA[ATTR_VV_COLOR]))) * (1.0 - getBit(a_bitSet, BITSET_GENERIC_LOCK_COLOR)); +#else +v_sampleAlphaOnly = 0.0; +#endif +} +#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY +vec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea; +vec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea; +float size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio; +v_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea); +v_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea); +v_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size; +#endif +} +#ifdef HITTEST +void draw(out lowp vec4 out_color, out highp vec3 out_pos) { +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +if (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) > 0.5) { +out_pos = vec3(0., 0., 2.); +return; +} +#endif +hittestFill(out_color, out_pos); +gl_PointSize = 1.0; +} +#elif defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +void draw(out lowp vec4 out_color, out highp vec3 out_pos) { +v_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE); +if (v_isOutline > 0.5) { +drawLine(out_color, out_pos); +} else { +drawFill(out_color, out_pos); +} +} +#else +#define draw drawFill +#endif +void main() +{ +INIT; +highp vec3 pos = vec3(0.); +highp vec4 color = vec4(0.); +draw(color, pos); +v_color = color; +gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); +}`,"hittest.glsl":`#ifdef HITTEST +#include +attribute vec2 a_pos1; +attribute vec2 a_pos2; +void hittestFill( +out lowp vec4 out_color, +out highp vec3 out_pos +) { +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); +vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.); +vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.); +float hittestDist = u_hittestDist; +float dist = distPointTriangle(u_hittestPos, pos.xy, pos1.xy, pos2.xy); +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if (dist < 0. || dist >= hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, dist == 0. ? (1. / 255.) : 0.); +} +#endif`},hittest:{"common.glsl":`#ifdef HITTEST +uniform float hittestDist; +uniform highp vec2 hittestPos; +float projectScalar(vec2 a, vec2 b) { +return dot(a, normalize(b)); +} +float distPointSegment(vec2 p0, vec2 p1, vec2 p2) { +vec2 L = p2 - p1; +vec2 A = p0 - p1; +float projAL = projectScalar(A, L); +float t = clamp(projAL / length(L), 0., 1.); +return distance(p0, p1 + t * (p2 - p1)); +} +void hittestMarker(out lowp vec4 out_color, out highp vec3 out_pos, in highp vec3 pos, float size) { +float dist = distance(pos, vec3(hittestPos, 1.)); +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if ((dist - size) > hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, (dist - size) < 0. ? (1. / 255.) : 0.); +} +float intersectPointTriangleBary(vec2 p, vec2 a, vec2 b, vec2 c) { +return inTriangle(xyToBarycentric(p, a, b, c)); +} +float distPointTriangle(vec2 p, vec2 a, vec2 b, vec2 c) { +vec2 ba = b - a; +vec2 ca = c - a; +float crossProduct = ba.x * ca.y - ca.x * ba.y; +bool isParallel = crossProduct < EPSILON_HITTEST && crossProduct > -EPSILON_HITTEST; +if (isParallel) { +return -1.; +} +if (intersectPointTriangleBary(p.xy, a, b, c) == 1.) { +return 0.; +} +float distAB = distPointSegment(p, a, b); +float distBC = distPointSegment(p, b, c); +float distCA = distPointSegment(p, c, a); +return min(min(distAB, distBC), distCA); +} +#endif`},icon:{"common.glsl":`#include +uniform lowp vec2 u_mosaicSize; +varying lowp vec4 v_color; +varying highp vec3 v_id; +varying highp vec4 v_sizeTex; +varying mediump vec3 v_pos; +varying lowp float v_opacity; +uniform lowp sampler2D u_texture; +#ifdef SDF +varying lowp vec4 v_outlineColor; +varying mediump float v_outlineWidth; +varying mediump float v_distRatio; +varying mediump float v_overridingOutlineColor; +varying mediump float v_isThin; +#endif +#ifdef SDF +vec4 getColor(vec2 v_size, vec2 v_tex) { +#ifdef HITTEST +lowp vec4 fillPixelColor = vec4(1.0); +#else +lowp vec4 fillPixelColor = v_color; +#endif +float d = 0.5 - rgba2float(texture2D(u_texture, v_tex)); +float size = max(v_size.x, v_size.y); +float dist = d * size * SOFT_EDGE_RATIO * v_distRatio; +fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); +float outlineWidth = v_outlineWidth; +#ifdef HIGHLIGHT +outlineWidth = max(outlineWidth, 4.0 * v_isThin); +#endif +if (outlineWidth > 0.25) { +lowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor; +float clampedOutlineSize = min(outlineWidth, size); +outlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0); +return v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor); +} +return v_opacity * fillPixelColor; +} +#else +vec4 getColor(vec2 _v_size, vec2 v_tex) { +lowp vec4 texColor = texture2D(u_texture, v_tex); +return v_opacity * texColor * v_color; +} +#endif`,heatmapAccumulate:{"common.glsl":`varying lowp vec4 v_hittestResult; +varying mediump vec2 v_offsetFromCenter; +varying highp float v_fieldValue;`,"heatmapAccumulate.frag":`precision mediump float; +#include +#ifdef HEATMAP_PRECISION_HALF_FLOAT +#define COMPRESSION_FACTOR 0.25 +#else +#define COMPRESSION_FACTOR 1.0 +#endif +uniform lowp sampler2D u_texture; +void main() { +#ifdef HITTEST +gl_FragColor = v_hittestResult; +#else +float radius = length(v_offsetFromCenter); +float shapeWeight = step(radius, 1.0); +float oneMinusRadiusSquared = 1.0 - radius * radius; +float kernelWeight = oneMinusRadiusSquared * oneMinusRadiusSquared; +gl_FragColor = vec4(shapeWeight * kernelWeight * v_fieldValue * COMPRESSION_FACTOR); +#endif +}`,"heatmapAccumulate.vert":`precision highp float; +attribute vec2 a_vertexOffset; +vec4 a_color = vec4(0.0); +vec2 a_zoomRange = vec2(0.0, 10000.0); +uniform float u_radius; +uniform float u_isFieldActive; +#include +#include +#include +void main() { +float filterFlags = getFilterFlags(); +#ifdef HITTEST +highp vec4 out_hittestResult = vec4(0.); +highp vec3 out_pos = vec3(0.); +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); +hittestMarker(out_hittestResult, out_pos, pos, u_radius); +v_hittestResult = out_hittestResult; +gl_PointSize = 1.; +gl_Position = vec4(clip(a_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +v_offsetFromCenter = sign(a_vertexOffset); +v_fieldValue = getAttributeData2(a_id).x * u_isFieldActive + 1.0 - u_isFieldActive; +vec3 centerPos = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); +vec3 vertexPos = centerPos + u_displayViewMat3 * vec3(v_offsetFromCenter, 0.0) * u_radius; +gl_Position = vec4(clip(a_color, vertexPos, filterFlags, a_zoomRange), 1.0); +#endif +}`},"hittest.glsl":`#ifdef HITTEST +#include +attribute vec2 a_vertexOffset1; +attribute vec2 a_vertexOffset2; +attribute vec2 a_texCoords1; +attribute vec2 a_texCoords2; +vec2 getTextureCoords(in vec3 bary, in vec2 texCoords0, in vec2 texCoords1, in vec2 texCoords2) { +return texCoords0 * bary.x + texCoords1 * bary.y + texCoords2 * bary.z; +} +void hittestIcon( +inout lowp vec4 out_color, +out highp vec3 out_pos, +in vec3 pos, +in vec3 offset, +in vec2 size, +in float scaleFactor, +in float isMapAligned +) { +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +vec3 posBase = u_viewMat3 * u_tileMat3 * pos; +vec3 offset1 = scaleFactor * vec3(a_vertexOffset1 / 16.0, 0.); +vec3 offset2 = scaleFactor * vec3(a_vertexOffset2 / 16.0, 0.); +vec2 pos0 = (posBase + getMatrixNoDisplay(isMapAligned) * offset).xy; +vec2 pos1 = (posBase + getMatrixNoDisplay(isMapAligned) * offset1).xy; +vec2 pos2 = (posBase + getMatrixNoDisplay(isMapAligned) * offset2).xy; +vec3 bary0 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, -u_hittestDist), pos0, pos1, pos2); +vec3 bary1 = xyToBarycentric(u_hittestPos + vec2(0., -u_hittestDist), pos0, pos1, pos2); +vec3 bary2 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, -u_hittestDist), pos0, pos1, pos2); +vec3 bary3 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, 0.), pos0, pos1, pos2); +vec3 bary4 = xyToBarycentric(u_hittestPos, pos0, pos1, pos2); +vec3 bary5 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, 0.), pos0, pos1, pos2); +vec3 bary6 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, u_hittestDist), pos0, pos1, pos2); +vec3 bary7 = xyToBarycentric(u_hittestPos + vec2(0., u_hittestDist), pos0, pos1, pos2); +vec3 bary8 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, u_hittestDist), pos0, pos1, pos2); +vec2 tex0 = a_texCoords / u_mosaicSize; +vec2 tex1 = a_texCoords1 / u_mosaicSize; +vec2 tex2 = a_texCoords2 / u_mosaicSize; +float alphaSum = 0.; +alphaSum += inTriangle(bary0) * getColor(size, getTextureCoords(bary0, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary1) * getColor(size, getTextureCoords(bary1, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary2) * getColor(size, getTextureCoords(bary2, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary3) * getColor(size, getTextureCoords(bary3, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary4) * getColor(size, getTextureCoords(bary4, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary5) * getColor(size, getTextureCoords(bary5, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary6) * getColor(size, getTextureCoords(bary6, tex0, tex1, tex2)).a; +alphaSum += inTriangle(bary7) * getColor(size, getTextureCoords(bary7, tex0, tex1, tex2)).a; +out_pos.z += step(alphaSum, .05) * 2.0; +out_color = vec4(1. / 255., 0., 0., alphaSum / 255.); +} +#endif`,"icon.frag":`precision mediump float; +#include +#include +#include +void main() +{ +#ifdef HITTEST +vec4 color = v_color; +#else +vec4 color = getColor(v_sizeTex.xy, v_sizeTex.zw); +#endif +#ifdef HIGHLIGHT +color.a = step(1.0 / 255.0, color.a); +#endif +gl_FragColor = color; +}`,"icon.vert":`precision highp float; +attribute vec4 a_color; +attribute vec4 a_outlineColor; +attribute vec4 a_sizeAndOutlineWidth; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +attribute vec2 a_bitSetAndDistRatio; +attribute vec2 a_zoomRange; +#include +#include +#include +float getMarkerScaleFactor(inout vec2 size, in float referenceSize) { +#ifdef VV_SIZE +float f = getSize(size.y) / size.y; +float sizeFactor = size.y / referenceSize; +return getSize(referenceSize) / referenceSize; +#else +return 1.; +#endif +} +void main() +{ +INIT; +float a_bitSet = a_bitSetAndDistRatio.x; +vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); +vec2 size = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0; +vec3 offset = vec3(a_vertexOffset / 16.0, 0.); +float outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0; +float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); +float referenceSize = a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0; +float scaleSymbolProportionally = getBit(a_bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); +float scaleFactor = getMarkerScaleFactor(size, referenceSize); +size.xy *= scaleFactor; +offset.xy *= scaleFactor; +outlineSize *= scaleSymbolProportionally * (scaleFactor - 1.0) + 1.0; +vec2 v_tex = a_texCoords / u_mosaicSize; +float filterFlags = getFilterFlags(); +v_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); +v_opacity = getOpacity(); +v_id = norm(a_id); +v_pos = u_dvsMat3 * pos + getMatrix(isMapAligned) * getRotation() * offset; +v_sizeTex = vec4(size.xy, v_tex.xy); +#ifdef SDF +v_isThin = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE); +#ifdef VV_COLOR +v_overridingOutlineColor = v_isThin; +#else +v_overridingOutlineColor = 0.0; +#endif +v_outlineWidth = min(outlineSize, max(max(size.x, size.y) - 0.99, 0.0)); +v_outlineColor = a_outlineColor; +v_distRatio = a_bitSetAndDistRatio.y / 128.0; +#endif +#ifdef HITTEST +highp vec4 out_color = vec4(0.); +highp vec3 out_pos = vec3(0.); +hittestIcon(out_color, out_pos, pos, offset, size, scaleFactor, isMapAligned); +v_color = out_color; +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); +#endif +}`},label:{"common.glsl":`uniform mediump float u_zoomLevel; +uniform mediump float u_mapRotation; +uniform mediump float u_mapAligned; +uniform mediump vec2 u_mosaicSize; +varying mediump float v_antialiasingWidth; +varying mediump float v_edgeDistanceOffset; +varying mediump vec2 v_tex; +varying mediump vec4 v_color; +varying lowp vec4 v_animation;`,"label.frag":"#include ","label.vert":`precision highp float; +#include +#include +attribute vec4 a_color; +attribute vec4 a_haloColor; +attribute vec4 a_texAndSize; +attribute vec4 a_refSymbolAndPlacementOffset; +attribute vec4 a_glyphData; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +uniform float u_isHaloPass; +uniform float u_isBackgroundPass; +uniform float u_mapRotation; +uniform float u_mapAligned; +float getZ(in float minZoom, in float maxZoom, in float angle) { +float glyphAngle = angle * 360.0 / 254.0; +float mapAngle = u_mapRotation * 360.0 / 254.0; +float diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle)); +float z = 0.0; +z += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom))); +z += u_mapAligned * 2.0 * step(90.0, diffAngle); +z += 2.0 * (1.0 - step(u_currentZoom, maxZoom)); +return z; +} +void main() +{ +INIT; +float groupMinZoom = getMinZoom(); +float glyphMinZoom = a_glyphData.x; +float glyphMaxZoom = a_glyphData.y; +float glyphAngle = a_glyphData.z; +float a_isBackground = a_glyphData.w; +float a_minZoom = max(groupMinZoom, glyphMinZoom); +float a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING; +vec2 a_placementDir = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw); +float a_refSymbolSize = a_refSymbolAndPlacementOffset.y; +float fontSize = a_texAndSize.z; +float haloSize = a_texAndSize.w * OUTLINE_SCALE; +vec2 vertexOffset = a_vertexOffset * OFFSET_PRECISION; +vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); +float z = getZ(a_minZoom, glyphMaxZoom, glyphAngle); +float fontScale = fontSize / SDF_FONT_SIZE; +float halfSize = getSize(a_refSymbolSize) / 2.0; +float animation = pow(getAnimationState(), vec4(2.0)).r; +float isText = 1.0 - a_isBackground; +float isBackground = u_isBackgroundPass * a_isBackground; +vec4 nonHaloColor = (isBackground + isText) * a_color; +v_color = animation * ((1.0 - u_isHaloPass) * nonHaloColor + (u_isHaloPass * a_haloColor)); +v_opacity = 1.0; +v_tex = a_texCoords / u_mosaicSize; +v_edgeDistanceOffset = u_isHaloPass * haloSize / fontScale / MAX_SDF_DISTANCE; +v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; +vec2 placementOffset = a_placementDir * (halfSize + a_placementPadding); +vec3 glyphOffset = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0); +vec3 v_pos = vec3((u_dvsMat3 * pos + glyphOffset).xy, z); +float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; +v_pos.z += 2.0 * isHidden; +gl_Position = vec4(v_pos, 1.0); +#ifdef DEBUG +v_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645); +#endif +}`},line:{"common.glsl":`varying lowp vec4 v_color; +varying highp vec3 v_id; +varying mediump vec2 v_normal; +varying mediump float v_lineHalfWidth; +varying lowp float v_opacity; +#ifdef PATTERN +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +#endif +#if defined(PATTERN) || defined(SDF) +varying highp float v_accumulatedDistance; +#endif +#ifdef SDF +varying mediump float v_lineWidthRatio; +#endif`,"hittest.glsl":`#include +#ifdef HITTEST +attribute vec2 a_pos1; +attribute vec2 a_pos2; +void hittestLine(out lowp vec4 out_color, out highp vec3 out_pos, float halfWidth) { +vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.); +vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.); +vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.); +vec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0); +float dist = min(distPointSegment(u_hittestPos, pos.xy, pos1.xy), +distPointSegment(u_hittestPos, pos.xy, pos2.xy)) - halfWidth; +out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); +if (dist >= u_hittestDist) { +out_pos.z += 2.0; +} +out_color = vec4(1. / 255., 0, 0, dist <= 0. ? (1. / 255.) : 0.); +} +#endif`,"line.frag":`precision lowp float; +#include +#include +#include +#include +#include +#include +#ifdef HITTEST +void main() { +gl_FragColor = v_color; +} +#else +void main() { +LineData inputs = LineData( +v_color, +v_normal, +v_lineHalfWidth, +v_opacity, +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +v_tlbr, +v_patternSize, +#endif +#ifdef SDF +v_lineWidthRatio, +#endif +#if defined(PATTERN) || defined(SDF) +v_accumulatedDistance, +#endif +#endif +v_id +); +gl_FragColor = shadeLine(inputs); +} +#endif`,"line.vert":`precision highp float; +attribute vec4 a_color; +attribute vec4 a_offsetAndNormal; +attribute vec2 a_accumulatedDistanceAndHalfWidth; +attribute vec4 a_tlbr; +attribute vec4 a_segmentDirection; +attribute vec2 a_aux; +attribute vec2 a_zoomRange; +#include +#include +#include +#include +#include +#include +#ifdef HITTEST +void draw() { +float aa = 0.5 * u_antialiasing; +float a_halfWidth = a_accumulatedDistanceAndHalfWidth.y / 16.; +float a_cimHalfWidth = a_aux.x / 16. ; +vec2 a_offset = a_offsetAndNormal.xy / 16.; +float baseWidth = getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth); +float halfWidth = getLineHalfWidth(baseWidth, aa); +highp vec3 pos = vec3(0.); +v_color = vec4(0.); +hittestLine(v_color, pos, halfWidth); +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); +} +#else +void draw() +{ +highp vec3 pos = vec3(0.); +LineData outputs = buildLine( +pos, +a_id, +a_pos, +a_color, +a_offsetAndNormal.xy / 16., +a_offsetAndNormal.zw / 16., +a_accumulatedDistanceAndHalfWidth.x, +a_accumulatedDistanceAndHalfWidth.y / 16., +a_segmentDirection.w, +a_tlbr, +a_segmentDirection.xy / 16., +a_aux.x / 16. +); +v_id = outputs.id; +v_color = outputs.color; +v_normal = outputs.normal; +v_lineHalfWidth = outputs.lineHalfWidth; +v_opacity = outputs.opacity; +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +v_tlbr = outputs.tlbr; +v_patternSize = outputs.patternSize; +#endif +#ifdef SDF +v_lineWidthRatio = outputs.lineWidthRatio; +#endif +#if defined(PATTERN) || defined(SDF) +v_accumulatedDistance = outputs.accumulatedDistance; +#endif +#endif +gl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0); +} +#endif +void main() { +INIT; +draw(); +}`},pie:{"pie.common.glsl":`uniform float outlineWidth; +uniform mediump float sectorThreshold; +varying vec3 v_id; +varying vec3 v_pos; +varying vec2 v_offset; +varying vec4 v_color; +varying float v_size; +varying float v_numOfEntries; +varying float v_maxSectorAngle; +varying vec2 v_filteredSectorToColorId[numberOfFields]; +varying vec2 v_texCoords; +varying float v_outlineWidth; +varying float v_opacity; +struct FilteredChartInfo { +float endSectorAngle; +int colorId; +};`,"pie.frag":`precision highp float; +#include +#include +#include +#include +uniform lowp vec4 colors[numberOfFields]; +uniform lowp vec4 defaultColor; +uniform lowp vec4 othersColor; +uniform lowp vec4 outlineColor; +uniform float donutRatio; +lowp vec4 getSectorColor(in int index, in vec2 filteredSectorToColorId[numberOfFields]) { +mediump int colorIndex = int(filteredSectorToColorId[index].y); +return colors[colorIndex]; +} +const int OTHER_SECTOR_ID = 255; +#ifdef HITTEST +vec4 getColor() { +float distanceSize = length(v_offset) * v_size; +float donutSize = donutRatio * v_size; +float alpha = step(donutSize, distanceSize) * (1.0 - step(v_size, distanceSize)); +return v_color; +} +#else +vec4 getColor() { +float angle = 90.0 - C_RAD_TO_DEG * atan2(v_offset.y, v_offset.x); +if (angle < 0.0) { +angle += 360.0; +} else if (angle > 360.0) { +angle = mod(angle, 360.0); +} +int numOfEntries = int(v_numOfEntries); +float maxSectorAngle = v_maxSectorAngle; +lowp vec4 fillColor = (maxSectorAngle > 0.0 || sectorThreshold > 0.0) ? othersColor : defaultColor; +lowp vec4 prevColor = vec4(0.0); +lowp vec4 nextColor = vec4(0.0); +float startSectorAngle = 0.0; +float endSectorAngle = 0.0; +if (angle < maxSectorAngle) { +for (int index = 0; index < numberOfFields; ++index) { +startSectorAngle = endSectorAngle; +endSectorAngle = v_filteredSectorToColorId[index].x; +if (endSectorAngle > angle) { +fillColor = getSectorColor(index, v_filteredSectorToColorId); +prevColor = sectorThreshold != 0.0 && index == 0 && abs(360.0 - maxSectorAngle) < EPSILON ? othersColor : +getSectorColor(index > 0 ? index - 1 : numOfEntries - 1, v_filteredSectorToColorId); +nextColor = sectorThreshold != 0.0 && abs(endSectorAngle - maxSectorAngle) < EPSILON ? othersColor : +getSectorColor(index < numOfEntries - 1 ? index + 1 : 0, v_filteredSectorToColorId); +break; +} +if (index == numOfEntries - 1) { +break; +} +} +} else { +prevColor = getSectorColor(numOfEntries - 1, v_filteredSectorToColorId); +nextColor = getSectorColor(0, v_filteredSectorToColorId); +startSectorAngle = maxSectorAngle; +endSectorAngle = 360.0; +} +lowp vec4 outlineColor = outlineColor; +float offset = length(v_offset); +float distanceSize = offset * v_size; +if (startSectorAngle != 0.0 || endSectorAngle != 360.0) { +float distanceToStartSector = (angle - startSectorAngle); +float distanceToEndSector = (endSectorAngle - angle); +float sectorThreshold = 0.6; +float beginSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToStartSector * offset); +float endSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToEndSector * offset); +if (endSectorAlpha > 0.0) { +fillColor = mix(nextColor, fillColor, endSectorAlpha); +} else if (beginSectorAlpha > 0.0) { +fillColor = mix(prevColor, fillColor, beginSectorAlpha); +} +} +float donutSize = donutRatio * (v_size - v_outlineWidth); +float endOfDonut = donutSize - v_outlineWidth; +float aaThreshold = 0.75; +float innerCircleAlpha = endOfDonut - aaThreshold > 0.0 ? smoothstep(endOfDonut - aaThreshold, endOfDonut + aaThreshold, distanceSize) : 1.0; +float outerCircleAlpha = 1.0 - smoothstep(v_size - aaThreshold, v_size + aaThreshold , distanceSize); +float circleAlpha = innerCircleAlpha * outerCircleAlpha; +float startOfOutline = v_size - v_outlineWidth; +if (startOfOutline > 0.0 && v_outlineWidth > 0.25) { +float outlineFactor = smoothstep(startOfOutline - aaThreshold, startOfOutline + aaThreshold, distanceSize); +float innerLineFactor = donutSize - aaThreshold > 0.0 ? 1.0 - smoothstep(donutSize - aaThreshold, donutSize + aaThreshold , distanceSize) : 0.0; +fillColor = mix(fillColor, outlineColor, innerLineFactor + outlineFactor); +} +return v_opacity * circleAlpha * fillColor; +} +#endif +void main() +{ +vec4 color = getColor(); +#ifdef highlight +color.a = step(1.0 / 255.0, color.a); +#endif +gl_FragColor = color; +}`,"pie.vert":`#include +#include +#include +#include +#include +#include +#include +#include +attribute float a_bitSet; +attribute vec2 a_offset; +attribute vec2 a_texCoords; +attribute vec2 a_size; +attribute float a_referenceSize; +attribute vec2 a_zoomRange; +int filterValue(in float sectorAngle, +in int currentIndex, +inout FilteredChartInfo filteredInfo, +inout vec2 filteredSectorToColorId[numberOfFields]) { +if (sectorAngle > sectorThreshold * 360.0) { +filteredInfo.endSectorAngle += sectorAngle; +filteredSectorToColorId[filteredInfo.colorId] = vec2(filteredInfo.endSectorAngle, currentIndex); +++filteredInfo.colorId; +} +return 0; +} +int filterValues(inout vec2 filteredSectorToColorId[numberOfFields], +inout FilteredChartInfo filteredInfo, +in float sectorAngles[numberOfFields]) { +for (int index = 0; index < numberOfFields; ++index) { +float sectorValue = sectorAngles[index]; +filterValue(sectorValue, index, filteredInfo, filteredSectorToColorId); +} +return filteredInfo.colorId; +} +vec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float a_referenceSize, in float bitSet) { +vec2 outSize = baseSize; +#ifdef VV_SIZE +float r = getSize(a_referenceSize, currentScale) / a_referenceSize; +outSize.xy *= r; +offset.xy *= r; +float scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); +outlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0; +#endif +return outSize; +} +vec3 getOffset(in vec2 in_offset, float a_bitSet) { +float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); +vec3 offset = vec3(in_offset, 0.0); +return getMatrix(isMapAligned) * offset; +} +float filterNaNValues(in float value) { +return value != NAN_MAGIC_NUMBER && value > 0.0 ? value : 0.0; +} +void main() +{ +INIT; +vec2 a_size = a_size; +vec2 a_offset = a_offset / 16.0; +float outlineSize = outlineWidth; +float a_bitSet = a_bitSet; +float a_referenceSize = a_referenceSize; +vec2 a_texCoords = a_texCoords / 4.0; +vec2 markerSize = getMarkerSize(a_offset, a_size, outlineSize, a_referenceSize, a_bitSet); +float filterFlags = getFilterFlags(); +vec3 pos = vec3(a_pos / 10.0, 1.0); +v_opacity = getOpacity(); +v_id = norm(a_id); +v_pos = displayViewScreenMat3 * pos + getOffset(a_offset, a_bitSet); +v_offset = sign(a_texCoords - 0.5); +v_size = max(markerSize.x, markerSize.y); +v_outlineWidth = outlineSize; +float attributeData[10]; +vec4 attributeData3 = getDataDriven0(a_id); +attributeData[0] = filterNaNValues(attributeData3.x); +attributeData[1] = filterNaNValues(attributeData3.y); +attributeData[2] = filterNaNValues(attributeData3.z); +attributeData[3] = filterNaNValues(attributeData3.w); +#if (numberOfFields > 4) +vec4 attributeData4 = getDataDriven1(a_id); +attributeData[4] = filterNaNValues(attributeData4.x); +attributeData[5] = filterNaNValues(attributeData4.y); +attributeData[6] = filterNaNValues(attributeData4.z); +attributeData[7] = filterNaNValues(attributeData4.w); +#endif +#if (numberOfFields > 8) +vec4 attributeData5 = getDataDriven2(a_id); +attributeData[8] = filterNaNValues(attributeData5.x); +attributeData[9] = filterNaNValues(attributeData5.y); +#endif +float sum = 0.0; +for (int i = 0; i < numberOfFields; ++i) { +sum += attributeData[i]; +} +float sectorAngles[numberOfFields]; +for (int i = 0; i < numberOfFields; ++i) { +sectorAngles[i] = 360.0 * attributeData[i] / sum; +} +vec2 filteredSectorToColorId[numberOfFields]; +FilteredChartInfo filteredInfo = FilteredChartInfo(0.0, 0); +int numOfEntries = filterValues(filteredSectorToColorId, filteredInfo, sectorAngles); +v_numOfEntries = float(numOfEntries); +v_maxSectorAngle = filteredInfo.endSectorAngle; +v_filteredSectorToColorId = filteredSectorToColorId; +#ifdef HITTEST +highp vec3 out_pos = vec3(0.0); +v_color = vec4(0.0); +hittestMarker(v_color, out_pos, viewMat3 * tileMat3 * pos, v_size); +gl_PointSize = 1.0; +gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); +#endif +}`},shared:{line:{"common.glsl":`#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) +uniform mediump vec2 u_mosaicSize; +varying mediump float v_sampleAlphaOnly; +#endif +struct LineData { +lowp vec4 color; +mediump vec2 normal; +mediump float lineHalfWidth; +lowp float opacity; +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +mediump vec4 tlbr; +mediump vec2 patternSize; +#endif +#ifdef SDF +mediump float lineWidthRatio; +#endif +#if defined(PATTERN) || defined(SDF) +highp float accumulatedDistance; +#endif +#endif +highp vec3 id; +};`,"line.frag":`uniform lowp float u_blur; +#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && !defined(HIGHLIGHT) +#if defined(PATTERN) || defined(SDF) +uniform sampler2D u_texture; +uniform highp float u_pixelRatio; +#endif +#endif +#if defined(SDF) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +lowp vec4 getLineColor(LineData line) { +mediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio; +mediump float relativeTexX = fract(line.accumulatedDistance / adjustedPatternWidth); +mediump float relativeTexY = 0.5 + 0.25 * line.normal.y; +mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); +mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; +float dist = d * line.lineHalfWidth; +return line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color; +} +#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) +lowp vec4 getLineColor(LineData line) { +mediump float lineHalfWidth = line.lineHalfWidth; +mediump float adjustedPatternHeight = line.patternSize.y * 2.0 * lineHalfWidth / line.patternSize.x; +mediump float relativeTexY = fract(line.accumulatedDistance / adjustedPatternHeight); +mediump float relativeTexX = 0.5 + 0.5 * line.normal.y; +mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); +lowp vec4 color = texture2D(u_texture, texCoord); +#ifdef VV_COLOR +if (v_sampleAlphaOnly > 0.5) { +color.rgb = vec3(color.a); +} +#endif +return line.opacity * line.color * color; +} +#else +lowp vec4 getLineColor(LineData line) { +return line.opacity * line.color; +} +#endif +vec4 shadeLine(LineData line) +{ +mediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0); +mediump float fragDist = length(line.normal) * line.lineHalfWidth; +lowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0); +lowp vec4 out_color = getLineColor(line) * alpha; +#ifdef HIGHLIGHT +out_color.a = step(1.0 / 255.0, out_color.a); +#endif +#ifdef ID +if (out_color.a < 1.0 / 255.0) { +discard; +} +out_color = vec4(line.id, 0.0); +#endif +return out_color; +}`,"line.vert":`float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) { +#ifdef VV_SIZE +float refLineWidth = 2.0 * referenceHalfWidth; +return 0.5 * (lineHalfWidth / max(referenceHalfWidth, EPSILON)) * getSize(refLineWidth); +#else +return lineHalfWidth; +#endif +} +float getLineHalfWidth(in float baseWidth, in float aa) { +float halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa; +#ifdef HIGHLIGHT +halfWidth = max(halfWidth, 2.0); +#endif +return halfWidth; +} +vec2 getDist(in vec2 offset, in float halfWidth) { +float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0); +return thinLineFactor * halfWidth * offset; +} +LineData buildLine( +out vec3 out_pos, +in vec3 in_id, +in vec2 in_pos, +in vec4 in_color, +in vec2 in_offset, +in vec2 in_normal, +in float in_accumulatedDist, +in float in_lineHalfWidth, +in float in_bitSet, +in vec4 in_tlbr, +in vec2 in_segmentDirection, +in float in_referenceHalfWidth +) +{ +float aa = 0.5 * u_antialiasing; +float baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth); +float halfWidth = getLineHalfWidth(baseWidth, aa); +float z = 2.0 * step(baseWidth, 0.0); +vec2 dist = getDist(in_offset, halfWidth); +vec3 offset = u_displayViewMat3 * vec3(dist, 0.0); +vec3 pos = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset; +#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +vec4 color = in_color; +float opacity = 1.0; +#else +vec4 color = getColor(in_color, in_bitSet, BITSET_GENERIC_LOCK_COLOR); +float opacity = getOpacity(); +#ifdef SDF +const float SDF_PATTERN_HALF_WIDTH = 15.5; +float scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH); +float lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH; +#endif +#endif +#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) +v_sampleAlphaOnly = getBit(in_bitSet, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); +#endif +out_pos = vec3(pos.xy, z); +return LineData( +color, +in_normal, +halfWidth, +opacity, +#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#ifdef PATTERN +in_tlbr / u_mosaicSize.xyxy, +vec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y), +#endif +#ifdef SDF +lineWidthRatio, +#endif +#if defined(PATTERN) || defined(SDF) +in_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist), +#endif +#endif +norm(in_id) +); +}`}},"symbologyTypeUtils.glsl":`#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE +#define SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE +#endif +#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_SIMPLE || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE +#define SYMBOLOGY_TYPE_IS_SIMPLE_LIKE +#endif`,text:{"common.glsl":`uniform highp vec2 u_mosaicSize; +varying highp vec3 v_id; +varying mediump vec3 v_pos; +varying lowp float v_opacity; +varying lowp vec4 v_color; +varying highp vec2 v_tex; +varying mediump float v_antialiasingWidth; +varying mediump float v_edgeDistanceOffset; +varying lowp float v_transparency;`,"hittest.glsl":"#include ","text.frag":`precision mediump float; +#include +uniform lowp sampler2D u_texture; +#ifdef HITTEST +vec4 getColor() { +return v_color; +} +#else +vec4 getColor() +{ +float SDF_CUTOFF = (2.0 / 8.0); +float SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF; +lowp float dist = texture2D(u_texture, v_tex).a; +mediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset; +#ifdef HIGHLIGHT +edge /= 2.0; +#endif +lowp float aa = v_antialiasingWidth; +lowp float alpha = smoothstep(edge - aa, edge + aa, dist); +return alpha * v_color * v_opacity; +} +#endif +void main() +{ +gl_FragColor = getColor(); +}`,"text.vert":`precision highp float; +#include +#include +#include +#include +attribute vec4 a_color; +attribute vec4 a_haloColor; +attribute vec4 a_texFontSize; +attribute vec4 a_aux; +attribute vec2 a_zoomRange; +attribute vec2 a_vertexOffset; +attribute vec2 a_texCoords; +uniform float u_isHaloPass; +uniform float u_isBackgroundPass; +float getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) { +#ifdef VV_SIZE +float r = getSize(referenceSize) / referenceSize; +baseSize *= r; +offset.xy *= r; +return baseSize; +#endif +return baseSize; +} +void main() +{ +INIT; +float a_isBackground = a_aux.y; +float a_referenceSize = a_aux.z * a_aux.z / 256.0; +float a_bitSet = a_aux.w; +float a_fontSize = a_texFontSize.z; +vec2 a_offset = a_vertexOffset * OFFSET_PRECISION; +vec3 in_pos = vec3(a_pos * POSITION_PRECISION, 1.0); +float fontSize = getTextSize(a_offset, a_fontSize, a_referenceSize); +float fontScale = fontSize / SDF_FONT_SIZE; +vec3 offset = getRotation() * vec3(a_offset, 0.0); +mat3 extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3; +float isText = 1.0 - a_isBackground; +float isBackground = u_isBackgroundPass * a_isBackground; +vec4 nonHaloColor = (isBackground * a_color) + (isText * getColor(a_color, a_bitSet, 1)); +v_color = u_isHaloPass * a_haloColor + (1.0 - u_isHaloPass) * nonHaloColor; +v_opacity = getOpacity(); +v_id = norm(a_id); +v_tex = a_texCoords / u_mosaicSize; +v_pos = u_dvsMat3 * in_pos + extrudeMatrix * offset; +float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; +v_pos.z += 2.0 * isHidden; +v_edgeDistanceOffset = u_isHaloPass * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE; +v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; +#ifdef HITTEST +highp vec3 out_pos = vec3(0.); +v_color = vec4(0.); +hittestMarker(v_color, out_pos, u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) ++ u_tileMat3 * offset, fontSize / 2.); +gl_PointSize = 1.; +gl_Position = vec4(clip(v_color, out_pos, getFilterFlags(), a_zoomRange), 1.0); +#else +gl_Position = vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0); +#endif +}`},"utils.glsl":`float rshift(in float u32, in int amount) { +return floor(u32 / pow(2.0, float(amount))); +} +float getBit(in float bitset, in int bitIndex) { +float offset = pow(2.0, float(bitIndex)); +return mod(floor(bitset / offset), 2.0); +} +const int maxHighlightReasons = 6; +float getFilterBit(in float bitset, in int bitIndex) { +return getBit(bitset, bitIndex + maxHighlightReasons); +} +float getHighlightBit(in float bitset, in int bitIndex) { +return getBit(bitset, bitIndex); +} +highp vec3 unpackDisplayIdTexel(in highp vec3 bitset) { +float isAggregate = getBit(bitset.b, 7); +return (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80))); +} +vec4 unpack(in float u32) { +float r = mod(rshift(u32, 0), 255.0); +float g = mod(rshift(u32, 8), 255.0); +float b = mod(rshift(u32, 16), 255.0); +float a = mod(rshift(u32, 24), 255.0); +return vec4(r, g, b, a); +} +vec3 norm(in vec3 v) { +return v /= 255.0; +} +vec4 norm(in vec4 v) { +return v /= 255.0; +} +float max4(vec4 target) { +return max(max(max(target.x, target.y), target.z), target.w); +} +vec2 unpack_u8_nf32(vec2 bytes) { +return (bytes - 127.0) / 127.0; +} +highp float rand(in vec2 co) { +highp float a = 12.9898; +highp float b = 78.233; +highp float c = 43758.5453; +highp float dt = dot(co, vec2(a,b)); +highp float sn = mod(dt, 3.14); +return fract(sin(sn) * c); +}`,"vcommon.glsl":`#include +#include +#include +#include +#include +attribute vec2 a_pos; +attribute highp vec3 a_id; +uniform highp mat3 displayViewScreenMat3; +uniform highp mat3 displayViewMat3; +uniform highp mat3 displayMat3; +uniform highp mat3 tileMat3; +uniform highp mat3 viewMat3; +uniform highp float pixelRatio; +uniform mediump float zoomFactor; +uniform mediump float antialiasing; +uniform mediump float currentScale; +uniform mediump float currentZoom; +uniform mediump float metersPerSRUnit; +vec4 VV_ADATA = vec4(0.0); +void loadVisualVariableData(inout vec4 target) { +target.rgba = getVisualVariableData(a_id); +} +#ifdef VV +#define INIT loadVisualVariableData(VV_ADATA) +#else +#define INIT +#endif +vec4 getColor(in vec4 a_color, in float a_bitSet, int index) { +#ifdef VV_COLOR +float isColorLocked = getBit(a_bitSet, index); +return getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked); +#else +return a_color; +#endif +} +float getOpacity() { +#ifdef VV_OPACITY +return getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]); +#else +return 1.0; +#endif +} +float getSize(in float in_size, in float currentScale) { +#ifdef VV_SIZE +return getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE], currentScale); +#else +return in_size; +#endif +} +mat3 getRotation() { +#ifdef VV_ROTATION +return getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0)); +#else +return mat3(1.0); +#endif +} +float getFilterFlags() { +#ifdef IGNORES_SAMPLER_PRECISION +return ceil(getFilterData(a_id).x * 255.0); +#else +return getFilterData(a_id).x * 255.0; +#endif +} +vec4 getAnimationState() { +return getAnimation(a_id); +} +float getMinZoom() { +vec4 data0 = getFilterData(a_id) * 255.0; +return data0.g; +} +mat3 getMatrixNoDisplay(float isMapAligned) { +return isMapAligned * viewMat3 * tileMat3 + (1.0 - isMapAligned) * tileMat3; +} +mat3 getMatrix(float isMapAligned) { +return isMapAligned * displayViewMat3 + (1.0 - isMapAligned) * displayMat3; +} +float checkHighlightBit(float filterFlags, int index) { +return getHighlightBit(filterFlags, index); +} +float checkHighlight(float filterFlags) { +float result = checkHighlightBit(filterFlags, 0); +for (int i = 1; i < maxHighlightReasons; i++) { +result = result + checkHighlightBit(filterFlags, i); +} +return step(0.1, result); +} +vec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) { +pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0)); +#ifdef inside +pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1)); +#elif defined(outside) +pos.z += 2.0 * getFilterBit(filterFlags, 1); +#elif defined(highlight) +#if !defined(highlight_all) +pos.z += 2.0 * (1.0 - checkHighlight(filterFlags)); +#endif +#endif +pos.z += 2.0 * (step(minMaxZoom.y, currentZoom) + (1.0 - step(minMaxZoom.x, currentZoom))); +return pos; +}`,"vv.glsl":`#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) +#define VV_SIZE +#endif +#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION) +#define VV +#endif +#ifdef VV_COLOR +uniform highp float colorValues[8]; +uniform vec4 colors[8]; +#endif +#ifdef VV_SIZE_MIN_MAX_VALUE +uniform highp vec4 minMaxValueAndSize; +#endif +#ifdef VV_SIZE_SCALE_STOPS +uniform highp float values[8]; +uniform float sizes[8]; +#endif +#ifdef VV_SIZE_FIELD_STOPS +uniform highp float values[8]; +uniform float sizes[8]; +#endif +#ifdef VV_SIZE_UNIT_VALUE +uniform highp float unitMeterRatio; +#endif +#ifdef VV_OPACITY +uniform highp float opacityValues[8]; +uniform float opacities[8]; +#endif +#ifdef VV_ROTATION +uniform lowp float rotationType; +#endif +bool isNan(float val) { +return (val == NAN_MAGIC_NUMBER); +} +#ifdef VV_SIZE_MIN_MAX_VALUE +float getVVMinMaxSize(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +float interpolationRatio = (sizeValue - minMaxValueAndSize.x) / (minMaxValueAndSize.y - minMaxValueAndSize.x); +interpolationRatio = clamp(interpolationRatio, 0.0, 1.0); +return minMaxValueAndSize.z + interpolationRatio * (minMaxValueAndSize.w - minMaxValueAndSize.z); +} +#endif +#ifdef VV_SIZE_SCALE_STOPS +float getVVScaleStopsSize(float currentScale) { +float outSize; +if (currentScale <= values[0]) { +outSize = sizes[0]; +} else { +if (currentScale >= values[7]) { +outSize = sizes[7]; +} else { +int index; +index = -1; +for (int i = 0; i < 8; i++) { +if (values[i] > currentScale) { +index = i; +break; +} +} +int prevIndex = index - 1; +float a = currentScale - values[prevIndex]; +float b = values[index] - values[prevIndex]; +outSize = mix(sizes[prevIndex], sizes[index], a / b); +} +} +return outSize; +} +#endif +#ifdef VV_SIZE_FIELD_STOPS +const int VV_SIZE_N = 8; +float getVVStopsSize(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +if (sizeValue <= values[0]) { +return sizes[0]; +} +if (sizeValue >= values[VV_SIZE_N - 1]) { +return sizes[VV_SIZE_N - 1]; +} +for (int i = 1; i < VV_SIZE_N; ++i) { +if (values[i] >= sizeValue) { +float f = (sizeValue - values[i-1]) / (values[i] - values[i-1]); +return mix(sizes[i-1], sizes[i], f); +} +} +return sizes[VV_SIZE_N - 1]; +} +#endif +#ifdef VV_SIZE_UNIT_VALUE +float getVVUnitValue(float sizeValue, float fallback) { +if (isNan(sizeValue)) { +return fallback; +} +return sizeValue * (metersPerSRUnit / unitMeterRatio); +} +#endif +#ifdef VV_OPACITY +const int VV_OPACITY_N = 8; +float getVVOpacity(float opacityValue) { +if (isNan(opacityValue)) { +return 1.0; +} +if (opacityValue <= opacityValues[0]) { +return opacities[0]; +} +for (int i = 1; i < VV_OPACITY_N; ++i) { +if (opacityValues[i] >= opacityValue) { +float f = (opacityValue - opacityValues[i-1]) / (opacityValues[i] - opacityValues[i-1]); +return mix(opacities[i-1], opacities[i], f); +} +} +return opacities[VV_OPACITY_N - 1]; +} +#endif +#ifdef VV_ROTATION +mat4 getVVRotation(float rotationValue) { +if (isNan(rotationValue)) { +return mat4(1, 0, 0, 0, +0, 1, 0, 0, +0, 0, 1, 0, +0, 0, 0, 1); +} +float rotation = rotationValue; +if (rotationType == 1.0) { +rotation = 90.0 - rotation; +} +float angle = C_DEG_TO_RAD * rotation; +float sinA = sin(angle); +float cosA = cos(angle); +return mat4(cosA, sinA, 0, 0, +-sinA, cosA, 0, 0, +0, 0, 1, 0, +0, 0, 0, 1); +} +mat3 getVVRotationMat3(float rotationValue) { +if (isNan(rotationValue)) { +return mat3(1, 0, 0, +0, 1, 0, +0, 0, 1); +} +float rotation = rotationValue; +if (rotationType == 1.0) { +rotation = 90.0 - rotation; +} +float angle = C_DEG_TO_RAD * -rotation; +float sinA = sin(angle); +float cosA = cos(angle); +return mat3(cosA, -sinA, 0, +sinA, cosA, 0, +0, 0, 1); +} +#endif +#ifdef VV_COLOR +const int VV_COLOR_N = 8; +vec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) { +if (isNan(colorValue) || isColorLocked == 1.0) { +return fallback; +} +if (colorValue <= colorValues[0]) { +return colors[0]; +} +for (int i = 1; i < VV_COLOR_N; ++i) { +if (colorValues[i] >= colorValue) { +float f = (colorValue - colorValues[i-1]) / (colorValues[i] - colorValues[i-1]); +return mix(colors[i-1], colors[i], f); +} +} +return colors[VV_COLOR_N - 1]; +} +#endif +float getVVSize(in float size, in float vvSize, in float currentScale) { +#ifdef VV_SIZE_MIN_MAX_VALUE +return getVVMinMaxSize(vvSize, size); +#elif defined(VV_SIZE_SCALE_STOPS) +float outSize = getVVScaleStopsSize(currentScale); +return isNan(outSize) ? size : outSize; +#elif defined(VV_SIZE_FIELD_STOPS) +float outSize = getVVStopsSize(vvSize, size); +return isNan(outSize) ? size : outSize; +#elif defined(VV_SIZE_UNIT_VALUE) +return getVVUnitValue(vvSize, size); +#else +return size; +#endif +}`},"post-processing":{blit:{"blit.frag":`precision mediump float; +uniform sampler2D u_texture; +varying vec2 v_uv; +void main() { +gl_FragColor = texture2D(u_texture, v_uv); +}`},bloom:{composite:{"composite.frag":`precision mediump float; +varying vec2 v_uv; +uniform sampler2D u_blurTexture1; +uniform sampler2D u_blurTexture2; +uniform sampler2D u_blurTexture3; +uniform sampler2D u_blurTexture4; +uniform sampler2D u_blurTexture5; +uniform float u_bloomStrength; +uniform float u_bloomRadius; +uniform float u_bloomFactors[NUMMIPS]; +uniform vec3 u_bloomTintColors[NUMMIPS]; +float lerpBloomFactor(const in float factor) { +float mirrorFactor = 1.2 - factor; +return mix(factor, mirrorFactor, u_bloomRadius); +} +void main() { +vec4 color = u_bloomStrength * ( +lerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) + +lerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) + +lerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) + +lerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) + +lerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv) +); +gl_FragColor = clamp(color, 0.0, 1.0); +}`},gaussianBlur:{"gaussianBlur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +uniform vec2 u_direction; +varying vec2 v_uv; +#define KERNEL_RADIUS RADIUS +#define SIGMA RADIUS +float gaussianPdf(in float x, in float sigma) { +return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; +} +void main() { +vec2 invSize = 1.0 / u_texSize; +float fSigma = float(SIGMA); +float weightSum = gaussianPdf(0.0, fSigma); +vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; +for (int i = 1; i < KERNEL_RADIUS; i ++) { +float x = float(i); +float w = gaussianPdf(x, fSigma); +vec2 uvOffset = u_direction * invSize * x; +vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); +vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); +pixelColorSum += (sample1 + sample2) * w; +weightSum += 2.0 * w; +} +gl_FragColor = pixelColorSum /weightSum; +}`},luminosityHighPass:{"luminosityHighPass.frag":`precision mediump float; +uniform sampler2D u_texture; +uniform vec3 u_defaultColor; +uniform float u_defaultOpacity; +uniform float u_luminosityThreshold; +uniform float u_smoothWidth; +varying vec2 v_uv; +void main() { +vec4 texel = texture2D(u_texture, v_uv); +vec3 luma = vec3(0.299, 0.587, 0.114); +float v = dot(texel.xyz, luma); +vec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity); +float alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v); +gl_FragColor = mix(outputColor, texel, alpha); +}`}},blur:{gaussianBlur:{"gaussianBlur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +uniform vec2 u_direction; +uniform float u_sigma; +varying vec2 v_uv; +#define KERNEL_RADIUS RADIUS +float gaussianPdf(in float x, in float sigma) { +return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; +} +void main() { +vec2 invSize = 1.0 / u_texSize; +float fSigma = u_sigma; +float weightSum = gaussianPdf(0.0, fSigma); +vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; +for (int i = 1; i < KERNEL_RADIUS; i ++) { +float x = float(i); +float w = gaussianPdf(x, fSigma); +vec2 uvOffset = u_direction * invSize * x; +vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); +vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); +pixelColorSum += (sample1 + sample2) * w; +weightSum += 2.0 * w; +} +gl_FragColor = pixelColorSum /weightSum; +}`},"radial-blur":{"radial-blur.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +const float sampleDist = 1.0; +const float sampleStrength = 2.2; +void main(void) { +float samples[10]; +samples[0] = -0.08; +samples[1] = -0.05; +samples[2] = -0.03; +samples[3] = -0.02; +samples[4] = -0.01; +samples[5] = 0.01; +samples[6] = 0.02; +samples[7] = 0.03; +samples[8] = 0.05; +samples[9] = 0.08; +vec2 dir = 0.5 - v_uv; +float dist = sqrt(dir.x * dir.x + dir.y * dir.y); +dir = dir / dist; +vec4 color = texture2D(u_colorTexture,v_uv); +vec4 sum = color; +for (int i = 0; i < 10; i++) { +sum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist); +} +sum *= 1.0 / 11.0; +float t = dist * sampleStrength; +t = clamp(t, 0.0, 1.0); +gl_FragColor = mix(color, sum, t); +}`}},dra:{"dra.frag":`precision mediump float; +uniform sampler2D u_minColor; +uniform sampler2D u_maxColor; +uniform sampler2D u_texture; +varying vec2 v_uv; +void main() { +vec4 minColor = texture2D(u_minColor, vec2(0.5)); +vec4 maxColor = texture2D(u_maxColor, vec2(0.5)); +vec4 color = texture2D(u_texture, v_uv); +vec3 minColorUnpremultiply = minColor.rgb / minColor.a; +vec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a; +vec3 colorUnpremultiply = color.rgb / color.a; +vec3 range = maxColorUnpremultiply - minColorUnpremultiply; +gl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a); +}`,"min-max":{"min-max.frag":`#extension GL_EXT_draw_buffers : require +precision mediump float; +#define CELL_SIZE 2 +uniform sampler2D u_minTexture; +uniform sampler2D u_maxTexture; +uniform vec2 u_srcResolution; +uniform vec2 u_dstResolution; +varying vec2 v_uv; +void main() { +vec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE); +vec2 onePixel = vec2(1.0) / u_srcResolution; +vec2 uv = (srcPixel + 0.5) / u_srcResolution; +vec4 minColor = vec4(1.0); +vec4 maxColor = vec4(0.0); +for (int y = 0; y < CELL_SIZE; ++y) { +for (int x = 0; x < CELL_SIZE; ++x) { +vec2 offset = uv + vec2(x, y) * onePixel; +minColor = min(minColor, texture2D(u_minTexture, offset)); +maxColor = max(maxColor, texture2D(u_maxTexture, offset)); +} +} +gl_FragData[0] = minColor; +gl_FragData[1] = maxColor; +}`}},"drop-shadow":{composite:{"composite.frag":`precision mediump float; +uniform sampler2D u_layerFBOTexture; +uniform sampler2D u_blurTexture; +uniform vec4 u_shadowColor; +uniform vec2 u_shadowOffset; +uniform highp mat3 u_displayViewMat3; +varying vec2 v_uv; +void main() { +vec3 offset = u_displayViewMat3 * vec3(u_shadowOffset, 0.0); +vec4 layerColor = texture2D(u_layerFBOTexture, v_uv); +vec4 blurColor = texture2D(u_blurTexture, v_uv - offset.xy / 2.0); +gl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor); +}`}},"edge-detect":{"frei-chen":{"frei-chen.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform vec2 u_texSize; +varying vec2 v_uv; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[9]; +const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 ); +const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 ); +const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 ); +const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 ); +const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 ); +const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 ); +const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 ); +const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 ); +const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 ); +void main() { +G[0] = g0, +G[1] = g1, +G[2] = g2, +G[3] = g3, +G[4] = g4, +G[5] = g5, +G[6] = g6, +G[7] = g7, +G[8] = g8; +mat3 I; +float cnv[9]; +vec3 sample; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 9; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]); +float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M); +gl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a); +}`},sobel:{"sobel.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +uniform vec2 u_texSize; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[2]; +const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ); +const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 ); +void main() { +mat3 I; +float cnv[2]; +vec3 sample; +G[0] = g0; +G[1] = g1; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 2; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +gl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a); +}`}},"edge-enhance":{"edge-enhance.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +varying vec2 v_uv; +uniform vec2 u_texSize; +vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); +mat3 G[2]; +const mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 ); +const mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 ); +void main() { +mat3 I; +float cnv[2]; +vec3 sample; +G[0] = g0; +G[1] = g1; +for (float i = 0.0; i < 3.0; i++) { +for (float j = 0.0; j < 3.0; j++) { +sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; +I[int(i)][int(j)] = length(sample); +} +} +for (int i = 0; i < 2; i++) { +float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); +cnv[i] = dp3 * dp3; +} +vec4 color = texture2D(u_colorTexture, v_uv); +gl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color); +}`},filterEffect:{"filterEffect.frag":`precision mediump float; +uniform sampler2D u_colorTexture; +uniform mat4 u_coefficients; +varying vec2 v_uv; +void main() { +vec4 color = texture2D(u_colorTexture, v_uv); +vec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0); +float a = color.a; +gl_FragColor = vec4(a * rgbw.rgb, a); +}`},pp:{"pp.vert":`precision mediump float; +attribute vec2 a_position; +varying vec2 v_uv; +void main() { +gl_Position = vec4(a_position, 0.0, 1.0); +v_uv = (a_position + 1.0) / 2.0; +}`}},raster:{bitmap:{"bitmap.frag":`precision mediump float; +varying highp vec2 v_texcoord; +uniform sampler2D u_texture; +uniform highp vec2 u_coordScale; +uniform lowp float u_opacity; +#include +void main() { +#ifdef BICUBIC +vec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale); +#else +vec4 color = texture2D(u_texture, v_texcoord); +#endif +gl_FragColor = vec4(color.rgb * u_opacity, color.a * u_opacity); +}`,"bitmap.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`},common:{"common.glsl":`uniform sampler2D u_image; +uniform int u_bandCount; +uniform bool u_flipY; +uniform float u_opacity; +uniform int u_resampling; +uniform vec2 u_srcImageSize; +#ifdef APPLY_PROJECTION +#include +#endif +#ifdef BICUBIC +#include +#endif +#ifdef BILINEAR +#include +#endif +vec2 getPixelLocation(vec2 coords) { +vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; +#ifdef APPLY_PROJECTION +targetLocation = projectPixelLocation(targetLocation); +#endif +return targetLocation; +} +bool isOutside(vec2 coords){ +if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { +return true; +} else { +return false; +} +} +vec4 getPixel(vec2 pixelLocation) { +#ifdef BICUBIC +vec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize); +#elif defined(BILINEAR) +vec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize); +#else +vec4 color = texture2D(u_image, pixelLocation); +#endif +return color; +}`,"common.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform highp float u_scale; +uniform highp vec2 u_offset; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos * u_scale + u_offset; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`,"contrastBrightness.glsl":`uniform float u_contrastOffset; +uniform float u_brightnessOffset; +vec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) { +vec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel; +float maxI = 255.0; +float mid = 128.0; +float c = u_contrastOffset; +float b = u_brightnessOffset; +vec4 v; +if (c > 0.0 && c < 100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid; +} else if (c <= 0.0 && c > -100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid; +} else if (c == 100.0) { +v = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b); +v = (sign(v) + 1.0) / 2.0; +} else if (c == -100.0) { +v = vec4(mid, mid, mid, currentPixel.a); +} +vec3 rgb = clamp(v.rgb / 255.0, 0.0, 1.0); +return vec4(rgb, currentPixel.a); +}`,"getSurfaceValues.glsl":`#include +void getSurfaceValues(sampler2D imageTexture, vec2 texCoord, vec2 srcImageSize, inout float values[10]) { +vec2 onePixel = 1.0 / srcImageSize; +vec4 va = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, -1.0))); +vec4 vb = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, -1.0))); +vec4 vc = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, -1.0))); +vec4 vd = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 0.0))); +vec4 ve = texture2D(imageTexture, mirror(texCoord)); +vec4 vf = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 0.0))); +vec4 vg = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 1.0))); +vec4 vh = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, 1.0))); +vec4 vi = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 1.0))); +float alpha = va.a * vb.a * vc.a * vd.a * ve.a * vf.a * vg.a * vh.a * vi.a; +values[0] = va.r; +values[1] = vb.r; +values[2] = vc.r; +values[3] = vd.r; +values[4] = ve.r; +values[5] = vf.r; +values[6] = vg.r; +values[7] = vh.r; +values[8] = vi.r; +values[9] = alpha; +}`,"inverse.glsl":`float invertValue(float value) { +float s = sign(value); +return (s * s) / (value + abs(s) - 1.0); +}`,"mirror.glsl":`vec2 mirror(vec2 pos) { +vec2 pos1 = abs(pos); +return step(pos1, vec2(1.0, 1.0)) * pos1 + step(1.0, pos1) * (2.0 - pos1); +}`,"projection.glsl":`uniform sampler2D u_transformGrid; +uniform vec2 u_transformSpacing; +uniform vec2 u_transformGridSize; +uniform vec2 u_targetImageSize; +vec2 projectPixelLocation(vec2 coords) { +#ifdef LOOKUP_PROJECTION +vec4 pv = texture2D(u_transformGrid, coords); +return vec2(pv.r, pv.g); +#endif +vec2 index_image = floor(coords * u_targetImageSize); +vec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t); +vec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize; +vec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing); +vec2 srcLocation; +vec2 transform_location = index_transform + oneTransformPixel * 0.5; +if (pos.s <= pos.t) { +vec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t)); +vec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t)); +srcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0)); +srcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0)); +} else { +vec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t)); +vec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t)); +srcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0)); +srcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0)); +} +return srcLocation; +}`},flow:{"getFadeOpacity.glsl":`uniform float u_decayRate; +uniform float u_fadeToZero; +float getFadeOpacity(float x) { +float cutOff = mix(0.0, exp(-u_decayRate), u_fadeToZero); +return (exp(-u_decayRate * x) - cutOff) / (1.0 - cutOff); +}`,"getFragmentColor.glsl":`vec4 getFragmentColor(vec4 color, float dist, float size, float featheringSize) { +float featheringStart = clamp(0.5 - featheringSize / size, 0.0, 0.5); +if (dist > featheringStart) { +color *= 1.0 - (dist - featheringStart) / (0.5 - featheringStart); +} +return color; +}`,imagery:{"imagery.frag":`precision highp float; +varying vec2 v_texcoord; +uniform sampler2D u_texture; +uniform float u_Min; +uniform float u_Max; +uniform float u_featheringSize; +#include +float getIntensity(float v) { +return u_Min + v * (u_Max - u_Min); +} +void main(void) { +vec4 sampled = texture2D(u_texture, v_texcoord); +float intensity = getIntensity(sampled.r); +gl_FragColor = getColor(intensity); +gl_FragColor.a *= getOpacity(sampled.r); +gl_FragColor.a *= sampled.a; +gl_FragColor.rgb *= gl_FragColor.a; +}`,"imagery.vert":`attribute vec2 a_position; +attribute vec2 a_texcoord; +uniform mat3 u_dvsMat3; +varying vec2 v_texcoord; +void main(void) { +vec2 xy = (u_dvsMat3 * vec3(a_position, 1.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_texcoord = a_texcoord; +}`},particles:{"particles.frag":`precision highp float; +varying vec4 v_color; +varying vec2 v_texcoord; +varying float v_size; +uniform float u_featheringSize; +#include +void main(void) { +gl_FragColor = getFragmentColor(v_color, length(v_texcoord - 0.5), v_size, u_featheringSize); +}`,"particles.vert":`attribute vec4 a_xyts0; +attribute vec4 a_xyts1; +attribute vec4 a_typeIdDurationSeed; +attribute vec4 a_extrudeInfo; +uniform mat3 u_dvsMat3; +uniform mat3 u_displayViewMat3; +uniform float u_time; +uniform float u_trailLength; +uniform float u_flowSpeed; +varying vec4 v_color; +varying vec2 v_texcoord; +varying float v_size; +uniform float u_featheringSize; +uniform float u_introFade; +#include +#include +void main(void) { +vec2 position0 = a_xyts0.xy; +float t0 = a_xyts0.z; +float speed0 = a_xyts0.w; +vec2 position1 = a_xyts1.xy; +float t1 = a_xyts1.z; +float speed1 = a_xyts1.w; +float type = a_typeIdDurationSeed.x; +float id = a_typeIdDurationSeed.y; +float duration = a_typeIdDurationSeed.z; +float seed = a_typeIdDurationSeed.w; +vec2 e0 = a_extrudeInfo.xy; +vec2 e1 = a_extrudeInfo.zw; +float animationPeriod = duration + u_trailLength; +float scaledTime = u_time * u_flowSpeed; +float randomizedTime = scaledTime + seed * animationPeriod; +float t = mod(randomizedTime, animationPeriod); +float fUnclamped = (t - t0) / (t1 - t0); +float f = clamp(fUnclamped, 0.0, 1.0); +float clampedTime = mix(t0, t1, f); +float speed = mix(speed0, speed1, f); +vec2 extrude; +vec2 position; +float fadeOpacity; +float introOpacity; +if (type == 2.0) { +if (fUnclamped < 0.0 || (fUnclamped > 1.0 && t1 != duration)) { +gl_Position = vec4(0.0, 0.0, -2.0, 1.0); +return; +} +vec2 ortho = mix(e0, e1, f); +vec2 parallel; +parallel = normalize(position1 - position0) * 0.5; +if (id == 1.0) { +extrude = ortho; +v_texcoord = vec2(0.5, 0.0); +} else if (id == 2.0) { +extrude = -ortho; +v_texcoord = vec2(0.5, 1.0); +} else if (id == 3.0) { +extrude = ortho + parallel; +v_texcoord = vec2(1.0, 0.0); +} else if (id == 4.0) { +extrude = -ortho + parallel; +v_texcoord = vec2(1.0, 1.0); +} +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} else { +if (fUnclamped < 0.0) { +gl_Position = vec4(0.0, 0.0, -2.0, 1.0); +return; +} +if (id == 1.0) { +extrude = e0; +v_texcoord = vec2(0.5, 0.0); +fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); +introOpacity = 1.0 - exp(-t0); +v_size = getSize(speed0); +v_color = getColor(speed0); +v_color.a *= getOpacity(speed0); +position = position0; +} else if (id == 2.0) { +extrude = -e0; +v_texcoord = vec2(0.5, 1.0); +fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); +introOpacity = 1.0 - exp(-t0); +v_size = getSize(speed0); +v_color = getColor(speed0); +v_color.a *= getOpacity(speed0); +position = position0; +} else if (id == 3.0) { +extrude = mix(e0, e1, f); +v_texcoord = vec2(0.5, 0.0); +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} else if (id == 4.0) { +extrude = -mix(e0, e1, f); +v_texcoord = vec2(0.5, 1.0); +fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); +introOpacity = 1.0 - exp(-clampedTime); +v_size = getSize(speed); +v_color = getColor(speed); +v_color.a *= getOpacity(speed); +position = mix(position0, position1, f); +} +} +vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(extrude * v_size, 0.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_color.a *= fadeOpacity; +v_color.a *= mix(1.0, introOpacity, u_introFade); +v_color.rgb *= v_color.a; +}`},streamlines:{"streamlines.frag":`precision highp float; +varying float v_side; +varying float v_time; +varying float v_totalTime; +varying float v_timeSeed; +varying vec4 v_color; +varying float v_size; +uniform float u_time; +uniform float u_trailLength; +uniform float u_flowSpeed; +uniform float u_featheringSize; +uniform float u_introFade; +#include +#include +void main(void) { +float t = mod(v_timeSeed * (v_totalTime + u_trailLength) + u_time * u_flowSpeed, v_totalTime + u_trailLength) - v_time; +vec4 color = v_color * step(0.0, t) * getFadeOpacity(t / u_trailLength); +color *= mix(1.0, 1.0 - exp(-v_time), u_introFade); +gl_FragColor = getFragmentColor(color, length((v_side + 1.0) / 2.0 - 0.5), v_size, u_featheringSize); +}`,"streamlines.vert":`attribute vec3 a_positionAndSide; +attribute vec3 a_timeInfo; +attribute vec2 a_extrude; +attribute float a_speed; +uniform mat3 u_dvsMat3; +uniform mat3 u_displayViewMat3; +varying float v_time; +varying float v_totalTime; +varying float v_timeSeed; +varying vec4 v_color; +varying float v_side; +varying float v_size; +uniform float u_featheringSize; +#include +void main(void) { +vec4 lineColor = getColor(a_speed); +float lineOpacity = getOpacity(a_speed); +float lineSize = getSize(a_speed); +vec2 position = a_positionAndSide.xy; +v_side = a_positionAndSide.z; +vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineSize, 0.0)).xy; +gl_Position = vec4(xy, 0.0, 1.0); +v_time = a_timeInfo.x; +v_totalTime = a_timeInfo.y; +v_timeSeed = a_timeInfo.z; +v_color = lineColor; +v_color.a *= lineOpacity; +v_color.rgb *= v_color.a; +v_size = lineSize; +}`},"vv.glsl":`#define MAX_STOPS 8 +#ifdef VV_COLOR +uniform float u_color_stops[MAX_STOPS]; +uniform vec4 u_color_values[MAX_STOPS]; +uniform int u_color_count; +#else +uniform vec4 u_color; +#endif +#ifdef VV_OPACITY +uniform float u_opacity_stops[MAX_STOPS]; +uniform float u_opacity_values[MAX_STOPS]; +uniform int u_opacity_count; +#else +uniform float u_opacity; +#endif +#ifdef VV_SIZE +uniform float u_size_stops[MAX_STOPS]; +uniform float u_size_values[MAX_STOPS]; +uniform int u_size_count; +#else +uniform float u_size; +#endif +uniform float u_featheringOffset; +vec4 getColor(float x) { +#ifdef VV_COLOR +vec4 color = u_color_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_color_count) { +break; +} +float x1 = u_color_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_color_stops[i]; +vec4 y2 = u_color_values[i]; +if (x < x2) { +vec4 y1 = u_color_values[i - 1]; +color = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +color = y2; +} +} +} +#else +vec4 color = u_color; +#endif +return color; +} +float getOpacity(float x) { +#ifdef VV_OPACITY +float opacity = u_opacity_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_opacity_count) { +break; +} +float x1 = u_opacity_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_opacity_stops[i]; +float y2 = u_opacity_values[i]; +if (x < x2) { +float y1 = u_opacity_values[i - 1]; +opacity = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +opacity = y2; +} +} +} +#else +float opacity = u_opacity; +#endif +return opacity; +} +float getSize(float x) { +#ifdef VV_SIZE +float size = u_size_values[0]; +{ +for (int i = 1; i < MAX_STOPS; i++) { +if (i >= u_size_count) { +break; +} +float x1 = u_size_stops[i - 1]; +if (x < x1) { +break; +} +float x2 = u_size_stops[i]; +float y2 = u_size_values[i]; +if (x < x2) { +float y1 = u_size_values[i - 1]; +size = y1 + (y2 - y1) * (x - x1) / (x2 - x1); +} else { +size = y2; +} +} +} +#else +float size = u_size; +#endif +return size + 2.0 * u_featheringSize * u_featheringOffset; +}`},hillshade:{"hillshade.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +uniform int u_hillshadeType; +uniform float u_sinZcosAs[6]; +uniform float u_sinZsinAs[6]; +uniform float u_cosZs[6]; +uniform float u_weights[6]; +uniform vec2 u_factor; +uniform float u_minValue; +uniform float u_maxValue; +uniform float u_scaling; +#include +#include +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +vec4 overlay(float val, float minValue, float maxValue, float hillshade) { +val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); +vec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0); +vec3 hsv = rgb2hsv(rgb.xyz); +hsv.z = hillshade; +return vec4(hsv2rgb(hsv) * u_scaling, 1.0) * rgb.a; +} +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +if (currentPixel.a == 0.0) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +float pv[10]; +getSurfaceValues(u_image, pixelLocation, u_srcImageSize, pv); +float alpha = pv[9]; +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * u_factor.s; +float dzy = (pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * u_factor.t; +float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); +float hillshade = 0.0; +if (u_hillshadeType == 0){ +float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; +float z = (u_cosZs[0] + cosDelta) / dzd; +if (z < 0.0) z = 0.0; +hillshade = z; +} else { +for (int k = 0; k < 6; k++) { +float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; +float z = (u_cosZs[k] + cosDelta) / dzd; +if (z < 0.0) z = 0.0; +hillshade = hillshade + z * u_weights[k]; +if (k == 5) break; +} +} +#ifdef APPLY_COLORMAP +vec4 result = overlay(pv[4], u_minValue, u_maxValue, hillshade) * alpha * u_opacity; +#else +hillshade *= u_scaling; +vec4 result = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity; +#endif +#ifdef ROUND_OUTPUT +result = vec4(floor(result.xyz + 0.5), result.a); +#endif +gl_FragColor = result; +}`},lut:{"colorize.glsl":`uniform sampler2D u_colormap; +uniform float u_colormapOffset; +uniform float u_colormapMaxIndex; +vec4 colorize(vec4 currentPixel, float scaleFactor) { +float clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex); +vec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0); +vec4 color = texture2D(u_colormap, clrPosition); +vec4 result = vec4(color.rgb, color.a * currentPixel.a); +return result; +} +vec4 colorizeNoClamp(vec4 currentPixel, float scaleFactor) { +float value = currentPixel.r * scaleFactor - u_colormapOffset; +vec4 result = colorize(currentPixel, scaleFactor); +return result * step(0.0, value) * step(value, u_colormapMaxIndex); +}`,"lut.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +#include +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +vec4 result = colorizeNoClamp(currentPixel, 1.0); +gl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity; +}`},magdir:{"magdir.frag":`precision mediump float; +varying vec4 v_color; +uniform lowp float u_opacity; +void main() { +gl_FragColor = v_color * u_opacity; +}`,"magdir.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_vv; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform vec2 u_symbolSize; +uniform vec2 u_symbolPercentRange; +uniform vec2 u_dataRange; +uniform float u_rotation; +uniform vec4 u_colors[12]; +varying vec4 v_color; +void main() +{ +float angle = a_offset.y + u_rotation; +#ifndef ROTATION_GEOGRAPHIC +angle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0; +#endif +vec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x; +#ifdef DATA_RANGE +float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); +float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); +float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); +#else +float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; +#endif +vec2 pos = a_pos + offset * sizePercentage * u_symbolSize; +v_color = u_colors[int(a_vv.x)]; +gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); +}`},reproject:{"reproject.frag":`precision mediump float; +varying vec2 v_texcoord; +#include +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; +}`,"reproject.vert":`precision mediump float; +attribute vec2 a_position; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_position; +gl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0); +}`},rfx:{aspect:{"aspect.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_cellSize; +uniform vec2 u_srcImageSize; +#include +const float pi = 3.14159265359; +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) / (8.0 * u_cellSize[0]); +float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) / (8.0 * u_cellSize[1]); +alpha *= sign(abs(dzx) + abs(dzy)); +float aspect_rad = (dzx == 0.0) ? (step(0.0, dzy) * 0.5 * pi + step(dzy, 0.0) * 1.5 * pi) : mod((2.5 * pi + atan(dzy, -dzx)), 2.0 * pi); +float aspect = aspect_rad * 180.0 / pi; +gl_FragColor = vec4(aspect, aspect, aspect, 1.0) * alpha; +}`},bandarithmetic:{"bandarithmetic.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +uniform float u_adjustments[3]; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +float nir = pv2.r; +float red = pv2.g; +float index; +#ifdef NDXI +index = (nir - red) * invertValue(nir + red); +#elif defined(SR) +index = nir * invertValue(red); +#elif defined(CI) +index = nir * invertValue(red) - 1.0; +#elif defined(SAVI) +index = (nir - red) * invertValue(nir + red + u_adjustments[0]) * (1.0 + u_adjustments[0]); +#elif defined(TSAVI) +float s = u_adjustments[0]; +float a = u_adjustments[1]; +float x = u_adjustments[2]; +float y = -a * s + x * (1.0 + s * s); +index = (s * (nir - s * red - a)) * invertValue(a * nir + red + y); +#elif defined(MSAVI) +float nir2 = 2.0 * nir + 1.0; +index = 0.5 * (nir2 - sqrt(nir2 * nir2 - 8.0 * (nir - red))); +#elif defined(GEMI) +float eta = (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) * invertValue(nir + red + 0.5); +index = eta * (1.0 - 0.25 * eta) - (red - 0.125) * invertValue(1.0 - red); +#elif defined(PVI) +float a = u_adjustments[0]; +float b = u_adjustments[1]; +float y = sqrt(1.0 + a * a); +index = (nir - a * red - b) * invertValue(y); +#elif defined(VARI) +index = (pv2.g - pv2.r) * invertValue(pv2.g + pv2.r - pv2.b); +#elif defined(MTVI) +float green = pv2.b; +float v = sqrt(pow((2.0 * nir + 1.0), 2.0) - (6.0 * nir - 5.0 * sqrt(red)) - 0.5); +index = 1.5 * (1.2 * (nir - green) - 2.5 * (red - green)) * invertValue(v); +#elif defined(RTVICORE) +float green = pv2.b; +index = 100.0 * (nir - red) - 10.0 * (nir - green); +#elif defined(EVI) +float blue = pv2.b; +float denom = nir + 6.0 * red - 7.5 * blue + 1.0; +index = (2.5 * (nir - red)) * invertValue(denom); +#elif defined(WNDWI) +float g = pv2.r; +float n = pv2.g; +float s = pv2.b; +float a = u_adjustments[0]; +float denom = g + a * n + (1.0 - a) * s; +index = (g - a * n - (1.0 - a) * s) * invertValue(denom); +#elif defined(BAI) +index = invertValue(pow((0.1 - red), 2.0) + pow((0.06 - nir), 2.0)); +#else +gl_FragColor = pv; +return; +#endif +#ifdef ROUND_OUTPUT +index = floor(index + 0.5); +#endif +gl_FragColor = vec4(index, index, index, pv.a); +}`},colormap2rgb:{"colormap2rgb.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec4 result = colorizeNoClamp(vec4(pv.r, pv.r, pv.r, 1.0), 1.0); +gl_FragColor = vec4(result.xyz * 255.0, 1.0) * result.a * pv.a; +}`},compositeband:{"compositeband.frag":`precision mediump float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +uniform sampler2D u_image2; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +#ifdef TWO_CONSTANT +uniform float u_image2Const; +#endif +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +float alpha = pv0.a; +#ifdef TWO_CONSTANT +float b = u_image1Const; +float c = u_image2Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#elif defined(ONE_CONSTANT) +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +float c = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +alpha *= pv1.a; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +vec4 pv2 = texture2D(u_image2, v_texcoord); +float b = pv1.r; +float c = pv2.r; +alpha = alpha * pv1.a * pv2.a; +#endif +gl_FragColor = vec4(a, b, c, alpha); +}`},computechange:{"computechange.frag":`precision mediump float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +uniform vec2 u_domainRange; +#include +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +#ifdef ONE_CONSTANT +float b = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, 0); +a = abc.s; +b = abc.t; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +#endif +float result = a; +float alpha = pv0.a; +#ifdef DIFFERENCE +result = a - b; +#elif defined(RELATIVE) +result = (a - b) * invertValue(max(abs(a), abs(b))); +#endif +bool isInvalid = result < u_domainRange.s || result > u_domainRange.t; +result = isInvalid ? 0.0 : result; +alpha *= float(!isInvalid); +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},contrast:{"contrast.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec4 result = adjustContrastBrightness(pv, false); +gl_FragColor = vec4(floor(result.rgb * 255.0 + 0.5), result.a); +}`},convolution:{"convolution.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_srcImageSize; +#define KERNEL_SIZE_ROWS ROWS +#define KERNEL_SIZE_COLS COLS +uniform vec2 u_clampRange; +uniform float u_kernel[25]; +#include +void main() { +vec3 rgb = vec3(0.0, 0.0, 0.0); +vec2 resolution = 1.0 / u_srcImageSize; +float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); +float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); +float alpha = 1.0; +for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { +float pos_row = rowOffset + float(row); +for (int col = 0; col < KERNEL_SIZE_COLS; col++) { +vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; +vec4 pv = texture2D(u_image, mirror(pos)); +rgb += pv.rgb * u_kernel[row * KERNEL_SIZE_COLS + col]; +alpha *= pv.a; +} +} +rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); +gl_FragColor = vec4(rgb * alpha, alpha); +}`},curvature:{"curvature.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform float u_zlFactor; +uniform vec2 u_srcImageSize; +#include +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float d = ((pv[3] + pv[5]) * 0.5 - pv[4]); +float e = ((pv[1] + pv[7]) * 0.5 - pv[4]); +float curvature = 0.0; +#ifdef STANDARD +curvature = -u_zlFactor * (d + e); +gl_FragColor = vec4(curvature, curvature, curvature, alpha); +#else +float f = (-pv[0] + pv[2] + pv[6] - pv[8]) / 4.0; +float g = (-pv[3] + pv[5]) / 2.0; +float h = (pv[1] - pv[7]) / 2.0; +float g2 = g * g; +float h2 = h * h; +#ifdef PROFILE +curvature = (u_zlFactor * (d * g2 + e * h2 + f * g * h)) / (g2 + h2); +#else +curvature = (-u_zlFactor * (d * h2 + e * g2 - f * g * h)) / (g2 + h2); +#endif +#endif +gl_FragColor = vec4(curvature, curvature, curvature, alpha); +}`},extractband:{"extractband.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +gl_FragColor = vec4(pv2, pv.a); +}`},focalstatistics:{"focalstatistics.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_srcImageSize; +#define KERNEL_SIZE_ROWS ROWS +#define KERNEL_SIZE_COLS COLS +uniform vec2 u_clampRange; +#include +#include +void main() { +vec2 resolution = 1.0 / u_srcImageSize; +float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); +float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); +float count = 0.0; +#ifdef STDDEV +vec3 sum = vec3(0.0, 0.0, 0.0); +vec3 sum2 = vec3(0.0, 0.0, 0.0); +#endif +vec4 currentPixel = texture2D(u_image, v_texcoord); +vec3 rgb = currentPixel.rgb; +for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { +float pos_row = rowOffset + float(row); +for (int col = 0; col < KERNEL_SIZE_COLS; col++) { +vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; +vec4 pv = texture2D(u_image, mirror(pos)); +count += pv.a; +#ifdef MIN +rgb = min(rgb, pv.rgb); +#elif defined(MAX) +rgb = max(rgb, pv.rgb); +#elif defined(MEAN) +rgb += pv.rgb; +#elif defined(STDDEV) +sum += pv.rgb; +sum2 += (pv.rgb * pv.rgb); +#endif +} +} +#ifdef MEAN +rgb *= invertValue(count); +#elif defined(STDDEV) +rgb = sqrt((sum2 - sum * sum * invertValue(count)) * invertValue(count)); +#endif +float alpha = step(0.9999, count); +rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); +#ifdef FILL +rgb = (1.0 - currentPixel.a) * rgb + currentPixel.a * currentPixel.rgb; +#endif +gl_FragColor = vec4(rgb * alpha, alpha); +}`},grayscale:{"grayscale.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec3 u_weights; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float value = dot(u_weights, pv.rgb); +gl_FragColor = vec4(value, value, value, pv.a); +}`},local:{"local.frag":`precision highp float; +uniform sampler2D u_image; +uniform sampler2D u_image1; +#ifdef ONE_CONSTANT +uniform float u_image1Const; +#ifdef TWO_CONSTANT +uniform float u_image2Const; +#endif +uniform mat3 u_imageSwap; +#endif +varying vec2 v_texcoord; +uniform vec2 u_domainRange; +#include +void main() { +vec4 pv0 = texture2D(u_image, v_texcoord); +float a = pv0.r; +#ifdef TWO_IMAGES +#ifdef ONE_CONSTANT +float b = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, 0); +a = abc.s; +b = abc.t; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +#endif +#elif defined(CONDITIONAL) +#ifdef TWO_CONSTANT +float b = u_image1Const; +float c = u_image2Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#elif defined(ONE_CONSTANT) +vec4 pv1 = texture2D(u_image1, v_texcoord); +float b = pv1.r; +float c = u_image1Const; +vec3 abc = u_imageSwap * vec3(a, b, c); +a = abc.s; +b = abc.t; +c = abc.p; +#else +vec4 pv1 = texture2D(u_image1, v_texcoord); +vec4 pv2 = texture2D(u_image2, v_texcoord); +float b = pv1.r; +float c = pv2.r; +#endif +#endif +float result = a; +float alpha = pv0.a; +#ifdef PLUS +result = a + b; +#elif defined(MINUS) +result = a - b; +#elif defined(TIMES) +result = a * b; +#elif defined(DIVIDE) +result = a * invertValue(b); +alpha *= float(abs(sign(b))); +#elif defined(FLOATDIVIDE) +result = a * invertValue(b); +alpha *= float(abs(sign(b))); +#elif defined(FLOORDIVIDE) +result = floor(a * invertValue(b)); +alpha *= float(abs(sign(b))); +#elif defined(SQUARE) +result = a * a; +#elif defined(SQRT) +result = sqrt(a); +#elif defined(POWER) +result = pow(a, b); +#elif defined(LN) +result = a <= 0.0 ? 0.0: log(a); +alpha *= float(a > 0.0); +#elif defined(LOG_1_0) +result = a <= 0.0 ? 0.0: log2(a) * invertValue(log2(10.0)); +alpha *= float(a > 0.0); +#elif defined(LOG_2) +result = a <= 0.0 ? 0.0: log2(a); +alpha *= float(a > 0.0); +#elif defined(EXP) +result = exp(a); +#elif defined(EXP_1_0) +result = pow(10.0, a); +#elif defined(EXP_2) +result = pow(2.0, a); +#elif defined(ROUNDDOWN) +result = floor(a); +#elif defined(ROUNDUP) +result = ceil(a); +#elif defined(INT) +result = float(sign(a)) * floor(abs(a)); +#elif defined(MOD) +result = mod(a, b); +#elif defined(NEGATE) +result = -a; +#elif defined(ABS) +result = abs(a); +#elif defined(ACOS) +result = abs(a) > 1.0 ? 0.0: acos(a); +alpha *= step(abs(a), 1.00001); +#elif defined(ACOSH) +result = acosh(a); +#elif defined(ASIN) +result = abs(a) > 1.0 ? 0.0: asin(a); +alpha *= step(abs(a), 1.00001); +#elif defined(ASINH) +result = asinh(a); +#elif defined(ATAN) +result = atan(a); +#elif defined(ATANH) +result = abs(a) > 1.0 ? 0.0: atanh(a); +alpha *= step(abs(a), 1.0); +#elif defined(ATAN_2) +result = atan(a, b); +#elif defined(COS) +result = cos(a); +#elif defined(COSH) +result = cosh(a); +#elif defined(SIN) +result = sin(a); +#elif defined(SINH) +result = sinh(a); +#elif defined(TAN) +result = tan(a); +#elif defined(TANH) +result = tanh(a); +#elif defined(BITWISEAND) +result = float(int(a) & int(b)); +#elif defined(BITWISEOR) +result = float(int(a) | int(b)); +#elif defined(BITWISELEFTSHIFT) +result = float(int(a) << int(b)); +#elif defined(BITWISERIGHTSHIFT) +result = float(int(a) >> int(b)); +#elif defined(BITWISENOT) +result = float(~(int(a))); +#elif defined(BITWISEXOR) +result = float(int(a) ^ int(b)); +#elif defined(BOOLEANAND) +result = float((a != 0.0) && (b != 0.0)); +#elif defined(BOOLEANNOT) +result = float(a == 0.0); +#elif defined(BOOLEANOR) +result = float((a != 0.0) || (b != 0.0)); +#elif defined(BOOLEANXOR) +result = float((a != 0.0) ^^ (b != 0.0)); +#elif defined(GREATERTHAN) +result = float(a > b); +#elif defined(GREATERTHANEQUAL) +result = float(a >= b); +#elif defined(LESSTHAN) +result = float(a < b); +#elif defined(LESSTHANEQUAL) +result = float(a <= b); +#elif defined(EQUALTO) +result = float(a == b); +#elif defined(NOTEQUAL) +result = float(a != b); +#elif defined(ISNULL) +result = float(alpha == 0.0); +alpha = 1.0; +#elif defined(SETNULL) +float maskValue = float(a == 0.0); +result = maskValue * b; +alpha *= maskValue; +#elif defined(CONDITIONAL) +float weight = float(abs(sign(a))); +result = weight * b + (1.0 - weight) * c; +#endif +float rangeFactor = step(u_domainRange.s, result) * step(result, u_domainRange.t); +result *= rangeFactor; +alpha *= rangeFactor; +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},mask:{"mask.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#define LEN_INCLUDED_RANGES 6 +#define LEN_NODATA_VALUES 6 +uniform highp float u_includedRanges[6]; +uniform highp float u_noDataValues[6]; +float maskFactor(float bandValue, float fromValue, float to) { +float factor = 1.0; +for (int i = 0; i < LEN_NODATA_VALUES; i++) { +factor *= float(u_noDataValues[i] != bandValue); +} +factor *= step(fromValue, bandValue) * step(bandValue, to); +return factor; +} +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float redFactor = maskFactor(pv.r, u_includedRanges[0], u_includedRanges[1]); +#ifdef MULTI_BAND +float greenFactor = maskFactor(pv.g, u_includedRanges[2], u_includedRanges[3]); +float blueFactor = maskFactor(pv.b, u_includedRanges[4], u_includedRanges[5]); +float maskFactor = redFactor * greenFactor * blueFactor; +gl_FragColor = pv * maskFactor; +#else +gl_FragColor = pv * redFactor; +#endif +}`},ndvi:{"ndvi.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform mediump mat3 u_bandIndexMat3; +#include +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +vec3 pv2 = u_bandIndexMat3 * pv.rgb; +float nir = pv2.r; +float red = pv2.g; +float index = (nir - red) * invertValue(nir + red); +#ifdef SCALED +index = floor((index + 1.0) * 100.0 + 0.5); +#endif +gl_FragColor = vec4(index, index, index, pv.a); +}`},remap:{"remap.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +#define LEN_REMAP_RANGES 18 +#define LEN_NODATA_RANGES 12 +uniform highp float u_rangeMaps[18]; +uniform highp float u_noDataRanges[12]; +uniform highp float u_unmatchMask; +uniform vec2 u_clampRange; +void main() { +vec4 pv = texture2D(u_image, v_texcoord); +float factor = 1.0; +float bandValue = pv.r; +for (int i = 0; i < LEN_NODATA_RANGES; i+=2) { +float inside = 1.0 - step(u_noDataRanges[i], bandValue) * step(bandValue, u_noDataRanges[i+1]); +factor *= inside; +} +float mapValue = 0.0; +float includeMask = 0.0; +for (int i = 0; i < LEN_REMAP_RANGES; i+=3) { +float stepMask = step(u_rangeMaps[i], bandValue) * step(bandValue, u_rangeMaps[i+1]); +includeMask = (1.0 - stepMask) * includeMask + stepMask; +mapValue = (1.0 - stepMask) * mapValue + stepMask * u_rangeMaps[i+2]; +} +bandValue = factor * (mapValue + (1.0 - includeMask) * u_unmatchMask * pv.r); +float bandMask = factor * max(u_unmatchMask, includeMask); +bandValue = clamp(bandValue, u_clampRange.s, u_clampRange.t); +gl_FragColor = vec4(bandValue, bandValue, bandValue, bandMask * pv.a); +}`},slope:{"slope.frag":`precision mediump float; +uniform sampler2D u_image; +varying vec2 v_texcoord; +uniform vec2 u_cellSize; +uniform float u_zFactor; +uniform vec2 u_srcImageSize; +uniform float u_pixelSizePower; +uniform float u_pixelSizeFactor; +#include +void main() { +float pv[10]; +getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); +float alpha = pv[9]; +float xf = (u_zFactor + pow(u_cellSize[0], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[0]); +float yf = (u_zFactor + pow(u_cellSize[1], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[1]); +float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * xf; +float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * yf; +float rise2run = sqrt(dzx * dzx + dzy * dzy); +#ifdef PERCENT_RISE +float result = rise2run * 100.0; +#else +float result = atan(rise2run) * 57.2957795; +#endif +#ifdef ROUND_OUTPUT +result = floor(result + 0.5); +#endif +gl_FragColor = vec4(result, result, result, alpha); +}`},stretch:{"stretch.frag":`precision mediump float; +uniform sampler2D u_image; +varying highp vec2 v_texcoord; +uniform float u_minCutOff[3]; +uniform float u_maxCutOff[3]; +uniform float u_minOutput; +uniform float u_maxOutput; +uniform float u_factor[3]; +uniform float u_gamma[3]; +uniform float u_gammaCorrection[3]; +float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection) { +val = clamp(val, minCutOff, maxCutOff); +float stretchedVal; +#ifdef USE_GAMMA +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +tempf -= step(1.0, gamma) * sign(gamma - 1.0) * pow(1.0 / outRange, relativeVal * gammaCorrection); +stretchedVal = tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput; +stretchedVal = clamp(stretchedVal, minOutput, maxOutput); +#else +stretchedVal = minOutput + (val - minCutOff) * factor; +#endif +#ifdef ROUND_OUTPUT +stretchedVal = floor(stretchedVal + 0.5); +#endif +return stretchedVal; +} +void main() { +vec4 currentPixel = texture2D(u_image, v_texcoord); +float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_gamma[0], u_gammaCorrection[0]); +#ifdef MULTI_BAND +float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_gamma[1], u_gammaCorrection[1]); +float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_gamma[2], u_gammaCorrection[2]); +gl_FragColor = vec4(redVal, greenVal, blueVal, currentPixel.a); +#else +gl_FragColor = vec4(redVal, redVal, redVal, currentPixel.a); +#endif +}`},vs:{"vs.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +varying highp vec2 v_texcoord; +void main() +{ +v_texcoord = a_pos; +gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); +}`}},scalar:{"scalar.frag":`precision mediump float; +uniform lowp float u_opacity; +varying vec2 v_pos; +const vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0); +const float outlineSize = 0.02; +const float innerRadius = 0.25; +const float outerRadius = 0.42; +const float innerSquareLength = 0.15; +void main() { +mediump float dist = length(v_pos); +mediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist); +fillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist)); +#ifdef INNER_CIRCLE +mediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist); +fillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist)); +#else +mediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0); +#endif +gl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity; +}`,"scalar.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_vv; +uniform highp mat3 u_dvsMat3; +uniform highp vec2 u_coordScale; +uniform vec2 u_symbolSize; +uniform vec2 u_symbolPercentRange; +uniform vec2 u_dataRange; +varying vec2 v_pos; +void main() +{ +#ifdef DATA_RANGE +float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); +float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); +float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); +#else +float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; +#endif +vec2 size = u_symbolSize * sizePercentage; +vec2 pos = a_pos + a_offset * size; +v_pos = a_offset; +gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); +}`},stretch:{"stretch.frag":`precision mediump float; +varying highp vec2 v_texcoord; +#include +uniform float u_minCutOff[3]; +uniform float u_maxCutOff[3]; +uniform float u_minOutput; +uniform float u_maxOutput; +uniform float u_factor[3]; +uniform bool u_useGamma; +uniform float u_gamma[3]; +uniform float u_gammaCorrection[3]; +#include +float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { +if (val >= maxCutOff) { +return maxOutput; +} else if (val <= minCutOff) { +return minOutput; +} +float stretchedVal; +if (useGamma) { +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +if (gamma > 1.0) { +tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); +} +stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; +} else { +stretchedVal = minOutput + (val - minCutOff) * factor; +} +#ifdef ROUND_OUTPUT +stretchedVal = floor(stretchedVal + 0.5); +#endif +return stretchedVal; +} +void main() { +vec2 pixelLocation = getPixelLocation(v_texcoord); +if (isOutside(pixelLocation)) { +gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +#ifdef NOOP +gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; +return; +#endif +if (u_bandCount == 1) { +float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); +#ifdef APPLY_COLORMAP +vec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0); +gl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity; +#else +gl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity; +#endif +} else { +float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); +float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); +float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); +gl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity; +} +}`}},stencil:{"stencil.frag":`void main() { +gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); +}`,"stencil.vert":`attribute vec2 a_pos; +uniform mat3 u_worldExtent; +void main() { +gl_Position = vec4(u_worldExtent * vec3(a_pos, 1.0), 1.0); +}`},test:{"TestShader.common.glsl":`#ifndef RETURN_RED +varying vec4 v_color; +#endif +varying vec2 v_offset;`,"TestShader.frag":`precision highp float; +#include +void main() { +if (v_offset.x > -.5 && v_offset.y > -.5 && v_offset.x < .5 && v_offset.y < .5) { +discard; +} +#ifdef RETURN_RED +gl_FragColor = vec4(1., 0., 0., 1.); +#else +gl_FragColor = v_color; +#endif +}`,"TestShader.vert":`const float POS_PRECISION_FACTOR = 10.; +const float OFFSET_PRECISION_FACTOR = 10.; +const float SIZE_PRECISION_FACTOR = 10.; +attribute vec2 a_pos_packed; +attribute vec2 a_offset_packed; +attribute float a_size_packed; +#ifdef DATA_DRIVEN_COLOR +const float u_dataDrivenColor_validValues[4] = float[4](0., 0., 1., 0.); +uniform vec4 u_dataDrivenColor_colorFallback; +uniform vec4 u_dataDrivenColor_color; +#endif +uniform float u_view_zoomLevel; +#include +#ifdef DATA_DRIVEN_COLOR +vec4 getColor(float value) { +int index = -1; +for (int i = 0; i < 4; i++) { +if (u_dataDrivenColor_validValues[i] == value) { +index = i; +break; +} +} +if (index == -1) { +return u_dataDrivenColor_colorFallback; +} +return u_dataDrivenColor_color; +} +#endif +void main() { +vec2 a_pos = a_pos_packed / POS_PRECISION_FACTOR; +vec2 a_offset = a_offset_packed / OFFSET_PRECISION_FACTOR; +float a_size = a_size_packed / SIZE_PRECISION_FACTOR; +vec4 color = vec4(1., 0., 0., 1.); +#ifdef DATA_DRIVEN_COLOR +color = getColor(1.); +#endif +vec2 offsetScaled = a_offset * a_size; +vec4 pos = vec4(a_pos.xy + offsetScaled, 0., 1.); +gl_Position = pos; +#ifndef RETURN_RED +v_color = color; +#endif +v_offset = a_offset; +}`},tileInfo:{"tileInfo.frag":`uniform mediump sampler2D u_texture; +varying mediump vec2 v_tex; +void main(void) { +lowp vec4 color = texture2D(u_texture, v_tex); +color.rgb *= color.a; +gl_FragColor = color; +}`,"tileInfo.vert":`attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform mediump float u_depth; +uniform mediump vec2 u_coord_ratio; +uniform mediump vec2 u_delta; +uniform mediump vec2 u_dimensions; +varying mediump vec2 v_tex; +void main() { +mediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions); +vec3 v_pos = u_dvsMat3 * vec3(offset, 1.0); +gl_Position = vec4(v_pos.xy, 0.0, 1.0); +v_tex = a_pos; +}`},util:{"atan2.glsl":`float atan2(in float y, in float x) { +float t0, t1, t2, t3, t4; +t3 = abs(x); +t1 = abs(y); +t0 = max(t3, t1); +t1 = min(t3, t1); +t3 = 1.0 / t0; +t3 = t1 * t3; +t4 = t3 * t3; +t0 = - 0.013480470; +t0 = t0 * t4 + 0.057477314; +t0 = t0 * t4 - 0.121239071; +t0 = t0 * t4 + 0.195635925; +t0 = t0 * t4 - 0.332994597; +t0 = t0 * t4 + 0.999995630; +t3 = t0 * t3; +t3 = (abs(y) > abs(x)) ? 1.570796327 - t3 : t3; +t3 = x < 0.0 ? 3.141592654 - t3 : t3; +t3 = y < 0.0 ? -t3 : t3; +return t3; +}`,"encoding.glsl":`const vec4 rgba2float_factors = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, rgba2float_factors); +}`}};function Qt(i){return function(e){let t=i;return e.split("/").forEach(o=>{t&&(t=t[o])}),t}}const Jt=new St(Qt(Xt));function fe(i){return Jt.resolveIncludes(i)}const ae={shaders:{vertexShader:fe("background/background.vert"),fragmentShader:fe("background/background.frag")},attributes:new Map([["a_pos",0]])},ei=()=>ht("clip",{geometry:[{location:0,name:"a_pos",count:2,type:P.SHORT}]});let ti=class extends Z{constructor(){super(...arguments),this._color=H(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:i}){i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setFaceCullingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255),i.setStencilFunction(U.ALWAYS,0,255)}draw(i,e){const{context:t,state:o,requestRender:a,allowDelayedRender:r}=i,l=ei(),n=e.getVAO(t,o,l.attributes,l.bufferLayouts);n.indexBuffer!=null&&(this._program||(this._program=ce(t,ae)),!r||a==null||this._program.compiled?(t.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",o.displayMat3),t.bindVAO(n),t.drawElements(A.TRIANGLES,n.indexBuffer.size,P.UNSIGNED_INT,0),t.bindVAO()):a())}};const xe=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,2)]]]),io=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,4),new ie("a_tex",2,P.BYTE,2,4)]]]),oo=new Map([["geometry",[new ie("a_pos",2,P.UNSIGNED_SHORT,0,4)]]]);let ii=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:i}){i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;this._initialized||this._initialize(t),!a||o==null||this._solidProgram.compiled?(t.setStencilFunctionSeparate(xt.FRONT_AND_BACK,U.GREATER,e.stencilRef,255),t.bindVAO(this._solidVertexArrayObject),t.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[e.rangeX,e.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.TRIANGLE_STRIP,0,4),t.bindVAO()):o()}_initialize(i){if(this._initialized)return!0;const e=ce(i,ae);if(!e)return!1;const t=new Int8Array([0,0,1,0,0,1,1,1]),o=k.createVertex(i,W.STATIC_DRAW,t),a=new K(i,ae.attributes,xe,new Map([["geometry",o]]));return this._solidProgram=e,this._solidVertexArrayObject=a,this._initialized=!0,!0}},oi=class extends $e{constructor(i,e,t,o,a,r,l=a,n=r){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Rt(i),this.resolution=e,this.x=t,this.y=o,this.width=a,this.height=r,this.rangeX=l,this.rangeY=n}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let i=this;for(;i.parent!==this._stage;){if(!i.parent)return 0;i=i.parent}return this._stage.children.indexOf(i)}setTransform(i){const e=this.resolution/(i.resolution*i.pixelRatio),t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t)}get destroyed(){return this._destroyed}};const ze=oe(),_e=Ct();let ai=class extends oi{constructor(i,e,t,o){super(i,e,t,o,ue,ue)}destroy(){super.destroy()}setTransform(i){const e=this.resolution/i.resolution,t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t);const n=Tt(pe(),r,0,0,l,o,a);bt(this.transforms.labelMat2d,i.viewMat2d,n)}_createTransforms(){return{labelMat2d:pe(),tileMat3:oe(),displayViewScreenMat3:oe()}}containsScreenPoint(i,e,t){const o=ge(ze,i.viewMat3,this.transforms.tileMat3),a=It(ze,o);if(a==null)return!0;At(_e,...e,1);const r=Pt(_e,_e,a),l=t*(this.resolution/i.resolution);return r[0]>=-l&&r[0]=-l&&r[1]{const t=e.end-e.start;i=Math.max(i,t)}),i}firstFit(i){if(this._head==null)return null;let e=null,t=this._head;for(;t;){const o=t.data.end-t.data.start;if(o===i)return e?e.next=t.next:this._head=t.next,t.data.start;if(o>i){const a=t.data.start;return t.data.start+=i,a}e=t,t=t.next}return null}free(i,e){const t=i+e;if(this._head==null){const l=new Y({start:i,end:t});return void(this._head=l)}if(t<=this._head.data.start){if(t===this._head.data.start)return void(this._head.data.start-=e);const l=new Y({start:i,end:t});return l.next=this._head,void(this._head=l)}let o=this._head,a=o.next;for(;a;){if(a.data.start>=t){if(o.data.end===i){if(o.data.end+=e,o.data.end===a.data.start){const n=a.data.end-a.data.start;return o.data.end+=n,void(o.next=a.next)}return}if(a.data.start===t)return void(a.data.start-=e);const l=new Y({start:i,end:t});return l.next=o.next,void(o.next=l)}o=a,a=a.next}if(i===o.data.end)return void(o.data.end+=e);const r=new Y({start:i,end:t});o.next=r}clear(){this._head=null}};function ri(i,e){return i<<16|255&e}function li(i){return 255&i}let te=class{constructor(i,e,t,o,a){this.instance=i,this.materialKey=e,this.target=t,this.start=o,this.count=a}get textureKey(){return li(this.materialKey)}get indexEnd(){return this.start+this.count}extend(i){this.count+=i}render(i){this.instance.techniqueRef.render(i,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const i=this.instance.instanceId;return this.target.getMesh(i).getAttributePrecisionPackFactors()}draw(i,e){Et(i)?this.drawCompute(i.context,e):this.drawGeometry(i.context,e)}drawCompute(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getComputeVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT/3;i.bindVAO(o),i.drawElements(A.POINTS,this.count/3,P.UNSIGNED_INT,a),i.bindVAO(null)}drawGeometry(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getGeometryVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT;i.bindVAO(o),i.drawElements(A.TRIANGLES,this.count,P.UNSIGNED_INT,a),i.bindVAO(null)}},ni=class rt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,o,a){const r=new rt;for(const l of e.values())for(const n of l.records){const s=o.getInstance(n.instanceId),c=ri(s.instanceId,n.textureKey);r.addRecord(s,c,n.indexStart,n.indexCount,n.vertexStart,n.vertexCount,t,a)}return r}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e,t){const{drawPhase:o}=e;for(const a of this.infos()){const r=a.instance.techniqueRef;r.drawPhase&o&&(t==null||r.type===t)&&a.render(e)}}addRecord(e,t,o,a,r,l,n,s){let c=o,u=a;if(u||(c=r,u=l),!u)return;if(this._head==null){const g=new te(e,t,n,c,u);return this._head=new Y(g),this._tail=this._head,this._length++,void this._minOrderedLength++}if(s===he.STRICT_ORDER)return this._insert(e,t,n,c,u,this._tail,null);let f=null,d=this._head;const _=e.instanceId,x=e.techniqueRef.symbologyPlane;if(s===he.STRICT_MARKERS_AND_TEXT&&(x===Ce.MARKER||x===Ce.TEXT))return this._insert(e,t,n,c,u,this._tail,null);for(;d;){const g=d.data.instance,b=g.instanceId,O=g.techniqueRef.symbologyPlane,S=f?.data.instance.instanceId;if(x=1){const o=this.index.operations[this.index.operations.length-1];o.srcFrom+o.count===i.indexStart&&(o.count+=i.indexCount,t=!0)}t||this.index.operations.push({srcFrom:i.indexStart,dstFrom:this.index.count,count:i.indexCount,mutate:e}),i.indexStart=this.index.count,this.index.count+=i.indexCount}};const Ve=j("esri-2d-log-allocations");let Ne=class lt{static create(e,t){const o=t.acquireUint32Array(e);return new lt(o,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},me=class nt{constructor(){this._data=new ArrayBuffer(nt.BYTE_LENGTH),this._freeList=new at({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}};class ao{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*me.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,Ve&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=me.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const o of this._pages){const a=o.acquireUint32Array(e);if(a!=null)return a}const t=this._addPage().acquireUint32Array(e);return ve(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,Ve&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new me;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}}const ui=1.25,we=32767,ci=we<<16|we;let Fe=class{constructor(i,e,t,o){this._pool=o;const a=Ne.create(e*t*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=e,this.strideInt=t,this.bufferType=i,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:e*t*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=a,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new at({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(i){if(!(this.maxAvailableSpace()>=i)&&i*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const e=this._cpu.length/this.strideInt,t=Math.round((e+i)*ui),o=t*this.strideInt;this._cpu.expand(o*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(e,t-e),this.memoryStats.bytesReserved+=(t-e)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(i,e){this._cpu.array[i]!==e&&(this._cpu.array[i]=e,this.dirty.start=Math.min(i,this.dirty.start),this.dirty.end=Math.max(i+1,this.dirty.end))}getGPUBuffer(i,e=!1){if(!this.bufferSize)return null;if(e){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(i)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(i)),this._gpu}getView(i,e){return this._cpu.getUint32View(i,e/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(i,e,t,o){const a=t*this.strideInt;if(!a)return 0;const r=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,l=new Uint32Array(i,r,a),n=this.freeList.firstFit(t);ve(n,"First fit region must be defined");const s=n*this.strideInt,c=a;if(this._cpu.array.set(l,s),o!==0)for(let u=0;uo,r=this._cpu,l=Ne.create(o,this._pool);a||l.array.set(this._cpu.getUint32View(0,this.intSize));for(const n of e)if(a||n.srcFrom!==n.dstFrom||n.mutate!==0){this.dirty.start=Math.min(this.dirty.start,n.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(n.dstFrom+n.count)*this.strideInt);for(let s=0;se.locations.has(o.name)).map(o=>({name:o.name,type:o.type,count:o.count,divisor:0,normalized:o.normalized??!1,offset:o.offset,stride:i.stride}));return new Map([["geometry",t]])}function di(i,e){const t=[],o=i.attributes.filter(a=>e.locations.has(a.name));for(const a of o){t.push({name:a.name,type:a.type,count:a.count,divisor:0,normalized:a.normalized??!1,offset:a.offset,stride:i.stride});const r=e.computeAttributeMap[a.name];r!=null&&r.length===2&&(t.push({name:r[0],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+i.stride,stride:i.stride}),t.push({name:r[1],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+2*i.stride,stride:i.stride}))}return new Map([["geometry",t]])}let _i=class{constructor(i,e){if(this._bufferPool=i,this._layout=e,this._invalidatedGeometry=!1,this._invalidatedCompute=!1,this._position=this._layout.attributes.find(t=>t.name==="pos"||t.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute")}destroy(){this._indexBuffer=Ee(this._indexBuffer),this._vertexBuffer=Ee(this._vertexBuffer),this._computeVAO?.disposeVAOOnly(),this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(i,e,t,o){return o?{primitive:A.POINTS,count:e/3,offset:t/3}:{primitive:i,count:e,offset:t}}getAttributePrecisionPackFactors(){const i={};for(const e of this.layout.attributes)e.packPrecisionFactor&&(i[e.name]=e.packPrecisionFactor);return i}getDebugVertexInfo(i=!1,e){if(!this._vertexBuffer)return null;const t=this._layout,o=t.stride,a=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),r=[];if(i)if(e==null)console.log("must provide location info to see compute attributes");else for(const f of t.attributes){const d=e.computeAttributeMap[f.name];d!=null&&d.length===2&&(r.push({...f,name:d[0],offset:f.offset+o}),r.push({...f,name:d[1],offset:f.offset+2*o}))}const l=new DataView(a.slice().buffer);let n=a.byteLength/o;i&&(n=this._indexBuffer.fillPointer/3);const s=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let c=0;const u=[];for(let f=0;fSe.getLogger("esri.views.2d.engine.webgl.FeatureTile");let pi=0,gi=class extends ai{constructor(i,e,t,o,a=!1){super(i,e,t,o),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=pi++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=pe(),this.enableDeferredUploads=a}destroy(){super.destroy(),this.clear()}clear(){for(const i of this._meshes.values())i.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(i){super.beforeRender(i),this._needsReshuffle&&i.reshuffleManager.schedule(this)}tryReady(i){const e=this._invalidated&&!this._uploadAllowed;return!(this.isReady||e||!this._encounteredEnd||!(i>=this._attributeEpoch))&&(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${i}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(i,e){if(this._uploadAllowed&&this._invalidated){this._entities.sort((t,o)=>{const a=o.sortKey,r=t.sortKey;return r===a?t.id-o.id:r-a}),e===he.BATCHING&&this.reshuffle(!0),this._displayList=ni.fromDisplayEntities(this._entities,this,i,e);for(const t of this._meshes.values())t.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(i){if(!this._meshes.has(i))throw new Error(`InternalError: Unable to find VAO for instance: ${i}`);return this._meshes.get(i)}getSortKeys(i){const e=new Map;for(const{id:t,sortKey:o}of this._entities)if(i.has(t)&&e.set(t,o),e.size===i.size)break;return e}onMessage(i){if(i.objectIdMap)for(const e in i.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[e]=i.objectIdMap[e];switch(i.type){case"append":this._onAppendMessage(i);break;case"update":this._onUpdateMessage(i)}if(this._aggregateMemoryStats(),this.requestRender(),i.end){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${i.attributeEpoch}]`),!i.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=i.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(i){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Ue(i?.append)}),i.clear&&this.clear(),!i.append)return;const e=le(new se(i.append.entities),ne);this._insert(e,i.append.data,!1)}_onUpdateMessage(i){j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:i.isPixelBuffer,modify:Ue(i.modify),remove:i.remove});const e=le(new se(i.modify.entities),ne),t=e.map(r=>r.id),o=i.isPixelBuffer??!1,a=[...i.remove,...t];o?this._removeByIdsFromBuffer(a):this._removeByIds(a),this._insert(e,i.modify.data,o)}reshuffle(i=!1){if(this.destroyed)return;const e=new Map;for(const t of this._entities)for(const o of t.records){const a=this._meshes.get(o.instanceId);let r=e.get(a);r||(r=new si(i),e.set(a,r)),r.copyRecord(o)}for(const[t,o]of e)t.reshuffle(o);this._invalidated=!0,this._aggregateMemoryStats(),j("esri-2d-update-debug")&&vi().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(i,e,t,o){const a=t*ue,r=o*ue;for(const l of i._entities){let n=null;for(const s of l.records)if(s.overlaps&e){const c=i.getMesh(s.instanceId),u=this._ensureMesh(s.instanceId,c.layout).copyRecordFrom(c,s,a,r);n||(n=new ne(l.id,l.sortKey),this._entityIdsFromBuffer.add(l.id),this._entities.push(n)),n.records.push(u)}}this._invalidated=!0}_ensureMesh(i,e){return this._meshes.has(i)||this._meshes.set(i,new _i(this._stage.bufferPool,e)),this._meshes.get(i)}_insert(i,e,t){if(!i.length)return;this._removeDuplicatedBufferedEntites(i);const o=this._insertVertexData(e);for(const a of i){for(const r of a.records)r.updateBaseOffsets(o.get(r.instanceId));t?this._tryInsertBufferedEntity(a):this._insertEntity(a)}this._invalidated=!0}_insertVertexData(i){const e=new Map;for(const t of i){const{instanceId:o,layout:a}=t,r=this._ensureMesh(o,a).append(t);if(t.metrics){const l=le(new se(t.metrics),pt)??[];this._metrics.push(...l)}e.set(o,r)}return e}_insertEntity(i){j("esri-2d-update-debug")&&this._entityIds.has(i.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${i.id}`),this._entityIds.add(i.id),this._entities.push(i)}_tryInsertBufferedEntity(i){this._entityIds.has(i.id)?this._removeRecordsFromMesh(i.records):(this._entityIdsFromBuffer.add(i.id),this._entities.push(i))}_removeDuplicatedBufferedEntites(i){if(!this._entityIdsFromBuffer.size)return;const e=[];for(const t of i)this._entityIdsFromBuffer.has(t.id)&&e.push(t.id);this._removeByIds(e)}_removeByIdsFromBuffer(i){this._removeByIds(i.filter(e=>this._entityIdsFromBuffer.has(e)))}_removeByIds(i){if(i.length===0)return;const e=new Set(i),t=[];for(const o of this._entities)e.has(o.id)?this._remove(o):t.push(o);this._entities=t,this._invalidated=!0}_remove(i){this._removeRecordsFromMesh(i.records),this._entityIds.delete(i.id),this._entityIdsFromBuffer.delete(i.id);for(let e=this._metrics.length-1;e>=0;e--)this._metrics[e].entityTexel===i.id&&this._metrics.splice(e,1)}_removeRecordsFromMesh(i){for(const e of i){const{instanceId:t,indexStart:o,indexCount:a,vertexStart:r,vertexCount:l}=e;this._meshes.get(t)?.remove(o,a,r,l)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const i of this._meshes.values())this.debugInfo.memory.bytesUsed+=i.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=i.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:i,bytesReserved:e}=this.debugInfo.memory,t=i/e,{minOrderedLength:o,length:a}=this.debugInfo.display;return e>dt&&t<_t||a>mt&&o/a({objectId:this._objectIdMap[i],displayId:i})):[]}};const Ge={shaders:{vertexShader:fe("tileInfo/tileInfo.vert"),fragmentShader:fe("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])},Ye=512,ye=512,$=16,M=8,hi=(ye-2*M)/5;let xi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:i}){i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;if(!e.isReady&&e instanceof gi&&e.hasData)return;if(this._loadWGLResources(t),a&&o!=null&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void o();t.bindVAO(this._outlineVertexArrayObject),t.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.LINE_STRIP,0,4);const r=this._getTexture(t,e);r&&(t.bindVAO(this._tileInfoVertexArrayObject),t.useProgram(this._tileInfoProgram),t.bindTexture(r,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",r.descriptor.width,r.descriptor.height),t.drawArrays(A.TRIANGLE_STRIP,0,4)),t.bindVAO()}_loadWGLResources(i){if(this._outlineProgram&&this._tileInfoProgram)return;const e=ce(i,ae),t=ce(i,Ge),o=new Int8Array([0,0,1,0,1,1,0,1]),a=k.createVertex(i,W.STATIC_DRAW,o),r=new K(i,ae.attributes,xe,new Map([["geometry",a]])),l=new Int8Array([0,0,1,0,0,1,1,1]),n=k.createVertex(i,W.STATIC_DRAW,l),s=new K(i,Ge.attributes,xe,new Map([["geometry",n]]));this._outlineProgram=e,this._tileInfoProgram=t,this._outlineVertexArrayObject=r,this._tileInfoVertexArrayObject=s}_getTexture(i,e){if(!this._ctx){const n=document.createElement("canvas");n.width=Ye,n.height=ye,this._ctx=n.getContext("2d")}if(!e.tileDebugInfoTexture){const n=new Lt;n.wrapMode=yt.CLAMP_TO_EDGE,n.samplingMode=B.LINEAR,n.isImmutable=!0,n.width=Ye,n.height=ye,e.tileDebugInfoTexture=new Mt(i,n)}const t=this._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t.textAlign="left",t.textBaseline="top",t.font=$-2+"px sans-serif",t.lineWidth=2,t.fillStyle="white",t.strokeStyle="black";const{debugSlot:o}=e;let a=M+hi*o;const r=`${o}) ${e.key.id} (${e.constructor.name})`;t.strokeText(r,M,a),t.fillText(r,M,a),a+=$;const{debugInfo:l}=e;if(l){const{length:n,minOrderedLength:s,minUnorderedLength:c,triangleCount:u}=l.display;if(n>0){const _=`Length: ${n}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(s){const _=`Min ordered length: ${s}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(c){const _=`Min unordered length: ${c}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(u>0){u>1e5&&(t.fillStyle="red",t.strokeStyle="white");const _=`Triangle count: ${u}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}const{bytesUsed:f,bytesReserved:d}=l.memory;if(t.fillStyle="white",t.strokeStyle="black",f>0||d>0){const _=`Memory usage: ${f} of ${d} bytes`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}}return e.tileDebugInfoTexture.setData(t.canvas),e.tileDebugInfoTexture}},yi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._patternMatrix=oe(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(i,e){const{context:t,painter:o,requestRender:a,allowDelayedRender:r}=i;this._loadWGLResources(i);const l=i.displayLevel,n=i.styleLayer,s=n.backgroundMaterial,c=o.vectorTilesMaterialManager,u=n.getPaintValue("background-color",l),f=n.getPaintValue("background-opacity",l),d=n.getPaintValue("background-pattern",l),_=d!==void 0,x=1|window.devicePixelRatio,g=i.spriteMosaic;let b,O;const S=x>Ze?2:1,T=this._programOptions;T.pattern=_;const v=c.getMaterialProgram(t,s,T);if(!r||a==null||v.compiled){if(t.bindVAO(this._vao),t.useProgram(v),_){const p=g.getMosaicItemPosition(d,!0);if(p!=null){const{tl:h,br:y,page:I}=p;b=y[0]-h[0],O=y[1]-h[1];const m=g.getPageSize(I);m!=null&&(g.bind(t,B.LINEAR,I,F),v.setUniform4f("u_tlbr",h[0],h[1],y[0],y[1]),v.setUniform2fv("u_mosaicSize",m),v.setUniform1i("u_texture",F))}v.setUniform1f("u_opacity",f)}else{const p=u[3]*f;this._color[0]=p*u[0],this._color[1]=p*u[1],this._color[2]=p*u[2],this._color[3]=p,v.setUniform4fv("u_color",this._color)}v.setUniform1f("u_depth",n.z||0);for(const p of e){if(v.setUniform1f("u_coord_range",p.rangeX),v.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),_){const h=Math.max(2**(Math.round(l)-p.key.level),1),y=S*p.width*h,I=y/Oe(b),m=y/Oe(O);this._patternMatrix[0]=I,this._patternMatrix[4]=m,v.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(U.EQUAL,0,255),t.drawArrays(A.TRIANGLE_STRIP,0,4)}}else a()}_loadWGLResources(i){if(this._vao)return;const{context:e,styleLayer:t}=i,o=t.backgroundMaterial,a=new Int8Array([0,0,1,0,0,1,1,1]),r=k.createVertex(e,W.STATIC_DRAW,a),l=new K(e,o.getAttributeLocations(),o.getLayoutInfo(),new Map([["geometry",r]]));this._vao=l}},Si=class extends Z{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(i,e){const{context:t,displayLevel:o,requiredLevel:a,state:r,painter:l,spriteMosaic:n,styleLayerUID:s,requestRender:c,allowDelayedRender:u}=i;if(!e.some(v=>v.layerData.get(s)?.circleIndexCount??!1))return;const f=i.styleLayer,d=f.circleMaterial,_=l.vectorTilesMaterialManager,x=1.2,g=f.getPaintValue("circle-translate",o),b=f.getPaintValue("circle-translate-anchor",o),O=this._programOptions,S=_.getMaterialProgram(t,d,O);if(u&&c!=null&&!S.compiled)return void c();t.useProgram(S),S.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),S.setUniform2fv("u_circleTranslation",g),S.setUniform1f("u_depth",f.z),S.setUniform1f("u_antialiasingWidth",x);let T=-1;for(const v of e){if(!v.layerData.has(s))continue;v.key.level!==T&&(T=v.key.level,d.setDataUniforms(S,o,f,T,n));const p=v.layerData.get(s);if(!p.circleIndexCount)continue;p.prepareForRendering(t);const h=p.vao;h!=null&&(t.bindVAO(h),S.setUniformMatrix3fv("u_dvsMat3",v.transforms.displayViewScreenMat3),a!==v.key.level?t.setStencilFunction(U.EQUAL,v.stencilRef,255):t.setStencilFunction(U.GREATER,255,255),t.drawElements(A.TRIANGLES,p.circleIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*p.circleIndexStart),v.triangleCount+=p.circleIndexCount/3)}}};const ke=1/65536;class Ti extends Z{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:o,renderPass:a,spriteMosaic:r,styleLayerUID:l}=e;let n=!1;for(const T of t)if(T.layerData.has(l)){const v=T.layerData.get(l);if(v.fillIndexCount>0||v.outlineIndexCount>0){n=!0;break}}if(!n)return;const s=e.styleLayer,c=s.getPaintProperty("fill-pattern"),u=c!==void 0,f=u&&c.isDataDriven;let d;if(u&&!f){const T=c.getValue(o);d=r.getMosaicItemPosition(T,!0)}const _=!u&&s.getPaintValue("fill-antialias",o);let x=!0,g=1;if(!u){const T=s.getPaintProperty("fill-color"),v=s.getPaintProperty("fill-opacity");if(!T?.isDataDriven&&!v?.isDataDriven){const p=s.getPaintValue("fill-color",o);g=s.getPaintValue("fill-opacity",o)*p[3],g>=1&&(x=!1)}}if(x&&a==="opaque")return;const b=s.getPaintValue("fill-translate",o),O=s.getPaintValue("fill-translate-anchor",o);(x||a!=="translucent")&&this._drawFill(e,l,s,t,b,O,u,d,f);const S=!s.hasDataDrivenOutlineColor&&s.outlineUsesFillColor&&g<1;_&&a!=="opaque"&&!S&&this._drawOutline(e,l,s,t,b,O)}_drawFill(e,t,o,a,r,l,n,s,c){if(n&&!c&&s==null)return;const{context:u,displayLevel:f,state:d,painter:_,pixelRatio:x,spriteMosaic:g,requestRender:b,allowDelayedRender:O}=e,S=o.fillMaterial,T=_.vectorTilesMaterialManager,v=x>Ze?2:1,p=this._fillProgramOptions;p.pattern=n;const h=T.getMaterialProgram(u,S,p);if(O&&b!=null&&!h.compiled)return void b();if(u.useProgram(h),s!=null){const{page:I}=s,m=g.getPageSize(I);m!=null&&(g.bind(u,B.LINEAR,I,F),h.setUniform2fv("u_mosaicSize",m),h.setUniform1i("u_texture",F))}h.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?d.displayMat3:d.displayViewMat3),h.setUniform2fv("u_fillTranslation",r),h.setUniform1f("u_depth",o.z+ke);let y=-1;for(const I of a){if(!I.layerData.has(t))continue;I.key.level!==y&&(y=I.key.level,S.setDataUniforms(h,f,o,y,g));const m=I.layerData.get(t);if(!m.fillIndexCount)continue;m.prepareForRendering(u);const V=m.fillVAO;if(V!=null){if(u.bindVAO(V),h.setUniformMatrix3fv("u_dvsMat3",I.transforms.displayViewScreenMat3),u.setStencilFunction(U.EQUAL,I.stencilRef,255),n){const E=Math.max(2**(Math.round(f)-I.key.level),1),D=I.rangeX/(v*I.width*E);h.setUniform1f("u_patternFactor",D)}if(c){const E=m.patternMap;if(!E)continue;for(const[D,L]of E){const q=g.getPageSize(D);q!=null&&(g.bind(u,B.LINEAR,D,F),h.setUniform2fv("u_mosaicSize",q),h.setUniform1i("u_texture",F),u.drawElements(A.TRIANGLES,L[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L[0]))}}else u.drawElements(A.TRIANGLES,m.fillIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*m.fillIndexStart);I.triangleCount+=m.fillIndexCount/3}}}_drawOutline(e,t,o,a,r,l){const{context:n,displayLevel:s,state:c,painter:u,pixelRatio:f,spriteMosaic:d,requestRender:_,allowDelayedRender:x}=e,g=o.outlineMaterial,b=u.vectorTilesMaterialManager,O=.75/f,S=this._outlineProgramOptions,T=b.getMaterialProgram(n,g,S);if(x&&_!=null&&!T.compiled)return void _();n.useProgram(T),T.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?c.displayMat3:c.displayViewMat3),T.setUniform2fv("u_fillTranslation",r),T.setUniform1f("u_depth",o.z+ke),T.setUniform1f("u_outline_width",O);let v=-1;for(const p of a){if(!p.layerData.has(t))continue;p.key.level!==v&&(v=p.key.level,g.setDataUniforms(T,s,o,v,d));const h=p.layerData.get(t);if(h.prepareForRendering(n),!h.outlineIndexCount)continue;const y=h.outlineVAO;y!=null&&(n.bindVAO(y),T.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),n.setStencilFunction(U.EQUAL,p.stencilRef,255),n.drawElements(A.TRIANGLES,h.outlineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*h.outlineIndexStart),p.triangleCount+=h.outlineIndexCount/3)}}}class bi extends Z{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:o,displayLevel:a,state:r,painter:l,pixelRatio:n,spriteMosaic:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e;if(!t.some(E=>E.layerData.get(c)?.lineIndexCount??!1))return;const d=e.styleLayer,_=d.lineMaterial,x=l.vectorTilesMaterialManager,g=d.getPaintValue("line-translate",a),b=d.getPaintValue("line-translate-anchor",a),O=d.getPaintProperty("line-pattern"),S=O!==void 0,T=S&&O.isDataDriven;let v,p;if(S&&!T){const E=O.getValue(a);v=s.getMosaicItemPosition(E)}let h=!1;if(!S){const E=d.getPaintProperty("line-dasharray");if(p=E!==void 0,h=p&&E.isDataDriven,p&&!h){const D=E.getValue(a),L=d.getDashKey(D,d.getLayoutValue("line-cap",a));v=s.getMosaicItemPosition(L)}}const y=1/n,I=this._programOptions;I.pattern=S,I.sdf=p;const m=x.getMaterialProgram(o,_,I);if(f&&u!=null&&!m.compiled)return void u();if(o.useProgram(m),m.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),m.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),m.setUniform2fv("u_lineTranslation",g),m.setUniform1f("u_depth",d.z),m.setUniform1f("u_antialiasing",y),v&&v!=null){const{page:E}=v,D=s.getPageSize(E);D!=null&&(s.bind(o,B.LINEAR,E,F),m.setUniform2fv("u_mosaicSize",D),m.setUniform1i("u_texture",F))}let V=-1;for(const E of t){if(!E.layerData.has(c))continue;E.key.level!==V&&(V=E.key.level,_.setDataUniforms(m,a,d,V,s));const D=2**(a-V)/n;m.setUniform1f("u_zoomFactor",D);const L=E.layerData.get(c);if(!L.lineIndexCount)continue;L.prepareForRendering(o);const q=L.vao;if(q!=null){if(o.bindVAO(q),m.setUniformMatrix3fv("u_dvsMat3",E.transforms.displayViewScreenMat3),o.setStencilFunction(U.EQUAL,E.stencilRef,255),T||h){const re=L.patternMap;if(!re)continue;for(const[C,X]of re){const z=s.getPageSize(C);z!=null&&(s.bind(o,B.LINEAR,C,F),m.setUniform2fv("u_mosaicSize",z),m.setUniform1i("u_texture",F),o.drawElements(A.TRIANGLES,X[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*X[0]))}}else o.drawElements(A.TRIANGLES,L.lineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);E.triangleCount+=L.lineIndexCount/3}}}}const Ii=256/360,Ei=1/Math.LN2;function Oi(i,e){return(i%=e)>=0?i:i+e}function He(i){return Oi(i*Ii,256)}function ro(i){return Math.log(i)*Ei}const Ai=1/65536;class Pi extends Z{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=zt()}dispose(){}drawMany(e,t){const o=e.styleLayer;this._drawIcons(e,o,t),this._drawText(e,o,t)}_drawIcons(e,t,o){const{context:a,displayLevel:r,painter:l,spriteMosaic:n,state:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e,d=t.iconMaterial,_=l.vectorTilesMaterialManager;let x,g=!1;for(const m of o)if(m.layerData.has(c)&&(x=m.layerData.get(c),x.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const b=t.getPaintValue("icon-translate",r),O=t.getPaintValue("icon-translate-anchor",r);let S=t.getLayoutValue("icon-rotation-alignment",r);S===G.AUTO&&(S=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const T=S===G.MAP,v=t.getLayoutValue("icon-keep-upright",r)&&T,p=x.isIconSDF,h=this._iconProgramOptions;h.sdf=p;const y=_.getMaterialProgram(a,d,h);if(f&&u!=null&&!y.compiled)return void u();a.useProgram(y),y.setUniformMatrix3fv("u_displayViewMat3",S===G.MAP?s.displayViewMat3:s.displayMat3),y.setUniformMatrix3fv("u_displayMat3",O===J.VIEWPORT?s.displayMat3:s.displayViewMat3),y.setUniform2fv("u_iconTranslation",b),y.setUniform1f("u_depth",t.z),y.setUniform1f("u_mapRotation",He(s.rotation)),y.setUniform1f("u_keepUpright",v?1:0),y.setUniform1f("u_level",10*r),y.setUniform1i("u_texture",F),y.setUniform1f("u_fadeDuration",Re/1e3);let I=-1;for(const m of o){if(!m.layerData.has(c)||(m.key.level!==I&&(I=m.key.level,d.setDataUniforms(y,r,t,I,n)),x=m.layerData.get(c),x.iconPerPageElementsMap.size===0))continue;x.prepareForRendering(a),x.updateOpacityInfo();const V=x.iconVAO;if(V!=null){a.bindVAO(V),y.setUniformMatrix3fv("u_dvsMat3",m.transforms.displayViewScreenMat3),y.setUniform1f("u_time",(performance.now()-x.lastOpacityUpdate)/1e3);for(const[E,D]of x.iconPerPageElementsMap)this._renderIconRange(e,y,D,E,m)}}}_renderIconRange(e,t,o,a,r){const{context:l,spriteMosaic:n}=e;this._spritesTextureSize[0]=n.getWidth(a)/4,this._spritesTextureSize[1]=n.getHeight(a)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),n.bind(l,B.LINEAR,a,F),this._setStencilState(e,r),l.drawElements(A.TRIANGLES,o[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*o[0]),r.triangleCount+=o[1]/3}_drawText(e,t,o){const{context:a,displayLevel:r,glyphMosaic:l,painter:n,pixelRatio:s,spriteMosaic:c,state:u,styleLayerUID:f,requestRender:d,allowDelayedRender:_}=e,x=t.textMaterial,g=n.vectorTilesMaterialManager;let b,O=!1;for(const z of o)if(z.layerData.has(f)&&(b=z.layerData.get(f),b.glyphPerPageElementsMap.size>0)){O=!0;break}if(!O)return;const S=t.getPaintProperty("text-opacity");if(S&&!S.isDataDriven&&S.getValue(r)===0)return;const T=t.getPaintProperty("text-color"),v=!T||T.isDataDriven||T.getValue(r)[3]>0,p=t.getPaintProperty("text-halo-width"),h=t.getPaintProperty("text-halo-color"),y=(!p||p.isDataDriven||p.getValue(r)>0)&&(!h||h.isDataDriven||h.getValue(r)[3]>0);if(!v&&!y)return;const I=24/8;let m=t.getLayoutValue("text-rotation-alignment",r);m===G.AUTO&&(m=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const V=m===G.MAP,E=t.getLayoutValue("text-keep-upright",r)&&V,D=.8*I/s;this._glyphTextureSize||(this._glyphTextureSize=Vt(l.width/4,l.height/4));const L=t.getPaintValue("text-translate",r),q=t.getPaintValue("text-translate-anchor",r),re=this._sdfProgramOptions,C=g.getMaterialProgram(a,x,re);if(_&&d!=null&&!C.compiled)return void d();a.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",m===G.MAP?u.displayViewMat3:u.displayMat3),C.setUniformMatrix3fv("u_displayMat3",q===J.VIEWPORT?u.displayMat3:u.displayViewMat3),C.setUniform2fv("u_textTranslation",L),C.setUniform1f("u_depth",t.z+Ai),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",He(u.rotation)),C.setUniform1f("u_keepUpright",E?1:0),C.setUniform1f("u_level",10*r),C.setUniform1i("u_texture",Pe),C.setUniform1f("u_antialiasingWidth",D),C.setUniform1f("u_fadeDuration",Re/1e3);let X=-1;for(const z of o){if(!z.layerData.has(f)||(z.key.level!==X&&(X=z.key.level,x.setDataUniforms(C,r,t,X,c)),b=z.layerData.get(f),b.glyphPerPageElementsMap.size===0))continue;b.prepareForRendering(a),b.updateOpacityInfo();const Ie=b.textVAO;if(Ie==null)continue;a.bindVAO(Ie),C.setUniformMatrix3fv("u_dvsMat3",z.transforms.displayViewScreenMat3),this._setStencilState(e,z);const st=(performance.now()-b.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",st),b.glyphPerPageElementsMap.forEach((ut,ct)=>{this._renderGlyphRange(a,ut,ct,l,C,y,v,z)})}}_renderGlyphRange(e,t,o,a,r,l,n,s){a.bind(e,B.LINEAR,o,Pe),l&&(r.setUniform1f("u_halo",1),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3),n&&(r.setUniform1f("u_halo",0),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:o,is3D:a,stencilSymbols:r}=e;if(o.setStencilTestEnabled(!0),r)return o.setStencilWriteMask(255),void o.setStencilFunction(U.ALWAYS,t.stencilRef,255);o.setStencilWriteMask(0),a?o.setStencilFunction(U.EQUAL,t.stencilRef,255):o.setStencilFunction(U.GREATER,255,255)}}const Ci={clip:ti,stencil:ii,bitmap:Yt,tileDebugInfo:xi,vtlBackground:yi,vtlFill:Ti,vtlLine:bi,vtlCircle:Si,vtlSymbol:Pi},Di=i=>{switch(i.BYTES_PER_ELEMENT){case 1:return P.UNSIGNED_BYTE;case 2:return P.UNSIGNED_SHORT;case 4:return P.UNSIGNED_INT;default:throw new Te("Cannot get DataType of array")}},Ri=(i,e,t,o)=>{let a=0;for(let r=1;r0:a<0},We=({coords:i,lengths:e},t)=>{const o=[];for(let a=0,r=0;ae?.dispose()),this._cache.indexBuffer=this._cache.vertexBuffers=null}get elementType(){return Di(this.indices)}getIndexBuffer(e,t=W.STATIC_DRAW){return this._cache.indexBuffer??=k.createIndex(e,t,this.indices),this._cache.indexBuffer}getVertexBuffers(e,t=W.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce((o,a)=>(o.push([a,k.createVertex(e,t,this.vertices[a])]),o),new Array)),this._cache.vertexBuffers}}class be extends $e{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=ft(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new be(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,o,a){const[r,l]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===r&&this._lastHeight===l||(this._lastWidth=r,this._lastHeight=l,this._destroyGL()),this._cache.vao==null){const n=this._createMesh(t,this._clip),s=n.getIndexBuffer(e),c=n.getVertexBuffers(e);this._cache.mesh=n,this._cache.vao=new K(e,o,a,c,s)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:oe()}}_invalidate(){this._destroyGL(),this.requestRender()}_createMesh(e,t){switch(t.type){case"rect":return w.fromScreenExtent(Ot(t,e.size[0],e.size[1]));case"path":return w.fromPath(t);case"geometry":return w.fromGeometry(e,t);default:return Se.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new Te("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),w.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}}class lo extends Dt{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Ci.clip],target:()=>this._clippingInfos,drawPhase:ee.MAP|ee.LABEL|ee.LABEL_ALPHA|ee.DEBUG|ee.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>be.fromClipArea(this.stage,t))),this.requestRender()}}export{Ut as F,oi as K,lo as N,ro as R,ii as Z,oo as a,gi as i,Z as k,ao as m,io as n,fe as o,xi as r,Ci as s}; diff --git a/custom-toc-separator/assets/WGLContainer-LxgEo4I_-DR17gokR.js b/custom-toc-separator/assets/WGLContainer-LxgEo4I_-DR17gokR.js deleted file mode 100644 index 72ec6be0..00000000 --- a/custom-toc-separator/assets/WGLContainer-LxgEo4I_-DR17gokR.js +++ /dev/null @@ -1,3619 +0,0 @@ -import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./story-OUarUCIt.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{r as k}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-DDmsm7e7.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{s as Rt}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-Bv29bzNX.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; -void main() { -gl_FragColor = u_color; -}`,"background.vert":`attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform mediump vec2 u_coord_range; -uniform mediump float u_depth; -void main() { -vec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0); -gl_Position = vec4(v_pos.xy, 0.0, 1.0); -}`},bitBlit:{"bitBlit.frag":`uniform lowp sampler2D u_tex; -uniform lowp float u_opacity; -varying mediump vec2 v_uv; -void main() { -lowp vec4 color = texture2D(u_tex, v_uv); -gl_FragColor = color * u_opacity; -}`,"bitBlit.vert":`attribute vec2 a_pos; -attribute vec2 a_tex; -varying mediump vec2 v_uv; -void main(void) { -gl_Position = vec4(a_pos , 0.0, 1.0); -v_uv = a_tex; -}`},debug:{overlay:{"overlay.frag":`precision mediump float; -varying vec4 v_color; -void main(void) { -gl_FragColor = v_color; -}`,"overlay.vert":`attribute vec3 a_PositionAndFlags; -uniform mat3 u_dvsMat3; -uniform vec4 u_colors[4]; -uniform float u_opacities[4]; -varying vec4 v_color; -void main(void) { -vec2 position = a_PositionAndFlags.xy; -float flags = a_PositionAndFlags.z; -int colorIndex = int(mod(flags, 4.0)); -vec4 color; -for (int i = 0; i < 4; i++) { -color = u_colors[i]; -if (i == colorIndex) { -break; -} -} -int opacityIndex = int(mod(floor(flags / 4.0), 4.0)); -float opacity; -for (int i = 0; i < 4; i++) { -opacity = u_opacities[i]; -if (i == opacityIndex) { -break; -} -} -v_color = color * opacity; -gl_Position = vec4((u_dvsMat3 * vec3(position, 1.0)).xy, 0.0, 1.0); -}`}},dot:{dot:{"dot.frag":`precision mediump float; -varying vec4 v_color; -varying float v_dotRatio; -varying float v_invEdgeRatio; -uniform highp float u_tileZoomFactor; -void main() -{ -float dist = length(gl_PointCoord - vec2(.5, .5)) * 2.; -float alpha = smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.); -gl_FragColor = v_color * alpha; -}`,"dot.vert":`precision highp float; -attribute vec2 a_pos; -uniform sampler2D u_texture; -uniform highp mat3 u_dvsMat3; -uniform highp float u_tileZoomFactor; -uniform highp float u_dotSize; -uniform highp float u_pixelRatio; -varying vec2 v_pos; -varying vec4 v_color; -varying float v_dotRatio; -varying float v_invEdgeRatio; -const float EPSILON = 0.000001; -void main() -{ -mat3 tileToTileTexture = mat3( 1., 0., 0., -0., -1., 0., -0., 1., 1. ); -vec3 texCoords = tileToTileTexture * vec3(a_pos.xy / 512., 1.); -v_color = texture2D(u_texture, texCoords.xy); -float smoothEdgeWidth = max(u_dotSize / 2., 1.) ; -float z = 0.; -z += 2.0 * step(v_color.a, EPSILON); -gl_PointSize = (smoothEdgeWidth + u_dotSize); -gl_Position = vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.); -v_dotRatio = u_dotSize / gl_PointSize; -v_invEdgeRatio = -1. / ( smoothEdgeWidth / gl_PointSize ); -gl_PointSize *= (u_pixelRatio * u_tileZoomFactor); -}`}},filtering:{"bicubic.glsl":`vec4 computeWeights(float v) { -float b = 1.0 / 6.0; -float v2 = v * v; -float v3 = v2 * v; -float w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0); -float w1 = b * (3.0 * v3 - 6.0 * v2 + 4.0); -float w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0); -float w3 = b * v3; -return vec4(w0, w1, w2, w3); -} -vec4 bicubicOffsetsAndWeights(float v) { -vec4 w = computeWeights(v); -float g0 = w.x + w.y; -float g1 = w.z + w.w; -float h0 = 1.0 - (w.y / g0) + v; -float h1 = 1.0 + (w.w / g1) - v; -return vec4(h0, h1, g0, g1); -} -vec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) { -vec2 eX = vec2(1.0 / texSize.x, 0.0); -vec2 eY = vec2(0.0, 1.0 / texSize.y); -vec2 texel = coords * texSize - 0.5; -vec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz; -vec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz; -vec2 coords10 = coords + hgX.x * eX; -vec2 coords00 = coords - hgX.y * eX; -vec2 coords11 = coords10 + hgY.x * eY; -vec2 coords01 = coords00 + hgY.x * eY; -coords10 = coords10 - hgY.y * eY; -coords00 = coords00 - hgY.y * eY; -vec4 color00 = texture2D(sampler, coords00); -vec4 color10 = texture2D(sampler, coords10); -vec4 color01 = texture2D(sampler, coords01); -vec4 color11 = texture2D(sampler, coords11); -color00 = mix(color00, color01, hgY.z); -color10 = mix(color10, color11, hgY.z); -color00 = mix(color00, color10, hgX.z); -return color00; -}`,"bilinear.glsl":`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { -vec2 texelStart = floor(coords * texSize); -vec2 coord0 = texelStart / texSize; -vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; -vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; -vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; -vec4 color0 = texture2D(sampler, coord0); -vec4 color1 = texture2D(sampler, coord1); -vec4 color2 = texture2D(sampler, coord2); -vec4 color3 = texture2D(sampler, coord3); -vec2 blend = fract(coords * texSize); -vec4 color01 = mix(color0, color1, blend.x); -vec4 color23 = mix(color2, color3, blend.x); -vec4 color = mix(color01, color23, blend.y); -#ifdef NNEDGE -float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); -color = color * alpha + (1.0 - alpha) * texture2D(sampler, coords); -#endif -return color; -}`,"epx.glsl":`vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) { -vec2 invSize = 1.0 / texSize; -vec2 texel = coords * texSize; -vec2 texel_i = floor(texel); -vec2 texel_frac = fract(texel); -vec4 colorP = texture2D(sampler, texel_i * invSize); -vec4 colorP1 = vec4(colorP); -vec4 colorP2 = vec4(colorP); -vec4 colorP3 = vec4(colorP); -vec4 colorP4 = vec4(colorP); -vec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize); -vec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize); -vec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize); -vec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize); -if (colorC == colorA && colorC != colorD && colorA != colorB) { -colorP1 = colorA; -} -if (colorA == colorB && colorA != colorC && colorB != colorD) { -colorP2 = colorB; -} -if (colorD == colorC && colorD != colorB && colorC != colorA) { -colorP3 = colorC; -} -if (colorB == colorD && colorB != colorA && colorD != colorC) { -colorP4 = colorD; -} -vec4 colorP12 = mix(colorP1, colorP2, texel_frac.x); -vec4 colorP34 = mix(colorP1, colorP2, texel_frac.x); -return mix(colorP12, colorP34, texel_frac.y); -}`},heatmap:{heatmapResolve:{"heatmapResolve.frag":`precision highp float; -#ifdef HEATMAP_PRECISION_HALF_FLOAT -#define COMPRESSION_FACTOR 4.0 -#else -#define COMPRESSION_FACTOR 1.0 -#endif -uniform sampler2D u_texture; -uniform sampler2D u_gradient; -uniform vec2 u_densityMinAndInvRange; -uniform float u_densityNormalization; -varying vec2 v_uv; -void main() { -vec4 data = texture2D(u_texture, v_uv); -float density = data.r * COMPRESSION_FACTOR; -density *= u_densityNormalization; -density = (density - u_densityMinAndInvRange.x) * u_densityMinAndInvRange.y; -vec4 color = texture2D(u_gradient, vec2(density, 0.5)); -gl_FragColor = vec4(color.rgb * color.a, color.a); -}`,"heatmapResolve.vert":`precision highp float; -attribute vec2 a_pos; -varying vec2 v_uv; -void main() { -v_uv = a_pos; -gl_Position = vec4(a_pos * 2.0 - 1.0, 1., 1.); -}`}},highlight:{"blur.frag":`varying mediump vec2 v_texcoord; -uniform mediump vec4 u_direction; -uniform mediump mat4 u_channelSelector; -uniform mediump float u_sigma; -uniform sampler2D u_texture; -mediump float gauss1(mediump vec2 dir) { -return exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma)); -} -mediump vec4 selectChannel(mediump vec4 sample) { -return u_channelSelector * sample; -} -void accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) { -mediump float w = gauss1(i * u_direction.xy); -tot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w; -weight += w; -} -void main(void) { -mediump float tot = 0.0; -mediump float weight = 0.0; -accumGauss1(-5.0, tot, weight); -accumGauss1(-4.0, tot, weight); -accumGauss1(-3.0, tot, weight); -accumGauss1(-2.0, tot, weight); -accumGauss1(-1.0, tot, weight); -accumGauss1(0.0, tot, weight); -accumGauss1(1.0, tot, weight); -accumGauss1(2.0, tot, weight); -accumGauss1(3.0, tot, weight); -accumGauss1(4.0, tot, weight); -accumGauss1(5.0, tot, weight); -gl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight); -}`,"highlight.frag":`varying mediump vec2 v_texcoord; -uniform sampler2D u_texture; -uniform mediump float u_sigma; -uniform sampler2D u_shade; -uniform mediump vec2 u_minMaxDistance; -mediump float estimateDistance() { -mediump float y = texture2D(u_texture, v_texcoord)[3]; -const mediump float y0 = 0.5; -mediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma); -mediump float d = (y - y0) / m0; -return d; -} -mediump vec4 shade(mediump float d) { -mediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x); -mappedDistance = clamp(mappedDistance, 0.0, 1.0); -return texture2D(u_shade, vec2(mappedDistance, 0.5)); -} -void main(void) { -mediump float d = estimateDistance(); -gl_FragColor = shade(d); -}`,"textured.vert":`attribute mediump vec2 a_position; -attribute mediump vec2 a_texcoord; -varying mediump vec2 v_texcoord; -void main(void) { -gl_Position = vec4(a_position, 0.0, 1.0); -v_texcoord = a_texcoord; -}`},materials:{"attributeData.glsl":`uniform highp sampler2D filterFlags; -uniform highp sampler2D animation; -uniform highp sampler2D gpgpu; -uniform highp sampler2D visualVariableData; -uniform highp sampler2D dataDriven0; -uniform highp sampler2D dataDriven1; -uniform highp sampler2D dataDriven2; -uniform float size; -highp vec2 getAttributeDataCoords(in highp vec3 id) { -highp vec3 texel = unpackDisplayIdTexel(id); -highp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256); -highp float col = mod(u32, size); -highp float row = (u32 - col) / size; -highp float u = col / size; -highp float v = row / size; -return vec2(u, v); -} -highp vec2 getAttributeDataTextureCoords(in highp vec3 id) { -return (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(size)); -} -highp vec4 getFilterData(in highp vec3 id) { -vec2 coords = getAttributeDataCoords(id); -return texture2D(filterFlags, coords); -} -highp vec4 getAnimation(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(animation, coords); -} -highp vec4 getVisualVariableData(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(visualVariableData, coords); -} -highp vec4 getDataDriven0(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven0, coords); -} -highp vec4 getDataDriven1(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven1, coords); -} -highp vec4 getGPGPU(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(gpgpu, coords); -} -highp vec4 getDataDriven2(in highp vec3 id) { -highp vec2 coords = getAttributeDataCoords(id); -return texture2D(dataDriven2, coords); -} -float u88VVToFloat(in vec2 v) { -bool isMagic = v.x == 255.0 && v.y == 255.0; -if (isMagic) { -return NAN_MAGIC_NUMBER; -} -return (v.x + v.y * float(0x100)) - 32768.0; -}`,"barycentric.glsl":`float inTriangle(vec3 bary) { -vec3 absBary = abs(bary); -return step((absBary.x + absBary.y + absBary.z), 1.05); -} -vec3 xyToBarycentric(in vec2 pos, in vec2 v0, in vec2 v1, in vec2 v2) { -mat3 xyToBarycentricMat3 = mat3( -v1.x * v2.y - v2.x * v1.y, v2.x * v0.y - v0.x * v2.y, v0.x * v1.y - v1.x * v0.y, -v1.y - v2.y, v2.y - v0.y, v0.y - v1.y, -v2.x - v1.x, v0.x - v2.x, v1.x - v0.x -); -float A2 = v0.x * (v1.y - v2.y) + v1.x * (v2.y - v0.y) + v2.x * (v0.y - v1.y); -return (1. / A2) * xyToBarycentricMat3 * vec3(1., pos); -}`,"constants.glsl":`const float C_DEG_TO_RAD = 3.14159265359 / 180.0; -const float C_256_TO_RAD = 3.14159265359 / 128.0; -const float C_RAD_TO_DEG = 180.0 / 3.141592654; -const float POSITION_PRECISION = 1.0 / 8.0; -const float FILL_POSITION_PRECISION = 1.0 / 1.0; -const float SOFT_EDGE_RATIO = 1.0; -const float THIN_LINE_WIDTH_FACTOR = 1.1; -const float THIN_LINE_HALF_WIDTH = 1.0; -const float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0; -const float OFFSET_PRECISION = 1.0 / 8.0; -const float OUTLINE_SCALE = 1.0 / 5.0; -const float SDF_FONT_SIZE = 24.0; -const float MAX_SDF_DISTANCE = 8.0; -const float PLACEMENT_PADDING = 8.0; -const float EPSILON = 0.00001; -const float EPSILON_HITTEST = 0.05; -const int MAX_FILTER_COUNT = 2; -const int ATTR_VV_SIZE = 0; -const int ATTR_VV_COLOR = 1; -const int ATTR_VV_OPACITY = 2; -const int ATTR_VV_ROTATION = 3; -const highp float NAN_MAGIC_NUMBER = 1e-30; -const int BITSET_GENERIC_LOCK_COLOR = 1; -const int BITSET_GENERIC_CONSIDER_ALPHA_ONLY = 4; -const int BITSET_MARKER_ALIGNMENT_MAP = 0; -const int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2; -const int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3; -const int BITSET_TYPE_FILL_OUTLINE = 0; -const int BITSET_FILL_RANDOM_PATTERN_OFFSET = 2; -const int BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR = 3; -const int BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR = 5; -const int BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR = 6; -const int BITSET_LINE_SCALE_DASH = 2;`,fill:{"common.glsl":`#include -#ifdef PATTERN -uniform mediump vec2 u_mosaicSize; -varying mediump float v_sampleAlphaOnly; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -uniform lowp vec4 u_isActive[ 2 ]; -uniform highp float u_dotValue; -uniform highp float u_tileDotsOverArea; -uniform highp float u_dotTextureDotCount; -uniform mediump float u_tileZoomFactor; -#endif -varying highp vec3 v_id; -varying lowp vec4 v_color; -varying lowp float v_opacity; -varying mediump vec4 v_aux1; -#ifdef PATTERN -varying mediump vec2 v_tileTextureCoord; -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -varying lowp float v_isOutline; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -varying highp vec2 v_dotTextureCoords; -varying highp vec4 v_dotThresholds[ 2 ]; -#endif`,"fill.frag":`precision highp float; -#include -#include -#include -#ifdef PATTERN -uniform lowp sampler2D u_texture; -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -uniform mediump mat4 u_dotColors[ 2 ]; -uniform sampler2D u_dotTextures[ 2 ]; -uniform vec4 u_dotBackgroundColor; -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#include -#include -lowp vec4 drawLine() { -float v_lineWidth = v_aux1.x; -vec2 v_normal = v_aux1.yz; -LineData inputs = LineData( -v_color, -v_normal, -v_lineWidth, -v_opacity, -v_id -); -return shadeLine(inputs); -} -#endif -lowp vec4 drawFill() { -lowp vec4 out_color = vec4(0.); -#ifdef HITTEST -out_color = v_color; -#elif defined(PATTERN) -mediump vec4 v_tlbr = v_aux1; -mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); -mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); -lowp vec4 color = texture2D(u_texture, samplePos); -if (v_sampleAlphaOnly > 0.5) { -color.rgb = vec3(color.a); -} -out_color = v_opacity * v_color * color; -#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY && !defined(HIGHLIGHT) -vec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords); -vec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords); -vec4 difference0 = v_dotThresholds[0] - textureThresholds0; -vec4 difference1 = v_dotThresholds[1] - textureThresholds1; -#ifdef DD_DOT_BLENDING -vec4 isPositive0 = step(0.0, difference0); -vec4 isPositive1 = step(0.0, difference1); -float weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1); -float lessThanEqZero = step(weightSum, 0.0); -float greaterThanZero = 1.0 - lessThanEqZero ; -float divisor = (weightSum + lessThanEqZero); -vec4 weights0 = difference0 * isPositive0 / divisor; -vec4 weights1 = difference1 * isPositive1 / divisor; -vec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1; -vec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor; -#else -float diffMax = max(max4(difference0), max4(difference1)); -float lessThanZero = step(diffMax, 0.0); -float greaterOrEqZero = 1.0 - lessThanZero; -vec4 isMax0 = step(diffMax, difference0); -vec4 isMax1 = step(diffMax, difference1); -vec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1; -vec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor; -#endif -out_color = preEffectColor; -#else -out_color = v_opacity * v_color; -#endif -#ifdef HIGHLIGHT -out_color.a = 1.0; -#endif -return out_color; -} -void main() { -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -if (v_isOutline > 0.5) { -gl_FragColor = drawLine(); -} else { -gl_FragColor = drawFill(); -} -#else -gl_FragColor = drawFill(); -#endif -}`,"fill.vert":`#include -#define PACKED_LINE -precision highp float; -attribute float a_bitset; -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -attribute float a_inverseArea; -vec4 a_color = vec4(0.0, 0.0, 0.0, 1.0); -vec2 a_zoomRange = vec2(0.0, 10000.0); -#else -attribute vec4 a_color; -attribute vec4 a_aux2; -attribute vec4 a_aux3; -#ifndef SYMBOLOGY_TYPE_IS_SIMPLE_LIKE -attribute vec4 a_aux1; -attribute vec2 a_zoomRange; -#else -vec2 a_zoomRange = vec2(0.0, 10000.0); -#endif -#endif -uniform vec2 u_tileOffset; -uniform vec2 u_maxIntNumOfCrossing; -#include -#include -#include -#include -const float INV_SCALE_COMPRESSION_FACTOR = 1.0 / 128.0; -const float MAX_REPRESENTABLE_INT = 16777216.0; -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -vec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) { -return featureAttrOverFeatureArea * (1.0 / dotValue) * (1.0 / tileDotsOverArea); -} -#endif -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#include -#include -void drawLine(out lowp vec4 out_color, out highp vec3 out_pos) { -LineData outputs = buildLine( -out_pos, -a_id, -a_pos, -a_color, -(a_aux3.xy - 128.) / 16., -(a_aux3.zw - 128.) / 16., -0., -a_aux2.z / 16., -a_bitset, -vec4(0.), -vec2(0.), -a_aux2.w / 16. -); -v_id = outputs.id; -v_opacity = outputs.opacity; -v_aux1 = vec4(outputs.lineHalfWidth, outputs.normal, 0.); -out_color = outputs.color; -} -#endif -void drawFill(out lowp vec4 out_color, out highp vec3 out_pos) { -float a_bitSet = a_bitset; -out_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); -v_opacity = getOpacity(); -v_id = norm(a_id); -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -mat3 tileToTileNormalized = mat3( 2. / 512., 0., 0., -0., -2. / 512., 0., --1., 1., 1. ); -out_pos = tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.); -#else -out_pos = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); -#endif -#ifdef PATTERN -vec4 a_tlbr = a_aux1; -float a_width = a_aux2.x; -float a_height = a_aux2.y; -vec2 a_offset = a_aux2.zw; -vec2 a_scale = a_aux3.xy; -float a_angle = a_aux3.z; -if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR) > 0.5) { -a_width *= INV_SCALE_COMPRESSION_FACTOR; -} -if (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR) > 0.5) { -a_height *= INV_SCALE_COMPRESSION_FACTOR; -} -vec2 scale = INV_SCALE_COMPRESSION_FACTOR * a_scale; -float width = u_zoomFactor * a_width * scale.x; -float height = u_zoomFactor * a_height * scale.y; -float angle = C_256_TO_RAD * a_angle; -float sinA = sin(angle); -float cosA = cos(angle); -float dx = 0.0; -float dy = 0.0; -if (getBit(a_bitset, BITSET_FILL_RANDOM_PATTERN_OFFSET) > 0.5) { -float id = rgba2float(vec4(a_id, 0.0)); -dx = rand(vec2(id, 0.0)); -dy = rand(vec2(0.0, id)); -} -mat3 patternMatrix = mat3(cosA / width, sinA / height, 0, --sinA / width, cosA / height, 0, -dx, dy, 1); -vec2 patternSize = vec2(a_width, a_height); -vec2 numPatternsPerMaxInt = vec2(MAX_REPRESENTABLE_INT) / patternSize; -vec2 maxIntCrossingOffsetCorrection = patternSize * fract(u_maxIntNumOfCrossing * numPatternsPerMaxInt); -vec2 tileOffset = u_tileOffset + maxIntCrossingOffsetCorrection - 0.5 * patternSize; -tileOffset = vec2(tileOffset.x * cosA - tileOffset.y * sinA, tileOffset.x * sinA + tileOffset.y * cosA); -tileOffset = mod(tileOffset, patternSize); -vec2 symbolOffset = u_zoomFactor * scale * vec2(a_offset - tileOffset) / vec2(width, height); -v_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset; -v_aux1 = a_tlbr / u_mosaicSize.xyxy; -v_sampleAlphaOnly = getBit(a_bitset, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); -if (getBit(a_bitSet, BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR) > 0.5) { -#ifdef VV_COLOR -v_sampleAlphaOnly *= (1.0 - float(isNan(VV_ADATA[ATTR_VV_COLOR]))) * (1.0 - getBit(a_bitSet, BITSET_GENERIC_LOCK_COLOR)); -#else -v_sampleAlphaOnly = 0.0; -#endif -} -#elif SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_DOT_DENSITY -vec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea; -vec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea; -float size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio; -v_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea); -v_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea); -v_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size; -#endif -} -#ifdef HITTEST -void draw(out lowp vec4 out_color, out highp vec3 out_pos) { -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -if (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) > 0.5) { -out_pos = vec3(0., 0., 2.); -return; -} -#endif -hittestFill(out_color, out_pos); -gl_PointSize = 1.0; -} -#elif defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -void draw(out lowp vec4 out_color, out highp vec3 out_pos) { -v_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE); -if (v_isOutline > 0.5) { -drawLine(out_color, out_pos); -} else { -drawFill(out_color, out_pos); -} -} -#else -#define draw drawFill -#endif -void main() -{ -INIT; -highp vec3 pos = vec3(0.); -highp vec4 color = vec4(0.); -draw(color, pos); -v_color = color; -gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); -}`,"hittest.glsl":`#ifdef HITTEST -#include -attribute vec2 a_pos1; -attribute vec2 a_pos2; -void hittestFill( -out lowp vec4 out_color, -out highp vec3 out_pos -) { -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.); -vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.); -vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.); -float hittestDist = u_hittestDist; -float dist = distPointTriangle(u_hittestPos, pos.xy, pos1.xy, pos2.xy); -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if (dist < 0. || dist >= hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, dist == 0. ? (1. / 255.) : 0.); -} -#endif`},hittest:{"common.glsl":`#ifdef HITTEST -uniform float hittestDist; -uniform highp vec2 hittestPos; -float projectScalar(vec2 a, vec2 b) { -return dot(a, normalize(b)); -} -float distPointSegment(vec2 p0, vec2 p1, vec2 p2) { -vec2 L = p2 - p1; -vec2 A = p0 - p1; -float projAL = projectScalar(A, L); -float t = clamp(projAL / length(L), 0., 1.); -return distance(p0, p1 + t * (p2 - p1)); -} -void hittestMarker(out lowp vec4 out_color, out highp vec3 out_pos, in highp vec3 pos, float size) { -float dist = distance(pos, vec3(hittestPos, 1.)); -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if ((dist - size) > hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, (dist - size) < 0. ? (1. / 255.) : 0.); -} -float intersectPointTriangleBary(vec2 p, vec2 a, vec2 b, vec2 c) { -return inTriangle(xyToBarycentric(p, a, b, c)); -} -float distPointTriangle(vec2 p, vec2 a, vec2 b, vec2 c) { -vec2 ba = b - a; -vec2 ca = c - a; -float crossProduct = ba.x * ca.y - ca.x * ba.y; -bool isParallel = crossProduct < EPSILON_HITTEST && crossProduct > -EPSILON_HITTEST; -if (isParallel) { -return -1.; -} -if (intersectPointTriangleBary(p.xy, a, b, c) == 1.) { -return 0.; -} -float distAB = distPointSegment(p, a, b); -float distBC = distPointSegment(p, b, c); -float distCA = distPointSegment(p, c, a); -return min(min(distAB, distBC), distCA); -} -#endif`},icon:{"common.glsl":`#include -uniform lowp vec2 u_mosaicSize; -varying lowp vec4 v_color; -varying highp vec3 v_id; -varying highp vec4 v_sizeTex; -varying mediump vec3 v_pos; -varying lowp float v_opacity; -uniform lowp sampler2D u_texture; -#ifdef SDF -varying lowp vec4 v_outlineColor; -varying mediump float v_outlineWidth; -varying mediump float v_distRatio; -varying mediump float v_overridingOutlineColor; -varying mediump float v_isThin; -#endif -#ifdef SDF -vec4 getColor(vec2 v_size, vec2 v_tex) { -#ifdef HITTEST -lowp vec4 fillPixelColor = vec4(1.0); -#else -lowp vec4 fillPixelColor = v_color; -#endif -float d = 0.5 - rgba2float(texture2D(u_texture, v_tex)); -float size = max(v_size.x, v_size.y); -float dist = d * size * SOFT_EDGE_RATIO * v_distRatio; -fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); -float outlineWidth = v_outlineWidth; -#ifdef HIGHLIGHT -outlineWidth = max(outlineWidth, 4.0 * v_isThin); -#endif -if (outlineWidth > 0.25) { -lowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor; -float clampedOutlineSize = min(outlineWidth, size); -outlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0); -return v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor); -} -return v_opacity * fillPixelColor; -} -#else -vec4 getColor(vec2 _v_size, vec2 v_tex) { -lowp vec4 texColor = texture2D(u_texture, v_tex); -return v_opacity * texColor * v_color; -} -#endif`,heatmapAccumulate:{"common.glsl":`varying lowp vec4 v_hittestResult; -varying mediump vec2 v_offsetFromCenter; -varying highp float v_fieldValue;`,"heatmapAccumulate.frag":`precision mediump float; -#include -#ifdef HEATMAP_PRECISION_HALF_FLOAT -#define COMPRESSION_FACTOR 0.25 -#else -#define COMPRESSION_FACTOR 1.0 -#endif -uniform lowp sampler2D u_texture; -void main() { -#ifdef HITTEST -gl_FragColor = v_hittestResult; -#else -float radius = length(v_offsetFromCenter); -float shapeWeight = step(radius, 1.0); -float oneMinusRadiusSquared = 1.0 - radius * radius; -float kernelWeight = oneMinusRadiusSquared * oneMinusRadiusSquared; -gl_FragColor = vec4(shapeWeight * kernelWeight * v_fieldValue * COMPRESSION_FACTOR); -#endif -}`,"heatmapAccumulate.vert":`precision highp float; -attribute vec2 a_vertexOffset; -vec4 a_color = vec4(0.0); -vec2 a_zoomRange = vec2(0.0, 10000.0); -uniform float u_radius; -uniform float u_isFieldActive; -#include -#include -#include -void main() { -float filterFlags = getFilterFlags(); -#ifdef HITTEST -highp vec4 out_hittestResult = vec4(0.); -highp vec3 out_pos = vec3(0.); -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); -hittestMarker(out_hittestResult, out_pos, pos, u_radius); -v_hittestResult = out_hittestResult; -gl_PointSize = 1.; -gl_Position = vec4(clip(a_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -v_offsetFromCenter = sign(a_vertexOffset); -v_fieldValue = getAttributeData2(a_id).x * u_isFieldActive + 1.0 - u_isFieldActive; -vec3 centerPos = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0); -vec3 vertexPos = centerPos + u_displayViewMat3 * vec3(v_offsetFromCenter, 0.0) * u_radius; -gl_Position = vec4(clip(a_color, vertexPos, filterFlags, a_zoomRange), 1.0); -#endif -}`},"hittest.glsl":`#ifdef HITTEST -#include -attribute vec2 a_vertexOffset1; -attribute vec2 a_vertexOffset2; -attribute vec2 a_texCoords1; -attribute vec2 a_texCoords2; -vec2 getTextureCoords(in vec3 bary, in vec2 texCoords0, in vec2 texCoords1, in vec2 texCoords2) { -return texCoords0 * bary.x + texCoords1 * bary.y + texCoords2 * bary.z; -} -void hittestIcon( -inout lowp vec4 out_color, -out highp vec3 out_pos, -in vec3 pos, -in vec3 offset, -in vec2 size, -in float scaleFactor, -in float isMapAligned -) { -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -vec3 posBase = u_viewMat3 * u_tileMat3 * pos; -vec3 offset1 = scaleFactor * vec3(a_vertexOffset1 / 16.0, 0.); -vec3 offset2 = scaleFactor * vec3(a_vertexOffset2 / 16.0, 0.); -vec2 pos0 = (posBase + getMatrixNoDisplay(isMapAligned) * offset).xy; -vec2 pos1 = (posBase + getMatrixNoDisplay(isMapAligned) * offset1).xy; -vec2 pos2 = (posBase + getMatrixNoDisplay(isMapAligned) * offset2).xy; -vec3 bary0 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, -u_hittestDist), pos0, pos1, pos2); -vec3 bary1 = xyToBarycentric(u_hittestPos + vec2(0., -u_hittestDist), pos0, pos1, pos2); -vec3 bary2 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, -u_hittestDist), pos0, pos1, pos2); -vec3 bary3 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, 0.), pos0, pos1, pos2); -vec3 bary4 = xyToBarycentric(u_hittestPos, pos0, pos1, pos2); -vec3 bary5 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, 0.), pos0, pos1, pos2); -vec3 bary6 = xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, u_hittestDist), pos0, pos1, pos2); -vec3 bary7 = xyToBarycentric(u_hittestPos + vec2(0., u_hittestDist), pos0, pos1, pos2); -vec3 bary8 = xyToBarycentric(u_hittestPos + vec2(u_hittestDist, u_hittestDist), pos0, pos1, pos2); -vec2 tex0 = a_texCoords / u_mosaicSize; -vec2 tex1 = a_texCoords1 / u_mosaicSize; -vec2 tex2 = a_texCoords2 / u_mosaicSize; -float alphaSum = 0.; -alphaSum += inTriangle(bary0) * getColor(size, getTextureCoords(bary0, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary1) * getColor(size, getTextureCoords(bary1, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary2) * getColor(size, getTextureCoords(bary2, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary3) * getColor(size, getTextureCoords(bary3, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary4) * getColor(size, getTextureCoords(bary4, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary5) * getColor(size, getTextureCoords(bary5, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary6) * getColor(size, getTextureCoords(bary6, tex0, tex1, tex2)).a; -alphaSum += inTriangle(bary7) * getColor(size, getTextureCoords(bary7, tex0, tex1, tex2)).a; -out_pos.z += step(alphaSum, .05) * 2.0; -out_color = vec4(1. / 255., 0., 0., alphaSum / 255.); -} -#endif`,"icon.frag":`precision mediump float; -#include -#include -#include -void main() -{ -#ifdef HITTEST -vec4 color = v_color; -#else -vec4 color = getColor(v_sizeTex.xy, v_sizeTex.zw); -#endif -#ifdef HIGHLIGHT -color.a = step(1.0 / 255.0, color.a); -#endif -gl_FragColor = color; -}`,"icon.vert":`precision highp float; -attribute vec4 a_color; -attribute vec4 a_outlineColor; -attribute vec4 a_sizeAndOutlineWidth; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -attribute vec2 a_bitSetAndDistRatio; -attribute vec2 a_zoomRange; -#include -#include -#include -float getMarkerScaleFactor(inout vec2 size, in float referenceSize) { -#ifdef VV_SIZE -float f = getSize(size.y) / size.y; -float sizeFactor = size.y / referenceSize; -return getSize(referenceSize) / referenceSize; -#else -return 1.; -#endif -} -void main() -{ -INIT; -float a_bitSet = a_bitSetAndDistRatio.x; -vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); -vec2 size = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0; -vec3 offset = vec3(a_vertexOffset / 16.0, 0.); -float outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0; -float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); -float referenceSize = a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0; -float scaleSymbolProportionally = getBit(a_bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); -float scaleFactor = getMarkerScaleFactor(size, referenceSize); -size.xy *= scaleFactor; -offset.xy *= scaleFactor; -outlineSize *= scaleSymbolProportionally * (scaleFactor - 1.0) + 1.0; -vec2 v_tex = a_texCoords / u_mosaicSize; -float filterFlags = getFilterFlags(); -v_color = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR); -v_opacity = getOpacity(); -v_id = norm(a_id); -v_pos = u_dvsMat3 * pos + getMatrix(isMapAligned) * getRotation() * offset; -v_sizeTex = vec4(size.xy, v_tex.xy); -#ifdef SDF -v_isThin = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE); -#ifdef VV_COLOR -v_overridingOutlineColor = v_isThin; -#else -v_overridingOutlineColor = 0.0; -#endif -v_outlineWidth = min(outlineSize, max(max(size.x, size.y) - 0.99, 0.0)); -v_outlineColor = a_outlineColor; -v_distRatio = a_bitSetAndDistRatio.y / 128.0; -#endif -#ifdef HITTEST -highp vec4 out_color = vec4(0.); -highp vec3 out_pos = vec3(0.); -hittestIcon(out_color, out_pos, pos, offset, size, scaleFactor, isMapAligned); -v_color = out_color; -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); -#endif -}`},label:{"common.glsl":`uniform mediump float u_zoomLevel; -uniform mediump float u_mapRotation; -uniform mediump float u_mapAligned; -uniform mediump vec2 u_mosaicSize; -varying mediump float v_antialiasingWidth; -varying mediump float v_edgeDistanceOffset; -varying mediump vec2 v_tex; -varying mediump vec4 v_color; -varying lowp vec4 v_animation;`,"label.frag":"#include ","label.vert":`precision highp float; -#include -#include -attribute vec4 a_color; -attribute vec4 a_haloColor; -attribute vec4 a_texAndSize; -attribute vec4 a_refSymbolAndPlacementOffset; -attribute vec4 a_glyphData; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -uniform float u_isHaloPass; -uniform float u_isBackgroundPass; -uniform float u_mapRotation; -uniform float u_mapAligned; -float getZ(in float minZoom, in float maxZoom, in float angle) { -float glyphAngle = angle * 360.0 / 254.0; -float mapAngle = u_mapRotation * 360.0 / 254.0; -float diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle)); -float z = 0.0; -z += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom))); -z += u_mapAligned * 2.0 * step(90.0, diffAngle); -z += 2.0 * (1.0 - step(u_currentZoom, maxZoom)); -return z; -} -void main() -{ -INIT; -float groupMinZoom = getMinZoom(); -float glyphMinZoom = a_glyphData.x; -float glyphMaxZoom = a_glyphData.y; -float glyphAngle = a_glyphData.z; -float a_isBackground = a_glyphData.w; -float a_minZoom = max(groupMinZoom, glyphMinZoom); -float a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING; -vec2 a_placementDir = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw); -float a_refSymbolSize = a_refSymbolAndPlacementOffset.y; -float fontSize = a_texAndSize.z; -float haloSize = a_texAndSize.w * OUTLINE_SCALE; -vec2 vertexOffset = a_vertexOffset * OFFSET_PRECISION; -vec3 pos = vec3(a_pos * POSITION_PRECISION, 1.0); -float z = getZ(a_minZoom, glyphMaxZoom, glyphAngle); -float fontScale = fontSize / SDF_FONT_SIZE; -float halfSize = getSize(a_refSymbolSize) / 2.0; -float animation = pow(getAnimationState(), vec4(2.0)).r; -float isText = 1.0 - a_isBackground; -float isBackground = u_isBackgroundPass * a_isBackground; -vec4 nonHaloColor = (isBackground + isText) * a_color; -v_color = animation * ((1.0 - u_isHaloPass) * nonHaloColor + (u_isHaloPass * a_haloColor)); -v_opacity = 1.0; -v_tex = a_texCoords / u_mosaicSize; -v_edgeDistanceOffset = u_isHaloPass * haloSize / fontScale / MAX_SDF_DISTANCE; -v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; -vec2 placementOffset = a_placementDir * (halfSize + a_placementPadding); -vec3 glyphOffset = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0); -vec3 v_pos = vec3((u_dvsMat3 * pos + glyphOffset).xy, z); -float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; -v_pos.z += 2.0 * isHidden; -gl_Position = vec4(v_pos, 1.0); -#ifdef DEBUG -v_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645); -#endif -}`},line:{"common.glsl":`varying lowp vec4 v_color; -varying highp vec3 v_id; -varying mediump vec2 v_normal; -varying mediump float v_lineHalfWidth; -varying lowp float v_opacity; -#ifdef PATTERN -varying mediump vec4 v_tlbr; -varying mediump vec2 v_patternSize; -#endif -#if defined(PATTERN) || defined(SDF) -varying highp float v_accumulatedDistance; -#endif -#ifdef SDF -varying mediump float v_lineWidthRatio; -#endif`,"hittest.glsl":`#include -#ifdef HITTEST -attribute vec2 a_pos1; -attribute vec2 a_pos2; -void hittestLine(out lowp vec4 out_color, out highp vec3 out_pos, float halfWidth) { -vec3 pos = u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.); -vec3 pos1 = u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.); -vec3 pos2 = u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.); -vec3 outTextureCoords = vec3(getAttributeDataTextureCoords(a_id), 0.0); -float dist = min(distPointSegment(u_hittestPos, pos.xy, pos1.xy), -distPointSegment(u_hittestPos, pos.xy, pos2.xy)) - halfWidth; -out_pos = vec3(getAttributeDataTextureCoords(a_id), 0.0); -if (dist >= u_hittestDist) { -out_pos.z += 2.0; -} -out_color = vec4(1. / 255., 0, 0, dist <= 0. ? (1. / 255.) : 0.); -} -#endif`,"line.frag":`precision lowp float; -#include -#include -#include -#include -#include -#include -#ifdef HITTEST -void main() { -gl_FragColor = v_color; -} -#else -void main() { -LineData inputs = LineData( -v_color, -v_normal, -v_lineHalfWidth, -v_opacity, -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -v_tlbr, -v_patternSize, -#endif -#ifdef SDF -v_lineWidthRatio, -#endif -#if defined(PATTERN) || defined(SDF) -v_accumulatedDistance, -#endif -#endif -v_id -); -gl_FragColor = shadeLine(inputs); -} -#endif`,"line.vert":`precision highp float; -attribute vec4 a_color; -attribute vec4 a_offsetAndNormal; -attribute vec2 a_accumulatedDistanceAndHalfWidth; -attribute vec4 a_tlbr; -attribute vec4 a_segmentDirection; -attribute vec2 a_aux; -attribute vec2 a_zoomRange; -#include -#include -#include -#include -#include -#include -#ifdef HITTEST -void draw() { -float aa = 0.5 * u_antialiasing; -float a_halfWidth = a_accumulatedDistanceAndHalfWidth.y / 16.; -float a_cimHalfWidth = a_aux.x / 16. ; -vec2 a_offset = a_offsetAndNormal.xy / 16.; -float baseWidth = getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth); -float halfWidth = getLineHalfWidth(baseWidth, aa); -highp vec3 pos = vec3(0.); -v_color = vec4(0.); -hittestLine(v_color, pos, halfWidth); -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0); -} -#else -void draw() -{ -highp vec3 pos = vec3(0.); -LineData outputs = buildLine( -pos, -a_id, -a_pos, -a_color, -a_offsetAndNormal.xy / 16., -a_offsetAndNormal.zw / 16., -a_accumulatedDistanceAndHalfWidth.x, -a_accumulatedDistanceAndHalfWidth.y / 16., -a_segmentDirection.w, -a_tlbr, -a_segmentDirection.xy / 16., -a_aux.x / 16. -); -v_id = outputs.id; -v_color = outputs.color; -v_normal = outputs.normal; -v_lineHalfWidth = outputs.lineHalfWidth; -v_opacity = outputs.opacity; -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -v_tlbr = outputs.tlbr; -v_patternSize = outputs.patternSize; -#endif -#ifdef SDF -v_lineWidthRatio = outputs.lineWidthRatio; -#endif -#if defined(PATTERN) || defined(SDF) -v_accumulatedDistance = outputs.accumulatedDistance; -#endif -#endif -gl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0); -} -#endif -void main() { -INIT; -draw(); -}`},pie:{"pie.common.glsl":`uniform float outlineWidth; -uniform mediump float sectorThreshold; -varying vec3 v_id; -varying vec3 v_pos; -varying vec2 v_offset; -varying vec4 v_color; -varying float v_size; -varying float v_numOfEntries; -varying float v_maxSectorAngle; -varying vec2 v_filteredSectorToColorId[numberOfFields]; -varying vec2 v_texCoords; -varying float v_outlineWidth; -varying float v_opacity; -struct FilteredChartInfo { -float endSectorAngle; -int colorId; -};`,"pie.frag":`precision highp float; -#include -#include -#include -#include -uniform lowp vec4 colors[numberOfFields]; -uniform lowp vec4 defaultColor; -uniform lowp vec4 othersColor; -uniform lowp vec4 outlineColor; -uniform float donutRatio; -lowp vec4 getSectorColor(in int index, in vec2 filteredSectorToColorId[numberOfFields]) { -mediump int colorIndex = int(filteredSectorToColorId[index].y); -return colors[colorIndex]; -} -const int OTHER_SECTOR_ID = 255; -#ifdef HITTEST -vec4 getColor() { -float distanceSize = length(v_offset) * v_size; -float donutSize = donutRatio * v_size; -float alpha = step(donutSize, distanceSize) * (1.0 - step(v_size, distanceSize)); -return v_color; -} -#else -vec4 getColor() { -float angle = 90.0 - C_RAD_TO_DEG * atan2(v_offset.y, v_offset.x); -if (angle < 0.0) { -angle += 360.0; -} else if (angle > 360.0) { -angle = mod(angle, 360.0); -} -int numOfEntries = int(v_numOfEntries); -float maxSectorAngle = v_maxSectorAngle; -lowp vec4 fillColor = (maxSectorAngle > 0.0 || sectorThreshold > 0.0) ? othersColor : defaultColor; -lowp vec4 prevColor = vec4(0.0); -lowp vec4 nextColor = vec4(0.0); -float startSectorAngle = 0.0; -float endSectorAngle = 0.0; -if (angle < maxSectorAngle) { -for (int index = 0; index < numberOfFields; ++index) { -startSectorAngle = endSectorAngle; -endSectorAngle = v_filteredSectorToColorId[index].x; -if (endSectorAngle > angle) { -fillColor = getSectorColor(index, v_filteredSectorToColorId); -prevColor = sectorThreshold != 0.0 && index == 0 && abs(360.0 - maxSectorAngle) < EPSILON ? othersColor : -getSectorColor(index > 0 ? index - 1 : numOfEntries - 1, v_filteredSectorToColorId); -nextColor = sectorThreshold != 0.0 && abs(endSectorAngle - maxSectorAngle) < EPSILON ? othersColor : -getSectorColor(index < numOfEntries - 1 ? index + 1 : 0, v_filteredSectorToColorId); -break; -} -if (index == numOfEntries - 1) { -break; -} -} -} else { -prevColor = getSectorColor(numOfEntries - 1, v_filteredSectorToColorId); -nextColor = getSectorColor(0, v_filteredSectorToColorId); -startSectorAngle = maxSectorAngle; -endSectorAngle = 360.0; -} -lowp vec4 outlineColor = outlineColor; -float offset = length(v_offset); -float distanceSize = offset * v_size; -if (startSectorAngle != 0.0 || endSectorAngle != 360.0) { -float distanceToStartSector = (angle - startSectorAngle); -float distanceToEndSector = (endSectorAngle - angle); -float sectorThreshold = 0.6; -float beginSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToStartSector * offset); -float endSectorAlpha = smoothstep(0.0, sectorThreshold, distanceToEndSector * offset); -if (endSectorAlpha > 0.0) { -fillColor = mix(nextColor, fillColor, endSectorAlpha); -} else if (beginSectorAlpha > 0.0) { -fillColor = mix(prevColor, fillColor, beginSectorAlpha); -} -} -float donutSize = donutRatio * (v_size - v_outlineWidth); -float endOfDonut = donutSize - v_outlineWidth; -float aaThreshold = 0.75; -float innerCircleAlpha = endOfDonut - aaThreshold > 0.0 ? smoothstep(endOfDonut - aaThreshold, endOfDonut + aaThreshold, distanceSize) : 1.0; -float outerCircleAlpha = 1.0 - smoothstep(v_size - aaThreshold, v_size + aaThreshold , distanceSize); -float circleAlpha = innerCircleAlpha * outerCircleAlpha; -float startOfOutline = v_size - v_outlineWidth; -if (startOfOutline > 0.0 && v_outlineWidth > 0.25) { -float outlineFactor = smoothstep(startOfOutline - aaThreshold, startOfOutline + aaThreshold, distanceSize); -float innerLineFactor = donutSize - aaThreshold > 0.0 ? 1.0 - smoothstep(donutSize - aaThreshold, donutSize + aaThreshold , distanceSize) : 0.0; -fillColor = mix(fillColor, outlineColor, innerLineFactor + outlineFactor); -} -return v_opacity * circleAlpha * fillColor; -} -#endif -void main() -{ -vec4 color = getColor(); -#ifdef highlight -color.a = step(1.0 / 255.0, color.a); -#endif -gl_FragColor = color; -}`,"pie.vert":`#include -#include -#include -#include -#include -#include -#include -#include -attribute float a_bitSet; -attribute vec2 a_offset; -attribute vec2 a_texCoords; -attribute vec2 a_size; -attribute float a_referenceSize; -attribute vec2 a_zoomRange; -int filterValue(in float sectorAngle, -in int currentIndex, -inout FilteredChartInfo filteredInfo, -inout vec2 filteredSectorToColorId[numberOfFields]) { -if (sectorAngle > sectorThreshold * 360.0) { -filteredInfo.endSectorAngle += sectorAngle; -filteredSectorToColorId[filteredInfo.colorId] = vec2(filteredInfo.endSectorAngle, currentIndex); -++filteredInfo.colorId; -} -return 0; -} -int filterValues(inout vec2 filteredSectorToColorId[numberOfFields], -inout FilteredChartInfo filteredInfo, -in float sectorAngles[numberOfFields]) { -for (int index = 0; index < numberOfFields; ++index) { -float sectorValue = sectorAngles[index]; -filterValue(sectorValue, index, filteredInfo, filteredSectorToColorId); -} -return filteredInfo.colorId; -} -vec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float a_referenceSize, in float bitSet) { -vec2 outSize = baseSize; -#ifdef VV_SIZE -float r = getSize(a_referenceSize, currentScale) / a_referenceSize; -outSize.xy *= r; -offset.xy *= r; -float scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY); -outlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0; -#endif -return outSize; -} -vec3 getOffset(in vec2 in_offset, float a_bitSet) { -float isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP); -vec3 offset = vec3(in_offset, 0.0); -return getMatrix(isMapAligned) * offset; -} -float filterNaNValues(in float value) { -return value != NAN_MAGIC_NUMBER && value > 0.0 ? value : 0.0; -} -void main() -{ -INIT; -vec2 a_size = a_size; -vec2 a_offset = a_offset / 16.0; -float outlineSize = outlineWidth; -float a_bitSet = a_bitSet; -float a_referenceSize = a_referenceSize; -vec2 a_texCoords = a_texCoords / 4.0; -vec2 markerSize = getMarkerSize(a_offset, a_size, outlineSize, a_referenceSize, a_bitSet); -float filterFlags = getFilterFlags(); -vec3 pos = vec3(a_pos / 10.0, 1.0); -v_opacity = getOpacity(); -v_id = norm(a_id); -v_pos = displayViewScreenMat3 * pos + getOffset(a_offset, a_bitSet); -v_offset = sign(a_texCoords - 0.5); -v_size = max(markerSize.x, markerSize.y); -v_outlineWidth = outlineSize; -float attributeData[10]; -vec4 attributeData3 = getDataDriven0(a_id); -attributeData[0] = filterNaNValues(attributeData3.x); -attributeData[1] = filterNaNValues(attributeData3.y); -attributeData[2] = filterNaNValues(attributeData3.z); -attributeData[3] = filterNaNValues(attributeData3.w); -#if (numberOfFields > 4) -vec4 attributeData4 = getDataDriven1(a_id); -attributeData[4] = filterNaNValues(attributeData4.x); -attributeData[5] = filterNaNValues(attributeData4.y); -attributeData[6] = filterNaNValues(attributeData4.z); -attributeData[7] = filterNaNValues(attributeData4.w); -#endif -#if (numberOfFields > 8) -vec4 attributeData5 = getDataDriven2(a_id); -attributeData[8] = filterNaNValues(attributeData5.x); -attributeData[9] = filterNaNValues(attributeData5.y); -#endif -float sum = 0.0; -for (int i = 0; i < numberOfFields; ++i) { -sum += attributeData[i]; -} -float sectorAngles[numberOfFields]; -for (int i = 0; i < numberOfFields; ++i) { -sectorAngles[i] = 360.0 * attributeData[i] / sum; -} -vec2 filteredSectorToColorId[numberOfFields]; -FilteredChartInfo filteredInfo = FilteredChartInfo(0.0, 0); -int numOfEntries = filterValues(filteredSectorToColorId, filteredInfo, sectorAngles); -v_numOfEntries = float(numOfEntries); -v_maxSectorAngle = filteredInfo.endSectorAngle; -v_filteredSectorToColorId = filteredSectorToColorId; -#ifdef HITTEST -highp vec3 out_pos = vec3(0.0); -v_color = vec4(0.0); -hittestMarker(v_color, out_pos, viewMat3 * tileMat3 * pos, v_size); -gl_PointSize = 1.0; -gl_Position = vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0); -#endif -}`},shared:{line:{"common.glsl":`#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) -uniform mediump vec2 u_mosaicSize; -varying mediump float v_sampleAlphaOnly; -#endif -struct LineData { -lowp vec4 color; -mediump vec2 normal; -mediump float lineHalfWidth; -lowp float opacity; -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -mediump vec4 tlbr; -mediump vec2 patternSize; -#endif -#ifdef SDF -mediump float lineWidthRatio; -#endif -#if defined(PATTERN) || defined(SDF) -highp float accumulatedDistance; -#endif -#endif -highp vec3 id; -};`,"line.frag":`uniform lowp float u_blur; -#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && !defined(HIGHLIGHT) -#if defined(PATTERN) || defined(SDF) -uniform sampler2D u_texture; -uniform highp float u_pixelRatio; -#endif -#endif -#if defined(SDF) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -lowp vec4 getLineColor(LineData line) { -mediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio; -mediump float relativeTexX = fract(line.accumulatedDistance / adjustedPatternWidth); -mediump float relativeTexY = 0.5 + 0.25 * line.normal.y; -mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); -mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; -float dist = d * line.lineHalfWidth; -return line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color; -} -#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) -lowp vec4 getLineColor(LineData line) { -mediump float lineHalfWidth = line.lineHalfWidth; -mediump float adjustedPatternHeight = line.patternSize.y * 2.0 * lineHalfWidth / line.patternSize.x; -mediump float relativeTexY = fract(line.accumulatedDistance / adjustedPatternHeight); -mediump float relativeTexX = 0.5 + 0.5 * line.normal.y; -mediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY)); -lowp vec4 color = texture2D(u_texture, texCoord); -#ifdef VV_COLOR -if (v_sampleAlphaOnly > 0.5) { -color.rgb = vec3(color.a); -} -#endif -return line.opacity * line.color * color; -} -#else -lowp vec4 getLineColor(LineData line) { -return line.opacity * line.color; -} -#endif -vec4 shadeLine(LineData line) -{ -mediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0); -mediump float fragDist = length(line.normal) * line.lineHalfWidth; -lowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0); -lowp vec4 out_color = getLineColor(line) * alpha; -#ifdef HIGHLIGHT -out_color.a = step(1.0 / 255.0, out_color.a); -#endif -#ifdef ID -if (out_color.a < 1.0 / 255.0) { -discard; -} -out_color = vec4(line.id, 0.0); -#endif -return out_color; -}`,"line.vert":`float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) { -#ifdef VV_SIZE -float refLineWidth = 2.0 * referenceHalfWidth; -return 0.5 * (lineHalfWidth / max(referenceHalfWidth, EPSILON)) * getSize(refLineWidth); -#else -return lineHalfWidth; -#endif -} -float getLineHalfWidth(in float baseWidth, in float aa) { -float halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa; -#ifdef HIGHLIGHT -halfWidth = max(halfWidth, 2.0); -#endif -return halfWidth; -} -vec2 getDist(in vec2 offset, in float halfWidth) { -float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0); -return thinLineFactor * halfWidth * offset; -} -LineData buildLine( -out vec3 out_pos, -in vec3 in_id, -in vec2 in_pos, -in vec4 in_color, -in vec2 in_offset, -in vec2 in_normal, -in float in_accumulatedDist, -in float in_lineHalfWidth, -in float in_bitSet, -in vec4 in_tlbr, -in vec2 in_segmentDirection, -in float in_referenceHalfWidth -) -{ -float aa = 0.5 * u_antialiasing; -float baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth); -float halfWidth = getLineHalfWidth(baseWidth, aa); -float z = 2.0 * step(baseWidth, 0.0); -vec2 dist = getDist(in_offset, halfWidth); -vec3 offset = u_displayViewMat3 * vec3(dist, 0.0); -vec3 pos = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset; -#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -vec4 color = in_color; -float opacity = 1.0; -#else -vec4 color = getColor(in_color, in_bitSet, BITSET_GENERIC_LOCK_COLOR); -float opacity = getOpacity(); -#ifdef SDF -const float SDF_PATTERN_HALF_WIDTH = 15.5; -float scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH); -float lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH; -#endif -#endif -#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) && defined(PATTERN) -v_sampleAlphaOnly = getBit(in_bitSet, BITSET_GENERIC_CONSIDER_ALPHA_ONLY); -#endif -out_pos = vec3(pos.xy, z); -return LineData( -color, -in_normal, -halfWidth, -opacity, -#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#ifdef PATTERN -in_tlbr / u_mosaicSize.xyxy, -vec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y), -#endif -#ifdef SDF -lineWidthRatio, -#endif -#if defined(PATTERN) || defined(SDF) -in_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist), -#endif -#endif -norm(in_id) -); -}`}},"symbologyTypeUtils.glsl":`#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE -#define SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE -#endif -#if SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_SIMPLE || SYMBOLOGY_TYPE == SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE -#define SYMBOLOGY_TYPE_IS_SIMPLE_LIKE -#endif`,text:{"common.glsl":`uniform highp vec2 u_mosaicSize; -varying highp vec3 v_id; -varying mediump vec3 v_pos; -varying lowp float v_opacity; -varying lowp vec4 v_color; -varying highp vec2 v_tex; -varying mediump float v_antialiasingWidth; -varying mediump float v_edgeDistanceOffset; -varying lowp float v_transparency;`,"hittest.glsl":"#include ","text.frag":`precision mediump float; -#include -uniform lowp sampler2D u_texture; -#ifdef HITTEST -vec4 getColor() { -return v_color; -} -#else -vec4 getColor() -{ -float SDF_CUTOFF = (2.0 / 8.0); -float SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF; -lowp float dist = texture2D(u_texture, v_tex).a; -mediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset; -#ifdef HIGHLIGHT -edge /= 2.0; -#endif -lowp float aa = v_antialiasingWidth; -lowp float alpha = smoothstep(edge - aa, edge + aa, dist); -return alpha * v_color * v_opacity; -} -#endif -void main() -{ -gl_FragColor = getColor(); -}`,"text.vert":`precision highp float; -#include -#include -#include -#include -attribute vec4 a_color; -attribute vec4 a_haloColor; -attribute vec4 a_texFontSize; -attribute vec4 a_aux; -attribute vec2 a_zoomRange; -attribute vec2 a_vertexOffset; -attribute vec2 a_texCoords; -uniform float u_isHaloPass; -uniform float u_isBackgroundPass; -float getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) { -#ifdef VV_SIZE -float r = getSize(referenceSize) / referenceSize; -baseSize *= r; -offset.xy *= r; -return baseSize; -#endif -return baseSize; -} -void main() -{ -INIT; -float a_isBackground = a_aux.y; -float a_referenceSize = a_aux.z * a_aux.z / 256.0; -float a_bitSet = a_aux.w; -float a_fontSize = a_texFontSize.z; -vec2 a_offset = a_vertexOffset * OFFSET_PRECISION; -vec3 in_pos = vec3(a_pos * POSITION_PRECISION, 1.0); -float fontSize = getTextSize(a_offset, a_fontSize, a_referenceSize); -float fontScale = fontSize / SDF_FONT_SIZE; -vec3 offset = getRotation() * vec3(a_offset, 0.0); -mat3 extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3; -float isText = 1.0 - a_isBackground; -float isBackground = u_isBackgroundPass * a_isBackground; -vec4 nonHaloColor = (isBackground * a_color) + (isText * getColor(a_color, a_bitSet, 1)); -v_color = u_isHaloPass * a_haloColor + (1.0 - u_isHaloPass) * nonHaloColor; -v_opacity = getOpacity(); -v_id = norm(a_id); -v_tex = a_texCoords / u_mosaicSize; -v_pos = u_dvsMat3 * in_pos + extrudeMatrix * offset; -float isHidden = u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground; -v_pos.z += 2.0 * isHidden; -v_edgeDistanceOffset = u_isHaloPass * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE; -v_antialiasingWidth = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio; -#ifdef HITTEST -highp vec3 out_pos = vec3(0.); -v_color = vec4(0.); -hittestMarker(v_color, out_pos, u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) -+ u_tileMat3 * offset, fontSize / 2.); -gl_PointSize = 1.; -gl_Position = vec4(clip(v_color, out_pos, getFilterFlags(), a_zoomRange), 1.0); -#else -gl_Position = vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0); -#endif -}`},"utils.glsl":`float rshift(in float u32, in int amount) { -return floor(u32 / pow(2.0, float(amount))); -} -float getBit(in float bitset, in int bitIndex) { -float offset = pow(2.0, float(bitIndex)); -return mod(floor(bitset / offset), 2.0); -} -const int maxHighlightReasons = 6; -float getFilterBit(in float bitset, in int bitIndex) { -return getBit(bitset, bitIndex + maxHighlightReasons); -} -float getHighlightBit(in float bitset, in int bitIndex) { -return getBit(bitset, bitIndex); -} -highp vec3 unpackDisplayIdTexel(in highp vec3 bitset) { -float isAggregate = getBit(bitset.b, 7); -return (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80))); -} -vec4 unpack(in float u32) { -float r = mod(rshift(u32, 0), 255.0); -float g = mod(rshift(u32, 8), 255.0); -float b = mod(rshift(u32, 16), 255.0); -float a = mod(rshift(u32, 24), 255.0); -return vec4(r, g, b, a); -} -vec3 norm(in vec3 v) { -return v /= 255.0; -} -vec4 norm(in vec4 v) { -return v /= 255.0; -} -float max4(vec4 target) { -return max(max(max(target.x, target.y), target.z), target.w); -} -vec2 unpack_u8_nf32(vec2 bytes) { -return (bytes - 127.0) / 127.0; -} -highp float rand(in vec2 co) { -highp float a = 12.9898; -highp float b = 78.233; -highp float c = 43758.5453; -highp float dt = dot(co, vec2(a,b)); -highp float sn = mod(dt, 3.14); -return fract(sin(sn) * c); -}`,"vcommon.glsl":`#include -#include -#include -#include -#include -attribute vec2 a_pos; -attribute highp vec3 a_id; -uniform highp mat3 displayViewScreenMat3; -uniform highp mat3 displayViewMat3; -uniform highp mat3 displayMat3; -uniform highp mat3 tileMat3; -uniform highp mat3 viewMat3; -uniform highp float pixelRatio; -uniform mediump float zoomFactor; -uniform mediump float antialiasing; -uniform mediump float currentScale; -uniform mediump float currentZoom; -uniform mediump float metersPerSRUnit; -vec4 VV_ADATA = vec4(0.0); -void loadVisualVariableData(inout vec4 target) { -target.rgba = getVisualVariableData(a_id); -} -#ifdef VV -#define INIT loadVisualVariableData(VV_ADATA) -#else -#define INIT -#endif -vec4 getColor(in vec4 a_color, in float a_bitSet, int index) { -#ifdef VV_COLOR -float isColorLocked = getBit(a_bitSet, index); -return getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked); -#else -return a_color; -#endif -} -float getOpacity() { -#ifdef VV_OPACITY -return getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]); -#else -return 1.0; -#endif -} -float getSize(in float in_size, in float currentScale) { -#ifdef VV_SIZE -return getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE], currentScale); -#else -return in_size; -#endif -} -mat3 getRotation() { -#ifdef VV_ROTATION -return getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0)); -#else -return mat3(1.0); -#endif -} -float getFilterFlags() { -#ifdef IGNORES_SAMPLER_PRECISION -return ceil(getFilterData(a_id).x * 255.0); -#else -return getFilterData(a_id).x * 255.0; -#endif -} -vec4 getAnimationState() { -return getAnimation(a_id); -} -float getMinZoom() { -vec4 data0 = getFilterData(a_id) * 255.0; -return data0.g; -} -mat3 getMatrixNoDisplay(float isMapAligned) { -return isMapAligned * viewMat3 * tileMat3 + (1.0 - isMapAligned) * tileMat3; -} -mat3 getMatrix(float isMapAligned) { -return isMapAligned * displayViewMat3 + (1.0 - isMapAligned) * displayMat3; -} -float checkHighlightBit(float filterFlags, int index) { -return getHighlightBit(filterFlags, index); -} -float checkHighlight(float filterFlags) { -float result = checkHighlightBit(filterFlags, 0); -for (int i = 1; i < maxHighlightReasons; i++) { -result = result + checkHighlightBit(filterFlags, i); -} -return step(0.1, result); -} -vec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) { -pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0)); -#ifdef inside -pos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1)); -#elif defined(outside) -pos.z += 2.0 * getFilterBit(filterFlags, 1); -#elif defined(highlight) -#if !defined(highlight_all) -pos.z += 2.0 * (1.0 - checkHighlight(filterFlags)); -#endif -#endif -pos.z += 2.0 * (step(minMaxZoom.y, currentZoom) + (1.0 - step(minMaxZoom.x, currentZoom))); -return pos; -}`,"vv.glsl":`#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE) -#define VV_SIZE -#endif -#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION) -#define VV -#endif -#ifdef VV_COLOR -uniform highp float colorValues[8]; -uniform vec4 colors[8]; -#endif -#ifdef VV_SIZE_MIN_MAX_VALUE -uniform highp vec4 minMaxValueAndSize; -#endif -#ifdef VV_SIZE_SCALE_STOPS -uniform highp float values[8]; -uniform float sizes[8]; -#endif -#ifdef VV_SIZE_FIELD_STOPS -uniform highp float values[8]; -uniform float sizes[8]; -#endif -#ifdef VV_SIZE_UNIT_VALUE -uniform highp float unitMeterRatio; -#endif -#ifdef VV_OPACITY -uniform highp float opacityValues[8]; -uniform float opacities[8]; -#endif -#ifdef VV_ROTATION -uniform lowp float rotationType; -#endif -bool isNan(float val) { -return (val == NAN_MAGIC_NUMBER); -} -#ifdef VV_SIZE_MIN_MAX_VALUE -float getVVMinMaxSize(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -float interpolationRatio = (sizeValue - minMaxValueAndSize.x) / (minMaxValueAndSize.y - minMaxValueAndSize.x); -interpolationRatio = clamp(interpolationRatio, 0.0, 1.0); -return minMaxValueAndSize.z + interpolationRatio * (minMaxValueAndSize.w - minMaxValueAndSize.z); -} -#endif -#ifdef VV_SIZE_SCALE_STOPS -float getVVScaleStopsSize(float currentScale) { -float outSize; -if (currentScale <= values[0]) { -outSize = sizes[0]; -} else { -if (currentScale >= values[7]) { -outSize = sizes[7]; -} else { -int index; -index = -1; -for (int i = 0; i < 8; i++) { -if (values[i] > currentScale) { -index = i; -break; -} -} -int prevIndex = index - 1; -float a = currentScale - values[prevIndex]; -float b = values[index] - values[prevIndex]; -outSize = mix(sizes[prevIndex], sizes[index], a / b); -} -} -return outSize; -} -#endif -#ifdef VV_SIZE_FIELD_STOPS -const int VV_SIZE_N = 8; -float getVVStopsSize(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -if (sizeValue <= values[0]) { -return sizes[0]; -} -if (sizeValue >= values[VV_SIZE_N - 1]) { -return sizes[VV_SIZE_N - 1]; -} -for (int i = 1; i < VV_SIZE_N; ++i) { -if (values[i] >= sizeValue) { -float f = (sizeValue - values[i-1]) / (values[i] - values[i-1]); -return mix(sizes[i-1], sizes[i], f); -} -} -return sizes[VV_SIZE_N - 1]; -} -#endif -#ifdef VV_SIZE_UNIT_VALUE -float getVVUnitValue(float sizeValue, float fallback) { -if (isNan(sizeValue)) { -return fallback; -} -return sizeValue * (metersPerSRUnit / unitMeterRatio); -} -#endif -#ifdef VV_OPACITY -const int VV_OPACITY_N = 8; -float getVVOpacity(float opacityValue) { -if (isNan(opacityValue)) { -return 1.0; -} -if (opacityValue <= opacityValues[0]) { -return opacities[0]; -} -for (int i = 1; i < VV_OPACITY_N; ++i) { -if (opacityValues[i] >= opacityValue) { -float f = (opacityValue - opacityValues[i-1]) / (opacityValues[i] - opacityValues[i-1]); -return mix(opacities[i-1], opacities[i], f); -} -} -return opacities[VV_OPACITY_N - 1]; -} -#endif -#ifdef VV_ROTATION -mat4 getVVRotation(float rotationValue) { -if (isNan(rotationValue)) { -return mat4(1, 0, 0, 0, -0, 1, 0, 0, -0, 0, 1, 0, -0, 0, 0, 1); -} -float rotation = rotationValue; -if (rotationType == 1.0) { -rotation = 90.0 - rotation; -} -float angle = C_DEG_TO_RAD * rotation; -float sinA = sin(angle); -float cosA = cos(angle); -return mat4(cosA, sinA, 0, 0, --sinA, cosA, 0, 0, -0, 0, 1, 0, -0, 0, 0, 1); -} -mat3 getVVRotationMat3(float rotationValue) { -if (isNan(rotationValue)) { -return mat3(1, 0, 0, -0, 1, 0, -0, 0, 1); -} -float rotation = rotationValue; -if (rotationType == 1.0) { -rotation = 90.0 - rotation; -} -float angle = C_DEG_TO_RAD * -rotation; -float sinA = sin(angle); -float cosA = cos(angle); -return mat3(cosA, -sinA, 0, -sinA, cosA, 0, -0, 0, 1); -} -#endif -#ifdef VV_COLOR -const int VV_COLOR_N = 8; -vec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) { -if (isNan(colorValue) || isColorLocked == 1.0) { -return fallback; -} -if (colorValue <= colorValues[0]) { -return colors[0]; -} -for (int i = 1; i < VV_COLOR_N; ++i) { -if (colorValues[i] >= colorValue) { -float f = (colorValue - colorValues[i-1]) / (colorValues[i] - colorValues[i-1]); -return mix(colors[i-1], colors[i], f); -} -} -return colors[VV_COLOR_N - 1]; -} -#endif -float getVVSize(in float size, in float vvSize, in float currentScale) { -#ifdef VV_SIZE_MIN_MAX_VALUE -return getVVMinMaxSize(vvSize, size); -#elif defined(VV_SIZE_SCALE_STOPS) -float outSize = getVVScaleStopsSize(currentScale); -return isNan(outSize) ? size : outSize; -#elif defined(VV_SIZE_FIELD_STOPS) -float outSize = getVVStopsSize(vvSize, size); -return isNan(outSize) ? size : outSize; -#elif defined(VV_SIZE_UNIT_VALUE) -return getVVUnitValue(vvSize, size); -#else -return size; -#endif -}`},"post-processing":{blit:{"blit.frag":`precision mediump float; -uniform sampler2D u_texture; -varying vec2 v_uv; -void main() { -gl_FragColor = texture2D(u_texture, v_uv); -}`},bloom:{composite:{"composite.frag":`precision mediump float; -varying vec2 v_uv; -uniform sampler2D u_blurTexture1; -uniform sampler2D u_blurTexture2; -uniform sampler2D u_blurTexture3; -uniform sampler2D u_blurTexture4; -uniform sampler2D u_blurTexture5; -uniform float u_bloomStrength; -uniform float u_bloomRadius; -uniform float u_bloomFactors[NUMMIPS]; -uniform vec3 u_bloomTintColors[NUMMIPS]; -float lerpBloomFactor(const in float factor) { -float mirrorFactor = 1.2 - factor; -return mix(factor, mirrorFactor, u_bloomRadius); -} -void main() { -vec4 color = u_bloomStrength * ( -lerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) + -lerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) + -lerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) + -lerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) + -lerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv) -); -gl_FragColor = clamp(color, 0.0, 1.0); -}`},gaussianBlur:{"gaussianBlur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -uniform vec2 u_direction; -varying vec2 v_uv; -#define KERNEL_RADIUS RADIUS -#define SIGMA RADIUS -float gaussianPdf(in float x, in float sigma) { -return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; -} -void main() { -vec2 invSize = 1.0 / u_texSize; -float fSigma = float(SIGMA); -float weightSum = gaussianPdf(0.0, fSigma); -vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; -for (int i = 1; i < KERNEL_RADIUS; i ++) { -float x = float(i); -float w = gaussianPdf(x, fSigma); -vec2 uvOffset = u_direction * invSize * x; -vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); -vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); -pixelColorSum += (sample1 + sample2) * w; -weightSum += 2.0 * w; -} -gl_FragColor = pixelColorSum /weightSum; -}`},luminosityHighPass:{"luminosityHighPass.frag":`precision mediump float; -uniform sampler2D u_texture; -uniform vec3 u_defaultColor; -uniform float u_defaultOpacity; -uniform float u_luminosityThreshold; -uniform float u_smoothWidth; -varying vec2 v_uv; -void main() { -vec4 texel = texture2D(u_texture, v_uv); -vec3 luma = vec3(0.299, 0.587, 0.114); -float v = dot(texel.xyz, luma); -vec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity); -float alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v); -gl_FragColor = mix(outputColor, texel, alpha); -}`}},blur:{gaussianBlur:{"gaussianBlur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -uniform vec2 u_direction; -uniform float u_sigma; -varying vec2 v_uv; -#define KERNEL_RADIUS RADIUS -float gaussianPdf(in float x, in float sigma) { -return 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma; -} -void main() { -vec2 invSize = 1.0 / u_texSize; -float fSigma = u_sigma; -float weightSum = gaussianPdf(0.0, fSigma); -vec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum; -for (int i = 1; i < KERNEL_RADIUS; i ++) { -float x = float(i); -float w = gaussianPdf(x, fSigma); -vec2 uvOffset = u_direction * invSize * x; -vec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset); -vec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset); -pixelColorSum += (sample1 + sample2) * w; -weightSum += 2.0 * w; -} -gl_FragColor = pixelColorSum /weightSum; -}`},"radial-blur":{"radial-blur.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -const float sampleDist = 1.0; -const float sampleStrength = 2.2; -void main(void) { -float samples[10]; -samples[0] = -0.08; -samples[1] = -0.05; -samples[2] = -0.03; -samples[3] = -0.02; -samples[4] = -0.01; -samples[5] = 0.01; -samples[6] = 0.02; -samples[7] = 0.03; -samples[8] = 0.05; -samples[9] = 0.08; -vec2 dir = 0.5 - v_uv; -float dist = sqrt(dir.x * dir.x + dir.y * dir.y); -dir = dir / dist; -vec4 color = texture2D(u_colorTexture,v_uv); -vec4 sum = color; -for (int i = 0; i < 10; i++) { -sum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist); -} -sum *= 1.0 / 11.0; -float t = dist * sampleStrength; -t = clamp(t, 0.0, 1.0); -gl_FragColor = mix(color, sum, t); -}`}},dra:{"dra.frag":`precision mediump float; -uniform sampler2D u_minColor; -uniform sampler2D u_maxColor; -uniform sampler2D u_texture; -varying vec2 v_uv; -void main() { -vec4 minColor = texture2D(u_minColor, vec2(0.5)); -vec4 maxColor = texture2D(u_maxColor, vec2(0.5)); -vec4 color = texture2D(u_texture, v_uv); -vec3 minColorUnpremultiply = minColor.rgb / minColor.a; -vec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a; -vec3 colorUnpremultiply = color.rgb / color.a; -vec3 range = maxColorUnpremultiply - minColorUnpremultiply; -gl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a); -}`,"min-max":{"min-max.frag":`#extension GL_EXT_draw_buffers : require -precision mediump float; -#define CELL_SIZE 2 -uniform sampler2D u_minTexture; -uniform sampler2D u_maxTexture; -uniform vec2 u_srcResolution; -uniform vec2 u_dstResolution; -varying vec2 v_uv; -void main() { -vec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE); -vec2 onePixel = vec2(1.0) / u_srcResolution; -vec2 uv = (srcPixel + 0.5) / u_srcResolution; -vec4 minColor = vec4(1.0); -vec4 maxColor = vec4(0.0); -for (int y = 0; y < CELL_SIZE; ++y) { -for (int x = 0; x < CELL_SIZE; ++x) { -vec2 offset = uv + vec2(x, y) * onePixel; -minColor = min(minColor, texture2D(u_minTexture, offset)); -maxColor = max(maxColor, texture2D(u_maxTexture, offset)); -} -} -gl_FragData[0] = minColor; -gl_FragData[1] = maxColor; -}`}},"drop-shadow":{composite:{"composite.frag":`precision mediump float; -uniform sampler2D u_layerFBOTexture; -uniform sampler2D u_blurTexture; -uniform vec4 u_shadowColor; -uniform vec2 u_shadowOffset; -uniform highp mat3 u_displayViewMat3; -varying vec2 v_uv; -void main() { -vec3 offset = u_displayViewMat3 * vec3(u_shadowOffset, 0.0); -vec4 layerColor = texture2D(u_layerFBOTexture, v_uv); -vec4 blurColor = texture2D(u_blurTexture, v_uv - offset.xy / 2.0); -gl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor); -}`}},"edge-detect":{"frei-chen":{"frei-chen.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform vec2 u_texSize; -varying vec2 v_uv; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[9]; -const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 ); -const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 ); -const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 ); -const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 ); -const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 ); -const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 ); -const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 ); -const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 ); -const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 ); -void main() { -G[0] = g0, -G[1] = g1, -G[2] = g2, -G[3] = g3, -G[4] = g4, -G[5] = g5, -G[6] = g6, -G[7] = g7, -G[8] = g8; -mat3 I; -float cnv[9]; -vec3 sample; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 9; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]); -float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M); -gl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a); -}`},sobel:{"sobel.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -uniform vec2 u_texSize; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[2]; -const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 ); -const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 ); -void main() { -mat3 I; -float cnv[2]; -vec3 sample; -G[0] = g0; -G[1] = g1; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 2; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -gl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a); -}`}},"edge-enhance":{"edge-enhance.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -varying vec2 v_uv; -uniform vec2 u_texSize; -vec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y); -mat3 G[2]; -const mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 ); -const mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 ); -void main() { -mat3 I; -float cnv[2]; -vec3 sample; -G[0] = g0; -G[1] = g1; -for (float i = 0.0; i < 3.0; i++) { -for (float j = 0.0; j < 3.0; j++) { -sample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb; -I[int(i)][int(j)] = length(sample); -} -} -for (int i = 0; i < 2; i++) { -float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]); -cnv[i] = dp3 * dp3; -} -vec4 color = texture2D(u_colorTexture, v_uv); -gl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color); -}`},filterEffect:{"filterEffect.frag":`precision mediump float; -uniform sampler2D u_colorTexture; -uniform mat4 u_coefficients; -varying vec2 v_uv; -void main() { -vec4 color = texture2D(u_colorTexture, v_uv); -vec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0); -float a = color.a; -gl_FragColor = vec4(a * rgbw.rgb, a); -}`},pp:{"pp.vert":`precision mediump float; -attribute vec2 a_position; -varying vec2 v_uv; -void main() { -gl_Position = vec4(a_position, 0.0, 1.0); -v_uv = (a_position + 1.0) / 2.0; -}`}},raster:{bitmap:{"bitmap.frag":`precision mediump float; -varying highp vec2 v_texcoord; -uniform sampler2D u_texture; -uniform highp vec2 u_coordScale; -uniform lowp float u_opacity; -#include -void main() { -#ifdef BICUBIC -vec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale); -#else -vec4 color = texture2D(u_texture, v_texcoord); -#endif -gl_FragColor = vec4(color.rgb * u_opacity, color.a * u_opacity); -}`,"bitmap.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`},common:{"common.glsl":`uniform sampler2D u_image; -uniform int u_bandCount; -uniform bool u_flipY; -uniform float u_opacity; -uniform int u_resampling; -uniform vec2 u_srcImageSize; -#ifdef APPLY_PROJECTION -#include -#endif -#ifdef BICUBIC -#include -#endif -#ifdef BILINEAR -#include -#endif -vec2 getPixelLocation(vec2 coords) { -vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; -#ifdef APPLY_PROJECTION -targetLocation = projectPixelLocation(targetLocation); -#endif -return targetLocation; -} -bool isOutside(vec2 coords){ -if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { -return true; -} else { -return false; -} -} -vec4 getPixel(vec2 pixelLocation) { -#ifdef BICUBIC -vec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize); -#elif defined(BILINEAR) -vec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize); -#else -vec4 color = texture2D(u_image, pixelLocation); -#endif -return color; -}`,"common.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform highp float u_scale; -uniform highp vec2 u_offset; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos * u_scale + u_offset; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`,"contrastBrightness.glsl":`uniform float u_contrastOffset; -uniform float u_brightnessOffset; -vec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) { -vec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel; -float maxI = 255.0; -float mid = 128.0; -float c = u_contrastOffset; -float b = u_brightnessOffset; -vec4 v; -if (c > 0.0 && c < 100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid; -} else if (c <= 0.0 && c > -100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid; -} else if (c == 100.0) { -v = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b); -v = (sign(v) + 1.0) / 2.0; -} else if (c == -100.0) { -v = vec4(mid, mid, mid, currentPixel.a); -} -vec3 rgb = clamp(v.rgb / 255.0, 0.0, 1.0); -return vec4(rgb, currentPixel.a); -}`,"getSurfaceValues.glsl":`#include -void getSurfaceValues(sampler2D imageTexture, vec2 texCoord, vec2 srcImageSize, inout float values[10]) { -vec2 onePixel = 1.0 / srcImageSize; -vec4 va = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, -1.0))); -vec4 vb = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, -1.0))); -vec4 vc = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, -1.0))); -vec4 vd = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 0.0))); -vec4 ve = texture2D(imageTexture, mirror(texCoord)); -vec4 vf = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 0.0))); -vec4 vg = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 1.0))); -vec4 vh = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, 1.0))); -vec4 vi = texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 1.0))); -float alpha = va.a * vb.a * vc.a * vd.a * ve.a * vf.a * vg.a * vh.a * vi.a; -values[0] = va.r; -values[1] = vb.r; -values[2] = vc.r; -values[3] = vd.r; -values[4] = ve.r; -values[5] = vf.r; -values[6] = vg.r; -values[7] = vh.r; -values[8] = vi.r; -values[9] = alpha; -}`,"inverse.glsl":`float invertValue(float value) { -float s = sign(value); -return (s * s) / (value + abs(s) - 1.0); -}`,"mirror.glsl":`vec2 mirror(vec2 pos) { -vec2 pos1 = abs(pos); -return step(pos1, vec2(1.0, 1.0)) * pos1 + step(1.0, pos1) * (2.0 - pos1); -}`,"projection.glsl":`uniform sampler2D u_transformGrid; -uniform vec2 u_transformSpacing; -uniform vec2 u_transformGridSize; -uniform vec2 u_targetImageSize; -vec2 projectPixelLocation(vec2 coords) { -#ifdef LOOKUP_PROJECTION -vec4 pv = texture2D(u_transformGrid, coords); -return vec2(pv.r, pv.g); -#endif -vec2 index_image = floor(coords * u_targetImageSize); -vec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t); -vec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize; -vec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing); -vec2 srcLocation; -vec2 transform_location = index_transform + oneTransformPixel * 0.5; -if (pos.s <= pos.t) { -vec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t)); -vec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t)); -srcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0)); -srcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0)); -} else { -vec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t)); -vec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t)); -srcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0)); -srcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0)); -} -return srcLocation; -}`},flow:{"getFadeOpacity.glsl":`uniform float u_decayRate; -uniform float u_fadeToZero; -float getFadeOpacity(float x) { -float cutOff = mix(0.0, exp(-u_decayRate), u_fadeToZero); -return (exp(-u_decayRate * x) - cutOff) / (1.0 - cutOff); -}`,"getFragmentColor.glsl":`vec4 getFragmentColor(vec4 color, float dist, float size, float featheringSize) { -float featheringStart = clamp(0.5 - featheringSize / size, 0.0, 0.5); -if (dist > featheringStart) { -color *= 1.0 - (dist - featheringStart) / (0.5 - featheringStart); -} -return color; -}`,imagery:{"imagery.frag":`precision highp float; -varying vec2 v_texcoord; -uniform sampler2D u_texture; -uniform float u_Min; -uniform float u_Max; -uniform float u_featheringSize; -#include -float getIntensity(float v) { -return u_Min + v * (u_Max - u_Min); -} -void main(void) { -vec4 sampled = texture2D(u_texture, v_texcoord); -float intensity = getIntensity(sampled.r); -gl_FragColor = getColor(intensity); -gl_FragColor.a *= getOpacity(sampled.r); -gl_FragColor.a *= sampled.a; -gl_FragColor.rgb *= gl_FragColor.a; -}`,"imagery.vert":`attribute vec2 a_position; -attribute vec2 a_texcoord; -uniform mat3 u_dvsMat3; -varying vec2 v_texcoord; -void main(void) { -vec2 xy = (u_dvsMat3 * vec3(a_position, 1.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_texcoord = a_texcoord; -}`},particles:{"particles.frag":`precision highp float; -varying vec4 v_color; -varying vec2 v_texcoord; -varying float v_size; -uniform float u_featheringSize; -#include -void main(void) { -gl_FragColor = getFragmentColor(v_color, length(v_texcoord - 0.5), v_size, u_featheringSize); -}`,"particles.vert":`attribute vec4 a_xyts0; -attribute vec4 a_xyts1; -attribute vec4 a_typeIdDurationSeed; -attribute vec4 a_extrudeInfo; -uniform mat3 u_dvsMat3; -uniform mat3 u_displayViewMat3; -uniform float u_time; -uniform float u_trailLength; -uniform float u_flowSpeed; -varying vec4 v_color; -varying vec2 v_texcoord; -varying float v_size; -uniform float u_featheringSize; -uniform float u_introFade; -#include -#include -void main(void) { -vec2 position0 = a_xyts0.xy; -float t0 = a_xyts0.z; -float speed0 = a_xyts0.w; -vec2 position1 = a_xyts1.xy; -float t1 = a_xyts1.z; -float speed1 = a_xyts1.w; -float type = a_typeIdDurationSeed.x; -float id = a_typeIdDurationSeed.y; -float duration = a_typeIdDurationSeed.z; -float seed = a_typeIdDurationSeed.w; -vec2 e0 = a_extrudeInfo.xy; -vec2 e1 = a_extrudeInfo.zw; -float animationPeriod = duration + u_trailLength; -float scaledTime = u_time * u_flowSpeed; -float randomizedTime = scaledTime + seed * animationPeriod; -float t = mod(randomizedTime, animationPeriod); -float fUnclamped = (t - t0) / (t1 - t0); -float f = clamp(fUnclamped, 0.0, 1.0); -float clampedTime = mix(t0, t1, f); -float speed = mix(speed0, speed1, f); -vec2 extrude; -vec2 position; -float fadeOpacity; -float introOpacity; -if (type == 2.0) { -if (fUnclamped < 0.0 || (fUnclamped > 1.0 && t1 != duration)) { -gl_Position = vec4(0.0, 0.0, -2.0, 1.0); -return; -} -vec2 ortho = mix(e0, e1, f); -vec2 parallel; -parallel = normalize(position1 - position0) * 0.5; -if (id == 1.0) { -extrude = ortho; -v_texcoord = vec2(0.5, 0.0); -} else if (id == 2.0) { -extrude = -ortho; -v_texcoord = vec2(0.5, 1.0); -} else if (id == 3.0) { -extrude = ortho + parallel; -v_texcoord = vec2(1.0, 0.0); -} else if (id == 4.0) { -extrude = -ortho + parallel; -v_texcoord = vec2(1.0, 1.0); -} -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} else { -if (fUnclamped < 0.0) { -gl_Position = vec4(0.0, 0.0, -2.0, 1.0); -return; -} -if (id == 1.0) { -extrude = e0; -v_texcoord = vec2(0.5, 0.0); -fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); -introOpacity = 1.0 - exp(-t0); -v_size = getSize(speed0); -v_color = getColor(speed0); -v_color.a *= getOpacity(speed0); -position = position0; -} else if (id == 2.0) { -extrude = -e0; -v_texcoord = vec2(0.5, 1.0); -fadeOpacity = getFadeOpacity((t - t0) / u_trailLength); -introOpacity = 1.0 - exp(-t0); -v_size = getSize(speed0); -v_color = getColor(speed0); -v_color.a *= getOpacity(speed0); -position = position0; -} else if (id == 3.0) { -extrude = mix(e0, e1, f); -v_texcoord = vec2(0.5, 0.0); -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} else if (id == 4.0) { -extrude = -mix(e0, e1, f); -v_texcoord = vec2(0.5, 1.0); -fadeOpacity = getFadeOpacity((t - clampedTime) / u_trailLength); -introOpacity = 1.0 - exp(-clampedTime); -v_size = getSize(speed); -v_color = getColor(speed); -v_color.a *= getOpacity(speed); -position = mix(position0, position1, f); -} -} -vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(extrude * v_size, 0.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_color.a *= fadeOpacity; -v_color.a *= mix(1.0, introOpacity, u_introFade); -v_color.rgb *= v_color.a; -}`},streamlines:{"streamlines.frag":`precision highp float; -varying float v_side; -varying float v_time; -varying float v_totalTime; -varying float v_timeSeed; -varying vec4 v_color; -varying float v_size; -uniform float u_time; -uniform float u_trailLength; -uniform float u_flowSpeed; -uniform float u_featheringSize; -uniform float u_introFade; -#include -#include -void main(void) { -float t = mod(v_timeSeed * (v_totalTime + u_trailLength) + u_time * u_flowSpeed, v_totalTime + u_trailLength) - v_time; -vec4 color = v_color * step(0.0, t) * getFadeOpacity(t / u_trailLength); -color *= mix(1.0, 1.0 - exp(-v_time), u_introFade); -gl_FragColor = getFragmentColor(color, length((v_side + 1.0) / 2.0 - 0.5), v_size, u_featheringSize); -}`,"streamlines.vert":`attribute vec3 a_positionAndSide; -attribute vec3 a_timeInfo; -attribute vec2 a_extrude; -attribute float a_speed; -uniform mat3 u_dvsMat3; -uniform mat3 u_displayViewMat3; -varying float v_time; -varying float v_totalTime; -varying float v_timeSeed; -varying vec4 v_color; -varying float v_side; -varying float v_size; -uniform float u_featheringSize; -#include -void main(void) { -vec4 lineColor = getColor(a_speed); -float lineOpacity = getOpacity(a_speed); -float lineSize = getSize(a_speed); -vec2 position = a_positionAndSide.xy; -v_side = a_positionAndSide.z; -vec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineSize, 0.0)).xy; -gl_Position = vec4(xy, 0.0, 1.0); -v_time = a_timeInfo.x; -v_totalTime = a_timeInfo.y; -v_timeSeed = a_timeInfo.z; -v_color = lineColor; -v_color.a *= lineOpacity; -v_color.rgb *= v_color.a; -v_size = lineSize; -}`},"vv.glsl":`#define MAX_STOPS 8 -#ifdef VV_COLOR -uniform float u_color_stops[MAX_STOPS]; -uniform vec4 u_color_values[MAX_STOPS]; -uniform int u_color_count; -#else -uniform vec4 u_color; -#endif -#ifdef VV_OPACITY -uniform float u_opacity_stops[MAX_STOPS]; -uniform float u_opacity_values[MAX_STOPS]; -uniform int u_opacity_count; -#else -uniform float u_opacity; -#endif -#ifdef VV_SIZE -uniform float u_size_stops[MAX_STOPS]; -uniform float u_size_values[MAX_STOPS]; -uniform int u_size_count; -#else -uniform float u_size; -#endif -uniform float u_featheringOffset; -vec4 getColor(float x) { -#ifdef VV_COLOR -vec4 color = u_color_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_color_count) { -break; -} -float x1 = u_color_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_color_stops[i]; -vec4 y2 = u_color_values[i]; -if (x < x2) { -vec4 y1 = u_color_values[i - 1]; -color = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -color = y2; -} -} -} -#else -vec4 color = u_color; -#endif -return color; -} -float getOpacity(float x) { -#ifdef VV_OPACITY -float opacity = u_opacity_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_opacity_count) { -break; -} -float x1 = u_opacity_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_opacity_stops[i]; -float y2 = u_opacity_values[i]; -if (x < x2) { -float y1 = u_opacity_values[i - 1]; -opacity = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -opacity = y2; -} -} -} -#else -float opacity = u_opacity; -#endif -return opacity; -} -float getSize(float x) { -#ifdef VV_SIZE -float size = u_size_values[0]; -{ -for (int i = 1; i < MAX_STOPS; i++) { -if (i >= u_size_count) { -break; -} -float x1 = u_size_stops[i - 1]; -if (x < x1) { -break; -} -float x2 = u_size_stops[i]; -float y2 = u_size_values[i]; -if (x < x2) { -float y1 = u_size_values[i - 1]; -size = y1 + (y2 - y1) * (x - x1) / (x2 - x1); -} else { -size = y2; -} -} -} -#else -float size = u_size; -#endif -return size + 2.0 * u_featheringSize * u_featheringOffset; -}`},hillshade:{"hillshade.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -uniform int u_hillshadeType; -uniform float u_sinZcosAs[6]; -uniform float u_sinZsinAs[6]; -uniform float u_cosZs[6]; -uniform float u_weights[6]; -uniform vec2 u_factor; -uniform float u_minValue; -uniform float u_maxValue; -uniform float u_scaling; -#include -#include -vec3 rgb2hsv(vec3 c) { -vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); -vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); -float d = q.x - min(q.w, q.y); -float e = 1.0e-10; -return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); -} -vec3 hsv2rgb(vec3 c) { -vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); -return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} -vec4 overlay(float val, float minValue, float maxValue, float hillshade) { -val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); -vec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0); -vec3 hsv = rgb2hsv(rgb.xyz); -hsv.z = hillshade; -return vec4(hsv2rgb(hsv) * u_scaling, 1.0) * rgb.a; -} -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -if (currentPixel.a == 0.0) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -float pv[10]; -getSurfaceValues(u_image, pixelLocation, u_srcImageSize, pv); -float alpha = pv[9]; -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * u_factor.s; -float dzy = (pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * u_factor.t; -float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); -float hillshade = 0.0; -if (u_hillshadeType == 0){ -float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; -float z = (u_cosZs[0] + cosDelta) / dzd; -if (z < 0.0) z = 0.0; -hillshade = z; -} else { -for (int k = 0; k < 6; k++) { -float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; -float z = (u_cosZs[k] + cosDelta) / dzd; -if (z < 0.0) z = 0.0; -hillshade = hillshade + z * u_weights[k]; -if (k == 5) break; -} -} -#ifdef APPLY_COLORMAP -vec4 result = overlay(pv[4], u_minValue, u_maxValue, hillshade) * alpha * u_opacity; -#else -hillshade *= u_scaling; -vec4 result = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity; -#endif -#ifdef ROUND_OUTPUT -result = vec4(floor(result.xyz + 0.5), result.a); -#endif -gl_FragColor = result; -}`},lut:{"colorize.glsl":`uniform sampler2D u_colormap; -uniform float u_colormapOffset; -uniform float u_colormapMaxIndex; -vec4 colorize(vec4 currentPixel, float scaleFactor) { -float clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex); -vec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0); -vec4 color = texture2D(u_colormap, clrPosition); -vec4 result = vec4(color.rgb, color.a * currentPixel.a); -return result; -} -vec4 colorizeNoClamp(vec4 currentPixel, float scaleFactor) { -float value = currentPixel.r * scaleFactor - u_colormapOffset; -vec4 result = colorize(currentPixel, scaleFactor); -return result * step(0.0, value) * step(value, u_colormapMaxIndex); -}`,"lut.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -#include -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -vec4 result = colorizeNoClamp(currentPixel, 1.0); -gl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity; -}`},magdir:{"magdir.frag":`precision mediump float; -varying vec4 v_color; -uniform lowp float u_opacity; -void main() { -gl_FragColor = v_color * u_opacity; -}`,"magdir.vert":`precision mediump float; -attribute vec2 a_pos; -attribute vec2 a_offset; -attribute vec2 a_vv; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform vec2 u_symbolSize; -uniform vec2 u_symbolPercentRange; -uniform vec2 u_dataRange; -uniform float u_rotation; -uniform vec4 u_colors[12]; -varying vec4 v_color; -void main() -{ -float angle = a_offset.y + u_rotation; -#ifndef ROTATION_GEOGRAPHIC -angle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0; -#endif -vec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x; -#ifdef DATA_RANGE -float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); -float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); -float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); -#else -float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; -#endif -vec2 pos = a_pos + offset * sizePercentage * u_symbolSize; -v_color = u_colors[int(a_vv.x)]; -gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); -}`},reproject:{"reproject.frag":`precision mediump float; -varying vec2 v_texcoord; -#include -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; -}`,"reproject.vert":`precision mediump float; -attribute vec2 a_position; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_position; -gl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0); -}`},rfx:{aspect:{"aspect.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_cellSize; -uniform vec2 u_srcImageSize; -#include -const float pi = 3.14159265359; -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) / (8.0 * u_cellSize[0]); -float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) / (8.0 * u_cellSize[1]); -alpha *= sign(abs(dzx) + abs(dzy)); -float aspect_rad = (dzx == 0.0) ? (step(0.0, dzy) * 0.5 * pi + step(dzy, 0.0) * 1.5 * pi) : mod((2.5 * pi + atan(dzy, -dzx)), 2.0 * pi); -float aspect = aspect_rad * 180.0 / pi; -gl_FragColor = vec4(aspect, aspect, aspect, 1.0) * alpha; -}`},bandarithmetic:{"bandarithmetic.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -uniform float u_adjustments[3]; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -float nir = pv2.r; -float red = pv2.g; -float index; -#ifdef NDXI -index = (nir - red) * invertValue(nir + red); -#elif defined(SR) -index = nir * invertValue(red); -#elif defined(CI) -index = nir * invertValue(red) - 1.0; -#elif defined(SAVI) -index = (nir - red) * invertValue(nir + red + u_adjustments[0]) * (1.0 + u_adjustments[0]); -#elif defined(TSAVI) -float s = u_adjustments[0]; -float a = u_adjustments[1]; -float x = u_adjustments[2]; -float y = -a * s + x * (1.0 + s * s); -index = (s * (nir - s * red - a)) * invertValue(a * nir + red + y); -#elif defined(MSAVI) -float nir2 = 2.0 * nir + 1.0; -index = 0.5 * (nir2 - sqrt(nir2 * nir2 - 8.0 * (nir - red))); -#elif defined(GEMI) -float eta = (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) * invertValue(nir + red + 0.5); -index = eta * (1.0 - 0.25 * eta) - (red - 0.125) * invertValue(1.0 - red); -#elif defined(PVI) -float a = u_adjustments[0]; -float b = u_adjustments[1]; -float y = sqrt(1.0 + a * a); -index = (nir - a * red - b) * invertValue(y); -#elif defined(VARI) -index = (pv2.g - pv2.r) * invertValue(pv2.g + pv2.r - pv2.b); -#elif defined(MTVI) -float green = pv2.b; -float v = sqrt(pow((2.0 * nir + 1.0), 2.0) - (6.0 * nir - 5.0 * sqrt(red)) - 0.5); -index = 1.5 * (1.2 * (nir - green) - 2.5 * (red - green)) * invertValue(v); -#elif defined(RTVICORE) -float green = pv2.b; -index = 100.0 * (nir - red) - 10.0 * (nir - green); -#elif defined(EVI) -float blue = pv2.b; -float denom = nir + 6.0 * red - 7.5 * blue + 1.0; -index = (2.5 * (nir - red)) * invertValue(denom); -#elif defined(WNDWI) -float g = pv2.r; -float n = pv2.g; -float s = pv2.b; -float a = u_adjustments[0]; -float denom = g + a * n + (1.0 - a) * s; -index = (g - a * n - (1.0 - a) * s) * invertValue(denom); -#elif defined(BAI) -index = invertValue(pow((0.1 - red), 2.0) + pow((0.06 - nir), 2.0)); -#else -gl_FragColor = pv; -return; -#endif -#ifdef ROUND_OUTPUT -index = floor(index + 0.5); -#endif -gl_FragColor = vec4(index, index, index, pv.a); -}`},colormap2rgb:{"colormap2rgb.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec4 result = colorizeNoClamp(vec4(pv.r, pv.r, pv.r, 1.0), 1.0); -gl_FragColor = vec4(result.xyz * 255.0, 1.0) * result.a * pv.a; -}`},compositeband:{"compositeband.frag":`precision mediump float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -uniform sampler2D u_image2; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -#ifdef TWO_CONSTANT -uniform float u_image2Const; -#endif -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -float alpha = pv0.a; -#ifdef TWO_CONSTANT -float b = u_image1Const; -float c = u_image2Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#elif defined(ONE_CONSTANT) -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -float c = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -alpha *= pv1.a; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -vec4 pv2 = texture2D(u_image2, v_texcoord); -float b = pv1.r; -float c = pv2.r; -alpha = alpha * pv1.a * pv2.a; -#endif -gl_FragColor = vec4(a, b, c, alpha); -}`},computechange:{"computechange.frag":`precision mediump float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -uniform vec2 u_domainRange; -#include -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -#ifdef ONE_CONSTANT -float b = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, 0); -a = abc.s; -b = abc.t; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -#endif -float result = a; -float alpha = pv0.a; -#ifdef DIFFERENCE -result = a - b; -#elif defined(RELATIVE) -result = (a - b) * invertValue(max(abs(a), abs(b))); -#endif -bool isInvalid = result < u_domainRange.s || result > u_domainRange.t; -result = isInvalid ? 0.0 : result; -alpha *= float(!isInvalid); -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},contrast:{"contrast.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec4 result = adjustContrastBrightness(pv, false); -gl_FragColor = vec4(floor(result.rgb * 255.0 + 0.5), result.a); -}`},convolution:{"convolution.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_srcImageSize; -#define KERNEL_SIZE_ROWS ROWS -#define KERNEL_SIZE_COLS COLS -uniform vec2 u_clampRange; -uniform float u_kernel[25]; -#include -void main() { -vec3 rgb = vec3(0.0, 0.0, 0.0); -vec2 resolution = 1.0 / u_srcImageSize; -float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); -float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); -float alpha = 1.0; -for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { -float pos_row = rowOffset + float(row); -for (int col = 0; col < KERNEL_SIZE_COLS; col++) { -vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; -vec4 pv = texture2D(u_image, mirror(pos)); -rgb += pv.rgb * u_kernel[row * KERNEL_SIZE_COLS + col]; -alpha *= pv.a; -} -} -rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); -gl_FragColor = vec4(rgb * alpha, alpha); -}`},curvature:{"curvature.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform float u_zlFactor; -uniform vec2 u_srcImageSize; -#include -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float d = ((pv[3] + pv[5]) * 0.5 - pv[4]); -float e = ((pv[1] + pv[7]) * 0.5 - pv[4]); -float curvature = 0.0; -#ifdef STANDARD -curvature = -u_zlFactor * (d + e); -gl_FragColor = vec4(curvature, curvature, curvature, alpha); -#else -float f = (-pv[0] + pv[2] + pv[6] - pv[8]) / 4.0; -float g = (-pv[3] + pv[5]) / 2.0; -float h = (pv[1] - pv[7]) / 2.0; -float g2 = g * g; -float h2 = h * h; -#ifdef PROFILE -curvature = (u_zlFactor * (d * g2 + e * h2 + f * g * h)) / (g2 + h2); -#else -curvature = (-u_zlFactor * (d * h2 + e * g2 - f * g * h)) / (g2 + h2); -#endif -#endif -gl_FragColor = vec4(curvature, curvature, curvature, alpha); -}`},extractband:{"extractband.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -gl_FragColor = vec4(pv2, pv.a); -}`},focalstatistics:{"focalstatistics.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_srcImageSize; -#define KERNEL_SIZE_ROWS ROWS -#define KERNEL_SIZE_COLS COLS -uniform vec2 u_clampRange; -#include -#include -void main() { -vec2 resolution = 1.0 / u_srcImageSize; -float rowOffset = -float(floor(float(KERNEL_SIZE_ROWS) / 2.0)); -float colOffset = -float(floor(float(KERNEL_SIZE_COLS) / 2.0)); -float count = 0.0; -#ifdef STDDEV -vec3 sum = vec3(0.0, 0.0, 0.0); -vec3 sum2 = vec3(0.0, 0.0, 0.0); -#endif -vec4 currentPixel = texture2D(u_image, v_texcoord); -vec3 rgb = currentPixel.rgb; -for (int row = 0; row < KERNEL_SIZE_ROWS; row++) { -float pos_row = rowOffset + float(row); -for (int col = 0; col < KERNEL_SIZE_COLS; col++) { -vec2 pos = v_texcoord + vec2(colOffset + float(col), pos_row) * resolution; -vec4 pv = texture2D(u_image, mirror(pos)); -count += pv.a; -#ifdef MIN -rgb = min(rgb, pv.rgb); -#elif defined(MAX) -rgb = max(rgb, pv.rgb); -#elif defined(MEAN) -rgb += pv.rgb; -#elif defined(STDDEV) -sum += pv.rgb; -sum2 += (pv.rgb * pv.rgb); -#endif -} -} -#ifdef MEAN -rgb *= invertValue(count); -#elif defined(STDDEV) -rgb = sqrt((sum2 - sum * sum * invertValue(count)) * invertValue(count)); -#endif -float alpha = step(0.9999, count); -rgb = clamp(rgb, u_clampRange.s, u_clampRange.t); -#ifdef FILL -rgb = (1.0 - currentPixel.a) * rgb + currentPixel.a * currentPixel.rgb; -#endif -gl_FragColor = vec4(rgb * alpha, alpha); -}`},grayscale:{"grayscale.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec3 u_weights; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float value = dot(u_weights, pv.rgb); -gl_FragColor = vec4(value, value, value, pv.a); -}`},local:{"local.frag":`precision highp float; -uniform sampler2D u_image; -uniform sampler2D u_image1; -#ifdef ONE_CONSTANT -uniform float u_image1Const; -#ifdef TWO_CONSTANT -uniform float u_image2Const; -#endif -uniform mat3 u_imageSwap; -#endif -varying vec2 v_texcoord; -uniform vec2 u_domainRange; -#include -void main() { -vec4 pv0 = texture2D(u_image, v_texcoord); -float a = pv0.r; -#ifdef TWO_IMAGES -#ifdef ONE_CONSTANT -float b = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, 0); -a = abc.s; -b = abc.t; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -#endif -#elif defined(CONDITIONAL) -#ifdef TWO_CONSTANT -float b = u_image1Const; -float c = u_image2Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#elif defined(ONE_CONSTANT) -vec4 pv1 = texture2D(u_image1, v_texcoord); -float b = pv1.r; -float c = u_image1Const; -vec3 abc = u_imageSwap * vec3(a, b, c); -a = abc.s; -b = abc.t; -c = abc.p; -#else -vec4 pv1 = texture2D(u_image1, v_texcoord); -vec4 pv2 = texture2D(u_image2, v_texcoord); -float b = pv1.r; -float c = pv2.r; -#endif -#endif -float result = a; -float alpha = pv0.a; -#ifdef PLUS -result = a + b; -#elif defined(MINUS) -result = a - b; -#elif defined(TIMES) -result = a * b; -#elif defined(DIVIDE) -result = a * invertValue(b); -alpha *= float(abs(sign(b))); -#elif defined(FLOATDIVIDE) -result = a * invertValue(b); -alpha *= float(abs(sign(b))); -#elif defined(FLOORDIVIDE) -result = floor(a * invertValue(b)); -alpha *= float(abs(sign(b))); -#elif defined(SQUARE) -result = a * a; -#elif defined(SQRT) -result = sqrt(a); -#elif defined(POWER) -result = pow(a, b); -#elif defined(LN) -result = a <= 0.0 ? 0.0: log(a); -alpha *= float(a > 0.0); -#elif defined(LOG_1_0) -result = a <= 0.0 ? 0.0: log2(a) * invertValue(log2(10.0)); -alpha *= float(a > 0.0); -#elif defined(LOG_2) -result = a <= 0.0 ? 0.0: log2(a); -alpha *= float(a > 0.0); -#elif defined(EXP) -result = exp(a); -#elif defined(EXP_1_0) -result = pow(10.0, a); -#elif defined(EXP_2) -result = pow(2.0, a); -#elif defined(ROUNDDOWN) -result = floor(a); -#elif defined(ROUNDUP) -result = ceil(a); -#elif defined(INT) -result = float(sign(a)) * floor(abs(a)); -#elif defined(MOD) -result = mod(a, b); -#elif defined(NEGATE) -result = -a; -#elif defined(ABS) -result = abs(a); -#elif defined(ACOS) -result = abs(a) > 1.0 ? 0.0: acos(a); -alpha *= step(abs(a), 1.00001); -#elif defined(ACOSH) -result = acosh(a); -#elif defined(ASIN) -result = abs(a) > 1.0 ? 0.0: asin(a); -alpha *= step(abs(a), 1.00001); -#elif defined(ASINH) -result = asinh(a); -#elif defined(ATAN) -result = atan(a); -#elif defined(ATANH) -result = abs(a) > 1.0 ? 0.0: atanh(a); -alpha *= step(abs(a), 1.0); -#elif defined(ATAN_2) -result = atan(a, b); -#elif defined(COS) -result = cos(a); -#elif defined(COSH) -result = cosh(a); -#elif defined(SIN) -result = sin(a); -#elif defined(SINH) -result = sinh(a); -#elif defined(TAN) -result = tan(a); -#elif defined(TANH) -result = tanh(a); -#elif defined(BITWISEAND) -result = float(int(a) & int(b)); -#elif defined(BITWISEOR) -result = float(int(a) | int(b)); -#elif defined(BITWISELEFTSHIFT) -result = float(int(a) << int(b)); -#elif defined(BITWISERIGHTSHIFT) -result = float(int(a) >> int(b)); -#elif defined(BITWISENOT) -result = float(~(int(a))); -#elif defined(BITWISEXOR) -result = float(int(a) ^ int(b)); -#elif defined(BOOLEANAND) -result = float((a != 0.0) && (b != 0.0)); -#elif defined(BOOLEANNOT) -result = float(a == 0.0); -#elif defined(BOOLEANOR) -result = float((a != 0.0) || (b != 0.0)); -#elif defined(BOOLEANXOR) -result = float((a != 0.0) ^^ (b != 0.0)); -#elif defined(GREATERTHAN) -result = float(a > b); -#elif defined(GREATERTHANEQUAL) -result = float(a >= b); -#elif defined(LESSTHAN) -result = float(a < b); -#elif defined(LESSTHANEQUAL) -result = float(a <= b); -#elif defined(EQUALTO) -result = float(a == b); -#elif defined(NOTEQUAL) -result = float(a != b); -#elif defined(ISNULL) -result = float(alpha == 0.0); -alpha = 1.0; -#elif defined(SETNULL) -float maskValue = float(a == 0.0); -result = maskValue * b; -alpha *= maskValue; -#elif defined(CONDITIONAL) -float weight = float(abs(sign(a))); -result = weight * b + (1.0 - weight) * c; -#endif -float rangeFactor = step(u_domainRange.s, result) * step(result, u_domainRange.t); -result *= rangeFactor; -alpha *= rangeFactor; -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},mask:{"mask.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#define LEN_INCLUDED_RANGES 6 -#define LEN_NODATA_VALUES 6 -uniform highp float u_includedRanges[6]; -uniform highp float u_noDataValues[6]; -float maskFactor(float bandValue, float fromValue, float to) { -float factor = 1.0; -for (int i = 0; i < LEN_NODATA_VALUES; i++) { -factor *= float(u_noDataValues[i] != bandValue); -} -factor *= step(fromValue, bandValue) * step(bandValue, to); -return factor; -} -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float redFactor = maskFactor(pv.r, u_includedRanges[0], u_includedRanges[1]); -#ifdef MULTI_BAND -float greenFactor = maskFactor(pv.g, u_includedRanges[2], u_includedRanges[3]); -float blueFactor = maskFactor(pv.b, u_includedRanges[4], u_includedRanges[5]); -float maskFactor = redFactor * greenFactor * blueFactor; -gl_FragColor = pv * maskFactor; -#else -gl_FragColor = pv * redFactor; -#endif -}`},ndvi:{"ndvi.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform mediump mat3 u_bandIndexMat3; -#include -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -vec3 pv2 = u_bandIndexMat3 * pv.rgb; -float nir = pv2.r; -float red = pv2.g; -float index = (nir - red) * invertValue(nir + red); -#ifdef SCALED -index = floor((index + 1.0) * 100.0 + 0.5); -#endif -gl_FragColor = vec4(index, index, index, pv.a); -}`},remap:{"remap.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -#define LEN_REMAP_RANGES 18 -#define LEN_NODATA_RANGES 12 -uniform highp float u_rangeMaps[18]; -uniform highp float u_noDataRanges[12]; -uniform highp float u_unmatchMask; -uniform vec2 u_clampRange; -void main() { -vec4 pv = texture2D(u_image, v_texcoord); -float factor = 1.0; -float bandValue = pv.r; -for (int i = 0; i < LEN_NODATA_RANGES; i+=2) { -float inside = 1.0 - step(u_noDataRanges[i], bandValue) * step(bandValue, u_noDataRanges[i+1]); -factor *= inside; -} -float mapValue = 0.0; -float includeMask = 0.0; -for (int i = 0; i < LEN_REMAP_RANGES; i+=3) { -float stepMask = step(u_rangeMaps[i], bandValue) * step(bandValue, u_rangeMaps[i+1]); -includeMask = (1.0 - stepMask) * includeMask + stepMask; -mapValue = (1.0 - stepMask) * mapValue + stepMask * u_rangeMaps[i+2]; -} -bandValue = factor * (mapValue + (1.0 - includeMask) * u_unmatchMask * pv.r); -float bandMask = factor * max(u_unmatchMask, includeMask); -bandValue = clamp(bandValue, u_clampRange.s, u_clampRange.t); -gl_FragColor = vec4(bandValue, bandValue, bandValue, bandMask * pv.a); -}`},slope:{"slope.frag":`precision mediump float; -uniform sampler2D u_image; -varying vec2 v_texcoord; -uniform vec2 u_cellSize; -uniform float u_zFactor; -uniform vec2 u_srcImageSize; -uniform float u_pixelSizePower; -uniform float u_pixelSizeFactor; -#include -void main() { -float pv[10]; -getSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv); -float alpha = pv[9]; -float xf = (u_zFactor + pow(u_cellSize[0], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[0]); -float yf = (u_zFactor + pow(u_cellSize[1], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[1]); -float dzx = (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * xf; -float dzy = -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * yf; -float rise2run = sqrt(dzx * dzx + dzy * dzy); -#ifdef PERCENT_RISE -float result = rise2run * 100.0; -#else -float result = atan(rise2run) * 57.2957795; -#endif -#ifdef ROUND_OUTPUT -result = floor(result + 0.5); -#endif -gl_FragColor = vec4(result, result, result, alpha); -}`},stretch:{"stretch.frag":`precision mediump float; -uniform sampler2D u_image; -varying highp vec2 v_texcoord; -uniform float u_minCutOff[3]; -uniform float u_maxCutOff[3]; -uniform float u_minOutput; -uniform float u_maxOutput; -uniform float u_factor[3]; -uniform float u_gamma[3]; -uniform float u_gammaCorrection[3]; -float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection) { -val = clamp(val, minCutOff, maxCutOff); -float stretchedVal; -#ifdef USE_GAMMA -float tempf = 1.0; -float outRange = maxOutput - minOutput; -float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); -tempf -= step(1.0, gamma) * sign(gamma - 1.0) * pow(1.0 / outRange, relativeVal * gammaCorrection); -stretchedVal = tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput; -stretchedVal = clamp(stretchedVal, minOutput, maxOutput); -#else -stretchedVal = minOutput + (val - minCutOff) * factor; -#endif -#ifdef ROUND_OUTPUT -stretchedVal = floor(stretchedVal + 0.5); -#endif -return stretchedVal; -} -void main() { -vec4 currentPixel = texture2D(u_image, v_texcoord); -float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_gamma[0], u_gammaCorrection[0]); -#ifdef MULTI_BAND -float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_gamma[1], u_gammaCorrection[1]); -float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_gamma[2], u_gammaCorrection[2]); -gl_FragColor = vec4(redVal, greenVal, blueVal, currentPixel.a); -#else -gl_FragColor = vec4(redVal, redVal, redVal, currentPixel.a); -#endif -}`},vs:{"vs.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -varying highp vec2 v_texcoord; -void main() -{ -v_texcoord = a_pos; -gl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0); -}`}},scalar:{"scalar.frag":`precision mediump float; -uniform lowp float u_opacity; -varying vec2 v_pos; -const vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0); -const float outlineSize = 0.02; -const float innerRadius = 0.25; -const float outerRadius = 0.42; -const float innerSquareLength = 0.15; -void main() { -mediump float dist = length(v_pos); -mediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist); -fillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist)); -#ifdef INNER_CIRCLE -mediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist); -fillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist)); -#else -mediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0); -#endif -gl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity; -}`,"scalar.vert":`precision mediump float; -attribute vec2 a_pos; -attribute vec2 a_offset; -attribute vec2 a_vv; -uniform highp mat3 u_dvsMat3; -uniform highp vec2 u_coordScale; -uniform vec2 u_symbolSize; -uniform vec2 u_symbolPercentRange; -uniform vec2 u_dataRange; -varying vec2 v_pos; -void main() -{ -#ifdef DATA_RANGE -float valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0); -float sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x); -float sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y); -#else -float sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0; -#endif -vec2 size = u_symbolSize * sizePercentage; -vec2 pos = a_pos + a_offset * size; -v_pos = a_offset; -gl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0); -}`},stretch:{"stretch.frag":`precision mediump float; -varying highp vec2 v_texcoord; -#include -uniform float u_minCutOff[3]; -uniform float u_maxCutOff[3]; -uniform float u_minOutput; -uniform float u_maxOutput; -uniform float u_factor[3]; -uniform bool u_useGamma; -uniform float u_gamma[3]; -uniform float u_gammaCorrection[3]; -#include -float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { -if (val >= maxCutOff) { -return maxOutput; -} else if (val <= minCutOff) { -return minOutput; -} -float stretchedVal; -if (useGamma) { -float tempf = 1.0; -float outRange = maxOutput - minOutput; -float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); -if (gamma > 1.0) { -tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); -} -stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; -} else { -stretchedVal = minOutput + (val - minCutOff) * factor; -} -#ifdef ROUND_OUTPUT -stretchedVal = floor(stretchedVal + 0.5); -#endif -return stretchedVal; -} -void main() { -vec2 pixelLocation = getPixelLocation(v_texcoord); -if (isOutside(pixelLocation)) { -gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -return; -} -vec4 currentPixel = getPixel(pixelLocation); -#ifdef NOOP -gl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity; -return; -#endif -if (u_bandCount == 1) { -float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); -#ifdef APPLY_COLORMAP -vec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0); -gl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity; -#else -gl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity; -#endif -} else { -float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); -float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); -float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); -gl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity; -} -}`}},stencil:{"stencil.frag":`void main() { -gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); -}`,"stencil.vert":`attribute vec2 a_pos; -uniform mat3 u_worldExtent; -void main() { -gl_Position = vec4(u_worldExtent * vec3(a_pos, 1.0), 1.0); -}`},test:{"TestShader.common.glsl":`#ifndef RETURN_RED -varying vec4 v_color; -#endif -varying vec2 v_offset;`,"TestShader.frag":`precision highp float; -#include -void main() { -if (v_offset.x > -.5 && v_offset.y > -.5 && v_offset.x < .5 && v_offset.y < .5) { -discard; -} -#ifdef RETURN_RED -gl_FragColor = vec4(1., 0., 0., 1.); -#else -gl_FragColor = v_color; -#endif -}`,"TestShader.vert":`const float POS_PRECISION_FACTOR = 10.; -const float OFFSET_PRECISION_FACTOR = 10.; -const float SIZE_PRECISION_FACTOR = 10.; -attribute vec2 a_pos_packed; -attribute vec2 a_offset_packed; -attribute float a_size_packed; -#ifdef DATA_DRIVEN_COLOR -const float u_dataDrivenColor_validValues[4] = float[4](0., 0., 1., 0.); -uniform vec4 u_dataDrivenColor_colorFallback; -uniform vec4 u_dataDrivenColor_color; -#endif -uniform float u_view_zoomLevel; -#include -#ifdef DATA_DRIVEN_COLOR -vec4 getColor(float value) { -int index = -1; -for (int i = 0; i < 4; i++) { -if (u_dataDrivenColor_validValues[i] == value) { -index = i; -break; -} -} -if (index == -1) { -return u_dataDrivenColor_colorFallback; -} -return u_dataDrivenColor_color; -} -#endif -void main() { -vec2 a_pos = a_pos_packed / POS_PRECISION_FACTOR; -vec2 a_offset = a_offset_packed / OFFSET_PRECISION_FACTOR; -float a_size = a_size_packed / SIZE_PRECISION_FACTOR; -vec4 color = vec4(1., 0., 0., 1.); -#ifdef DATA_DRIVEN_COLOR -color = getColor(1.); -#endif -vec2 offsetScaled = a_offset * a_size; -vec4 pos = vec4(a_pos.xy + offsetScaled, 0., 1.); -gl_Position = pos; -#ifndef RETURN_RED -v_color = color; -#endif -v_offset = a_offset; -}`},tileInfo:{"tileInfo.frag":`uniform mediump sampler2D u_texture; -varying mediump vec2 v_tex; -void main(void) { -lowp vec4 color = texture2D(u_texture, v_tex); -color.rgb *= color.a; -gl_FragColor = color; -}`,"tileInfo.vert":`attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform mediump float u_depth; -uniform mediump vec2 u_coord_ratio; -uniform mediump vec2 u_delta; -uniform mediump vec2 u_dimensions; -varying mediump vec2 v_tex; -void main() { -mediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions); -vec3 v_pos = u_dvsMat3 * vec3(offset, 1.0); -gl_Position = vec4(v_pos.xy, 0.0, 1.0); -v_tex = a_pos; -}`},util:{"atan2.glsl":`float atan2(in float y, in float x) { -float t0, t1, t2, t3, t4; -t3 = abs(x); -t1 = abs(y); -t0 = max(t3, t1); -t1 = min(t3, t1); -t3 = 1.0 / t0; -t3 = t1 * t3; -t4 = t3 * t3; -t0 = - 0.013480470; -t0 = t0 * t4 + 0.057477314; -t0 = t0 * t4 - 0.121239071; -t0 = t0 * t4 + 0.195635925; -t0 = t0 * t4 - 0.332994597; -t0 = t0 * t4 + 0.999995630; -t3 = t0 * t3; -t3 = (abs(y) > abs(x)) ? 1.570796327 - t3 : t3; -t3 = x < 0.0 ? 3.141592654 - t3 : t3; -t3 = y < 0.0 ? -t3 : t3; -return t3; -}`,"encoding.glsl":`const vec4 rgba2float_factors = vec4( -255.0 / (256.0), -255.0 / (256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0 * 256.0) -); -float rgba2float(vec4 rgba) { -return dot(rgba, rgba2float_factors); -}`}};function Qt(i){return function(e){let t=i;return e.split("/").forEach(o=>{t&&(t=t[o])}),t}}const Jt=new St(Qt(Xt));function fe(i){return Jt.resolveIncludes(i)}const ae={shaders:{vertexShader:fe("background/background.vert"),fragmentShader:fe("background/background.frag")},attributes:new Map([["a_pos",0]])},ei=()=>ht("clip",{geometry:[{location:0,name:"a_pos",count:2,type:P.SHORT}]});let ti=class extends Z{constructor(){super(...arguments),this._color=H(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:i}){i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setFaceCullingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255),i.setStencilFunction(U.ALWAYS,0,255)}draw(i,e){const{context:t,state:o,requestRender:a,allowDelayedRender:r}=i,l=ei(),n=e.getVAO(t,o,l.attributes,l.bufferLayouts);n.indexBuffer!=null&&(this._program||(this._program=ce(t,ae)),!r||a==null||this._program.compiled?(t.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",o.displayMat3),t.bindVAO(n),t.drawElements(A.TRIANGLES,n.indexBuffer.size,P.UNSIGNED_INT,0),t.bindVAO()):a())}};const xe=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,2)]]]),io=new Map([["geometry",[new ie("a_pos",2,P.BYTE,0,4),new ie("a_tex",2,P.BYTE,2,4)]]]),oo=new Map([["geometry",[new ie("a_pos",2,P.UNSIGNED_SHORT,0,4)]]]);let ii=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:i}){i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setStencilOp(Q.KEEP,Q.KEEP,Q.REPLACE),i.setStencilWriteMask(255)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;this._initialized||this._initialize(t),!a||o==null||this._solidProgram.compiled?(t.setStencilFunctionSeparate(xt.FRONT_AND_BACK,U.GREATER,e.stencilRef,255),t.bindVAO(this._solidVertexArrayObject),t.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[e.rangeX,e.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.TRIANGLE_STRIP,0,4),t.bindVAO()):o()}_initialize(i){if(this._initialized)return!0;const e=ce(i,ae);if(!e)return!1;const t=new Int8Array([0,0,1,0,0,1,1,1]),o=k.createVertex(i,W.STATIC_DRAW,t),a=new K(i,ae.attributes,xe,new Map([["geometry",o]]));return this._solidProgram=e,this._solidVertexArrayObject=a,this._initialized=!0,!0}},oi=class extends $e{constructor(i,e,t,o,a,r,l=a,n=r){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Rt(i),this.resolution=e,this.x=t,this.y=o,this.width=a,this.height=r,this.rangeX=l,this.rangeY=n}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let i=this;for(;i.parent!==this._stage;){if(!i.parent)return 0;i=i.parent}return this._stage.children.indexOf(i)}setTransform(i){const e=this.resolution/(i.resolution*i.pixelRatio),t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t)}get destroyed(){return this._destroyed}};const ze=oe(),_e=Ct();let ai=class extends oi{constructor(i,e,t,o){super(i,e,t,o,ue,ue)}destroy(){super.destroy()}setTransform(i){const e=this.resolution/i.resolution,t=this.transforms.tileMat3,[o,a]=i.toScreenNoRotation([0,0],[this.x,this.y]),r=this.width/this.rangeX*e,l=this.height/this.rangeY*e;qe(t,r,0,0,0,l,0,o,a,1),ge(this.transforms.displayViewScreenMat3,i.displayViewMat3,t);const n=Tt(pe(),r,0,0,l,o,a);bt(this.transforms.labelMat2d,i.viewMat2d,n)}_createTransforms(){return{labelMat2d:pe(),tileMat3:oe(),displayViewScreenMat3:oe()}}containsScreenPoint(i,e,t){const o=ge(ze,i.viewMat3,this.transforms.tileMat3),a=It(ze,o);if(a==null)return!0;At(_e,...e,1);const r=Pt(_e,_e,a),l=t*(this.resolution/i.resolution);return r[0]>=-l&&r[0]=-l&&r[1]{const t=e.end-e.start;i=Math.max(i,t)}),i}firstFit(i){if(this._head==null)return null;let e=null,t=this._head;for(;t;){const o=t.data.end-t.data.start;if(o===i)return e?e.next=t.next:this._head=t.next,t.data.start;if(o>i){const a=t.data.start;return t.data.start+=i,a}e=t,t=t.next}return null}free(i,e){const t=i+e;if(this._head==null){const l=new Y({start:i,end:t});return void(this._head=l)}if(t<=this._head.data.start){if(t===this._head.data.start)return void(this._head.data.start-=e);const l=new Y({start:i,end:t});return l.next=this._head,void(this._head=l)}let o=this._head,a=o.next;for(;a;){if(a.data.start>=t){if(o.data.end===i){if(o.data.end+=e,o.data.end===a.data.start){const n=a.data.end-a.data.start;return o.data.end+=n,void(o.next=a.next)}return}if(a.data.start===t)return void(a.data.start-=e);const l=new Y({start:i,end:t});return l.next=o.next,void(o.next=l)}o=a,a=a.next}if(i===o.data.end)return void(o.data.end+=e);const r=new Y({start:i,end:t});o.next=r}clear(){this._head=null}};function ri(i,e){return i<<16|255&e}function li(i){return 255&i}let te=class{constructor(i,e,t,o,a){this.instance=i,this.materialKey=e,this.target=t,this.start=o,this.count=a}get textureKey(){return li(this.materialKey)}get indexEnd(){return this.start+this.count}extend(i){this.count+=i}render(i){this.instance.techniqueRef.render(i,this)}getStencilReference(){return this.target.stencilRef}getAttributePrecisionPackFactors(){const i=this.instance.instanceId;return this.target.getMesh(i).getAttributePrecisionPackFactors()}draw(i,e){Et(i)?this.drawCompute(i.context,e):this.drawGeometry(i.context,e)}drawCompute(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getComputeVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT/3;i.bindVAO(o),i.drawElements(A.POINTS,this.count/3,P.UNSIGNED_INT,a),i.bindVAO(null)}drawGeometry(i,e){const t=this.instance.instanceId,o=this.target.getMesh(t).getGeometryVAO(i,e),a=this.start*Uint32Array.BYTES_PER_ELEMENT;i.bindVAO(o),i.drawElements(A.TRIANGLES,this.count,P.UNSIGNED_INT,a),i.bindVAO(null)}},ni=class rt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,o,a){const r=new rt;for(const l of e.values())for(const n of l.records){const s=o.getInstance(n.instanceId),c=ri(s.instanceId,n.textureKey);r.addRecord(s,c,n.indexStart,n.indexCount,n.vertexStart,n.vertexCount,t,a)}return r}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e,t){const{drawPhase:o}=e;for(const a of this.infos()){const r=a.instance.techniqueRef;r.drawPhase&o&&(t==null||r.type===t)&&a.render(e)}}addRecord(e,t,o,a,r,l,n,s){let c=o,u=a;if(u||(c=r,u=l),!u)return;if(this._head==null){const g=new te(e,t,n,c,u);return this._head=new Y(g),this._tail=this._head,this._length++,void this._minOrderedLength++}if(s===he.STRICT_ORDER)return this._insert(e,t,n,c,u,this._tail,null);let f=null,d=this._head;const _=e.instanceId,x=e.techniqueRef.symbologyPlane;if(s===he.STRICT_MARKERS_AND_TEXT&&(x===Ce.MARKER||x===Ce.TEXT))return this._insert(e,t,n,c,u,this._tail,null);for(;d;){const g=d.data.instance,b=g.instanceId,O=g.techniqueRef.symbologyPlane,S=f?.data.instance.instanceId;if(x=1){const o=this.index.operations[this.index.operations.length-1];o.srcFrom+o.count===i.indexStart&&(o.count+=i.indexCount,t=!0)}t||this.index.operations.push({srcFrom:i.indexStart,dstFrom:this.index.count,count:i.indexCount,mutate:e}),i.indexStart=this.index.count,this.index.count+=i.indexCount}};const Ve=j("esri-2d-log-allocations");let Ne=class lt{static create(e,t){const o=t.acquireUint32Array(e);return new lt(o,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},me=class nt{constructor(){this._data=new ArrayBuffer(nt.BYTE_LENGTH),this._freeList=new at({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}};class ao{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*me.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,Ve&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=me.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const o of this._pages){const a=o.acquireUint32Array(e);if(a!=null)return a}const t=this._addPage().acquireUint32Array(e);return ve(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,Ve&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new me;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}}const ui=1.25,we=32767,ci=we<<16|we;let Fe=class{constructor(i,e,t,o){this._pool=o;const a=Ne.create(e*t*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=e,this.strideInt=t,this.bufferType=i,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:e*t*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=a,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new at({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(i){if(!(this.maxAvailableSpace()>=i)&&i*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const e=this._cpu.length/this.strideInt,t=Math.round((e+i)*ui),o=t*this.strideInt;this._cpu.expand(o*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(e,t-e),this.memoryStats.bytesReserved+=(t-e)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(i,e){this._cpu.array[i]!==e&&(this._cpu.array[i]=e,this.dirty.start=Math.min(i,this.dirty.start),this.dirty.end=Math.max(i+1,this.dirty.end))}getGPUBuffer(i,e=!1){if(!this.bufferSize)return null;if(e){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(i)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(i)),this._gpu}getView(i,e){return this._cpu.getUint32View(i,e/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(i,e,t,o){const a=t*this.strideInt;if(!a)return 0;const r=e*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,l=new Uint32Array(i,r,a),n=this.freeList.firstFit(t);ve(n,"First fit region must be defined");const s=n*this.strideInt,c=a;if(this._cpu.array.set(l,s),o!==0)for(let u=0;uo,r=this._cpu,l=Ne.create(o,this._pool);a||l.array.set(this._cpu.getUint32View(0,this.intSize));for(const n of e)if(a||n.srcFrom!==n.dstFrom||n.mutate!==0){this.dirty.start=Math.min(this.dirty.start,n.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(n.dstFrom+n.count)*this.strideInt);for(let s=0;se.locations.has(o.name)).map(o=>({name:o.name,type:o.type,count:o.count,divisor:0,normalized:o.normalized??!1,offset:o.offset,stride:i.stride}));return new Map([["geometry",t]])}function di(i,e){const t=[],o=i.attributes.filter(a=>e.locations.has(a.name));for(const a of o){t.push({name:a.name,type:a.type,count:a.count,divisor:0,normalized:a.normalized??!1,offset:a.offset,stride:i.stride});const r=e.computeAttributeMap[a.name];r!=null&&r.length===2&&(t.push({name:r[0],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+i.stride,stride:i.stride}),t.push({name:r[1],count:a.count,divisor:0,type:a.type,normalized:a.normalized??!1,offset:a.offset+2*i.stride,stride:i.stride}))}return new Map([["geometry",t]])}let _i=class{constructor(i,e){if(this._bufferPool=i,this._layout=e,this._invalidatedGeometry=!1,this._invalidatedCompute=!1,this._position=this._layout.attributes.find(t=>t.name==="pos"||t.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute")}destroy(){this._indexBuffer=Ee(this._indexBuffer),this._vertexBuffer=Ee(this._vertexBuffer),this._computeVAO?.disposeVAOOnly(),this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(i,e,t,o){return o?{primitive:A.POINTS,count:e/3,offset:t/3}:{primitive:i,count:e,offset:t}}getAttributePrecisionPackFactors(){const i={};for(const e of this.layout.attributes)e.packPrecisionFactor&&(i[e.name]=e.packPrecisionFactor);return i}getDebugVertexInfo(i=!1,e){if(!this._vertexBuffer)return null;const t=this._layout,o=t.stride,a=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),r=[];if(i)if(e==null)console.log("must provide location info to see compute attributes");else for(const f of t.attributes){const d=e.computeAttributeMap[f.name];d!=null&&d.length===2&&(r.push({...f,name:d[0],offset:f.offset+o}),r.push({...f,name:d[1],offset:f.offset+2*o}))}const l=new DataView(a.slice().buffer);let n=a.byteLength/o;i&&(n=this._indexBuffer.fillPointer/3);const s=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let c=0;const u=[];for(let f=0;fSe.getLogger("esri.views.2d.engine.webgl.FeatureTile");let pi=0,gi=class extends ai{constructor(i,e,t,o,a=!1){super(i,e,t,o),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=pi++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=pe(),this.enableDeferredUploads=a}destroy(){super.destroy(),this.clear()}clear(){for(const i of this._meshes.values())i.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(i){super.beforeRender(i),this._needsReshuffle&&i.reshuffleManager.schedule(this)}tryReady(i){const e=this._invalidated&&!this._uploadAllowed;return!(this.isReady||e||!this._encounteredEnd||!(i>=this._attributeEpoch))&&(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${i}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(i,e){if(this._uploadAllowed&&this._invalidated){this._entities.sort((t,o)=>{const a=o.sortKey,r=t.sortKey;return r===a?t.id-o.id:r-a}),e===he.BATCHING&&this.reshuffle(!0),this._displayList=ni.fromDisplayEntities(this._entities,this,i,e);for(const t of this._meshes.values())t.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(i){if(!this._meshes.has(i))throw new Error(`InternalError: Unable to find VAO for instance: ${i}`);return this._meshes.get(i)}getSortKeys(i){const e=new Map;for(const{id:t,sortKey:o}of this._entities)if(i.has(t)&&e.set(t,o),e.size===i.size)break;return e}onMessage(i){if(i.objectIdMap)for(const e in i.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[e]=i.objectIdMap[e];switch(i.type){case"append":this._onAppendMessage(i);break;case"update":this._onUpdateMessage(i)}if(this._aggregateMemoryStats(),this.requestRender(),i.end){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${i.attributeEpoch}]`),!i.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=i.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(i){if(j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Ue(i?.append)}),i.clear&&this.clear(),!i.append)return;const e=le(new se(i.append.entities),ne);this._insert(e,i.append.data,!1)}_onUpdateMessage(i){j("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:i.isPixelBuffer,modify:Ue(i.modify),remove:i.remove});const e=le(new se(i.modify.entities),ne),t=e.map(r=>r.id),o=i.isPixelBuffer??!1,a=[...i.remove,...t];o?this._removeByIdsFromBuffer(a):this._removeByIds(a),this._insert(e,i.modify.data,o)}reshuffle(i=!1){if(this.destroyed)return;const e=new Map;for(const t of this._entities)for(const o of t.records){const a=this._meshes.get(o.instanceId);let r=e.get(a);r||(r=new si(i),e.set(a,r)),r.copyRecord(o)}for(const[t,o]of e)t.reshuffle(o);this._invalidated=!0,this._aggregateMemoryStats(),j("esri-2d-update-debug")&&vi().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(i,e,t,o){const a=t*ue,r=o*ue;for(const l of i._entities){let n=null;for(const s of l.records)if(s.overlaps&e){const c=i.getMesh(s.instanceId),u=this._ensureMesh(s.instanceId,c.layout).copyRecordFrom(c,s,a,r);n||(n=new ne(l.id,l.sortKey),this._entityIdsFromBuffer.add(l.id),this._entities.push(n)),n.records.push(u)}}this._invalidated=!0}_ensureMesh(i,e){return this._meshes.has(i)||this._meshes.set(i,new _i(this._stage.bufferPool,e)),this._meshes.get(i)}_insert(i,e,t){if(!i.length)return;this._removeDuplicatedBufferedEntites(i);const o=this._insertVertexData(e);for(const a of i){for(const r of a.records)r.updateBaseOffsets(o.get(r.instanceId));t?this._tryInsertBufferedEntity(a):this._insertEntity(a)}this._invalidated=!0}_insertVertexData(i){const e=new Map;for(const t of i){const{instanceId:o,layout:a}=t,r=this._ensureMesh(o,a).append(t);if(t.metrics){const l=le(new se(t.metrics),pt)??[];this._metrics.push(...l)}e.set(o,r)}return e}_insertEntity(i){j("esri-2d-update-debug")&&this._entityIds.has(i.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${i.id}`),this._entityIds.add(i.id),this._entities.push(i)}_tryInsertBufferedEntity(i){this._entityIds.has(i.id)?this._removeRecordsFromMesh(i.records):(this._entityIdsFromBuffer.add(i.id),this._entities.push(i))}_removeDuplicatedBufferedEntites(i){if(!this._entityIdsFromBuffer.size)return;const e=[];for(const t of i)this._entityIdsFromBuffer.has(t.id)&&e.push(t.id);this._removeByIds(e)}_removeByIdsFromBuffer(i){this._removeByIds(i.filter(e=>this._entityIdsFromBuffer.has(e)))}_removeByIds(i){if(i.length===0)return;const e=new Set(i),t=[];for(const o of this._entities)e.has(o.id)?this._remove(o):t.push(o);this._entities=t,this._invalidated=!0}_remove(i){this._removeRecordsFromMesh(i.records),this._entityIds.delete(i.id),this._entityIdsFromBuffer.delete(i.id);for(let e=this._metrics.length-1;e>=0;e--)this._metrics[e].entityTexel===i.id&&this._metrics.splice(e,1)}_removeRecordsFromMesh(i){for(const e of i){const{instanceId:t,indexStart:o,indexCount:a,vertexStart:r,vertexCount:l}=e;this._meshes.get(t)?.remove(o,a,r,l)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const i of this._meshes.values())this.debugInfo.memory.bytesUsed+=i.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=i.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:i,bytesReserved:e}=this.debugInfo.memory,t=i/e,{minOrderedLength:o,length:a}=this.debugInfo.display;return e>dt&&t<_t||a>mt&&o/a({objectId:this._objectIdMap[i],displayId:i})):[]}};const Ge={shaders:{vertexShader:fe("tileInfo/tileInfo.vert"),fragmentShader:fe("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])},Ye=512,ye=512,$=16,M=8,hi=(ye-2*M)/5;let xi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:i}){i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1)}draw(i,e){const{context:t,requestRender:o,allowDelayedRender:a}=i;if(!e.isReady&&e instanceof gi&&e.hasData)return;if(this._loadWGLResources(t),a&&o!=null&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void o();t.bindVAO(this._outlineVertexArrayObject),t.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",e.rangeX,e.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),t.drawArrays(A.LINE_STRIP,0,4);const r=this._getTexture(t,e);r&&(t.bindVAO(this._tileInfoVertexArrayObject),t.useProgram(this._tileInfoProgram),t.bindTexture(r,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",e.rangeX/e.width,e.rangeY/e.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",r.descriptor.width,r.descriptor.height),t.drawArrays(A.TRIANGLE_STRIP,0,4)),t.bindVAO()}_loadWGLResources(i){if(this._outlineProgram&&this._tileInfoProgram)return;const e=ce(i,ae),t=ce(i,Ge),o=new Int8Array([0,0,1,0,1,1,0,1]),a=k.createVertex(i,W.STATIC_DRAW,o),r=new K(i,ae.attributes,xe,new Map([["geometry",a]])),l=new Int8Array([0,0,1,0,0,1,1,1]),n=k.createVertex(i,W.STATIC_DRAW,l),s=new K(i,Ge.attributes,xe,new Map([["geometry",n]]));this._outlineProgram=e,this._tileInfoProgram=t,this._outlineVertexArrayObject=r,this._tileInfoVertexArrayObject=s}_getTexture(i,e){if(!this._ctx){const n=document.createElement("canvas");n.width=Ye,n.height=ye,this._ctx=n.getContext("2d")}if(!e.tileDebugInfoTexture){const n=new Lt;n.wrapMode=yt.CLAMP_TO_EDGE,n.samplingMode=B.LINEAR,n.isImmutable=!0,n.width=Ye,n.height=ye,e.tileDebugInfoTexture=new Mt(i,n)}const t=this._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t.textAlign="left",t.textBaseline="top",t.font=$-2+"px sans-serif",t.lineWidth=2,t.fillStyle="white",t.strokeStyle="black";const{debugSlot:o}=e;let a=M+hi*o;const r=`${o}) ${e.key.id} (${e.constructor.name})`;t.strokeText(r,M,a),t.fillText(r,M,a),a+=$;const{debugInfo:l}=e;if(l){const{length:n,minOrderedLength:s,minUnorderedLength:c,triangleCount:u}=l.display;if(n>0){const _=`Length: ${n}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(s){const _=`Min ordered length: ${s}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(c){const _=`Min unordered length: ${c}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}if(u>0){u>1e5&&(t.fillStyle="red",t.strokeStyle="white");const _=`Triangle count: ${u}`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}const{bytesUsed:f,bytesReserved:d}=l.memory;if(t.fillStyle="white",t.strokeStyle="black",f>0||d>0){const _=`Memory usage: ${f} of ${d} bytes`;t.strokeText(_,M,a),t.fillText(_,M,a),a+=$}}return e.tileDebugInfoTexture.setData(t.canvas),e.tileDebugInfoTexture}},yi=class extends Z{constructor(){super(...arguments),this._color=H(1,0,0,1),this._patternMatrix=oe(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(i,e){const{context:t,painter:o,requestRender:a,allowDelayedRender:r}=i;this._loadWGLResources(i);const l=i.displayLevel,n=i.styleLayer,s=n.backgroundMaterial,c=o.vectorTilesMaterialManager,u=n.getPaintValue("background-color",l),f=n.getPaintValue("background-opacity",l),d=n.getPaintValue("background-pattern",l),_=d!==void 0,x=1|window.devicePixelRatio,g=i.spriteMosaic;let b,O;const S=x>Ze?2:1,T=this._programOptions;T.pattern=_;const v=c.getMaterialProgram(t,s,T);if(!r||a==null||v.compiled){if(t.bindVAO(this._vao),t.useProgram(v),_){const p=g.getMosaicItemPosition(d,!0);if(p!=null){const{tl:h,br:y,page:I}=p;b=y[0]-h[0],O=y[1]-h[1];const m=g.getPageSize(I);m!=null&&(g.bind(t,B.LINEAR,I,F),v.setUniform4f("u_tlbr",h[0],h[1],y[0],y[1]),v.setUniform2fv("u_mosaicSize",m),v.setUniform1i("u_texture",F))}v.setUniform1f("u_opacity",f)}else{const p=u[3]*f;this._color[0]=p*u[0],this._color[1]=p*u[1],this._color[2]=p*u[2],this._color[3]=p,v.setUniform4fv("u_color",this._color)}v.setUniform1f("u_depth",n.z||0);for(const p of e){if(v.setUniform1f("u_coord_range",p.rangeX),v.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),_){const h=Math.max(2**(Math.round(l)-p.key.level),1),y=S*p.width*h,I=y/Oe(b),m=y/Oe(O);this._patternMatrix[0]=I,this._patternMatrix[4]=m,v.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(U.EQUAL,0,255),t.drawArrays(A.TRIANGLE_STRIP,0,4)}}else a()}_loadWGLResources(i){if(this._vao)return;const{context:e,styleLayer:t}=i,o=t.backgroundMaterial,a=new Int8Array([0,0,1,0,0,1,1,1]),r=k.createVertex(e,W.STATIC_DRAW,a),l=new K(e,o.getAttributeLocations(),o.getLayoutInfo(),new Map([["geometry",r]]));this._vao=l}},Si=class extends Z{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(i,e){const{context:t,displayLevel:o,requiredLevel:a,state:r,painter:l,spriteMosaic:n,styleLayerUID:s,requestRender:c,allowDelayedRender:u}=i;if(!e.some(v=>v.layerData.get(s)?.circleIndexCount??!1))return;const f=i.styleLayer,d=f.circleMaterial,_=l.vectorTilesMaterialManager,x=1.2,g=f.getPaintValue("circle-translate",o),b=f.getPaintValue("circle-translate-anchor",o),O=this._programOptions,S=_.getMaterialProgram(t,d,O);if(u&&c!=null&&!S.compiled)return void c();t.useProgram(S),S.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),S.setUniform2fv("u_circleTranslation",g),S.setUniform1f("u_depth",f.z),S.setUniform1f("u_antialiasingWidth",x);let T=-1;for(const v of e){if(!v.layerData.has(s))continue;v.key.level!==T&&(T=v.key.level,d.setDataUniforms(S,o,f,T,n));const p=v.layerData.get(s);if(!p.circleIndexCount)continue;p.prepareForRendering(t);const h=p.vao;h!=null&&(t.bindVAO(h),S.setUniformMatrix3fv("u_dvsMat3",v.transforms.displayViewScreenMat3),a!==v.key.level?t.setStencilFunction(U.EQUAL,v.stencilRef,255):t.setStencilFunction(U.GREATER,255,255),t.drawElements(A.TRIANGLES,p.circleIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*p.circleIndexStart),v.triangleCount+=p.circleIndexCount/3)}}};const ke=1/65536;class Ti extends Z{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:o,renderPass:a,spriteMosaic:r,styleLayerUID:l}=e;let n=!1;for(const T of t)if(T.layerData.has(l)){const v=T.layerData.get(l);if(v.fillIndexCount>0||v.outlineIndexCount>0){n=!0;break}}if(!n)return;const s=e.styleLayer,c=s.getPaintProperty("fill-pattern"),u=c!==void 0,f=u&&c.isDataDriven;let d;if(u&&!f){const T=c.getValue(o);d=r.getMosaicItemPosition(T,!0)}const _=!u&&s.getPaintValue("fill-antialias",o);let x=!0,g=1;if(!u){const T=s.getPaintProperty("fill-color"),v=s.getPaintProperty("fill-opacity");if(!T?.isDataDriven&&!v?.isDataDriven){const p=s.getPaintValue("fill-color",o);g=s.getPaintValue("fill-opacity",o)*p[3],g>=1&&(x=!1)}}if(x&&a==="opaque")return;const b=s.getPaintValue("fill-translate",o),O=s.getPaintValue("fill-translate-anchor",o);(x||a!=="translucent")&&this._drawFill(e,l,s,t,b,O,u,d,f);const S=!s.hasDataDrivenOutlineColor&&s.outlineUsesFillColor&&g<1;_&&a!=="opaque"&&!S&&this._drawOutline(e,l,s,t,b,O)}_drawFill(e,t,o,a,r,l,n,s,c){if(n&&!c&&s==null)return;const{context:u,displayLevel:f,state:d,painter:_,pixelRatio:x,spriteMosaic:g,requestRender:b,allowDelayedRender:O}=e,S=o.fillMaterial,T=_.vectorTilesMaterialManager,v=x>Ze?2:1,p=this._fillProgramOptions;p.pattern=n;const h=T.getMaterialProgram(u,S,p);if(O&&b!=null&&!h.compiled)return void b();if(u.useProgram(h),s!=null){const{page:I}=s,m=g.getPageSize(I);m!=null&&(g.bind(u,B.LINEAR,I,F),h.setUniform2fv("u_mosaicSize",m),h.setUniform1i("u_texture",F))}h.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?d.displayMat3:d.displayViewMat3),h.setUniform2fv("u_fillTranslation",r),h.setUniform1f("u_depth",o.z+ke);let y=-1;for(const I of a){if(!I.layerData.has(t))continue;I.key.level!==y&&(y=I.key.level,S.setDataUniforms(h,f,o,y,g));const m=I.layerData.get(t);if(!m.fillIndexCount)continue;m.prepareForRendering(u);const V=m.fillVAO;if(V!=null){if(u.bindVAO(V),h.setUniformMatrix3fv("u_dvsMat3",I.transforms.displayViewScreenMat3),u.setStencilFunction(U.EQUAL,I.stencilRef,255),n){const E=Math.max(2**(Math.round(f)-I.key.level),1),D=I.rangeX/(v*I.width*E);h.setUniform1f("u_patternFactor",D)}if(c){const E=m.patternMap;if(!E)continue;for(const[D,L]of E){const q=g.getPageSize(D);q!=null&&(g.bind(u,B.LINEAR,D,F),h.setUniform2fv("u_mosaicSize",q),h.setUniform1i("u_texture",F),u.drawElements(A.TRIANGLES,L[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L[0]))}}else u.drawElements(A.TRIANGLES,m.fillIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*m.fillIndexStart);I.triangleCount+=m.fillIndexCount/3}}}_drawOutline(e,t,o,a,r,l){const{context:n,displayLevel:s,state:c,painter:u,pixelRatio:f,spriteMosaic:d,requestRender:_,allowDelayedRender:x}=e,g=o.outlineMaterial,b=u.vectorTilesMaterialManager,O=.75/f,S=this._outlineProgramOptions,T=b.getMaterialProgram(n,g,S);if(x&&_!=null&&!T.compiled)return void _();n.useProgram(T),T.setUniformMatrix3fv("u_displayMat3",l===J.VIEWPORT?c.displayMat3:c.displayViewMat3),T.setUniform2fv("u_fillTranslation",r),T.setUniform1f("u_depth",o.z+ke),T.setUniform1f("u_outline_width",O);let v=-1;for(const p of a){if(!p.layerData.has(t))continue;p.key.level!==v&&(v=p.key.level,g.setDataUniforms(T,s,o,v,d));const h=p.layerData.get(t);if(h.prepareForRendering(n),!h.outlineIndexCount)continue;const y=h.outlineVAO;y!=null&&(n.bindVAO(y),T.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),n.setStencilFunction(U.EQUAL,p.stencilRef,255),n.drawElements(A.TRIANGLES,h.outlineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*h.outlineIndexStart),p.triangleCount+=h.outlineIndexCount/3)}}}class bi extends Z{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:o,displayLevel:a,state:r,painter:l,pixelRatio:n,spriteMosaic:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e;if(!t.some(E=>E.layerData.get(c)?.lineIndexCount??!1))return;const d=e.styleLayer,_=d.lineMaterial,x=l.vectorTilesMaterialManager,g=d.getPaintValue("line-translate",a),b=d.getPaintValue("line-translate-anchor",a),O=d.getPaintProperty("line-pattern"),S=O!==void 0,T=S&&O.isDataDriven;let v,p;if(S&&!T){const E=O.getValue(a);v=s.getMosaicItemPosition(E)}let h=!1;if(!S){const E=d.getPaintProperty("line-dasharray");if(p=E!==void 0,h=p&&E.isDataDriven,p&&!h){const D=E.getValue(a),L=d.getDashKey(D,d.getLayoutValue("line-cap",a));v=s.getMosaicItemPosition(L)}}const y=1/n,I=this._programOptions;I.pattern=S,I.sdf=p;const m=x.getMaterialProgram(o,_,I);if(f&&u!=null&&!m.compiled)return void u();if(o.useProgram(m),m.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),m.setUniformMatrix3fv("u_displayMat3",b===J.VIEWPORT?r.displayMat3:r.displayViewMat3),m.setUniform2fv("u_lineTranslation",g),m.setUniform1f("u_depth",d.z),m.setUniform1f("u_antialiasing",y),v&&v!=null){const{page:E}=v,D=s.getPageSize(E);D!=null&&(s.bind(o,B.LINEAR,E,F),m.setUniform2fv("u_mosaicSize",D),m.setUniform1i("u_texture",F))}let V=-1;for(const E of t){if(!E.layerData.has(c))continue;E.key.level!==V&&(V=E.key.level,_.setDataUniforms(m,a,d,V,s));const D=2**(a-V)/n;m.setUniform1f("u_zoomFactor",D);const L=E.layerData.get(c);if(!L.lineIndexCount)continue;L.prepareForRendering(o);const q=L.vao;if(q!=null){if(o.bindVAO(q),m.setUniformMatrix3fv("u_dvsMat3",E.transforms.displayViewScreenMat3),o.setStencilFunction(U.EQUAL,E.stencilRef,255),T||h){const re=L.patternMap;if(!re)continue;for(const[C,X]of re){const z=s.getPageSize(C);z!=null&&(s.bind(o,B.LINEAR,C,F),m.setUniform2fv("u_mosaicSize",z),m.setUniform1i("u_texture",F),o.drawElements(A.TRIANGLES,X[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*X[0]))}}else o.drawElements(A.TRIANGLES,L.lineIndexCount,P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);E.triangleCount+=L.lineIndexCount/3}}}}const Ii=256/360,Ei=1/Math.LN2;function Oi(i,e){return(i%=e)>=0?i:i+e}function He(i){return Oi(i*Ii,256)}function ro(i){return Math.log(i)*Ei}const Ai=1/65536;class Pi extends Z{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=zt()}dispose(){}drawMany(e,t){const o=e.styleLayer;this._drawIcons(e,o,t),this._drawText(e,o,t)}_drawIcons(e,t,o){const{context:a,displayLevel:r,painter:l,spriteMosaic:n,state:s,styleLayerUID:c,requestRender:u,allowDelayedRender:f}=e,d=t.iconMaterial,_=l.vectorTilesMaterialManager;let x,g=!1;for(const m of o)if(m.layerData.has(c)&&(x=m.layerData.get(c),x.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const b=t.getPaintValue("icon-translate",r),O=t.getPaintValue("icon-translate-anchor",r);let S=t.getLayoutValue("icon-rotation-alignment",r);S===G.AUTO&&(S=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const T=S===G.MAP,v=t.getLayoutValue("icon-keep-upright",r)&&T,p=x.isIconSDF,h=this._iconProgramOptions;h.sdf=p;const y=_.getMaterialProgram(a,d,h);if(f&&u!=null&&!y.compiled)return void u();a.useProgram(y),y.setUniformMatrix3fv("u_displayViewMat3",S===G.MAP?s.displayViewMat3:s.displayMat3),y.setUniformMatrix3fv("u_displayMat3",O===J.VIEWPORT?s.displayMat3:s.displayViewMat3),y.setUniform2fv("u_iconTranslation",b),y.setUniform1f("u_depth",t.z),y.setUniform1f("u_mapRotation",He(s.rotation)),y.setUniform1f("u_keepUpright",v?1:0),y.setUniform1f("u_level",10*r),y.setUniform1i("u_texture",F),y.setUniform1f("u_fadeDuration",Re/1e3);let I=-1;for(const m of o){if(!m.layerData.has(c)||(m.key.level!==I&&(I=m.key.level,d.setDataUniforms(y,r,t,I,n)),x=m.layerData.get(c),x.iconPerPageElementsMap.size===0))continue;x.prepareForRendering(a),x.updateOpacityInfo();const V=x.iconVAO;if(V!=null){a.bindVAO(V),y.setUniformMatrix3fv("u_dvsMat3",m.transforms.displayViewScreenMat3),y.setUniform1f("u_time",(performance.now()-x.lastOpacityUpdate)/1e3);for(const[E,D]of x.iconPerPageElementsMap)this._renderIconRange(e,y,D,E,m)}}}_renderIconRange(e,t,o,a,r){const{context:l,spriteMosaic:n}=e;this._spritesTextureSize[0]=n.getWidth(a)/4,this._spritesTextureSize[1]=n.getHeight(a)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),n.bind(l,B.LINEAR,a,F),this._setStencilState(e,r),l.drawElements(A.TRIANGLES,o[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*o[0]),r.triangleCount+=o[1]/3}_drawText(e,t,o){const{context:a,displayLevel:r,glyphMosaic:l,painter:n,pixelRatio:s,spriteMosaic:c,state:u,styleLayerUID:f,requestRender:d,allowDelayedRender:_}=e,x=t.textMaterial,g=n.vectorTilesMaterialManager;let b,O=!1;for(const z of o)if(z.layerData.has(f)&&(b=z.layerData.get(f),b.glyphPerPageElementsMap.size>0)){O=!0;break}if(!O)return;const S=t.getPaintProperty("text-opacity");if(S&&!S.isDataDriven&&S.getValue(r)===0)return;const T=t.getPaintProperty("text-color"),v=!T||T.isDataDriven||T.getValue(r)[3]>0,p=t.getPaintProperty("text-halo-width"),h=t.getPaintProperty("text-halo-color"),y=(!p||p.isDataDriven||p.getValue(r)>0)&&(!h||h.isDataDriven||h.getValue(r)[3]>0);if(!v&&!y)return;const I=24/8;let m=t.getLayoutValue("text-rotation-alignment",r);m===G.AUTO&&(m=t.getLayoutValue("symbol-placement",r)===De.POINT?G.VIEWPORT:G.MAP);const V=m===G.MAP,E=t.getLayoutValue("text-keep-upright",r)&&V,D=.8*I/s;this._glyphTextureSize||(this._glyphTextureSize=Vt(l.width/4,l.height/4));const L=t.getPaintValue("text-translate",r),q=t.getPaintValue("text-translate-anchor",r),re=this._sdfProgramOptions,C=g.getMaterialProgram(a,x,re);if(_&&d!=null&&!C.compiled)return void d();a.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",m===G.MAP?u.displayViewMat3:u.displayMat3),C.setUniformMatrix3fv("u_displayMat3",q===J.VIEWPORT?u.displayMat3:u.displayViewMat3),C.setUniform2fv("u_textTranslation",L),C.setUniform1f("u_depth",t.z+Ai),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",He(u.rotation)),C.setUniform1f("u_keepUpright",E?1:0),C.setUniform1f("u_level",10*r),C.setUniform1i("u_texture",Pe),C.setUniform1f("u_antialiasingWidth",D),C.setUniform1f("u_fadeDuration",Re/1e3);let X=-1;for(const z of o){if(!z.layerData.has(f)||(z.key.level!==X&&(X=z.key.level,x.setDataUniforms(C,r,t,X,c)),b=z.layerData.get(f),b.glyphPerPageElementsMap.size===0))continue;b.prepareForRendering(a),b.updateOpacityInfo();const Ie=b.textVAO;if(Ie==null)continue;a.bindVAO(Ie),C.setUniformMatrix3fv("u_dvsMat3",z.transforms.displayViewScreenMat3),this._setStencilState(e,z);const st=(performance.now()-b.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",st),b.glyphPerPageElementsMap.forEach((ut,ct)=>{this._renderGlyphRange(a,ut,ct,l,C,y,v,z)})}}_renderGlyphRange(e,t,o,a,r,l,n,s){a.bind(e,B.LINEAR,o,Pe),l&&(r.setUniform1f("u_halo",1),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3),n&&(r.setUniform1f("u_halo",0),e.drawElements(A.TRIANGLES,t[1],P.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:o,is3D:a,stencilSymbols:r}=e;if(o.setStencilTestEnabled(!0),r)return o.setStencilWriteMask(255),void o.setStencilFunction(U.ALWAYS,t.stencilRef,255);o.setStencilWriteMask(0),a?o.setStencilFunction(U.EQUAL,t.stencilRef,255):o.setStencilFunction(U.GREATER,255,255)}}const Ci={clip:ti,stencil:ii,bitmap:Yt,tileDebugInfo:xi,vtlBackground:yi,vtlFill:Ti,vtlLine:bi,vtlCircle:Si,vtlSymbol:Pi},Di=i=>{switch(i.BYTES_PER_ELEMENT){case 1:return P.UNSIGNED_BYTE;case 2:return P.UNSIGNED_SHORT;case 4:return P.UNSIGNED_INT;default:throw new Te("Cannot get DataType of array")}},Ri=(i,e,t,o)=>{let a=0;for(let r=1;r0:a<0},We=({coords:i,lengths:e},t)=>{const o=[];for(let a=0,r=0;ae?.dispose()),this._cache.indexBuffer=this._cache.vertexBuffers=null}get elementType(){return Di(this.indices)}getIndexBuffer(e,t=W.STATIC_DRAW){return this._cache.indexBuffer??=k.createIndex(e,t,this.indices),this._cache.indexBuffer}getVertexBuffers(e,t=W.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce((o,a)=>(o.push([a,k.createVertex(e,t,this.vertices[a])]),o),new Array)),this._cache.vertexBuffers}}class be extends $e{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=ft(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new be(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,o,a){const[r,l]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===r&&this._lastHeight===l||(this._lastWidth=r,this._lastHeight=l,this._destroyGL()),this._cache.vao==null){const n=this._createMesh(t,this._clip),s=n.getIndexBuffer(e),c=n.getVertexBuffers(e);this._cache.mesh=n,this._cache.vao=new K(e,o,a,c,s)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:oe()}}_invalidate(){this._destroyGL(),this.requestRender()}_createMesh(e,t){switch(t.type){case"rect":return w.fromScreenExtent(Ot(t,e.size[0],e.size[1]));case"path":return w.fromPath(t);case"geometry":return w.fromGeometry(e,t);default:return Se.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new Te("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),w.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}}class lo extends Dt{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Ci.clip],target:()=>this._clippingInfos,drawPhase:ee.MAP|ee.LABEL|ee.LABEL_ALPHA|ee.DEBUG|ee.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>be.fromClipArea(this.stage,t))),this.requestRender()}}export{Ut as F,oi as K,lo as N,ro as R,ii as Z,oo as a,gi as i,Z as k,ao as m,io as n,fe as o,xi as r,Ci as s}; diff --git a/custom-toc-separator/assets/WMSLayer-C8eYRV4V-CjTxerqU.js b/custom-toc-separator/assets/WMSLayer-C8eYRV4V-CjTxerqU.js deleted file mode 100644 index b8362af6..00000000 --- a/custom-toc-separator/assets/WMSLayer-C8eYRV4V-CjTxerqU.js +++ /dev/null @@ -1,2 +0,0 @@ -import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./story-OUarUCIt.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{c as se}from"./scaleUtils-DxsfQwK1-rzzukPSH.js";import{D as Ye}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as et}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as rt}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{x as st}from"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-CGeXCscf.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r -`);throw new ve("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=g("Capability",r),i=g("Service",r),l=n&&g("Request",n);if(!n||!i||!l)return null;const s=g("Layer",n);if(!s)return null;const c=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",o=w("Title",i,"")||w("Name",i,""),p=w("AccessConstraints",i,""),f=/^none$/i.test(p)?"":p,d=w("Abstract",i,""),x=parseInt(w("MaxWidth",i,"5000"),10),v=parseInt(w("MaxHeight",i,"5000"),10),S=ue(l,"GetMap"),I=le(l,"GetMap"),h=j(s,c,t);if(!h)return null;let K,q=0;const Ee=Array.prototype.slice.call(n.childNodes),Re=h.sublayers??[],Q=b=>{b!=null&&Re.push(b)};Ee.forEach(b=>{b.nodeName==="Layer"&&(q===0?K=b:(q===1&&h.name&&(h.name="",Q(j(K,c,t))),Q(j(b,c,t))),q++)});let E=h.sublayers,B=h.extent;const Oe=h.fullExtents??[];if(E||(E=[]),E.length===0&&E.push(h),!B){const b=new L(E[0].extent);h.extent=b.toJSON(),B=h.extent}const Le=h.spatialReferences.length>0?h.spatialReferences:Se(h),Y=le(l,"GetFeatureInfo"),Pe=Y?ue(l,"GetFeatureInfo"):null,ee=Ie(E),Ae=h.minScale||0,Ue=h.maxScale||0,te=h.dimensions??[],_e=ee.reduce((b,P)=>b.concat(P.dimensions??[]),[]),re=te.concat(_e).filter(Ne);let ne=null;if(re.length){const b=re.map(P=>{const{extent:V}=P;return ft(V)?V.map(_=>_.getTime()):V?.map(_=>[_.min.getTime(),_.max.getTime()])}).flat(2).filter(U);ne={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:f,description:d,dimensions:te,extent:B,fullExtents:Oe,featureInfoFormats:Pe,featureInfoUrl:Y,mapUrl:I,maxWidth:x,maxHeight:v,maxScale:Ue,minScale:Ae,layers:ee,spatialReferences:Le,supportedImageFormatTypes:S,timeInfo:ne,title:o,version:c}}function ct(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function Se(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=Se(t);if(r.length>0)return r}return[]}function Ie(e){let t=[];for(const r of e)t.push(r),r.sublayers?.length&&(t=t.concat(Ie(r.sublayers)),delete r.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function dt(e,t,r,n){const i=g(e,r);return i?C(t,i,n):n}function g(e,t){for(let r=0;ri).filter(U);const n=[];for(const i of r)if(i.getAttribute("name")===t){const l=T("Format",i);for(const{textContent:s}of l)s!=null&&n.push(s)}return n}function pe(e,t,r){const n=g(t,e);if(!n)return r;const{textContent:i}=n;if(i==null||i==="")return r;const l=Number(i);return isNaN(l)?r:l}function j(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},i=g("LatLonBoundingBox",e),l=g("EX_GeographicBoundingBox",e);let s=null;i&&(s=A(i,4326)),l&&(s=new L(0,0,0,0,new N({wkid:4326})),s.xmin=parseFloat(w("westBoundLongitude",l,"0")),s.ymin=parseFloat(w("southBoundLatitude",l,"0")),s.xmax=parseFloat(w("eastBoundLongitude",l,"0")),s.ymax=parseFloat(w("northBoundLatitude",l,"0"))),i||l||(s=new L(-180,-90,180,90,new N({wkid:4326}))),n.minScale=pe(e,"MaxScaleDenominator",0),n.maxScale=pe(e,"MinScaleDenominator",0);const c=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(o=>{if(o.nodeName==="Name")n.name=o.textContent||"";else if(o.nodeName==="Title")n.title=o.textContent||"";else if(o.nodeName==="Abstract")n.description=o.textContent||"";else if(o.nodeName==="BoundingBox"){const p=o.getAttribute(c);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.slice(5),10);d===0||isNaN(d)||s||(s=t==="1.3.0"?A(o,d,J(d)):A(o,d))}const f=p?.indexOf(":");if(f&&f>-1){let d=parseInt(p.slice(f+1),10);d===0||isNaN(d)||(d=oe[d]??d);const x=t==="1.3.0"?A(o,d,J(d)):A(o,d);x&&n.fullExtents&&n.fullExtents.push(x)}}else if(o.nodeName===c)(o.textContent?.split(" ")??[]).forEach(p=>{let f=NaN;if(p.includes(":")){const[d,x]=p.toUpperCase().split(":");d!=="CRS"&&d!=="EPSG"||(f=parseInt(x,10))}else f=parseInt(p,10);if(f!==0&&!isNaN(f)){const d=oe[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(o.nodeName!=="Style"||n.legendUrl){if(o.nodeName==="Layer"){const p=j(o,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=g("LegendURL",o);if(p){const f=g("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=s?.toJSON(),n.dimensions=T("Dimension",e).filter(o=>o.getAttribute("name")&&o.getAttribute("units")&&o.textContent).map(o=>{const p=o.getAttribute("name"),f=o.getAttribute("units"),d=o.textContent,x=o.getAttribute("unitSymbol")??void 0,v=o.getAttribute("default")??void 0,S=C("default",o,"0")!=="0",I=C("nearestValue",o,"0")!=="0",h=C("current",o,"0")!=="0";return Ne({name:p,units:f})?{name:"time",units:"ISO8601",extent:de(d),default:de(v),multipleValues:S,nearestValue:I,current:h}:yt({name:p,units:f})?{name:"elevation",units:f,extent:me(d),unitSymbol:x,default:me(v),multipleValues:S,nearestValue:I}:{name:p,units:f,extent:ce(d),unitSymbol:x,default:ce(v),multipleValues:S,nearestValue:I}}),n}function ft(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function Fe(e){return e.nodeType===Node.ELEMENT_NODE}function yt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Ne(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ht(e,t){const r=[],n=we(e);for(const i in n.query)n.query.hasOwnProperty(i)&&(t.includes(i.toLowerCase())||r.push(i+"="+n.query[i]));return n.path+(r.length?"?"+r.join("&"):"")}function me(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:parseFloat(i[0]),max:parseFloat(i[1]),resolution:i.length>=3&&i[2]!=="0"?parseFloat(i[2]):void 0}}).filter(U):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:i[0],max:i[1],resolution:i.length>=3&&i[2]!=="0"?i[2]:void 0}}).filter(U):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:D(i[0]),max:D(i[1]),resolution:i.length>=3&&i[2]!=="0"?gt(i[2]):void 0}}).filter(U):r.map(n=>D(n))}function D(e){return He.fromISO(e,{zone:Je.utcInstance}).toJSDate()}function gt(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,r=e.match(t);return r?{years:R(r[1]),months:R(r[2]),days:R(r[3]),hours:R(r[4]),minutes:R(r[5]),seconds:R(r[6])}:null}function R(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function G(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const bt="0000-01-01T00:00:00Z",xt="9999-12-31T23:59:59Z";function fe(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:r}=e;return t&&r&&t.getTime()===r.getTime()?`${G(t)}`:`${t?G(t):bt}/${r?G(r):xt}`}const ye=new Set([102100,3857,102113,900913]),wt=new Set([3395,54004]);function vt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&ye.has(r)?t.find(n=>ye.has(n))||t.find(n=>wt.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function he(e){return e==="text/html"}function ge(e){return e==="text/plain"}let m=class extends et(st(nt(it(tt(rt(Qe(Ye))))))){constructor(...e){super(...e),this.allSublayers=new ze({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},F)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch($e).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new L({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(he)??this.featureInfoFormats.find(ge)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(he(e)||ge(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new N(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return be(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return be(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const i=new Map,l=e.flatten(({sublayers:s})=>s??[]);for(const s of l)if(typeof s.parent?.id=="number"){const c=i.get(s.parent.id);c!=null?c.push(s.id):i.set(s.parent.id,[s.id])}for(const s of l){const c={sublayer:s,...n},o=s.write({parentLayerId:typeof s.parent?.id=="number"?s.parent.id:-1},c);if(i.has(s.id)&&(o.sublayerIds=i.get(s.id)),!s.sublayers&&s.name){const p=s.write({},c);delete p.id,t.layers.push(p)}}t.visibleLayers=l.filter(({visible:s,sublayers:c})=>s&&!c).map(({name:s})=>s).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=we(e);for(const i in r)/^(request|service)$/i.test(i)&&delete r[i];const n=ie(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const i=n?.pixelRatio??1,l=se({extent:e,width:t})*i,s=new ae({layer:this,scale:l}),{xmin:c,ymin:o,xmax:p,ymax:f,spatialReference:d}=e,x=vt(d,this.spatialReferences),v=this.version==="1.3.0"&&J(x)?`${o},${c},${f},${p}`:`${c},${o},${p},${f}`,S=s.toJSON(),I=this.version==="1.3.0"?"crs":"srs";return{bbox:v,[I]:x==null||isNaN(x)?void 0:"EPSG:"+x,...S}}async fetchImage(e,t,r,n){const i=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const o=document.createElement("canvas");return o.width=t,o.height=r,o}const s=fe(n?.timeExtent),c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal};return W(i??"",c).then(o=>o.data)}async fetchImageBitmap(e,t,r,n){const i=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const s=fe(n?.timeExtent),c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal},{data:o}=await W(i,c);return ut(o,i,n?.signal)}fetchFeatureInfo(e,t,r,n,i){const l=se({extent:e,width:t}),s=new ae({layer:this,scale:l}),c=ct(s.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const o=this.version==="1.3.0"?{I:n,J:i}:{x:n,y:i},p={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...o},f={...this.createExportImageParameters(e,t,r),...p},d=this._mixCustomParameters(f);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(d):this._defaultFetchFeatureInfoFunction(ie(this.featureInfoUrl,d))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return at(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?N.WebMercator:new N({wkid:t});return qe(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Be(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new Ve({title:this.title,content:t}),n=new We({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await W(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=mt(n)}if(this.parsedUrl){const t=new ke(this.parsedUrl.path),{httpsDomains:r}=De.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new ve("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function St(e,t){return e.some(r=>{for(const n in r)if(Ze(r,n,null,t))return!0;return!1})}function be(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ge(e)).forEach((l,s)=>l.id=s);for(const l of e){const s=new Z;s.read(l,t),r&&!r.includes(s.name)&&(s.visible=!1),n.set(s.id,s)}const i=[];for(const l of e){const s=l.id!=null?n.get(l.id):null;if(s)if(l.parentLayerId!=null&&l.parentLayerId>=0){const c=n.get(l.parentLayerId);if(!c)continue;c.sublayers||(c.sublayers=new z),c.sublayers.push(s)}else i.push(s)}return i}a([u({readOnly:!0})],m.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],m.prototype,"copyright",void 0),a([u()],m.prototype,"description",void 0),a([u({readOnly:!0})],m.prototype,"dimensions",void 0),a([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],m.prototype,"fullExtent",void 0),a([O(["web-document","portal-item"],"fullExtent",["extent"])],m.prototype,"readFullExtentFromItemOrMap",null),a([k(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],m.prototype,"writeFullExtent",null),a([u()],m.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],m.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoUrl",void 0),a([u()],m.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],m.prototype,"imageFormat",void 0),a([O("imageFormat",["supportedImageFormatTypes"])],m.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],m.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],m.prototype,"imageMaxWidth",void 0),a([u()],m.prototype,"imageTransparency",void 0),a([u(ot)],m.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],m.prototype,"isReference",void 0),a([u({type:["WMS"]})],m.prototype,"operationalLayerType",void 0),a([u()],m.prototype,"resourceInfo",void 0),a([u({type:N,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],m.prototype,"spatialReference",void 0),a([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],m.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Xe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],m.prototype,"spatialReferences",void 0),a([k(["web-document","portal-item"],"spatialReferences")],m.prototype,"writeSpatialReferences",null),a([u({type:z.ofType(Z),json:{write:{target:"layers",overridePolicy(e,t,r){if(St(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],m.prototype,"sublayers",void 0),a([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],m.prototype,"readSublayersFromItemOrMap",null),a([O("service","sublayers",["layers"])],m.prototype,"readSublayers",null),a([k("sublayers",{layers:{type:[Z]},visibleLayers:{type:[String]}})],m.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],m.prototype,"type",void 0),a([u(lt)],m.prototype,"url",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"version",void 0),m=a([xe("esri.layers.WMSLayer")],m);const Yt=m;export{Yt as default}; diff --git a/custom-toc-separator/assets/WMSLayer-C8eYRV4V-kb-WeC_q.js b/custom-toc-separator/assets/WMSLayer-C8eYRV4V-kb-WeC_q.js new file mode 100644 index 00000000..6be077c1 --- /dev/null +++ b/custom-toc-separator/assets/WMSLayer-C8eYRV4V-kb-WeC_q.js @@ -0,0 +1,2 @@ +import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./story-DT1Ep1ux.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{c as se}from"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import{D as Ye}from"./Layer-ChoECxvZ-ocw70508.js";import{u as et}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as rt}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{x as st}from"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-BAaMjACd.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-DL05uTg1.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r +`);throw new ve("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=g("Capability",r),i=g("Service",r),l=n&&g("Request",n);if(!n||!i||!l)return null;const s=g("Layer",n);if(!s)return null;const c=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",o=w("Title",i,"")||w("Name",i,""),p=w("AccessConstraints",i,""),f=/^none$/i.test(p)?"":p,d=w("Abstract",i,""),x=parseInt(w("MaxWidth",i,"5000"),10),v=parseInt(w("MaxHeight",i,"5000"),10),S=ue(l,"GetMap"),I=le(l,"GetMap"),h=j(s,c,t);if(!h)return null;let K,q=0;const Ee=Array.prototype.slice.call(n.childNodes),Re=h.sublayers??[],Q=b=>{b!=null&&Re.push(b)};Ee.forEach(b=>{b.nodeName==="Layer"&&(q===0?K=b:(q===1&&h.name&&(h.name="",Q(j(K,c,t))),Q(j(b,c,t))),q++)});let E=h.sublayers,B=h.extent;const Oe=h.fullExtents??[];if(E||(E=[]),E.length===0&&E.push(h),!B){const b=new L(E[0].extent);h.extent=b.toJSON(),B=h.extent}const Le=h.spatialReferences.length>0?h.spatialReferences:Se(h),Y=le(l,"GetFeatureInfo"),Pe=Y?ue(l,"GetFeatureInfo"):null,ee=Ie(E),Ae=h.minScale||0,Ue=h.maxScale||0,te=h.dimensions??[],_e=ee.reduce((b,P)=>b.concat(P.dimensions??[]),[]),re=te.concat(_e).filter(Ne);let ne=null;if(re.length){const b=re.map(P=>{const{extent:V}=P;return ft(V)?V.map(_=>_.getTime()):V?.map(_=>[_.min.getTime(),_.max.getTime()])}).flat(2).filter(U);ne={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:f,description:d,dimensions:te,extent:B,fullExtents:Oe,featureInfoFormats:Pe,featureInfoUrl:Y,mapUrl:I,maxWidth:x,maxHeight:v,maxScale:Ue,minScale:Ae,layers:ee,spatialReferences:Le,supportedImageFormatTypes:S,timeInfo:ne,title:o,version:c}}function ct(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function Se(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=Se(t);if(r.length>0)return r}return[]}function Ie(e){let t=[];for(const r of e)t.push(r),r.sublayers?.length&&(t=t.concat(Ie(r.sublayers)),delete r.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function dt(e,t,r,n){const i=g(e,r);return i?C(t,i,n):n}function g(e,t){for(let r=0;ri).filter(U);const n=[];for(const i of r)if(i.getAttribute("name")===t){const l=T("Format",i);for(const{textContent:s}of l)s!=null&&n.push(s)}return n}function pe(e,t,r){const n=g(t,e);if(!n)return r;const{textContent:i}=n;if(i==null||i==="")return r;const l=Number(i);return isNaN(l)?r:l}function j(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},i=g("LatLonBoundingBox",e),l=g("EX_GeographicBoundingBox",e);let s=null;i&&(s=A(i,4326)),l&&(s=new L(0,0,0,0,new N({wkid:4326})),s.xmin=parseFloat(w("westBoundLongitude",l,"0")),s.ymin=parseFloat(w("southBoundLatitude",l,"0")),s.xmax=parseFloat(w("eastBoundLongitude",l,"0")),s.ymax=parseFloat(w("northBoundLatitude",l,"0"))),i||l||(s=new L(-180,-90,180,90,new N({wkid:4326}))),n.minScale=pe(e,"MaxScaleDenominator",0),n.maxScale=pe(e,"MinScaleDenominator",0);const c=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(o=>{if(o.nodeName==="Name")n.name=o.textContent||"";else if(o.nodeName==="Title")n.title=o.textContent||"";else if(o.nodeName==="Abstract")n.description=o.textContent||"";else if(o.nodeName==="BoundingBox"){const p=o.getAttribute(c);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.slice(5),10);d===0||isNaN(d)||s||(s=t==="1.3.0"?A(o,d,J(d)):A(o,d))}const f=p?.indexOf(":");if(f&&f>-1){let d=parseInt(p.slice(f+1),10);d===0||isNaN(d)||(d=oe[d]??d);const x=t==="1.3.0"?A(o,d,J(d)):A(o,d);x&&n.fullExtents&&n.fullExtents.push(x)}}else if(o.nodeName===c)(o.textContent?.split(" ")??[]).forEach(p=>{let f=NaN;if(p.includes(":")){const[d,x]=p.toUpperCase().split(":");d!=="CRS"&&d!=="EPSG"||(f=parseInt(x,10))}else f=parseInt(p,10);if(f!==0&&!isNaN(f)){const d=oe[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(o.nodeName!=="Style"||n.legendUrl){if(o.nodeName==="Layer"){const p=j(o,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=g("LegendURL",o);if(p){const f=g("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=s?.toJSON(),n.dimensions=T("Dimension",e).filter(o=>o.getAttribute("name")&&o.getAttribute("units")&&o.textContent).map(o=>{const p=o.getAttribute("name"),f=o.getAttribute("units"),d=o.textContent,x=o.getAttribute("unitSymbol")??void 0,v=o.getAttribute("default")??void 0,S=C("default",o,"0")!=="0",I=C("nearestValue",o,"0")!=="0",h=C("current",o,"0")!=="0";return Ne({name:p,units:f})?{name:"time",units:"ISO8601",extent:de(d),default:de(v),multipleValues:S,nearestValue:I,current:h}:yt({name:p,units:f})?{name:"elevation",units:f,extent:me(d),unitSymbol:x,default:me(v),multipleValues:S,nearestValue:I}:{name:p,units:f,extent:ce(d),unitSymbol:x,default:ce(v),multipleValues:S,nearestValue:I}}),n}function ft(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function Fe(e){return e.nodeType===Node.ELEMENT_NODE}function yt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Ne(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ht(e,t){const r=[],n=we(e);for(const i in n.query)n.query.hasOwnProperty(i)&&(t.includes(i.toLowerCase())||r.push(i+"="+n.query[i]));return n.path+(r.length?"?"+r.join("&"):"")}function me(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:parseFloat(i[0]),max:parseFloat(i[1]),resolution:i.length>=3&&i[2]!=="0"?parseFloat(i[2]):void 0}}).filter(U):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:i[0],max:i[1],resolution:i.length>=3&&i[2]!=="0"?i[2]:void 0}}).filter(U):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:D(i[0]),max:D(i[1]),resolution:i.length>=3&&i[2]!=="0"?gt(i[2]):void 0}}).filter(U):r.map(n=>D(n))}function D(e){return He.fromISO(e,{zone:Je.utcInstance}).toJSDate()}function gt(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,r=e.match(t);return r?{years:R(r[1]),months:R(r[2]),days:R(r[3]),hours:R(r[4]),minutes:R(r[5]),seconds:R(r[6])}:null}function R(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function G(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const bt="0000-01-01T00:00:00Z",xt="9999-12-31T23:59:59Z";function fe(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:r}=e;return t&&r&&t.getTime()===r.getTime()?`${G(t)}`:`${t?G(t):bt}/${r?G(r):xt}`}const ye=new Set([102100,3857,102113,900913]),wt=new Set([3395,54004]);function vt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&ye.has(r)?t.find(n=>ye.has(n))||t.find(n=>wt.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function he(e){return e==="text/html"}function ge(e){return e==="text/plain"}let m=class extends et(st(nt(it(tt(rt(Qe(Ye))))))){constructor(...e){super(...e),this.allSublayers=new ze({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},F)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch($e).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new L({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(he)??this.featureInfoFormats.find(ge)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(he(e)||ge(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new N(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return be(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return be(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const i=new Map,l=e.flatten(({sublayers:s})=>s??[]);for(const s of l)if(typeof s.parent?.id=="number"){const c=i.get(s.parent.id);c!=null?c.push(s.id):i.set(s.parent.id,[s.id])}for(const s of l){const c={sublayer:s,...n},o=s.write({parentLayerId:typeof s.parent?.id=="number"?s.parent.id:-1},c);if(i.has(s.id)&&(o.sublayerIds=i.get(s.id)),!s.sublayers&&s.name){const p=s.write({},c);delete p.id,t.layers.push(p)}}t.visibleLayers=l.filter(({visible:s,sublayers:c})=>s&&!c).map(({name:s})=>s).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=we(e);for(const i in r)/^(request|service)$/i.test(i)&&delete r[i];const n=ie(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const i=n?.pixelRatio??1,l=se({extent:e,width:t})*i,s=new ae({layer:this,scale:l}),{xmin:c,ymin:o,xmax:p,ymax:f,spatialReference:d}=e,x=vt(d,this.spatialReferences),v=this.version==="1.3.0"&&J(x)?`${o},${c},${f},${p}`:`${c},${o},${p},${f}`,S=s.toJSON(),I=this.version==="1.3.0"?"crs":"srs";return{bbox:v,[I]:x==null||isNaN(x)?void 0:"EPSG:"+x,...S}}async fetchImage(e,t,r,n){const i=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const o=document.createElement("canvas");return o.width=t,o.height=r,o}const s=fe(n?.timeExtent),c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal};return W(i??"",c).then(o=>o.data)}async fetchImageBitmap(e,t,r,n){const i=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const s=fe(n?.timeExtent),c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal},{data:o}=await W(i,c);return ut(o,i,n?.signal)}fetchFeatureInfo(e,t,r,n,i){const l=se({extent:e,width:t}),s=new ae({layer:this,scale:l}),c=ct(s.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const o=this.version==="1.3.0"?{I:n,J:i}:{x:n,y:i},p={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...o},f={...this.createExportImageParameters(e,t,r),...p},d=this._mixCustomParameters(f);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(d):this._defaultFetchFeatureInfoFunction(ie(this.featureInfoUrl,d))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return at(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?N.WebMercator:new N({wkid:t});return qe(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Be(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new Ve({title:this.title,content:t}),n=new We({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await W(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=mt(n)}if(this.parsedUrl){const t=new ke(this.parsedUrl.path),{httpsDomains:r}=De.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new ve("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function St(e,t){return e.some(r=>{for(const n in r)if(Ze(r,n,null,t))return!0;return!1})}function be(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ge(e)).forEach((l,s)=>l.id=s);for(const l of e){const s=new Z;s.read(l,t),r&&!r.includes(s.name)&&(s.visible=!1),n.set(s.id,s)}const i=[];for(const l of e){const s=l.id!=null?n.get(l.id):null;if(s)if(l.parentLayerId!=null&&l.parentLayerId>=0){const c=n.get(l.parentLayerId);if(!c)continue;c.sublayers||(c.sublayers=new z),c.sublayers.push(s)}else i.push(s)}return i}a([u({readOnly:!0})],m.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],m.prototype,"copyright",void 0),a([u()],m.prototype,"description",void 0),a([u({readOnly:!0})],m.prototype,"dimensions",void 0),a([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],m.prototype,"fullExtent",void 0),a([O(["web-document","portal-item"],"fullExtent",["extent"])],m.prototype,"readFullExtentFromItemOrMap",null),a([k(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],m.prototype,"writeFullExtent",null),a([u()],m.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],m.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoUrl",void 0),a([u()],m.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],m.prototype,"imageFormat",void 0),a([O("imageFormat",["supportedImageFormatTypes"])],m.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],m.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],m.prototype,"imageMaxWidth",void 0),a([u()],m.prototype,"imageTransparency",void 0),a([u(ot)],m.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],m.prototype,"isReference",void 0),a([u({type:["WMS"]})],m.prototype,"operationalLayerType",void 0),a([u()],m.prototype,"resourceInfo",void 0),a([u({type:N,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],m.prototype,"spatialReference",void 0),a([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],m.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Xe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],m.prototype,"spatialReferences",void 0),a([k(["web-document","portal-item"],"spatialReferences")],m.prototype,"writeSpatialReferences",null),a([u({type:z.ofType(Z),json:{write:{target:"layers",overridePolicy(e,t,r){if(St(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],m.prototype,"sublayers",void 0),a([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],m.prototype,"readSublayersFromItemOrMap",null),a([O("service","sublayers",["layers"])],m.prototype,"readSublayers",null),a([k("sublayers",{layers:{type:[Z]},visibleLayers:{type:[String]}})],m.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],m.prototype,"type",void 0),a([u(lt)],m.prototype,"url",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"version",void 0),m=a([xe("esri.layers.WMSLayer")],m);const Yt=m;export{Yt as default}; diff --git a/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-BVoi86GG.js b/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-BVoi86GG.js deleted file mode 100644 index b566d870..00000000 --- a/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-BVoi86GG.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./story-OUarUCIt.js";import{d as b}from"./BitmapContainer-BC8fvmFc-kxGu4sMT.js";import{X as q,Y as L}from"./LayerView-Bish-E63-DehQ-_Za.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-Bei3OeVZ.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js";import{T as B}from"./timeSupport-ohWmWReZ-Cgf7mpSC.js";import"./main-lj2zzr_L.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./Tile-D75RMC64-DDmsm7e7.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";import"./Bitmap-CcqmzvfR-BO796kOM.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const de=u;export{de as default}; diff --git a/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-DBRyUp6L.js b/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-DBRyUp6L.js new file mode 100644 index 00000000..177e25ce --- /dev/null +++ b/custom-toc-separator/assets/WMSLayerView2D-Dz-z-fa9-DBRyUp6L.js @@ -0,0 +1 @@ +import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./story-DT1Ep1ux.js";import{d as b}from"./BitmapContainer-BC8fvmFc-CdhuTm0j.js";import{X as q,Y as L}from"./LayerView-Bish-E63-B3VRdVIM.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-BzAy5Mad.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-DL05uTg1.js";import{T as B}from"./timeSupport-ohWmWReZ-CSAKuiyl.js";import"./main-BTdHgocv.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./Tile-D75RMC64-XRkD8ADC.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";import"./Bitmap-CcqmzvfR-ppkuK-SZ.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const de=u;export{de as default}; diff --git a/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-Bq0CKOK2.js b/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-Bq0CKOK2.js new file mode 100644 index 00000000..a9af3990 --- /dev/null +++ b/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-Bq0CKOK2.js @@ -0,0 +1 @@ +import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./story-DT1Ep1ux.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as Me}from"./Layer-ChoECxvZ-ocw70508.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-BgSZQGkL.js";import{u as Le}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-C54e75zw.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ue[r.toLowerCase()]&&(s=ue[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Et=d;export{Et as default}; diff --git a/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-DBDKBXYD.js b/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-DBDKBXYD.js deleted file mode 100644 index 82729976..00000000 --- a/custom-toc-separator/assets/WMTSLayer-DJY_jjIE-DBDKBXYD.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./story-OUarUCIt.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as Me}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-DzBqU6HL.js";import{u as Le}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-561xzxdP.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ue[r.toLowerCase()]&&(s=ue[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Et=d;export{Et as default}; diff --git a/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-BP_v6RMY.js b/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-BP_v6RMY.js new file mode 100644 index 00000000..27985a3f --- /dev/null +++ b/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-BP_v6RMY.js @@ -0,0 +1 @@ +import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./story-DT1Ep1ux.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-DEpR3hKq.js";import{X as S,Y as T}from"./LayerView-Bish-E63-B3VRdVIM.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-XRkD8ADC.js";import{s as d}from"./TileKey-C5IL-JBr-Do29X9ef.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-B4aMLSjJ.js";import{i as M}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./main-BTdHgocv.js";import"./MapView-BGOJJ8ch-Dabu63Ao.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import"./Container-BcuL1ZEG-Cg9V4YKU.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import"./LabelMetric-BeluzH3o-wKRDKh4R.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-D0v5nxXn.js";import"./BufferObject-BM_7mcDb-D5jPRgIi.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import"./ProgramTemplate-DQOm6Omy-BId56203.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";import"./layerViewUtils-DURAPenP-1iVHX8OF.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const te=r;export{te as default}; diff --git a/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-CVIfYQAH.js b/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-CVIfYQAH.js deleted file mode 100644 index d3ec0e26..00000000 --- a/custom-toc-separator/assets/WMTSLayerView2D-Bl5FUDUu-CVIfYQAH.js +++ /dev/null @@ -1 +0,0 @@ -import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./story-OUarUCIt.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-CYao57HT.js";import{X as S,Y as T}from"./LayerView-Bish-E63-DehQ-_Za.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-DDmsm7e7.js";import{s as d}from"./TileKey-C5IL-JBr-Cy7bNm0k.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-B9bwJvtU.js";import{i as M}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./main-lj2zzr_L.js";import"./MapView-BGOJJ8ch-MH2z-up5.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-BO796kOM.js";import"./Container-BcuL1ZEG-DGKfmUxH.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./WGLContainer-LxgEo4I_-DR17gokR.js";import"./LabelMetric-BeluzH3o-D5oryYiP.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DeIeQX6y.js";import"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";import"./layerViewUtils-DURAPenP-XPLsaos3.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const te=r;export{te as default}; diff --git a/custom-toc-separator/assets/WebTileLayer-CUoicUjK-BgSZQGkL.js b/custom-toc-separator/assets/WebTileLayer-CUoicUjK-BgSZQGkL.js new file mode 100644 index 00000000..cf7a74e8 --- /dev/null +++ b/custom-toc-separator/assets/WebTileLayer-CUoicUjK-BgSZQGkL.js @@ -0,0 +1 @@ +import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,eL as M,cA as U,k as L,f as w,c2 as W,a0 as g,ac as D}from"./story-DT1Ep1ux.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import{D as $}from"./Layer-ChoECxvZ-ocw70508.js";import{u as O}from"./BlendLayer-D1WkSmwP-DaCYrII3.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import{C as z}from"./PortalLayer-CElnYuSQ-CcA75vOb.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import{u as T}from"./imageBitmapUtils-DA36kg39-DfVYzy_v.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-C54e75zw.js";import"./main-BTdHgocv.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(A(z(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=L(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+W(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([D("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,me as W,c as p}; diff --git a/custom-toc-separator/assets/WebTileLayer-CUoicUjK-DzBqU6HL.js b/custom-toc-separator/assets/WebTileLayer-CUoicUjK-DzBqU6HL.js deleted file mode 100644 index c8f38e77..00000000 --- a/custom-toc-separator/assets/WebTileLayer-CUoicUjK-DzBqU6HL.js +++ /dev/null @@ -1 +0,0 @@ -import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,eL as M,cA as U,k as L,f as w,c2 as W,a0 as g,ac as D}from"./story-OUarUCIt.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import{D as $}from"./Layer-ChoECxvZ-DxWUU3pP.js";import{u as O}from"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import{E as A}from"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import{C as z}from"./PortalLayer-CElnYuSQ-B2e-CURI.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import{u as T}from"./imageBitmapUtils-DA36kg39-zZ47VIK5.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-561xzxdP.js";import"./main-lj2zzr_L.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(A(z(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=L(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+W(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([D("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,me as W,c as p}; diff --git a/custom-toc-separator/assets/WhereClause-DxwoyBMS-D_DBEuLt.js b/custom-toc-separator/assets/WhereClause-DxwoyBMS-D_DBEuLt.js deleted file mode 100644 index d2fe3a12..00000000 --- a/custom-toc-separator/assets/WhereClause-DxwoyBMS-D_DBEuLt.js +++ /dev/null @@ -1,7 +0,0 @@ -import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{c2 as jo,F as J,K as ur,b_ as Yo,c5 as Bo,c6 as Qo,q as Go}from"./story-OUarUCIt.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./main-lj2zzr_L.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` -`,"\r"],!1,!1),vt=y("`",!1),ht=H(["`"],!0,!1),ji=function(e){return e},Yi=function(e){return k(I(),...e)},wt=function(e,r,s){return{op:r,expr:s,location:I()}},Bi=function(e,r){return de(e,r)},It=function(e,r,s){return{op:r,expr:s,location:I()}},Qi=function(e,r){return de(e,r)},Gi=function(e){return ko("NOT",e,I())},Wi=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?de(e,r.tail):ar(r.op,e,r.right,r.escape,I())},gt=function(e,r){return{op:e,expr:r,location:I()}},Ki=function(e){return{type:"arithmetic",tail:e}},Xi=function(e,r){return{op:e+"NOT",right:r}},ea=function(e,r){return{op:e,right:r}},ta=function(e,r,s){return k(I(),r,s)},ra=function(e,r){return{op:"NOT"+e,right:r}},na=function(e,r,s){return k(I(),r,s)},ia=function(e,r){return{op:e,right:r}},aa=function(e){return e[0]+" "+e[2]},sa=function(e){return e[0]+" "+e[2]},ua=function(e,r,s){return{op:e,right:r,escape:s.value}},oa=function(e,r){return{op:e,right:r,escape:""}},la=function(e,r){return{op:e,right:r}},ca=function(e,r){return{op:e,right:r}},yt=function(e,r,s){return{op:r,expr:s,location:I()}},fa=function(e,r){return de(e,r)},Tt=function(e,r,s){return{op:r,expr:s,location:I()}},da=function(e,r){return de(e,r)},pa=function(e){return e.paren=!0,e},ma=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:I(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:I(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:I(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:I()}:{type:"column-reference",location:I(),table:"",column:e}},va=function(e){return{type:"column-reference",location:I(),table:"",column:e,delimited:!0}},ha=function(e){return e},wa=function(e,r){return e+r.join("")},Ia=function(e,r){return e+r.join("")},ga=function(e){return e},ya=function(e){return e.join("")},Ta=function(){return'"'},Na=function(e){return{type:"parameter",location:I(),value:e[1]}},Oa=function(e,r){return k(I(),e,r)},Sa=function(e,r){return k(I(),e,r)},xa=function(e){return{type:"function",location:I(),name:"extract",args:e}},Ca=function(e,r,s){return k(I(),e,r,...s?[s]:[])},Ma=function(e,r,s){return k(I(),e,r,s)},Ea=function(e){return{type:"function",location:I(),name:"substring",args:e}},Fa=function(e,r){return k(I(),e,r)},ba=function(e,r){return k(I(),e,r)},Aa=function(e){return{type:"function",location:I(),name:"cast",args:e}},Pa=function(){return{type:"data-type",location:I(),value:{type:"integer"}}},Da=function(){return{type:"data-type",location:I(),value:{type:"smallint"}}},La=function(){return{type:"data-type",location:I(),value:{type:"float"}}},_a=function(){return{type:"data-type",location:I(),value:{type:"real"}}},Ra=function(){return{type:"data-type",location:I(),value:{type:"date"}}},Ua=function(){return{type:"data-type",location:I(),value:{type:"timestamp"}}},Ja=function(){return{type:"data-type",location:I(),value:{type:"time"}}},Va=function(e){return{type:"data-type",location:I(),value:{type:"varchar",size:parseInt(e)}}},Za=function(e,r,s){return k(I(),e,r,s)},ka=function(e,r){return k(I(),e,r)},za=function(e){return{type:"function",location:I(),name:"trim",args:e}},$a=function(e){return{type:"string",location:I(),value:e??"BOTH"}},Ha=function(e,r){return k(I(),e,r)},qa=function(e,r){return k(I(),e,r)},ja=function(e){return{type:"function",location:I(),name:"position",args:e}},Ya=function(e,r){return{type:"function",location:I(),name:e,args:r}},Ba=function(e){return{type:"string",location:I(),value:e}},Qa=function(e){return e.type==="string"&&zo(e.value),{type:"timestamp",location:I(),value:e.value}},Ga=function(e){return e.type==="string"&&$o(e.value),{type:"time",location:I(),value:e.value}},Wa=function(e,r,s){return{type:"interval",location:I(),value:r,qualifier:s,op:e}},Ka=function(e,r){return{type:"interval",location:I(),value:e,qualifier:r,op:""}},Xa=function(e,r){return{type:"interval-qualifier",location:I(),start:e,end:r}},es=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},ts=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},rs=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},ns=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},is=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},as=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},ss=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},us=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},os=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},ls=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},cs=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},fs=function(){return{type:"string",location:I(),value:"day"}},ds=function(){return{type:"string",location:I(),value:"hour"}},ps=function(){return{type:"string",location:I(),value:"minute"}},ms=function(){return{type:"string",location:I(),value:"month"}},vs=function(){return{type:"string",location:I(),value:"year"}},hs=function(e){return parseFloat(e)},ws=function(e){return parseFloat(e)},Is=function(e){return e.type==="string"&&Ho(e.value),{type:"date",location:I(),value:e.value}},gs=function(){return{type:"null",location:I(),value:null}},ys=function(){return{type:"boolean",location:I(),value:!0}},Ts=function(){return{type:"boolean",location:I(),value:!1}},Nt=function(){return"'"},Ns=function(e){return{type:"string",location:I(),value:e.join("")}},Os=function(e,r){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:null,elseLocation:null}},Ss=function(e,r,s){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:s.value,elseLocation:s.location}},xs=function(e){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:null,elseLocation:null}},Cs=function(e,r){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:r.value,elseLocation:r.location}},Ms=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Es=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Fs=function(e){return{type:"else-clause",location:I(),value:e}},bs=function(e){return{type:"number",location:I(),value:e}},As=function(e,r,s){return parseFloat(e+r+s)},Ps=function(e,r){return parseFloat(e+r)},Ds=function(e,r){return parseFloat(e+r)},Ls=function(e){return parseFloat(e)},_s=function(e,r){return e[0]+r},Rs=function(e){return"."+(e??"")},Us=function(e,r){return e+r},Js=function(e){return e.join("")},Vs=function(e,r){return"e"+(r===null?"":r)},Zs=function(){return"IN"},ks=function(){return"IS"},zs=function(){return"LIKE"},$s=function(){return"ESCAPE"},Hs=function(){return"NOT"},qs=function(){return"AND"},js=function(){return"OR"},Ys=function(){return"BETWEEN"},Bs=function(){return"FROM"},Qs=function(){return"FOR"},Gs=function(){return"SUBSTRING"},Ws=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Xs=function(){return"POSITION"},eu=function(){return"TIMESTAMP"},tu=function(){return"DATE"},ru=function(){return"TIME"},nu=function(){return"LEADING"},iu=function(){return"TRAILING"},au=function(){return"BOTH"},su=function(){return"CAST"},uu=function(){return"AS"},ou=function(){return"INTEGER"},lu=function(){return"INT"},cu=function(){return"SMALLINT"},fu=function(){return"FLOAT"},du=function(){return"REAL"},pu=function(){return"VARCHAR"},mu=function(){return"TO"},vu=function(){return"INTERVAL"},hu=function(){return"YEAR"},wu=function(){return"TIMEZONE_HOUR"},Iu=function(){return"TIMEZONE_MINUTE"},gu=function(){return"MONTH"},yu=function(){return"DAY"},Tu=function(){return"HOUR"},Nu=function(){return"MINUTE"},Ou=function(){return"SECOND"},Su=function(){return"CASE"},xu=function(){return"END"},Cu=function(){return"WHEN"},Mu=function(){return"THEN"},Eu=function(){return"ELSE"},Fu=function(e){return e},bu=function(e){return e.join("")},n=0|i.peg$currPos,f=n,ue=[{line:1,column:1}],Y=n,we=i.peg$maxFailExpected||[],c=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in v))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');g=v[i.startRule]}function I(){return Ie(f,n)}function _e(e,r){throw Pu(e,r=r!==void 0?r:Ie(f,n))}function y(e,r){return{type:"literal",text:e,ignoreCase:r}}function H(e,r,s){return{type:"class",parts:e,inverted:r,ignoreCase:s}}function Au(){return{type:"end"}}function Ot(e){var r,s=ue[e];if(s)return s;if(e>=ue.length)r=ue.length-1;else for(r=e;!ue[--r];);for(s={line:(s=ue[r]).line,column:s.column};rY&&(Y=n,we=[]),we.push(e))}function Pu(e,r){return new se(e,null,null,r)}function Du(e,r,s){return new se(se.buildMessage(e,r),e,r,s)}function St(){var e,r;return e=n,p(),(r=M())!==t?(p(),f=e,e=ji(r)):(n=e,e=t),e}function xt(){var e,r,s,o,h,C;if(e=n,_()!==t){for(p(),r=[],s=M();s!==t;)r.push(s),s=n,o=n,h=p(),(C=W())!==t?o=h=[h,C,p()]:(n=o,o=t),o!==t&&(o=M())===t?(n=s,s=t):s=o;s=p(),(o=R())!==t?(f=e,e=Yi(r)):(n=e,e=t)}else n=e,e=t;return e}function M(){var e,r,s,o,h,C;if(e=n,(r=Re())!==t){for(s=[],o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Bi(r,s)}else n=e,e=t;return e}function Re(){var e,r,s,o,h,C;if(e=n,(r=ge())!==t){for(s=[],o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Qi(r,s)}else n=e,e=t;return e}function ge(){var e,r,s,o,h;return e=n,(r=fe())===t&&(r=n,a.charCodeAt(n)===33?(s=T,n++):(s=t,c===0&&w(Pn)),s!==t?(o=n,c++,a.charCodeAt(n)===61?(h=S,n++):(h=t,c===0&&w(Dn)),c--,h===t?o=void 0:(n=o,o=t),o!==t?r=s=[s,o]:(n=r,r=t)):(n=r,r=t)),r!==t?(s=p(),(o=ge())!==t?(f=e,e=Gi(o)):(n=e,e=t)):(n=e,e=t),e===t&&(e=Lu()),e}function Lu(){var e,r,s,o;return e=n,(r=G())!==t?(s=n,p(),(o=_u())!==t?s=o:(n=s,s=t),s===t&&(s=null),f=e,e=Wi(r,s)):(n=e,e=t),e}function _u(){var e;return(e=Ru())===t&&(e=Zu())===t&&(e=Ju())===t&&(e=Uu())===t&&(e=Vu()),e}function Ru(){var e,r,s,o,h;if(e=n,r=[],s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t),s!==t)for(;s!==t;)r.push(s),s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t);else r=t;return r!==t&&(f=e,r=Ki(r)),e=r}function Ct(){var e;return a.substr(n,2)===O?(e=O,n+=2):(e=t,c===0&&w(Ln)),e===t&&(a.charCodeAt(n)===62?(e=x,n++):(e=t,c===0&&w(_n)),e===t&&(a.substr(n,2)===D?(e=D,n+=2):(e=t,c===0&&w(Rn)),e===t&&(a.substr(n,2)===F?(e=F,n+=2):(e=t,c===0&&w(Un)),e===t&&(e=a.charAt(n),Sn.test(e)?n++:(e=t,c===0&&w(Jn)),e===t&&(a.substr(n,2)===X?(e=X,n+=2):(e=t,c===0&&w(Vn))))))),e}function Uu(){var e,r,s,o;return e=n,(r=zt())!==t?(p(),(s=fe())!==t?(p(),(o=G())!==t?(f=e,e=Xi(r,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=zt())!==t?(p(),(s=G())!==t?(f=e,e=ea(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Ju(){var e,r,s,o,h,C,ie,sr;return e=n,(r=fe())!==t?(p(),(s=qt())!==t?(o=p(),h=n,(C=G())!==t?(p(),(ie=Ce())!==t?(p(),(sr=G())!==t?(f=h,h=ta(s,C,sr)):(n=h,h=t)):(n=h,h=t)):(n=h,h=t),h!==t?(f=e,e=ra(s,h)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=qt())!==t?(p(),s=n,(o=G())!==t?(h=p(),(C=Ce())!==t?(p(),(ie=G())!==t?(f=s,s=na(r,o,ie)):(n=s,s=t)):(n=s,s=t)):(n=s,s=t),s!==t?(f=e,e=ia(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Mt(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=$t())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=aa(r)),(e=r)===t&&(e=$t()),e}function Et(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=ze())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=sa(r)),(e=r)===t&&(e=ze()),e}function Vu(){var e,r,s,o;return e=n,(r=Mt())!==t?(p(),(s=te())!==t?(p(),yo()!==t?(p(),(o=ke())!==t?(f=e,e=ua(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Mt())!==t?(p(),(s=te())!==t?(f=e,e=oa(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Zu(){var e,r,s;return e=n,(r=Et())!==t?(p(),(s=xt())!==t?(f=e,e=la(r,s)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Et())!==t?(p(),(s=Ze())!==t?(f=e,e=ca(r,s)):(n=e,e=t)):(n=e,e=t)),e}function G(){var e,r,s,o,h,C;if(e=n,(r=Ue())!==t){for(s=[],o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=fa(r,s)}else n=e,e=t;return e}function Ft(){var e;return e=a.charAt(n),ve.test(e)?n++:(e=t,c===0&&w(he)),e===t&&(a.substr(n,2)===ee?(e=ee,n+=2):(e=t,c===0&&w(Zn))),e}function Ue(){var e,r,s,o,h,C;if(e=n,(r=Je())!==t){for(s=[],o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=da(r,s)}else n=e,e=t;return e}function bt(){var e;return e=a.charAt(n),xn.test(e)?n++:(e=t,c===0&&w(kn)),e}function Je(){var e,r;return(e=eo())===t&&(e=Bu())===t&&(e=Qu())===t&&(e=Wu())===t&&(e=Ku())===t&&(e=Gu())===t&&(e=Xu())===t&&(e=co())===t&&(e=ku())===t&&(e=Ze())===t&&(e=n,_()!==t?(p(),(r=M())!==t?(p(),R()!==t?(f=e,e=pa(r)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function ku(){var e,r;return e=n,(r=zu())!==t&&(f=e,r=ma(r)),(e=r)===t&&(e=n,(r=Hu())!==t&&(f=e,r=va(r)),e=r),e}function zu(){var e,r;return e=n,(r=$u())!==t&&(f=e,r=ha(r)),e=r}function $u(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=Pt();o!==t;)s.push(o),o=Pt();f=e,e=wa(r,s)}else n=e,e=t;return e}function At(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=N();o!==t;)s.push(o),o=N();f=e,e=Ia(r,s)}else n=e,e=t;return e}function Ve(){var e;return e=a.charAt(n),Cn.test(e)?n++:(e=t,c===0&&w(zn)),e}function N(){var e;return e=a.charAt(n),Mn.test(e)?n++:(e=t,c===0&&w($n)),e}function Pt(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function Hu(){var e,r;return e=n,ye()!==t?(r=qu(),ye()!==t?(f=e,e=ga(r)):(n=e,e=t)):(n=e,e=t),e}function qu(){var e,r,s;for(e=n,r=[],s=Dt();s!==t;)r.push(s),s=Dt();return f=e,e=r=ya(r)}function Dt(){var e;return(e=Yu())===t&&(e=ju()),e}function ju(){var e;return e=n,ye()!==t&&ye()!==t?(f=e,e=Ta()):(n=e,e=t),e}function Yu(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function ye(){var e;return e=a.charAt(n),En.test(e)?n++:(e=t,c===0&&w(Hn)),e}function Ze(){var e,r,s,o;return e=n,r=n,a.charCodeAt(n)===64?(s=Cr,n++):(s=t,c===0&&w(qn)),s!==t&&(o=At())!==t?r=s=[s,o]:(n=r,r=t),r!==t&&(f=e,r=Na(r)),e=r}function Bu(){var e,r,s,o;return e=n,jt()!==t?(p(),r=n,_()!==t?(p(),(s=Rt())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Oa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=Rt())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Sa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=xa(r)):(n=e,e=t)):(n=e,e=t),e}function Qu(){var e,r,s,o,h,C,ie;return e=n,No()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),h=n,To()!==t?(C=p(),(ie=M())!==t?(p(),h=ie):(n=h,h=t)):(n=h,h=t),h===t&&(h=null),R()!==t?(f=r,r=Ca(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),(h=W())!==t?(p(),(C=M())!==t&&(ie=R())!==t?(f=r,r=Ma(s,o,C)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Ea(r)):(n=e,e=t)):(n=e,e=t),e}function Gu(){var e,r,s,o;return e=n,Eo()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),Fo()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=Fa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=ba(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Aa(r)):(n=e,e=t)):(n=e,e=t),e}function Lt(){var e,r,s;return e=n,(r=bo())===t&&(r=Ao()),r!==t&&(f=e,r=Pa()),(e=r)===t&&(e=n,(r=Po())!==t&&(f=e,r=Da()),(e=r)===t&&(e=n,(r=Do())!==t&&(f=e,r=La()),(e=r)===t&&(e=n,(r=Lo())!==t&&(f=e,r=_a()),(e=r)===t&&(e=n,(r=Bt())!==t&&(f=e,r=Ra()),(e=r)===t&&(e=n,(r=Yt())!==t&&(f=e,r=Ua()),(e=r)===t&&(e=n,(r=Qt())!==t&&(f=e,r=Ja()),(e=r)===t&&(e=n,(r=_o())!==t?(p(),_()!==t?(p(),(s=re())!==t?(p(),R()!==t?(f=e,e=Va(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)))))))),e}function Wu(){var e,r,s,o,h;return e=n,Oo()!==t?(p(),r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),$e()!==t?(p(),(h=M())!==t?(p(),R()!==t?(f=r,r=Za(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),R()!==t?(f=r,r=ka(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=za(r)):(n=e,e=t)):(n=e,e=t),e}function _t(){var e,r;return e=n,(r=xo())===t&&(r=Co())===t&&(r=Mo()),r===t&&(r=null),f=e,e=r=$a(r)}function Ku(){var e,r,s,o;return e=n,So()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),ze()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Ha(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=qa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=ja(r)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,s,o;return e=n,r=n,c++,s=jt(),c--,s===t?r=void 0:(n=r,r=t),r!==t&&(s=Zo())!==t?(p(),(o=xt())!==t?(f=e,e=Ya(s,o)):(n=e,e=t)):(n=e,e=t),e}function Rt(){var e,r;return e=n,(r=Wt())===t&&(r=Kt())===t&&(r=Xt())===t&&(r=er())===t&&(r=tr())===t&&(r=ne())===t&&(r=Uo())===t&&(r=Jo()),r!==t&&(f=e,r=Ba(r)),e=r}function eo(){var e;return(e=ke())===t&&(e=mo())===t&&(e=lo())===t&&(e=oo())===t&&(e=uo())===t&&(e=to())===t&&(e=no())===t&&(e=ro()),e}function to(){var e,r;return e=n,Yt()!==t?(p(),(r=te())!==t?(f=e,e=Qa(r)):(n=e,e=t)):(n=e,e=t),e}function ro(){var e,r;return e=n,Qt()!==t?(p(),(r=te())!==t?(f=e,e=Ga(r)):(n=e,e=t)):(n=e,e=t),e}function no(){var e,r,s,o;return e=n,Gt()!==t?(p(),r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t?(p(),(s=te())!==t?(p(),(o=Ut())!==t?(f=e,e=Wa(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,Gt()!==t?(p(),(r=te())!==t?(p(),(s=Ut())!==t?(f=e,e=Ka(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ut(){var e,r,s;return e=n,(r=io())!==t?(p(),Ro()!==t?(p(),(s=ao())!==t?(f=e,e=Xa(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=so()),e}function io(){var e,r,s;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=ts(r)),e=r),e}function ao(){var e,r,s,o;return e=n,(r=ce())!==t&&(f=e,r=rs(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=ns(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=is(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=as()),e=r))),e}function so(){var e,r,s,o;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ss(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=us(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=os(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ls(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=cs()),e=r)))),e}function ce(){var e,r;return e=n,(r=Xt())!==t&&(f=e,r=fs()),(e=r)===t&&(e=n,(r=er())!==t&&(f=e,r=ds()),(e=r)===t&&(e=n,(r=tr())!==t&&(f=e,r=ps()),(e=r)===t&&(e=n,(r=Kt())!==t&&(f=e,r=ms()),(e=r)===t&&(e=n,(r=Wt())!==t&&(f=e,r=vs()),e=r)))),e}function Te(){var e,r;return e=n,(r=re())!==t&&(f=e,r=hs(r)),e=r}function Ne(){var e,r;return e=n,(r=re())!==t&&(f=e,r=ws(r)),e=r}function uo(){var e,r;return e=n,Bt()!==t?(p(),(r=te())!==t?(f=e,e=Is(r)):(n=e,e=t)):(n=e,e=t),e}function oo(){var e,r;return e=n,(r=wo())!==t&&(f=e,r=gs()),e=r}function lo(){var e,r;return e=n,(r=Io())!==t&&(f=e,r=ys()),(e=r)===t&&(e=n,(r=go())!==t&&(f=e,r=Ts()),e=r),e}function te(){var e;return(e=ke())===t&&(e=Ze()),e}function ke(){var e,r,s,o,h;if(e=n,a.charCodeAt(n)===39?(r=at,n++):(r=t,c===0&&w(dt)),r===t&&(a.substr(n,2)===st?(r=st,n+=2):(r=t,c===0&&w(jn))),r!==t){for(s=[],o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));o!==t;)s.push(o),o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));a.charCodeAt(n)===39?(o=at,n++):(o=t,c===0&&w(dt)),o!==t?(f=e,e=Ns(s)):(n=e,e=t)}else n=e,e=t;return e}function co(){var e;return(e=fo())===t&&(e=po()),e}function fo(){var e,r,s,o,h;if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Ee())!==t?(f=e,e=Os(r,s)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Jt())!==t?(h=p(),Ee()!==t?(f=e,e=Ss(r,s,o)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function po(){var e,r,s,o;if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Ee())!==t?(f=e,e=xs(r)):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Jt())!==t?(o=p(),Ee()!==t?(f=e,e=Cs(r,s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Oe(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Ms(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Se(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Jt(){var e,r;return e=n,Vo()!==t?(p(),(r=M())!==t?(f=e,e=Fs(r)):(n=e,e=t)):(n=e,e=t),e}function mo(){var e,r,s,o;return e=n,(r=vo())!==t?(s=n,c++,o=Ve(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=bs(r)):(n=e,e=t)):(n=e,e=t),e}function vo(){var e,r,s,o;return e=n,(r=xe())!==t&&(s=Vt())!==t&&(o=Zt())!==t?(f=e,e=As(r,s,o)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Vt())!==t?(f=e,e=Ps(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Zt())!==t?(f=e,e=Ds(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(f=e,r=Ls(r)),e=r))),e}function xe(){var e,r,s;return(e=re())===t&&(e=n,r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t&&(s=re())!==t?(f=e,e=_s(r,s)):(n=e,e=t)),e}function Vt(){var e,r,s;return e=n,a.charCodeAt(n)===46?(r=Mr,n++):(r=t,c===0&&w(Yn)),r!==t?((s=re())===t&&(s=null),f=e,e=Rs(s)):(n=e,e=t),e}function Zt(){var e,r,s;return e=n,(r=ho())!==t&&(s=re())!==t?(f=e,e=Us(r,s)):(n=e,e=t),e}function re(){var e,r,s;if(e=n,r=[],(s=kt())!==t)for(;s!==t;)r.push(s),s=kt();else r=t;return r!==t&&(f=e,r=Js(r)),e=r}function kt(){var e;return e=a.charAt(n),Fn.test(e)?n++:(e=t,c===0&&w(Bn)),e}function ho(){var e,r,s;return e=n,r=a.charAt(n),bn.test(r)?n++:(r=t,c===0&&w(Qn)),r!==t?(s=a.charAt(n),ve.test(s)?n++:(s=t,c===0&&w(he)),s===t&&(s=null),f=e,e=Vs(r,s)):(n=e,e=t),e}function wo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Er?n+=4:(r=t,c===0&&w(Gn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function Io(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Fr?n+=4:(r=t,c===0&&w(Wn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function go(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===br?n+=5:(r=t,c===0&&w(Kn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function ze(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ar?n+=2:(r=t,c===0&&w(Xn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Zs()):(n=e,e=t)):(n=e,e=t),e}function zt(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Pr?n+=2:(r=t,c===0&&w(ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ks()):(n=e,e=t)):(n=e,e=t),e}function $t(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Dr?n+=4:(r=t,c===0&&w(ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=zs()):(n=e,e=t)):(n=e,e=t),e}function yo(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===Lr?n+=6:(r=t,c===0&&w(ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=$s()):(n=e,e=t)):(n=e,e=t),e}function fe(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===_r?n+=3:(r=t,c===0&&w(ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Hs()):(n=e,e=t)):(n=e,e=t),e}function Ce(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Rr?n+=3:(r=t,c===0&&w(ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=qs()):(n=e,e=t)):(n=e,e=t),e}function Ht(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ur?n+=2:(r=t,c===0&&w(ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=js()):(n=e,e=t)):(n=e,e=t),e}function qt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Jr?n+=7:(r=t,c===0&&w(si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ys()):(n=e,e=t)):(n=e,e=t),e}function $e(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Vr?n+=4:(r=t,c===0&&w(ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Bs()):(n=e,e=t)):(n=e,e=t),e}function To(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Zr?n+=3:(r=t,c===0&&w(oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Qs()):(n=e,e=t)):(n=e,e=t),e}function No(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===kr?n+=9:(r=t,c===0&&w(li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Gs()):(n=e,e=t)):(n=e,e=t),e}function jt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===zr?n+=7:(r=t,c===0&&w(ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ws()):(n=e,e=t)):(n=e,e=t),e}function Oo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===$r?n+=4:(r=t,c===0&&w(fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ks()):(n=e,e=t)):(n=e,e=t),e}function So(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Hr?n+=8:(r=t,c===0&&w(di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Xs()):(n=e,e=t)):(n=e,e=t),e}function Yt(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===qr?n+=9:(r=t,c===0&&w(pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=eu()):(n=e,e=t)):(n=e,e=t),e}function Bt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===jr?n+=4:(r=t,c===0&&w(mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=tu()):(n=e,e=t)):(n=e,e=t),e}function Qt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Yr?n+=4:(r=t,c===0&&w(vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ru()):(n=e,e=t)):(n=e,e=t),e}function xo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Br?n+=7:(r=t,c===0&&w(hi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=nu()):(n=e,e=t)):(n=e,e=t),e}function Co(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Qr?n+=8:(r=t,c===0&&w(wi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=iu()):(n=e,e=t)):(n=e,e=t),e}function Mo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Gr?n+=4:(r=t,c===0&&w(Ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=au()):(n=e,e=t)):(n=e,e=t),e}function Eo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Wr?n+=4:(r=t,c===0&&w(gi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=su()):(n=e,e=t)):(n=e,e=t),e}function Fo(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Kr?n+=2:(r=t,c===0&&w(yi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=uu()):(n=e,e=t)):(n=e,e=t),e}function bo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Xr?n+=7:(r=t,c===0&&w(Ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ou()):(n=e,e=t)):(n=e,e=t),e}function Ao(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===en?n+=3:(r=t,c===0&&w(Ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=lu()):(n=e,e=t)):(n=e,e=t),e}function Po(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===tn?n+=8:(r=t,c===0&&w(Oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=cu()):(n=e,e=t)):(n=e,e=t),e}function Do(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===rn?n+=5:(r=t,c===0&&w(Si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=fu()):(n=e,e=t)):(n=e,e=t),e}function Lo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===nn?n+=4:(r=t,c===0&&w(xi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=du()):(n=e,e=t)):(n=e,e=t),e}function _o(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===an?n+=7:(r=t,c===0&&w(Ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=pu()):(n=e,e=t)):(n=e,e=t),e}function Ro(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===sn?n+=2:(r=t,c===0&&w(Mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=mu()):(n=e,e=t)):(n=e,e=t),e}function Gt(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===un?n+=8:(r=t,c===0&&w(Ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=vu()):(n=e,e=t)):(n=e,e=t),e}function Wt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===on?n+=4:(r=t,c===0&&w(Fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=hu()):(n=e,e=t)):(n=e,e=t),e}function Uo(){var e,r,s,o;return e=n,(r=a.substr(n,13)).toLowerCase()===ln?n+=13:(r=t,c===0&&w(bi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=wu()):(n=e,e=t)):(n=e,e=t),e}function Jo(){var e,r,s,o;return e=n,(r=a.substr(n,15)).toLowerCase()===cn?n+=15:(r=t,c===0&&w(Ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Iu()):(n=e,e=t)):(n=e,e=t),e}function Kt(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===fn?n+=5:(r=t,c===0&&w(Pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=gu()):(n=e,e=t)):(n=e,e=t),e}function Xt(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===dn?n+=3:(r=t,c===0&&w(Di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=yu()):(n=e,e=t)):(n=e,e=t),e}function er(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===pn?n+=4:(r=t,c===0&&w(Li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Tu()):(n=e,e=t)):(n=e,e=t),e}function tr(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===mn?n+=6:(r=t,c===0&&w(_i)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Nu()):(n=e,e=t)):(n=e,e=t),e}function ne(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===vn?n+=6:(r=t,c===0&&w(Ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ou()):(n=e,e=t)):(n=e,e=t),e}function Me(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===hn?n+=4:(r=t,c===0&&w(Ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Su()):(n=e,e=t)):(n=e,e=t),e}function Ee(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===wn?n+=3:(r=t,c===0&&w(Ji)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=xu()):(n=e,e=t)):(n=e,e=t),e}function rr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===In?n+=4:(r=t,c===0&&w(Vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Cu()):(n=e,e=t)):(n=e,e=t),e}function nr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===gn?n+=4:(r=t,c===0&&w(Zi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Mu()):(n=e,e=t)):(n=e,e=t),e}function Vo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===yn?n+=4:(r=t,c===0&&w(ki)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Eu()):(n=e,e=t)):(n=e,e=t),e}function W(){var e;return a.charCodeAt(n)===44?(e=Tn,n++):(e=t,c===0&&w(zi)),e}function _(){var e;return a.charCodeAt(n)===40?(e=Nn,n++):(e=t,c===0&&w($i)),e}function R(){var e;return a.charCodeAt(n)===41?(e=On,n++):(e=t,c===0&&w(Hi)),e}function p(){var e,r;for(e=[],r=ir();r!==t;)e.push(r),r=ir();return e}function ir(){var e;return e=a.charAt(n),An.test(e)?n++:(e=t,c===0&&w(qi)),e}function Zo(){var e,r,s,o;if(e=n,(r=At())!==t&&(f=e,r=Fu(r)),(e=r)===t)if(e=n,a.charCodeAt(n)===96?(r=ut,n++):(r=t,c===0&&w(vt)),r!==t){if(s=[],o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht)),o!==t)for(;o!==t;)s.push(o),o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht));else s=t;s!==t?(a.charCodeAt(n)===96?(o=ut,n++):(o=t,c===0&&w(vt)),o!==t?(f=e,e=bu(s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ko(e,r,s){return{type:"unary-expression",location:s,operator:e,expr:r}}function ar(e,r,s,o,h){const C={type:"binary-expression",location:h,operator:e,left:r,right:s};return o!==void 0&&(C.escape=o),C}function k(e,...r){return{type:"expression-list",location:e,value:r}}function de(e,r){let s=e;for(const{op:o,expr:h,location:{end:C}}of r)s=ar(o,s,h,void 0,{...s.location,end:C});return s}function zo(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Timestamp literal is invalid")}function $o(e){/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)!==!0&&_e("Time literal is invalid")}function Ho(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Date literal is invalid")}if(u=g(),i.peg$library)return{peg$result:u,peg$currPos:n,peg$FAILED:t,peg$maxFailExpected:we,peg$maxFailPos:Y};if(u!==t&&n===a.length)return u;throw u!==t&&n `+g+` -`+S+` | -`+v.line+" | "+O+` -`+S+" | "+Qe("",l.column-1," ")+Qe("",x,"^")}else i+=` - at `+g}return i},se.buildMessage=function(a,i){var u={literal:function(O){return'"'+l(O.text)+'"'},class:function(O){var x=O.parts.map(function(D){return Array.isArray(D)?v(D[0])+"-"+v(D[1]):v(D)});return"["+(O.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function t(O){return O.charCodeAt(0).toString(16).toUpperCase()}function l(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function v(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function g(O){return u[O.type](O)}function T(O){var x,D,F=O.map(g);if(F.sort(),F.length>0){for(x=1,D=1;x=")&&z(i,u[1],"<=")}static notbetween(i,u,t){return i==null||u[0]==null||u[1]==null?null:z(i,u[0],"<")||z(i,u[1],">")}static ternaryNot(i){return Ae(i)}static ternaryAnd(i,u){return Or(i,u)}static ternaryOr(i,u){return Sr(i,u)}}class it{constructor(i,u,t="UTC",l=null){this.fieldsIndex=u,this.timeZone=t,this.currentUser=l,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=yc.parse(i);const{isStandardized:v,isAggregate:g,currentUserRequired:T,referencedFieldNames:S}=this._extractExpressionInfo(u);this._referencedFieldNames=S,this.isStandardized=v,this.isAggregate=g,this.currentUserRequired=T}static convertValueToStorageFormat(i,u=null){if(u===null)return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toStorageFormat():L(i)?i.toStorageString():A(i)?i.toStorageFormat():i;switch(u){case"date":return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toMilliseconds():A(i)?i.toNumber():i;case"date-only":return q(i)?j.fromDateJS(i).toString():P(i)?j.fromSqlTimeStampOffset(i).toString():b(i)?j.fromDateTime(i).toString():i;case"time-only":return q(i)?$.fromDateJS(i).toStorageString():b(i)?$.fromDateTime(i).toStorageString():P(i)?$.fromSqlTimeStampOffset(i).toStorageString():L(i)?i.toStorageString():i;case"timestamp-offset":if(q(i))return Q.fromJSDate(i).toStorageFormat();if(b(i))return Q.fromDateTime(i).toStorageFormat();if(P(i))return i.toStorageFormat()}return i}static create(i,u={}){return new it(i,u.fieldsIndex,u.timeZone??void 0,u.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,null,u,i,t)}calculateValue(i,u=le,t=this.currentUser){const l=this._evaluateNode(this.parseTree,i,u,null,t);return l instanceof E?l.valueInMilliseconds()/864e5:l}calculateValueCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.calculateValue(i,u):(this._compileMe(),this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}testFeature(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,i,u,null,t)}testFeatureCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.testFeature(i,u):(this._compileMe(),!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,U(this.parseTree,i=>{i.type==="current-time"?this._hasDateFunctions=!0:i.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||Tc.has(i.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const i=new Set;return U(this.parseTree,u=>{u.type==="function"&&i.add(u.name.toLowerCase())}),Array.from(i)}getExpressions(){const i=new Map;return U(this.parseTree,u=>{if(u.type==="function"){const t=u.name.toLowerCase(),l=u.args.value[0];if(l.type==="column-reference"){const v=l.column,g=`${t}-${v}`;i.has(g)||i.set(g,{aggregateType:t,field:v})}}}),[...i.values()]}getVariables(){const i=new Set;return U(this.parseTree,u=>{u.type==="parameter"&&i.add(u.value.toLowerCase())}),Array.from(i)}_compileMe(){const i="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone","currentUser",i).bind(be)}_extractExpressionInfo(i){const u=[],t=new Set;let l=!0,v=!1,g=!1;return U(this.parseTree,T=>{switch(T.type){case"column-reference":{const S=i?.get(T.column);let O,x;S?O=x=S.name??"":(x=T.column,O=x.toLowerCase()),t.has(O)||(t.add(O),u.push(x)),T.column=x;break}case"current-user":g=!0;break;case"function":{const{name:S,args:O}=T,x=O.value.length;l&&(l=yl(S,x)),v===!1&&(v=lr(S,x));break}}}),{referencedFieldNames:Array.from(u),isStandardized:l,isAggregate:v,currentUserRequired:g}}evaluateNodeToJavaScript(i){switch(i.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(i.value)+", "+JSON.stringify(i.qualifier)+","+JSON.stringify(i.op)+")";case"case-expression":{let u="";if(i.format==="simple"){const t=this.evaluateNodeToJavaScript(i.operand);u="( ";for(let l=0;l=",this.timeZone)&&z(T,S[1],"<=",this.timeZone)}case"NOTBETWEEN":{const T=this._evaluateNode(i.left,u,t,l,v),S=this._evaluateNode(i.right,u,t,l,v);return T==null||S[0]==null||S[1]==null?null:z(T,S[0],"<",this.timeZone)||z(T,S[1],">",this.timeZone)}case"LIKE":return Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape);case"NOT LIKE":return Ae(Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return z(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return Tr(i.operator,this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),this.timeZone)}case"null":case"boolean":case"string":case"number":return i.value;case"date":return i.parsedValue??=Ir(i.value,"unknown"),i.parsedValue;case"timestamp":return i.parsedValue??=De(i.value,"unknown"),i.parsedValue;case"time":return tt(i.value);case"current-time":return i.mode==="date"?be.currentDate(this.timeZone):i.mode==="time"?be.currentTime(this.timeZone):be.currentTimestamp(this.timeZone);case"current-user":return v??null;case"column-reference":return xr(u,i.column,this.fieldsIndex,t);case"data-type":return i.value;case"function":{if(this.isAggregate&&lr(i.name,i.args.value.length)){const S=[];for(const O of i.args?.value||[]){const x=[];for(const D of l||[])x.push(this._evaluateNode(O,D,t,null,v));S.push(x)}return Ko(i.name,S)}const T=this._evaluateNode(i.args,u,t,l,v);return rt(i.name,T,this.timeZone)}}throw new m(d.UnsupportedSyntax,{node:i.type})}}function Nr(a){return a===!0}function We(a){return Array.isArray(a)?a:[a]}function Ae(a){return a!==null?a!==!0:null}function Or(a,i){return a!=null&&i!=null?a===!0&&i===!0:a!==!1&&i!==!1&&null}function Sr(a,i){return a!=null&&i!=null?a===!0||i===!0:a===!0||i===!0||null}function Ke(a,i,u){if(a==null)return null;let t=!1;for(const l of i)if(l==null)t=null;else{if(a===l){t=!0;break}if(Ge(a)&&Ge(l)&&(t=z(a,l,"="),t))break}return t}const dr="-[]/{}()*+?.\\^$|";var ae;function Nc(a,i){const u=i;let t="",l=ae.Normal;for(let v=0;v(Oc(a)?a.attributes:a)[i]},Ec=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:it,defaultAttributeAdapter:le},Symbol.toStringTag,{value:"Module"}));export{Ec as W,it as Z,d as a,m as n,Q as r,Ko as u}; diff --git a/custom-toc-separator/assets/WhereClause-DxwoyBMS-Daxq3yaK.js b/custom-toc-separator/assets/WhereClause-DxwoyBMS-Daxq3yaK.js new file mode 100644 index 00000000..ce09ae56 --- /dev/null +++ b/custom-toc-separator/assets/WhereClause-DxwoyBMS-Daxq3yaK.js @@ -0,0 +1,7 @@ +import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{c2 as jo,F as J,K as ur,b_ as Yo,c5 as Bo,c6 as Qo,q as Go}from"./story-DT1Ep1ux.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./main-BTdHgocv.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` +`,"\r"],!1,!1),vt=y("`",!1),ht=H(["`"],!0,!1),ji=function(e){return e},Yi=function(e){return k(I(),...e)},wt=function(e,r,s){return{op:r,expr:s,location:I()}},Bi=function(e,r){return de(e,r)},It=function(e,r,s){return{op:r,expr:s,location:I()}},Qi=function(e,r){return de(e,r)},Gi=function(e){return ko("NOT",e,I())},Wi=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?de(e,r.tail):ar(r.op,e,r.right,r.escape,I())},gt=function(e,r){return{op:e,expr:r,location:I()}},Ki=function(e){return{type:"arithmetic",tail:e}},Xi=function(e,r){return{op:e+"NOT",right:r}},ea=function(e,r){return{op:e,right:r}},ta=function(e,r,s){return k(I(),r,s)},ra=function(e,r){return{op:"NOT"+e,right:r}},na=function(e,r,s){return k(I(),r,s)},ia=function(e,r){return{op:e,right:r}},aa=function(e){return e[0]+" "+e[2]},sa=function(e){return e[0]+" "+e[2]},ua=function(e,r,s){return{op:e,right:r,escape:s.value}},oa=function(e,r){return{op:e,right:r,escape:""}},la=function(e,r){return{op:e,right:r}},ca=function(e,r){return{op:e,right:r}},yt=function(e,r,s){return{op:r,expr:s,location:I()}},fa=function(e,r){return de(e,r)},Tt=function(e,r,s){return{op:r,expr:s,location:I()}},da=function(e,r){return de(e,r)},pa=function(e){return e.paren=!0,e},ma=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:I(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:I(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:I(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:I()}:{type:"column-reference",location:I(),table:"",column:e}},va=function(e){return{type:"column-reference",location:I(),table:"",column:e,delimited:!0}},ha=function(e){return e},wa=function(e,r){return e+r.join("")},Ia=function(e,r){return e+r.join("")},ga=function(e){return e},ya=function(e){return e.join("")},Ta=function(){return'"'},Na=function(e){return{type:"parameter",location:I(),value:e[1]}},Oa=function(e,r){return k(I(),e,r)},Sa=function(e,r){return k(I(),e,r)},xa=function(e){return{type:"function",location:I(),name:"extract",args:e}},Ca=function(e,r,s){return k(I(),e,r,...s?[s]:[])},Ma=function(e,r,s){return k(I(),e,r,s)},Ea=function(e){return{type:"function",location:I(),name:"substring",args:e}},Fa=function(e,r){return k(I(),e,r)},ba=function(e,r){return k(I(),e,r)},Aa=function(e){return{type:"function",location:I(),name:"cast",args:e}},Pa=function(){return{type:"data-type",location:I(),value:{type:"integer"}}},Da=function(){return{type:"data-type",location:I(),value:{type:"smallint"}}},La=function(){return{type:"data-type",location:I(),value:{type:"float"}}},_a=function(){return{type:"data-type",location:I(),value:{type:"real"}}},Ra=function(){return{type:"data-type",location:I(),value:{type:"date"}}},Ua=function(){return{type:"data-type",location:I(),value:{type:"timestamp"}}},Ja=function(){return{type:"data-type",location:I(),value:{type:"time"}}},Va=function(e){return{type:"data-type",location:I(),value:{type:"varchar",size:parseInt(e)}}},Za=function(e,r,s){return k(I(),e,r,s)},ka=function(e,r){return k(I(),e,r)},za=function(e){return{type:"function",location:I(),name:"trim",args:e}},$a=function(e){return{type:"string",location:I(),value:e??"BOTH"}},Ha=function(e,r){return k(I(),e,r)},qa=function(e,r){return k(I(),e,r)},ja=function(e){return{type:"function",location:I(),name:"position",args:e}},Ya=function(e,r){return{type:"function",location:I(),name:e,args:r}},Ba=function(e){return{type:"string",location:I(),value:e}},Qa=function(e){return e.type==="string"&&zo(e.value),{type:"timestamp",location:I(),value:e.value}},Ga=function(e){return e.type==="string"&&$o(e.value),{type:"time",location:I(),value:e.value}},Wa=function(e,r,s){return{type:"interval",location:I(),value:r,qualifier:s,op:e}},Ka=function(e,r){return{type:"interval",location:I(),value:e,qualifier:r,op:""}},Xa=function(e,r){return{type:"interval-qualifier",location:I(),start:e,end:r}},es=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},ts=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},rs=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},ns=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},is=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},as=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},ss=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},us=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},os=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},ls=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},cs=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},fs=function(){return{type:"string",location:I(),value:"day"}},ds=function(){return{type:"string",location:I(),value:"hour"}},ps=function(){return{type:"string",location:I(),value:"minute"}},ms=function(){return{type:"string",location:I(),value:"month"}},vs=function(){return{type:"string",location:I(),value:"year"}},hs=function(e){return parseFloat(e)},ws=function(e){return parseFloat(e)},Is=function(e){return e.type==="string"&&Ho(e.value),{type:"date",location:I(),value:e.value}},gs=function(){return{type:"null",location:I(),value:null}},ys=function(){return{type:"boolean",location:I(),value:!0}},Ts=function(){return{type:"boolean",location:I(),value:!1}},Nt=function(){return"'"},Ns=function(e){return{type:"string",location:I(),value:e.join("")}},Os=function(e,r){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:null,elseLocation:null}},Ss=function(e,r,s){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:s.value,elseLocation:s.location}},xs=function(e){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:null,elseLocation:null}},Cs=function(e,r){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:r.value,elseLocation:r.location}},Ms=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Es=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Fs=function(e){return{type:"else-clause",location:I(),value:e}},bs=function(e){return{type:"number",location:I(),value:e}},As=function(e,r,s){return parseFloat(e+r+s)},Ps=function(e,r){return parseFloat(e+r)},Ds=function(e,r){return parseFloat(e+r)},Ls=function(e){return parseFloat(e)},_s=function(e,r){return e[0]+r},Rs=function(e){return"."+(e??"")},Us=function(e,r){return e+r},Js=function(e){return e.join("")},Vs=function(e,r){return"e"+(r===null?"":r)},Zs=function(){return"IN"},ks=function(){return"IS"},zs=function(){return"LIKE"},$s=function(){return"ESCAPE"},Hs=function(){return"NOT"},qs=function(){return"AND"},js=function(){return"OR"},Ys=function(){return"BETWEEN"},Bs=function(){return"FROM"},Qs=function(){return"FOR"},Gs=function(){return"SUBSTRING"},Ws=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Xs=function(){return"POSITION"},eu=function(){return"TIMESTAMP"},tu=function(){return"DATE"},ru=function(){return"TIME"},nu=function(){return"LEADING"},iu=function(){return"TRAILING"},au=function(){return"BOTH"},su=function(){return"CAST"},uu=function(){return"AS"},ou=function(){return"INTEGER"},lu=function(){return"INT"},cu=function(){return"SMALLINT"},fu=function(){return"FLOAT"},du=function(){return"REAL"},pu=function(){return"VARCHAR"},mu=function(){return"TO"},vu=function(){return"INTERVAL"},hu=function(){return"YEAR"},wu=function(){return"TIMEZONE_HOUR"},Iu=function(){return"TIMEZONE_MINUTE"},gu=function(){return"MONTH"},yu=function(){return"DAY"},Tu=function(){return"HOUR"},Nu=function(){return"MINUTE"},Ou=function(){return"SECOND"},Su=function(){return"CASE"},xu=function(){return"END"},Cu=function(){return"WHEN"},Mu=function(){return"THEN"},Eu=function(){return"ELSE"},Fu=function(e){return e},bu=function(e){return e.join("")},n=0|i.peg$currPos,f=n,ue=[{line:1,column:1}],Y=n,we=i.peg$maxFailExpected||[],c=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in v))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');g=v[i.startRule]}function I(){return Ie(f,n)}function _e(e,r){throw Pu(e,r=r!==void 0?r:Ie(f,n))}function y(e,r){return{type:"literal",text:e,ignoreCase:r}}function H(e,r,s){return{type:"class",parts:e,inverted:r,ignoreCase:s}}function Au(){return{type:"end"}}function Ot(e){var r,s=ue[e];if(s)return s;if(e>=ue.length)r=ue.length-1;else for(r=e;!ue[--r];);for(s={line:(s=ue[r]).line,column:s.column};rY&&(Y=n,we=[]),we.push(e))}function Pu(e,r){return new se(e,null,null,r)}function Du(e,r,s){return new se(se.buildMessage(e,r),e,r,s)}function St(){var e,r;return e=n,p(),(r=M())!==t?(p(),f=e,e=ji(r)):(n=e,e=t),e}function xt(){var e,r,s,o,h,C;if(e=n,_()!==t){for(p(),r=[],s=M();s!==t;)r.push(s),s=n,o=n,h=p(),(C=W())!==t?o=h=[h,C,p()]:(n=o,o=t),o!==t&&(o=M())===t?(n=s,s=t):s=o;s=p(),(o=R())!==t?(f=e,e=Yi(r)):(n=e,e=t)}else n=e,e=t;return e}function M(){var e,r,s,o,h,C;if(e=n,(r=Re())!==t){for(s=[],o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Bi(r,s)}else n=e,e=t;return e}function Re(){var e,r,s,o,h,C;if(e=n,(r=ge())!==t){for(s=[],o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Qi(r,s)}else n=e,e=t;return e}function ge(){var e,r,s,o,h;return e=n,(r=fe())===t&&(r=n,a.charCodeAt(n)===33?(s=T,n++):(s=t,c===0&&w(Pn)),s!==t?(o=n,c++,a.charCodeAt(n)===61?(h=S,n++):(h=t,c===0&&w(Dn)),c--,h===t?o=void 0:(n=o,o=t),o!==t?r=s=[s,o]:(n=r,r=t)):(n=r,r=t)),r!==t?(s=p(),(o=ge())!==t?(f=e,e=Gi(o)):(n=e,e=t)):(n=e,e=t),e===t&&(e=Lu()),e}function Lu(){var e,r,s,o;return e=n,(r=G())!==t?(s=n,p(),(o=_u())!==t?s=o:(n=s,s=t),s===t&&(s=null),f=e,e=Wi(r,s)):(n=e,e=t),e}function _u(){var e;return(e=Ru())===t&&(e=Zu())===t&&(e=Ju())===t&&(e=Uu())===t&&(e=Vu()),e}function Ru(){var e,r,s,o,h;if(e=n,r=[],s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t),s!==t)for(;s!==t;)r.push(s),s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t);else r=t;return r!==t&&(f=e,r=Ki(r)),e=r}function Ct(){var e;return a.substr(n,2)===O?(e=O,n+=2):(e=t,c===0&&w(Ln)),e===t&&(a.charCodeAt(n)===62?(e=x,n++):(e=t,c===0&&w(_n)),e===t&&(a.substr(n,2)===D?(e=D,n+=2):(e=t,c===0&&w(Rn)),e===t&&(a.substr(n,2)===F?(e=F,n+=2):(e=t,c===0&&w(Un)),e===t&&(e=a.charAt(n),Sn.test(e)?n++:(e=t,c===0&&w(Jn)),e===t&&(a.substr(n,2)===X?(e=X,n+=2):(e=t,c===0&&w(Vn))))))),e}function Uu(){var e,r,s,o;return e=n,(r=zt())!==t?(p(),(s=fe())!==t?(p(),(o=G())!==t?(f=e,e=Xi(r,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=zt())!==t?(p(),(s=G())!==t?(f=e,e=ea(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Ju(){var e,r,s,o,h,C,ie,sr;return e=n,(r=fe())!==t?(p(),(s=qt())!==t?(o=p(),h=n,(C=G())!==t?(p(),(ie=Ce())!==t?(p(),(sr=G())!==t?(f=h,h=ta(s,C,sr)):(n=h,h=t)):(n=h,h=t)):(n=h,h=t),h!==t?(f=e,e=ra(s,h)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=qt())!==t?(p(),s=n,(o=G())!==t?(h=p(),(C=Ce())!==t?(p(),(ie=G())!==t?(f=s,s=na(r,o,ie)):(n=s,s=t)):(n=s,s=t)):(n=s,s=t),s!==t?(f=e,e=ia(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Mt(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=$t())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=aa(r)),(e=r)===t&&(e=$t()),e}function Et(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=ze())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=sa(r)),(e=r)===t&&(e=ze()),e}function Vu(){var e,r,s,o;return e=n,(r=Mt())!==t?(p(),(s=te())!==t?(p(),yo()!==t?(p(),(o=ke())!==t?(f=e,e=ua(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Mt())!==t?(p(),(s=te())!==t?(f=e,e=oa(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Zu(){var e,r,s;return e=n,(r=Et())!==t?(p(),(s=xt())!==t?(f=e,e=la(r,s)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Et())!==t?(p(),(s=Ze())!==t?(f=e,e=ca(r,s)):(n=e,e=t)):(n=e,e=t)),e}function G(){var e,r,s,o,h,C;if(e=n,(r=Ue())!==t){for(s=[],o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=fa(r,s)}else n=e,e=t;return e}function Ft(){var e;return e=a.charAt(n),ve.test(e)?n++:(e=t,c===0&&w(he)),e===t&&(a.substr(n,2)===ee?(e=ee,n+=2):(e=t,c===0&&w(Zn))),e}function Ue(){var e,r,s,o,h,C;if(e=n,(r=Je())!==t){for(s=[],o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=da(r,s)}else n=e,e=t;return e}function bt(){var e;return e=a.charAt(n),xn.test(e)?n++:(e=t,c===0&&w(kn)),e}function Je(){var e,r;return(e=eo())===t&&(e=Bu())===t&&(e=Qu())===t&&(e=Wu())===t&&(e=Ku())===t&&(e=Gu())===t&&(e=Xu())===t&&(e=co())===t&&(e=ku())===t&&(e=Ze())===t&&(e=n,_()!==t?(p(),(r=M())!==t?(p(),R()!==t?(f=e,e=pa(r)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function ku(){var e,r;return e=n,(r=zu())!==t&&(f=e,r=ma(r)),(e=r)===t&&(e=n,(r=Hu())!==t&&(f=e,r=va(r)),e=r),e}function zu(){var e,r;return e=n,(r=$u())!==t&&(f=e,r=ha(r)),e=r}function $u(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=Pt();o!==t;)s.push(o),o=Pt();f=e,e=wa(r,s)}else n=e,e=t;return e}function At(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=N();o!==t;)s.push(o),o=N();f=e,e=Ia(r,s)}else n=e,e=t;return e}function Ve(){var e;return e=a.charAt(n),Cn.test(e)?n++:(e=t,c===0&&w(zn)),e}function N(){var e;return e=a.charAt(n),Mn.test(e)?n++:(e=t,c===0&&w($n)),e}function Pt(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function Hu(){var e,r;return e=n,ye()!==t?(r=qu(),ye()!==t?(f=e,e=ga(r)):(n=e,e=t)):(n=e,e=t),e}function qu(){var e,r,s;for(e=n,r=[],s=Dt();s!==t;)r.push(s),s=Dt();return f=e,e=r=ya(r)}function Dt(){var e;return(e=Yu())===t&&(e=ju()),e}function ju(){var e;return e=n,ye()!==t&&ye()!==t?(f=e,e=Ta()):(n=e,e=t),e}function Yu(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function ye(){var e;return e=a.charAt(n),En.test(e)?n++:(e=t,c===0&&w(Hn)),e}function Ze(){var e,r,s,o;return e=n,r=n,a.charCodeAt(n)===64?(s=Cr,n++):(s=t,c===0&&w(qn)),s!==t&&(o=At())!==t?r=s=[s,o]:(n=r,r=t),r!==t&&(f=e,r=Na(r)),e=r}function Bu(){var e,r,s,o;return e=n,jt()!==t?(p(),r=n,_()!==t?(p(),(s=Rt())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Oa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=Rt())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Sa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=xa(r)):(n=e,e=t)):(n=e,e=t),e}function Qu(){var e,r,s,o,h,C,ie;return e=n,No()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),h=n,To()!==t?(C=p(),(ie=M())!==t?(p(),h=ie):(n=h,h=t)):(n=h,h=t),h===t&&(h=null),R()!==t?(f=r,r=Ca(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),(h=W())!==t?(p(),(C=M())!==t&&(ie=R())!==t?(f=r,r=Ma(s,o,C)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Ea(r)):(n=e,e=t)):(n=e,e=t),e}function Gu(){var e,r,s,o;return e=n,Eo()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),Fo()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=Fa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=ba(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Aa(r)):(n=e,e=t)):(n=e,e=t),e}function Lt(){var e,r,s;return e=n,(r=bo())===t&&(r=Ao()),r!==t&&(f=e,r=Pa()),(e=r)===t&&(e=n,(r=Po())!==t&&(f=e,r=Da()),(e=r)===t&&(e=n,(r=Do())!==t&&(f=e,r=La()),(e=r)===t&&(e=n,(r=Lo())!==t&&(f=e,r=_a()),(e=r)===t&&(e=n,(r=Bt())!==t&&(f=e,r=Ra()),(e=r)===t&&(e=n,(r=Yt())!==t&&(f=e,r=Ua()),(e=r)===t&&(e=n,(r=Qt())!==t&&(f=e,r=Ja()),(e=r)===t&&(e=n,(r=_o())!==t?(p(),_()!==t?(p(),(s=re())!==t?(p(),R()!==t?(f=e,e=Va(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)))))))),e}function Wu(){var e,r,s,o,h;return e=n,Oo()!==t?(p(),r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),$e()!==t?(p(),(h=M())!==t?(p(),R()!==t?(f=r,r=Za(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),R()!==t?(f=r,r=ka(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=za(r)):(n=e,e=t)):(n=e,e=t),e}function _t(){var e,r;return e=n,(r=xo())===t&&(r=Co())===t&&(r=Mo()),r===t&&(r=null),f=e,e=r=$a(r)}function Ku(){var e,r,s,o;return e=n,So()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),ze()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Ha(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=qa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=ja(r)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,s,o;return e=n,r=n,c++,s=jt(),c--,s===t?r=void 0:(n=r,r=t),r!==t&&(s=Zo())!==t?(p(),(o=xt())!==t?(f=e,e=Ya(s,o)):(n=e,e=t)):(n=e,e=t),e}function Rt(){var e,r;return e=n,(r=Wt())===t&&(r=Kt())===t&&(r=Xt())===t&&(r=er())===t&&(r=tr())===t&&(r=ne())===t&&(r=Uo())===t&&(r=Jo()),r!==t&&(f=e,r=Ba(r)),e=r}function eo(){var e;return(e=ke())===t&&(e=mo())===t&&(e=lo())===t&&(e=oo())===t&&(e=uo())===t&&(e=to())===t&&(e=no())===t&&(e=ro()),e}function to(){var e,r;return e=n,Yt()!==t?(p(),(r=te())!==t?(f=e,e=Qa(r)):(n=e,e=t)):(n=e,e=t),e}function ro(){var e,r;return e=n,Qt()!==t?(p(),(r=te())!==t?(f=e,e=Ga(r)):(n=e,e=t)):(n=e,e=t),e}function no(){var e,r,s,o;return e=n,Gt()!==t?(p(),r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t?(p(),(s=te())!==t?(p(),(o=Ut())!==t?(f=e,e=Wa(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,Gt()!==t?(p(),(r=te())!==t?(p(),(s=Ut())!==t?(f=e,e=Ka(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ut(){var e,r,s;return e=n,(r=io())!==t?(p(),Ro()!==t?(p(),(s=ao())!==t?(f=e,e=Xa(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=so()),e}function io(){var e,r,s;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=ts(r)),e=r),e}function ao(){var e,r,s,o;return e=n,(r=ce())!==t&&(f=e,r=rs(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=ns(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=is(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=as()),e=r))),e}function so(){var e,r,s,o;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ss(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=us(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=os(s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ls(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=cs()),e=r)))),e}function ce(){var e,r;return e=n,(r=Xt())!==t&&(f=e,r=fs()),(e=r)===t&&(e=n,(r=er())!==t&&(f=e,r=ds()),(e=r)===t&&(e=n,(r=tr())!==t&&(f=e,r=ps()),(e=r)===t&&(e=n,(r=Kt())!==t&&(f=e,r=ms()),(e=r)===t&&(e=n,(r=Wt())!==t&&(f=e,r=vs()),e=r)))),e}function Te(){var e,r;return e=n,(r=re())!==t&&(f=e,r=hs(r)),e=r}function Ne(){var e,r;return e=n,(r=re())!==t&&(f=e,r=ws(r)),e=r}function uo(){var e,r;return e=n,Bt()!==t?(p(),(r=te())!==t?(f=e,e=Is(r)):(n=e,e=t)):(n=e,e=t),e}function oo(){var e,r;return e=n,(r=wo())!==t&&(f=e,r=gs()),e=r}function lo(){var e,r;return e=n,(r=Io())!==t&&(f=e,r=ys()),(e=r)===t&&(e=n,(r=go())!==t&&(f=e,r=Ts()),e=r),e}function te(){var e;return(e=ke())===t&&(e=Ze()),e}function ke(){var e,r,s,o,h;if(e=n,a.charCodeAt(n)===39?(r=at,n++):(r=t,c===0&&w(dt)),r===t&&(a.substr(n,2)===st?(r=st,n+=2):(r=t,c===0&&w(jn))),r!==t){for(s=[],o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));o!==t;)s.push(o),o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));a.charCodeAt(n)===39?(o=at,n++):(o=t,c===0&&w(dt)),o!==t?(f=e,e=Ns(s)):(n=e,e=t)}else n=e,e=t;return e}function co(){var e;return(e=fo())===t&&(e=po()),e}function fo(){var e,r,s,o,h;if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Ee())!==t?(f=e,e=Os(r,s)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Jt())!==t?(h=p(),Ee()!==t?(f=e,e=Ss(r,s,o)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function po(){var e,r,s,o;if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Ee())!==t?(f=e,e=xs(r)):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Jt())!==t?(o=p(),Ee()!==t?(f=e,e=Cs(r,s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Oe(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Ms(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Se(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Jt(){var e,r;return e=n,Vo()!==t?(p(),(r=M())!==t?(f=e,e=Fs(r)):(n=e,e=t)):(n=e,e=t),e}function mo(){var e,r,s,o;return e=n,(r=vo())!==t?(s=n,c++,o=Ve(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=bs(r)):(n=e,e=t)):(n=e,e=t),e}function vo(){var e,r,s,o;return e=n,(r=xe())!==t&&(s=Vt())!==t&&(o=Zt())!==t?(f=e,e=As(r,s,o)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Vt())!==t?(f=e,e=Ps(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Zt())!==t?(f=e,e=Ds(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(f=e,r=Ls(r)),e=r))),e}function xe(){var e,r,s;return(e=re())===t&&(e=n,r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t&&(s=re())!==t?(f=e,e=_s(r,s)):(n=e,e=t)),e}function Vt(){var e,r,s;return e=n,a.charCodeAt(n)===46?(r=Mr,n++):(r=t,c===0&&w(Yn)),r!==t?((s=re())===t&&(s=null),f=e,e=Rs(s)):(n=e,e=t),e}function Zt(){var e,r,s;return e=n,(r=ho())!==t&&(s=re())!==t?(f=e,e=Us(r,s)):(n=e,e=t),e}function re(){var e,r,s;if(e=n,r=[],(s=kt())!==t)for(;s!==t;)r.push(s),s=kt();else r=t;return r!==t&&(f=e,r=Js(r)),e=r}function kt(){var e;return e=a.charAt(n),Fn.test(e)?n++:(e=t,c===0&&w(Bn)),e}function ho(){var e,r,s;return e=n,r=a.charAt(n),bn.test(r)?n++:(r=t,c===0&&w(Qn)),r!==t?(s=a.charAt(n),ve.test(s)?n++:(s=t,c===0&&w(he)),s===t&&(s=null),f=e,e=Vs(r,s)):(n=e,e=t),e}function wo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Er?n+=4:(r=t,c===0&&w(Gn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function Io(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Fr?n+=4:(r=t,c===0&&w(Wn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function go(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===br?n+=5:(r=t,c===0&&w(Kn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function ze(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ar?n+=2:(r=t,c===0&&w(Xn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Zs()):(n=e,e=t)):(n=e,e=t),e}function zt(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Pr?n+=2:(r=t,c===0&&w(ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ks()):(n=e,e=t)):(n=e,e=t),e}function $t(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Dr?n+=4:(r=t,c===0&&w(ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=zs()):(n=e,e=t)):(n=e,e=t),e}function yo(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===Lr?n+=6:(r=t,c===0&&w(ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=$s()):(n=e,e=t)):(n=e,e=t),e}function fe(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===_r?n+=3:(r=t,c===0&&w(ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Hs()):(n=e,e=t)):(n=e,e=t),e}function Ce(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Rr?n+=3:(r=t,c===0&&w(ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=qs()):(n=e,e=t)):(n=e,e=t),e}function Ht(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ur?n+=2:(r=t,c===0&&w(ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=js()):(n=e,e=t)):(n=e,e=t),e}function qt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Jr?n+=7:(r=t,c===0&&w(si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ys()):(n=e,e=t)):(n=e,e=t),e}function $e(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Vr?n+=4:(r=t,c===0&&w(ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Bs()):(n=e,e=t)):(n=e,e=t),e}function To(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Zr?n+=3:(r=t,c===0&&w(oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Qs()):(n=e,e=t)):(n=e,e=t),e}function No(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===kr?n+=9:(r=t,c===0&&w(li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Gs()):(n=e,e=t)):(n=e,e=t),e}function jt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===zr?n+=7:(r=t,c===0&&w(ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ws()):(n=e,e=t)):(n=e,e=t),e}function Oo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===$r?n+=4:(r=t,c===0&&w(fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ks()):(n=e,e=t)):(n=e,e=t),e}function So(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Hr?n+=8:(r=t,c===0&&w(di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Xs()):(n=e,e=t)):(n=e,e=t),e}function Yt(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===qr?n+=9:(r=t,c===0&&w(pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=eu()):(n=e,e=t)):(n=e,e=t),e}function Bt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===jr?n+=4:(r=t,c===0&&w(mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=tu()):(n=e,e=t)):(n=e,e=t),e}function Qt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Yr?n+=4:(r=t,c===0&&w(vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ru()):(n=e,e=t)):(n=e,e=t),e}function xo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Br?n+=7:(r=t,c===0&&w(hi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=nu()):(n=e,e=t)):(n=e,e=t),e}function Co(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Qr?n+=8:(r=t,c===0&&w(wi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=iu()):(n=e,e=t)):(n=e,e=t),e}function Mo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Gr?n+=4:(r=t,c===0&&w(Ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=au()):(n=e,e=t)):(n=e,e=t),e}function Eo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Wr?n+=4:(r=t,c===0&&w(gi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=su()):(n=e,e=t)):(n=e,e=t),e}function Fo(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Kr?n+=2:(r=t,c===0&&w(yi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=uu()):(n=e,e=t)):(n=e,e=t),e}function bo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Xr?n+=7:(r=t,c===0&&w(Ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ou()):(n=e,e=t)):(n=e,e=t),e}function Ao(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===en?n+=3:(r=t,c===0&&w(Ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=lu()):(n=e,e=t)):(n=e,e=t),e}function Po(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===tn?n+=8:(r=t,c===0&&w(Oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=cu()):(n=e,e=t)):(n=e,e=t),e}function Do(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===rn?n+=5:(r=t,c===0&&w(Si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=fu()):(n=e,e=t)):(n=e,e=t),e}function Lo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===nn?n+=4:(r=t,c===0&&w(xi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=du()):(n=e,e=t)):(n=e,e=t),e}function _o(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===an?n+=7:(r=t,c===0&&w(Ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=pu()):(n=e,e=t)):(n=e,e=t),e}function Ro(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===sn?n+=2:(r=t,c===0&&w(Mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=mu()):(n=e,e=t)):(n=e,e=t),e}function Gt(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===un?n+=8:(r=t,c===0&&w(Ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=vu()):(n=e,e=t)):(n=e,e=t),e}function Wt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===on?n+=4:(r=t,c===0&&w(Fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=hu()):(n=e,e=t)):(n=e,e=t),e}function Uo(){var e,r,s,o;return e=n,(r=a.substr(n,13)).toLowerCase()===ln?n+=13:(r=t,c===0&&w(bi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=wu()):(n=e,e=t)):(n=e,e=t),e}function Jo(){var e,r,s,o;return e=n,(r=a.substr(n,15)).toLowerCase()===cn?n+=15:(r=t,c===0&&w(Ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Iu()):(n=e,e=t)):(n=e,e=t),e}function Kt(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===fn?n+=5:(r=t,c===0&&w(Pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=gu()):(n=e,e=t)):(n=e,e=t),e}function Xt(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===dn?n+=3:(r=t,c===0&&w(Di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=yu()):(n=e,e=t)):(n=e,e=t),e}function er(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===pn?n+=4:(r=t,c===0&&w(Li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Tu()):(n=e,e=t)):(n=e,e=t),e}function tr(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===mn?n+=6:(r=t,c===0&&w(_i)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Nu()):(n=e,e=t)):(n=e,e=t),e}function ne(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===vn?n+=6:(r=t,c===0&&w(Ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ou()):(n=e,e=t)):(n=e,e=t),e}function Me(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===hn?n+=4:(r=t,c===0&&w(Ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Su()):(n=e,e=t)):(n=e,e=t),e}function Ee(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===wn?n+=3:(r=t,c===0&&w(Ji)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=xu()):(n=e,e=t)):(n=e,e=t),e}function rr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===In?n+=4:(r=t,c===0&&w(Vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Cu()):(n=e,e=t)):(n=e,e=t),e}function nr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===gn?n+=4:(r=t,c===0&&w(Zi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Mu()):(n=e,e=t)):(n=e,e=t),e}function Vo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===yn?n+=4:(r=t,c===0&&w(ki)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Eu()):(n=e,e=t)):(n=e,e=t),e}function W(){var e;return a.charCodeAt(n)===44?(e=Tn,n++):(e=t,c===0&&w(zi)),e}function _(){var e;return a.charCodeAt(n)===40?(e=Nn,n++):(e=t,c===0&&w($i)),e}function R(){var e;return a.charCodeAt(n)===41?(e=On,n++):(e=t,c===0&&w(Hi)),e}function p(){var e,r;for(e=[],r=ir();r!==t;)e.push(r),r=ir();return e}function ir(){var e;return e=a.charAt(n),An.test(e)?n++:(e=t,c===0&&w(qi)),e}function Zo(){var e,r,s,o;if(e=n,(r=At())!==t&&(f=e,r=Fu(r)),(e=r)===t)if(e=n,a.charCodeAt(n)===96?(r=ut,n++):(r=t,c===0&&w(vt)),r!==t){if(s=[],o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht)),o!==t)for(;o!==t;)s.push(o),o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht));else s=t;s!==t?(a.charCodeAt(n)===96?(o=ut,n++):(o=t,c===0&&w(vt)),o!==t?(f=e,e=bu(s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ko(e,r,s){return{type:"unary-expression",location:s,operator:e,expr:r}}function ar(e,r,s,o,h){const C={type:"binary-expression",location:h,operator:e,left:r,right:s};return o!==void 0&&(C.escape=o),C}function k(e,...r){return{type:"expression-list",location:e,value:r}}function de(e,r){let s=e;for(const{op:o,expr:h,location:{end:C}}of r)s=ar(o,s,h,void 0,{...s.location,end:C});return s}function zo(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Timestamp literal is invalid")}function $o(e){/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)!==!0&&_e("Time literal is invalid")}function Ho(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Date literal is invalid")}if(u=g(),i.peg$library)return{peg$result:u,peg$currPos:n,peg$FAILED:t,peg$maxFailExpected:we,peg$maxFailPos:Y};if(u!==t&&n===a.length)return u;throw u!==t&&n `+g+` +`+S+` | +`+v.line+" | "+O+` +`+S+" | "+Qe("",l.column-1," ")+Qe("",x,"^")}else i+=` + at `+g}return i},se.buildMessage=function(a,i){var u={literal:function(O){return'"'+l(O.text)+'"'},class:function(O){var x=O.parts.map(function(D){return Array.isArray(D)?v(D[0])+"-"+v(D[1]):v(D)});return"["+(O.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function t(O){return O.charCodeAt(0).toString(16).toUpperCase()}function l(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function v(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+t(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+t(x)})}function g(O){return u[O.type](O)}function T(O){var x,D,F=O.map(g);if(F.sort(),F.length>0){for(x=1,D=1;x=")&&z(i,u[1],"<=")}static notbetween(i,u,t){return i==null||u[0]==null||u[1]==null?null:z(i,u[0],"<")||z(i,u[1],">")}static ternaryNot(i){return Ae(i)}static ternaryAnd(i,u){return Or(i,u)}static ternaryOr(i,u){return Sr(i,u)}}class it{constructor(i,u,t="UTC",l=null){this.fieldsIndex=u,this.timeZone=t,this.currentUser=l,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=yc.parse(i);const{isStandardized:v,isAggregate:g,currentUserRequired:T,referencedFieldNames:S}=this._extractExpressionInfo(u);this._referencedFieldNames=S,this.isStandardized=v,this.isAggregate=g,this.currentUserRequired=T}static convertValueToStorageFormat(i,u=null){if(u===null)return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toStorageFormat():L(i)?i.toStorageString():A(i)?i.toStorageFormat():i;switch(u){case"date":return q(i)?i.getTime():b(i)?i.toMillis():P(i)?i.toMilliseconds():A(i)?i.toNumber():i;case"date-only":return q(i)?j.fromDateJS(i).toString():P(i)?j.fromSqlTimeStampOffset(i).toString():b(i)?j.fromDateTime(i).toString():i;case"time-only":return q(i)?$.fromDateJS(i).toStorageString():b(i)?$.fromDateTime(i).toStorageString():P(i)?$.fromSqlTimeStampOffset(i).toStorageString():L(i)?i.toStorageString():i;case"timestamp-offset":if(q(i))return Q.fromJSDate(i).toStorageFormat();if(b(i))return Q.fromDateTime(i).toStorageFormat();if(P(i))return i.toStorageFormat()}return i}static create(i,u={}){return new it(i,u.fieldsIndex,u.timeZone??void 0,u.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,null,u,i,t)}calculateValue(i,u=le,t=this.currentUser){const l=this._evaluateNode(this.parseTree,i,u,null,t);return l instanceof E?l.valueInMilliseconds()/864e5:l}calculateValueCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.calculateValue(i,u):(this._compileMe(),this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}testFeature(i,u=le,t=this.currentUser){return!!this._evaluateNode(this.parseTree,i,u,null,t)}testFeatureCompiled(i,u=le,t=this.currentUser){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null):ur("esri-csp-restrictions")?this.testFeature(i,u):(this._compileMe(),!!this.parseTree._compiledVersion(i,this.parameters,u,this.fieldsIndex,this.timeZone,t??null))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,U(this.parseTree,i=>{i.type==="current-time"?this._hasDateFunctions=!0:i.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||Tc.has(i.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const i=new Set;return U(this.parseTree,u=>{u.type==="function"&&i.add(u.name.toLowerCase())}),Array.from(i)}getExpressions(){const i=new Map;return U(this.parseTree,u=>{if(u.type==="function"){const t=u.name.toLowerCase(),l=u.args.value[0];if(l.type==="column-reference"){const v=l.column,g=`${t}-${v}`;i.has(g)||i.set(g,{aggregateType:t,field:v})}}}),[...i.values()]}getVariables(){const i=new Set;return U(this.parseTree,u=>{u.type==="parameter"&&i.add(u.value.toLowerCase())}),Array.from(i)}_compileMe(){const i="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone","currentUser",i).bind(be)}_extractExpressionInfo(i){const u=[],t=new Set;let l=!0,v=!1,g=!1;return U(this.parseTree,T=>{switch(T.type){case"column-reference":{const S=i?.get(T.column);let O,x;S?O=x=S.name??"":(x=T.column,O=x.toLowerCase()),t.has(O)||(t.add(O),u.push(x)),T.column=x;break}case"current-user":g=!0;break;case"function":{const{name:S,args:O}=T,x=O.value.length;l&&(l=yl(S,x)),v===!1&&(v=lr(S,x));break}}}),{referencedFieldNames:Array.from(u),isStandardized:l,isAggregate:v,currentUserRequired:g}}evaluateNodeToJavaScript(i){switch(i.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(i.value)+", "+JSON.stringify(i.qualifier)+","+JSON.stringify(i.op)+")";case"case-expression":{let u="";if(i.format==="simple"){const t=this.evaluateNodeToJavaScript(i.operand);u="( ";for(let l=0;l=",this.timeZone)&&z(T,S[1],"<=",this.timeZone)}case"NOTBETWEEN":{const T=this._evaluateNode(i.left,u,t,l,v),S=this._evaluateNode(i.right,u,t,l,v);return T==null||S[0]==null||S[1]==null?null:z(T,S[0],"<",this.timeZone)||z(T,S[1],">",this.timeZone)}case"LIKE":return Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape);case"NOT LIKE":return Ae(Xe(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return z(this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),i.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return Tr(i.operator,this._evaluateNode(i.left,u,t,l,v),this._evaluateNode(i.right,u,t,l,v),this.timeZone)}case"null":case"boolean":case"string":case"number":return i.value;case"date":return i.parsedValue??=Ir(i.value,"unknown"),i.parsedValue;case"timestamp":return i.parsedValue??=De(i.value,"unknown"),i.parsedValue;case"time":return tt(i.value);case"current-time":return i.mode==="date"?be.currentDate(this.timeZone):i.mode==="time"?be.currentTime(this.timeZone):be.currentTimestamp(this.timeZone);case"current-user":return v??null;case"column-reference":return xr(u,i.column,this.fieldsIndex,t);case"data-type":return i.value;case"function":{if(this.isAggregate&&lr(i.name,i.args.value.length)){const S=[];for(const O of i.args?.value||[]){const x=[];for(const D of l||[])x.push(this._evaluateNode(O,D,t,null,v));S.push(x)}return Ko(i.name,S)}const T=this._evaluateNode(i.args,u,t,l,v);return rt(i.name,T,this.timeZone)}}throw new m(d.UnsupportedSyntax,{node:i.type})}}function Nr(a){return a===!0}function We(a){return Array.isArray(a)?a:[a]}function Ae(a){return a!==null?a!==!0:null}function Or(a,i){return a!=null&&i!=null?a===!0&&i===!0:a!==!1&&i!==!1&&null}function Sr(a,i){return a!=null&&i!=null?a===!0||i===!0:a===!0||i===!0||null}function Ke(a,i,u){if(a==null)return null;let t=!1;for(const l of i)if(l==null)t=null;else{if(a===l){t=!0;break}if(Ge(a)&&Ge(l)&&(t=z(a,l,"="),t))break}return t}const dr="-[]/{}()*+?.\\^$|";var ae;function Nc(a,i){const u=i;let t="",l=ae.Normal;for(let v=0;v(Oc(a)?a.attributes:a)[i]},Ec=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:it,defaultAttributeAdapter:le},Symbol.toStringTag,{value:"Module"}));export{Ec as W,it as Z,d as a,m as n,Q as r,Ko as u}; diff --git a/custom-toc-separator/assets/WorkerTileHandler-DLznBxmP-BuFp7VLT.js b/custom-toc-separator/assets/WorkerTileHandler-DLznBxmP-BuFp7VLT.js deleted file mode 100644 index a231246a..00000000 --- a/custom-toc-separator/assets/WorkerTileHandler-DLznBxmP-BuFp7VLT.js +++ /dev/null @@ -1,2 +0,0 @@ -import{aU as Ue,x as je,ba as Be,hm as Le,O as qe}from"./story-OUarUCIt.js";import{C as oe,I as _e}from"./enums-qHpGJ28Q-CmnLAccm.js";import{g as V,B as Te,R as ne,E as te,C as Ge,b as Ve,V as Ae,j as Ye,D as $e,N as Ze,d as Je,U as $,F as ye}from"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import{a as ke}from"./Rect-DD6XS68q-D_hsV3ag.js";import{o as Ce}from"./config-nuMERBvb-MDUrh2eL.js";import{n as se,l as C,p as Q,o as Ee,u as Me,r as Xe,m as we}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as Qe}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{M as et,k as tt,D as st}from"./TurboLine-CIlsAy5m-BIV61-kY.js";import{f as it,g as rt}from"./SourceLayerData-BT_Ywuvg-C3HNN94j.js";import{a as at,X as v,W as ot,Z as nt}from"./StyleRepository-D3WuVprR-D1hVbbHk.js";import{m as Se}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{d as lt}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./main-lj2zzr_L.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";function ht(a){return a===746||a===747||!(a<4352)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` -`),l&&(c=l.getValue(n,_)),c){case Ee.LOWERCASE:p=p.toLowerCase();break;case Ee.UPPERCASE:p=p.toUpperCase()}if(z._bidiEngine.hasBidiChar(p)){let I;I=z._bidiEngine.checkContextual(p)==="rtl"?"IDNNN":"ICNNN",p=z._bidiEngine.bidiTransform(p,I,"VLYSN"),g=!0}if(p.length>0){h&&(x=h.getValue(n,_));for(const I of x){let P=i[I];P||(P=i[I]=new Set);for(const T of p){const b=T.codePointAt(0);b!=null&&P.add(b)}}}}if(!y&&!p)continue;const M=s.getLayoutValue("symbol-sort-key",n,_),m={feature:_,sprite:y,label:p,rtl:g,geometry:w,hash:(p?Le(p):0)^(y?Le(y):0),priority:M,textFont:x};u.push(m)}this._symbolFeatures=u}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Me.POINT,o=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),l=e.getLayoutProperty("text-field"),h=r?new ot(e,i,n):null,u=l?new nt(e,i,n):null,d=this._workerTileHandler;let f;r&&(f=d.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const c=[];let x=1;u?.size&&(x=u.size/K);const _=u?u.maxAngle*Te:0,w=u?u.size*le:0;for(const y of this._symbolFeatures){let p;h&&f&&y.sprite&&(p=f[y.sprite],p&&p.sdf&&(this._isIconSDF=!0));let g;p&&h.update(i,y.feature);let M=0;const m=y.label;if(m){qe(u),u.update(i,y.feature);const I=n&&u.rotationAlignment===se.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(Xe.VERTICAL);let P=.5;switch(u.anchor){case C.TOP_LEFT:case C.LEFT:case C.BOTTOM_LEFT:P=0;break;case C.TOP_RIGHT:case C.RIGHT:case C.BOTTOM_RIGHT:P=1}let T=.5;switch(u.anchor){case C.TOP_LEFT:case C.TOP:case C.TOP_RIGHT:T=0;break;case C.BOTTOM_LEFT:case C.BOTTOM:case C.BOTTOM_RIGHT:T=1}let b=.5;switch(u.justify){case we.AUTO:b=P;break;case we.LEFT:b=0;break;case we.RIGHT:b=1}const L=u.letterSpacing*K,D=n?0:u.maxWidth*K,B=u.lineHeight*K,A=y.textFont.map(k=>d.getGlyphItems(k));if(g=new Ke(A,D,B,L,P,T,b).getShaping(m,y.rtl,I),g&&g.length>0){let k=1e30,E=-1e30;for(const R of g)k=Math.min(k,R.x),E=Math.max(E,R.x);M=(E-k+2*K)*x*le}}for(let I of y.geometry){const P=[];if(s===Me.LINE){if(g?.length&&u?.size){const T=u.size*le*(2+Math.min(2,4*Math.abs(u.offset[1])));I=z._smoothVertices(I,T)}z._pushAnchors(P,I,o,M)}else s===Me.LINE_CENTER?z._pushCenterAnchor(P,I):y.feature.type===Je.Polygon?z._pushCentroid(P,I):P.push(new ge(I[0].x,I[0].y));for(const T of P){if(T.x<0||T.x>Re||T.y<0||T.y>Re||n&&M>0&&u?.rotationAlignment===se.MAP&&!z._honorsTextMaxAngle(I,T,M,_,w))continue;const b={shaping:g,line:I,iconMosaicItem:p,anchor:T,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(b),this._processFeature(b,h,u)}}}c.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=z._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,o,r]=this._sourceTileKey.split("/");let l=0;e[l++]=this.type,e[l++]=this.layerUIDs.length;for(let h=0;hs in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:o,anchor:r}=t,l=this.zoom,h=this.layer,u=!!n;let d=!0;u&&(d=e?.optional||!n);const f=o&&o.length>0,c=!f||i?.optional;let x,_;if(u&&(x=this._placementEngine.getIconPlacement(r,n,e)),(x||d)&&(f&&(_=this._placementEngine.getTextPlacement(r,o,s,i)),_||c)){if(x&&_||(c||d?c||_?d||x||(_=null):x=null:(x=null,_=null)),_){const w=h.hasDataDrivenText?h.textMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(t,_.shapes,l,i.rotationAlignment,w),_.textColliders){t.textColliders=_.textColliders;for(const y of _.textColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}if(x){const w=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(t,x.shapes,l,n.page,e.rotationAlignment===se.VIEWPORT,w),x.iconColliders){t.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}}}_addPlacedIcons(t,e,i,s,n,o){const r=Math.max(i-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,u=this._markerMap;for(const d of e){const f=n?0:Math.max(i+$(d.minzoom),r),c=n?25:Math.min(i+$(d.maxzoom),25);if(c<=f)continue;const x=d.tl,_=d.tr,w=d.bl,y=d.br,p=d.mosaicRect,g=d.labelAngle,M=d.minAngle,m=d.maxAngle,I=d.anchor,P=l.index,T=p.x,b=p.y,L=T+p.width,D=b+p.height,B=l.index;l.add(I.x,I.y,x.x,x.y,T,b,g,M,m,f,c,o),l.add(I.x,I.y,_.x,_.y,L,b,g,M,m,f,c,o),l.add(I.x,I.y,w.x,w.y,T,D,g,M,m,f,c,o),l.add(I.x,I.y,y.x,y.y,L,D,g,M,m,f,c,o),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===B?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([B,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),u.has(s)?u.get(s)[1]+=6:u.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const o of n){const r=t.index,l=o.symbolInstance,h=o.ddAttributes,u=t.index;t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===u?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([u,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const o=Math.max(i-1,0),r=s===se.VIEWPORT;let l,h,u,d,f,c,x,_,w,y,p;for(const g of e)l=r?0:Math.max(i+$(g.minzoom),o),h=r?25:Math.min(i+$(g.maxzoom),25),!(h<=l)&&(u=g.tl,d=g.tr,f=g.bl,c=g.br,x=g.labelAngle,_=g.minAngle,w=g.maxAngle,y=g.anchor,p=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[c.x,c.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:x,minAngle:_,maxAngle:w,minLod:l,maxLod:h,placementLod:o,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const o=e.length-1;for(let f=0;f-r;){if(--h,h<0)return!1;o-=V.distance(t[h],l),l=t[h]}o+=V.distance(t[h],t[h+1]);const u=[];let d=0;const f=t.length;for(;on;)d-=u.shift().deviation;if(Math.abs(d)>s)return!1;o+=V.distance(x,w),h=_}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,o=0;s.push(0);for(let _=1;_0&&(n+=w,s.push(n),o++,o!==_&&(t[o]=t[_]))}if(i=o+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,l=t[0].y,h=t[i-1].x,u=t[i-1].y,d=V.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const f=[];f.push(new V(r,l));const c=1e-6,x=.5*e;for(let _=1;_=0;g--){const M=x+s[g+1]-s[_];if(M<0)break;const m=s[g+1]-s[g],I=s[_]-s[g]4096&&(r=4096),r<0&&(r=0),l>4096&&(l=4096),l<0&&(l=0);for(let h=1;h4096&&(u=4096),u<0&&(u=0),d>4096&&(d=4096),d<0&&(d=0),f>4096&&(f=4096),f<0&&(f=0),c>4096&&(c=4096),c<0&&(c=0);const x=(u-r)*(c-l)-(f-r)*(d-l);s+=x*(r+u+f),n+=x*(l+d+c),o+=x}s/=3*o,n/=3*o,isNaN(s)||isNaN(n)||t.push(new ge(s,n))}}z._bidiEngine=new lt;var W;(function(a){a[a.INITIALIZED=0]="INITIALIZED",a[a.NO_DATA=1]="NO_DATA",a[a.READY=2]="READY",a[a.MODIFIED=3]="MODIFIED",a[a.INVALID=4]="INVALID"})(W||(W={}));class Tt{constructor(t,e,i,s,n,o){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,o){this._styleLayerUIDs=new Set;for(const d of o)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[r,l,h]=e.tileKey.split("/").map(parseFloat);this._level=r;const u=Ye(this._level);for(const d of Object.keys(t)){const f=t[d];if(this._pbfTiles[d]=new Qe(new Uint8Array(f.protobuff),new DataView(f.protobuff)),f.refKey){const[c]=f.refKey.split("/").map(parseFloat),x=r-c;if(x>0){const _=(1<{o.has(u)||(n.push({name:u,repeat:d}),o.add(u))},l={};for(const u of s)u.getResources(u.tileClipper,r,l);if(this._tile.status===W.INVALID)return[];const h=this._fetchResources(n,l,t);return Promise.all([...h,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:r,returnedBuckets:l,layerIdToBucket:h,referencerUIDToReferencedId:u}=t,d=this._sourceDataMaxLOD;for(let f=s.length-1;f>=0;f--){const c=s[f];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===Q.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const x=e[c.source],_=n[c.source],w=c.sourceLayer,y=x[w];if(y){let p=r[c.source];if(p||(p=r[c.source]=new Set),p.add(c.sourceLayer),c.refLayerId)u.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=y.extent,g.tileClipper=_;let M=o[c.source];M||(M=o[c.source]={});let m=M[w];m||(m=M[w]=[]),m.push(g),l.push(g),h[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,o=10*this._level,r=10*(this._level+1),l=[],h=[];for(const u of Object.keys(n))n[u].forEach(d=>{l.push(d),h.push(u)});for(let u=0;u=r)continue;const m=g._maxzoom;if(m&&m<=o)continue}for(const M of x)M.pushFeature(p)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let o,r;t.length>0&&(o=n.fetchSprites(t,this._client,i),s.push(o));for(const l in e){const h=e[l];h.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,l,h,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const o=s.getMessage(),r=new rt(o);o.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case Q.BACKGROUND:return null;case Q.FILL:return this._createFillBucket(t);case Q.LINE:return this._createLineBucket(t);case Q.CIRCLE:return this._createCircleBucket(t);case Q.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.fillMaterial.getStride()),new ee,new yt(t.outlineMaterial.getStride()),new ee)}_createLineBucket(t){return new It(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new dt(t.lineMaterial.getStride()),new ee)}_createCircleBucket(t){return new pt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new gt(t.circleMaterial.getStride()),new ee)}_createSymbolBucket(t){const e=this._tile;return new z(e.tileKey,t,this._level,new ze(t.iconMaterial.getStride()),new ee,new ze(t.textMaterial.getStride()),new ee,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(a,t,e,i){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=a,this.refKeys=t,this._workerTileHandler=e,this._styleRepository=i}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(a,t){const e=t?.signal;if(e!=null){const h=()=>{e.removeEventListener("abort",h),this.status=W.INVALID};e.addEventListener("abort",h)}let i;const s={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(a,t)}catch(h){if(Ue(h))throw h;return{result:s,transferList:[]}}this.status=W.READY;const n=s.bucketsWithData,o=[];for(const h of i)if(h.hasFeatures()){const u=h.serialize();n.push(u)}else o.push(h.layer.uid);const r=[...n];let l=null;return o.length>0&&(l=Uint32Array.from(o),r.push(l.buffer)),s.emptyBuckets=l,{result:s,transferList:r}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(a,t){const e=a.sourceName2DataAndRefKey;return Object.keys(e).length===0?[]:(this.status=W.MODIFIED,new Tt(e,this,t.client,a.sourceDataMaxLOD,this._styleRepository,a.styleLayerUIDs).parse(t))}};const bt=25;class $t{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const o of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[o];s[o]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(o){if(n.setObsolete(),n.release(),!Ue(o))throw o;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new at(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const o of t)n[o.name]===void 0&&s.push(o);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i?.signal}).then(o=>{for(const r in o){const l=o[r];n[r]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const o=[];let r=this._glyphInfo[e];return r?i.forEach(l=>{r[l]||o.push(l)}):(r=this._glyphInfo[e]=[],i.forEach(l=>o.push(l))),o.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:o},n).then(l=>{for(let h=0;h=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` +`),l&&(c=l.getValue(n,_)),c){case Ee.LOWERCASE:p=p.toLowerCase();break;case Ee.UPPERCASE:p=p.toUpperCase()}if(z._bidiEngine.hasBidiChar(p)){let I;I=z._bidiEngine.checkContextual(p)==="rtl"?"IDNNN":"ICNNN",p=z._bidiEngine.bidiTransform(p,I,"VLYSN"),g=!0}if(p.length>0){h&&(x=h.getValue(n,_));for(const I of x){let P=i[I];P||(P=i[I]=new Set);for(const T of p){const b=T.codePointAt(0);b!=null&&P.add(b)}}}}if(!y&&!p)continue;const M=s.getLayoutValue("symbol-sort-key",n,_),m={feature:_,sprite:y,label:p,rtl:g,geometry:w,hash:(p?Le(p):0)^(y?Le(y):0),priority:M,textFont:x};u.push(m)}this._symbolFeatures=u}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Me.POINT,o=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),l=e.getLayoutProperty("text-field"),h=r?new ot(e,i,n):null,u=l?new nt(e,i,n):null,d=this._workerTileHandler;let f;r&&(f=d.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const c=[];let x=1;u?.size&&(x=u.size/K);const _=u?u.maxAngle*Te:0,w=u?u.size*le:0;for(const y of this._symbolFeatures){let p;h&&f&&y.sprite&&(p=f[y.sprite],p&&p.sdf&&(this._isIconSDF=!0));let g;p&&h.update(i,y.feature);let M=0;const m=y.label;if(m){qe(u),u.update(i,y.feature);const I=n&&u.rotationAlignment===se.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(Xe.VERTICAL);let P=.5;switch(u.anchor){case C.TOP_LEFT:case C.LEFT:case C.BOTTOM_LEFT:P=0;break;case C.TOP_RIGHT:case C.RIGHT:case C.BOTTOM_RIGHT:P=1}let T=.5;switch(u.anchor){case C.TOP_LEFT:case C.TOP:case C.TOP_RIGHT:T=0;break;case C.BOTTOM_LEFT:case C.BOTTOM:case C.BOTTOM_RIGHT:T=1}let b=.5;switch(u.justify){case we.AUTO:b=P;break;case we.LEFT:b=0;break;case we.RIGHT:b=1}const L=u.letterSpacing*K,D=n?0:u.maxWidth*K,B=u.lineHeight*K,A=y.textFont.map(k=>d.getGlyphItems(k));if(g=new Ke(A,D,B,L,P,T,b).getShaping(m,y.rtl,I),g&&g.length>0){let k=1e30,E=-1e30;for(const R of g)k=Math.min(k,R.x),E=Math.max(E,R.x);M=(E-k+2*K)*x*le}}for(let I of y.geometry){const P=[];if(s===Me.LINE){if(g?.length&&u?.size){const T=u.size*le*(2+Math.min(2,4*Math.abs(u.offset[1])));I=z._smoothVertices(I,T)}z._pushAnchors(P,I,o,M)}else s===Me.LINE_CENTER?z._pushCenterAnchor(P,I):y.feature.type===Je.Polygon?z._pushCentroid(P,I):P.push(new ge(I[0].x,I[0].y));for(const T of P){if(T.x<0||T.x>Re||T.y<0||T.y>Re||n&&M>0&&u?.rotationAlignment===se.MAP&&!z._honorsTextMaxAngle(I,T,M,_,w))continue;const b={shaping:g,line:I,iconMosaicItem:p,anchor:T,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(b),this._processFeature(b,h,u)}}}c.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=z._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,o,r]=this._sourceTileKey.split("/");let l=0;e[l++]=this.type,e[l++]=this.layerUIDs.length;for(let h=0;hs in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:o,anchor:r}=t,l=this.zoom,h=this.layer,u=!!n;let d=!0;u&&(d=e?.optional||!n);const f=o&&o.length>0,c=!f||i?.optional;let x,_;if(u&&(x=this._placementEngine.getIconPlacement(r,n,e)),(x||d)&&(f&&(_=this._placementEngine.getTextPlacement(r,o,s,i)),_||c)){if(x&&_||(c||d?c||_?d||x||(_=null):x=null:(x=null,_=null)),_){const w=h.hasDataDrivenText?h.textMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(t,_.shapes,l,i.rotationAlignment,w),_.textColliders){t.textColliders=_.textColliders;for(const y of _.textColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}if(x){const w=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(t,x.shapes,l,n.page,e.rotationAlignment===se.VIEWPORT,w),x.iconColliders){t.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}}}_addPlacedIcons(t,e,i,s,n,o){const r=Math.max(i-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,u=this._markerMap;for(const d of e){const f=n?0:Math.max(i+$(d.minzoom),r),c=n?25:Math.min(i+$(d.maxzoom),25);if(c<=f)continue;const x=d.tl,_=d.tr,w=d.bl,y=d.br,p=d.mosaicRect,g=d.labelAngle,M=d.minAngle,m=d.maxAngle,I=d.anchor,P=l.index,T=p.x,b=p.y,L=T+p.width,D=b+p.height,B=l.index;l.add(I.x,I.y,x.x,x.y,T,b,g,M,m,f,c,o),l.add(I.x,I.y,_.x,_.y,L,b,g,M,m,f,c,o),l.add(I.x,I.y,w.x,w.y,T,D,g,M,m,f,c,o),l.add(I.x,I.y,y.x,y.y,L,D,g,M,m,f,c,o),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===B?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([B,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),u.has(s)?u.get(s)[1]+=6:u.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const o of n){const r=t.index,l=o.symbolInstance,h=o.ddAttributes,u=t.index;t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===u?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([u,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const o=Math.max(i-1,0),r=s===se.VIEWPORT;let l,h,u,d,f,c,x,_,w,y,p;for(const g of e)l=r?0:Math.max(i+$(g.minzoom),o),h=r?25:Math.min(i+$(g.maxzoom),25),!(h<=l)&&(u=g.tl,d=g.tr,f=g.bl,c=g.br,x=g.labelAngle,_=g.minAngle,w=g.maxAngle,y=g.anchor,p=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[c.x,c.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:x,minAngle:_,maxAngle:w,minLod:l,maxLod:h,placementLod:o,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const o=e.length-1;for(let f=0;f-r;){if(--h,h<0)return!1;o-=V.distance(t[h],l),l=t[h]}o+=V.distance(t[h],t[h+1]);const u=[];let d=0;const f=t.length;for(;on;)d-=u.shift().deviation;if(Math.abs(d)>s)return!1;o+=V.distance(x,w),h=_}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,o=0;s.push(0);for(let _=1;_0&&(n+=w,s.push(n),o++,o!==_&&(t[o]=t[_]))}if(i=o+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,l=t[0].y,h=t[i-1].x,u=t[i-1].y,d=V.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const f=[];f.push(new V(r,l));const c=1e-6,x=.5*e;for(let _=1;_=0;g--){const M=x+s[g+1]-s[_];if(M<0)break;const m=s[g+1]-s[g],I=s[_]-s[g]4096&&(r=4096),r<0&&(r=0),l>4096&&(l=4096),l<0&&(l=0);for(let h=1;h4096&&(u=4096),u<0&&(u=0),d>4096&&(d=4096),d<0&&(d=0),f>4096&&(f=4096),f<0&&(f=0),c>4096&&(c=4096),c<0&&(c=0);const x=(u-r)*(c-l)-(f-r)*(d-l);s+=x*(r+u+f),n+=x*(l+d+c),o+=x}s/=3*o,n/=3*o,isNaN(s)||isNaN(n)||t.push(new ge(s,n))}}z._bidiEngine=new lt;var W;(function(a){a[a.INITIALIZED=0]="INITIALIZED",a[a.NO_DATA=1]="NO_DATA",a[a.READY=2]="READY",a[a.MODIFIED=3]="MODIFIED",a[a.INVALID=4]="INVALID"})(W||(W={}));class Tt{constructor(t,e,i,s,n,o){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,o){this._styleLayerUIDs=new Set;for(const d of o)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[r,l,h]=e.tileKey.split("/").map(parseFloat);this._level=r;const u=Ye(this._level);for(const d of Object.keys(t)){const f=t[d];if(this._pbfTiles[d]=new Qe(new Uint8Array(f.protobuff),new DataView(f.protobuff)),f.refKey){const[c]=f.refKey.split("/").map(parseFloat),x=r-c;if(x>0){const _=(1<{o.has(u)||(n.push({name:u,repeat:d}),o.add(u))},l={};for(const u of s)u.getResources(u.tileClipper,r,l);if(this._tile.status===W.INVALID)return[];const h=this._fetchResources(n,l,t);return Promise.all([...h,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:r,returnedBuckets:l,layerIdToBucket:h,referencerUIDToReferencedId:u}=t,d=this._sourceDataMaxLOD;for(let f=s.length-1;f>=0;f--){const c=s[f];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===Q.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const x=e[c.source],_=n[c.source],w=c.sourceLayer,y=x[w];if(y){let p=r[c.source];if(p||(p=r[c.source]=new Set),p.add(c.sourceLayer),c.refLayerId)u.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=y.extent,g.tileClipper=_;let M=o[c.source];M||(M=o[c.source]={});let m=M[w];m||(m=M[w]=[]),m.push(g),l.push(g),h[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,o=10*this._level,r=10*(this._level+1),l=[],h=[];for(const u of Object.keys(n))n[u].forEach(d=>{l.push(d),h.push(u)});for(let u=0;u=r)continue;const m=g._maxzoom;if(m&&m<=o)continue}for(const M of x)M.pushFeature(p)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let o,r;t.length>0&&(o=n.fetchSprites(t,this._client,i),s.push(o));for(const l in e){const h=e[l];h.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,l,h,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const o=s.getMessage(),r=new rt(o);o.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case Q.BACKGROUND:return null;case Q.FILL:return this._createFillBucket(t);case Q.LINE:return this._createLineBucket(t);case Q.CIRCLE:return this._createCircleBucket(t);case Q.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.fillMaterial.getStride()),new ee,new yt(t.outlineMaterial.getStride()),new ee)}_createLineBucket(t){return new It(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new dt(t.lineMaterial.getStride()),new ee)}_createCircleBucket(t){return new pt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new gt(t.circleMaterial.getStride()),new ee)}_createSymbolBucket(t){const e=this._tile;return new z(e.tileKey,t,this._level,new ze(t.iconMaterial.getStride()),new ee,new ze(t.textMaterial.getStride()),new ee,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(a,t,e,i){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=a,this.refKeys=t,this._workerTileHandler=e,this._styleRepository=i}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(a,t){const e=t?.signal;if(e!=null){const h=()=>{e.removeEventListener("abort",h),this.status=W.INVALID};e.addEventListener("abort",h)}let i;const s={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(a,t)}catch(h){if(Ue(h))throw h;return{result:s,transferList:[]}}this.status=W.READY;const n=s.bucketsWithData,o=[];for(const h of i)if(h.hasFeatures()){const u=h.serialize();n.push(u)}else o.push(h.layer.uid);const r=[...n];let l=null;return o.length>0&&(l=Uint32Array.from(o),r.push(l.buffer)),s.emptyBuckets=l,{result:s,transferList:r}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(a,t){const e=a.sourceName2DataAndRefKey;return Object.keys(e).length===0?[]:(this.status=W.MODIFIED,new Tt(e,this,t.client,a.sourceDataMaxLOD,this._styleRepository,a.styleLayerUIDs).parse(t))}};const bt=25;class $t{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const o of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[o];s[o]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(o){if(n.setObsolete(),n.release(),!Ue(o))throw o;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new at(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const o of t)n[o.name]===void 0&&s.push(o);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i?.signal}).then(o=>{for(const r in o){const l=o[r];n[r]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const o=[];let r=this._glyphInfo[e];return r?i.forEach(l=>{r[l]||o.push(l)}):(r=this._glyphInfo[e]=[],i.forEach(l=>o.push(l))),o.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:o},n).then(l=>{for(let h=0;hk(this)),this.guid=`calcite-action-${C()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(a=>a?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){R(this,this.effectiveLocale)}connectedCallback(){O(this),W(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){$(this),w()&&await j(this)}componentDidLoad(){L(this)}disconnectedCallback(){M(this),H(this),this.mutationObserver?.disconnect()}componentDidRender(){E(this)}async setFocus(){await T(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:i}=this,a={[o.textContainer]:!0,[o.textContainerVisible]:i};return t?e("div",{class:a,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:i,indicatorId:a,buttonId:n}=this;return e("div",{"aria-labelledby":n,"aria-live":"polite",class:o.indicatorText,id:a,role:"region"},t?i.indicator:null)}renderIconContainer(){const{loading:t,icon:i,scale:a,el:n,iconFlipRtl:s,indicator:l}=this,d=a==="l"?"l":"m",u=t?e("calcite-loader",{inline:!0,label:this.messages.loading,scale:d}):null,c=i?e("calcite-icon",{class:{[o.indicatorWithIcon]:l},flipRtl:s,icon:i,scale:F(this.scale)}):null,r=u||c,b=r||n.children?.length,h=e("div",{class:{[o.slotContainer]:!0,[o.slotContainerHidden]:t}},e("slot",null));return b?e("div",{"aria-hidden":"true",class:o.iconContainer,key:"icon-container"},r,h):null}render(){const{active:t,compact:i,disabled:a,icon:n,loading:s,textEnabled:l,label:d,text:u,indicator:c,indicatorId:r,buttonId:b,messages:h}=this,p=d||u,m=p?`${p}${c?` (${h.indicator})`:""}`:"",f={[o.button]:!0,[o.buttonTextVisible]:l,[o.buttonCompact]:i};return e(z,{key:"3b459307dcb6f8d373e70cd5c7a45d122565a70e"},e(I,{key:"3a81f1fb62a66f1dbd608f095ed90f2d47a9daf6",disabled:a},e("button",{key:"bb5249babc116d462becd6b9a056ca0d368c6e09","aria-busy":v(s),"aria-controls":c?r:null,"aria-label":m,"aria-pressed":v(t),class:f,disabled:a,id:b,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer(),!n&&c&&e("div",{class:o.indicatorWithoutIcon,key:"indicator-no-icon"})),e("slot",{key:"983989711d64076eca866c1928f9c777331fcba4",name:_.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return A}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function G(){typeof customElements>"u"||["calcite-action","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-action":customElements.get(t)||customElements.define(t,B);break;case"calcite-icon":customElements.get(t)||S();break;case"calcite-loader":customElements.get(t)||V();break}})}G();export{B as f,G as m}; diff --git a/custom-toc-separator/assets/action-GCQoufcz-Db81jJpr.js b/custom-toc-separator/assets/action-GCQoufcz-Db81jJpr.js deleted file mode 100644 index a865848f..00000000 --- a/custom-toc-separator/assets/action-GCQoufcz-Db81jJpr.js +++ /dev/null @@ -1,21 +0,0 @@ -import{p as x,b as y,n as k,c as w,a as e,D as z}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as v}from"./dom-N58V0tYi-DBU3jlah.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as E,p as I}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{o as $,r as L,f as T}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as O,q as M}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{c as D}from"./observers-BigwqTsw-BCNzxmob.js";import{e as F}from"./component-CWGf1hug-BASJpoEG.js";import{l as R,d as W,h as j,M as H}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{m as S}from"./icon-BXFbBbop-BKvGneFm.js";import{v as V}from"./loader-Ch7Jr16w-B4sW6aLS.js";const o={button:"button",buttonTextVisible:"button--text-visible",buttonCompact:"button--compact",indicatorText:"indicator-text",iconContainer:"icon-container",slotContainer:"slot-container",slotContainerHidden:"slot-container--hidden",textContainer:"text-container",textContainerVisible:"text-container--visible",indicatorWithIcon:"indicator-with-icon",indicatorWithoutIcon:"indicator-without-icon"},_={tooltip:"tooltip"},q=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;background-color:transparent}:host,button{border-end-end-radius:var(--calcite-action-corner-radius-end-end, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-end-start-radius:var(--calcite-action-corner-radius-end-start, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-start-end-radius:var(--calcite-action-corner-radius-start-end, var(--calcite-action-corner-radius, var(--calcite-corner-radius)));border-start-start-radius:var(--calcite-action-corner-radius-start-start, var(--calcite-action-corner-radius, var(--calcite-corner-radius)))}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1));color:var(--calcite-action-text-color, var(--calcite-color-text-3));text-align:unset;flex:1 0 auto}.button:hover,.button:focus{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-action-text-color-pressed, var(--calcite-color-text-1))}.button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.button:active{background-color:var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3))}.icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1.5rem}.text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus{color:var(--calcite-action-text-color-pressed, var(--calcite-color-text-1));background-color:var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3))}:host([active]) .button:active{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}:host([loading]) .text-container{opacity:var(--calcite-opacity-disabled)}:host([loading]) calcite-loader[inline]{margin-inline-end:0px}:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]) .button:active{background-color:var(--calcite-color-transparent-press)}:host([data-active]) .button{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}.indicator-with-icon{position:relative}.indicator-with-icon::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}.indicator-without-icon{margin-inline:0.25rem;inline-size:1rem;position:relative}.indicator-without-icon::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-color-foreground-1);opacity:var(--calcite-opacity-disabled)}:host([disabled]):host([active]) .button,:host([disabled]):host([active]) .button:hover,:host([disabled]):host([active]) .button:focus{background-color:var(--calcite-color-foreground-3);opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,A=q,B=x(class extends y{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=D("mutation",()=>k(this)),this.guid=`calcite-action-${C()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(a=>a?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){R(this,this.effectiveLocale)}connectedCallback(){O(this),W(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){$(this),w()&&await j(this)}componentDidLoad(){L(this)}disconnectedCallback(){M(this),H(this),this.mutationObserver?.disconnect()}componentDidRender(){E(this)}async setFocus(){await T(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:i}=this,a={[o.textContainer]:!0,[o.textContainerVisible]:i};return t?e("div",{class:a,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:i,indicatorId:a,buttonId:n}=this;return e("div",{"aria-labelledby":n,"aria-live":"polite",class:o.indicatorText,id:a,role:"region"},t?i.indicator:null)}renderIconContainer(){const{loading:t,icon:i,scale:a,el:n,iconFlipRtl:s,indicator:l}=this,d=a==="l"?"l":"m",u=t?e("calcite-loader",{inline:!0,label:this.messages.loading,scale:d}):null,c=i?e("calcite-icon",{class:{[o.indicatorWithIcon]:l},flipRtl:s,icon:i,scale:F(this.scale)}):null,r=u||c,b=r||n.children?.length,h=e("div",{class:{[o.slotContainer]:!0,[o.slotContainerHidden]:t}},e("slot",null));return b?e("div",{"aria-hidden":"true",class:o.iconContainer,key:"icon-container"},r,h):null}render(){const{active:t,compact:i,disabled:a,icon:n,loading:s,textEnabled:l,label:d,text:u,indicator:c,indicatorId:r,buttonId:b,messages:h}=this,p=d||u,m=p?`${p}${c?` (${h.indicator})`:""}`:"",f={[o.button]:!0,[o.buttonTextVisible]:l,[o.buttonCompact]:i};return e(z,{key:"3b459307dcb6f8d373e70cd5c7a45d122565a70e"},e(I,{key:"3a81f1fb62a66f1dbd608f095ed90f2d47a9daf6",disabled:a},e("button",{key:"bb5249babc116d462becd6b9a056ca0d368c6e09","aria-busy":v(s),"aria-controls":c?r:null,"aria-label":m,"aria-pressed":v(t),class:f,disabled:a,id:b,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer(),!n&&c&&e("div",{class:o.indicatorWithoutIcon,key:"indicator-no-icon"})),e("slot",{key:"983989711d64076eca866c1928f9c777331fcba4",name:_.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return A}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function G(){typeof customElements>"u"||["calcite-action","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-action":customElements.get(t)||customElements.define(t,B);break;case"calcite-icon":customElements.get(t)||S();break;case"calcite-loader":customElements.get(t)||V();break}})}G();export{B as f,G as m}; diff --git a/custom-toc-separator/assets/action-group-DhwU7QZv-C03omEu_.js b/custom-toc-separator/assets/action-group-DhwU7QZv-C03omEu_.js new file mode 100644 index 00000000..2bdfa2ed --- /dev/null +++ b/custom-toc-separator/assets/action-group-DhwU7QZv-C03omEu_.js @@ -0,0 +1 @@ +import{p as d,b as p,a as t}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{s as h,c as g}from"./conditionalSlot-DsCzytJ4-C2Pw5SgP.js";import{f,o as v,r as b}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{K as x,q as y}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{l as M,d as k,M as O,h as C}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{_ as s,K as P,O as E}from"./action-menu-DTIJuZNc-JfgVVBLH.js";import{G as L}from"./dom-N58V0tYi-DBU3jlah.js";import{m as A}from"./action-GCQoufcz-CMRVbhl9.js";import{m as w}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as z}from"./loader-Ch7Jr16w-DWxaqSJX.js";const i={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},_={menu:"ellipsis"},F={container:"container"},H=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns:1}:host([columns="2"]){--calcite-internal-action-group-columns:2}:host([columns="3"]){--calcite-internal-action-group-columns:3}:host([columns="4"]){--calcite-internal-action-group-columns:4}:host([columns="5"]){--calcite-internal-action-group-columns:5}:host([columns="6"]){--calcite-internal-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)), auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([hidden]){display:none}[hidden]{display:none}',$=H,S=d(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=e=>{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; diff --git a/custom-toc-separator/assets/action-group-DhwU7QZv-DKlcERk4.js b/custom-toc-separator/assets/action-group-DhwU7QZv-DKlcERk4.js deleted file mode 100644 index 60b9c6fa..00000000 --- a/custom-toc-separator/assets/action-group-DhwU7QZv-DKlcERk4.js +++ /dev/null @@ -1 +0,0 @@ -import{p as d,b as p,a as t}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{s as h,c as g}from"./conditionalSlot-DsCzytJ4-BJqhnuaV.js";import{f,o as v,r as b}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as x,q as y}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{l as M,d as k,M as O,h as C}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{_ as s,K as P,O as E}from"./action-menu-DTIJuZNc-CadEd7O7.js";import{G as L}from"./dom-N58V0tYi-DBU3jlah.js";import{m as A}from"./action-GCQoufcz-Db81jJpr.js";import{m as w}from"./icon-BXFbBbop-BKvGneFm.js";import{v as z}from"./loader-Ch7Jr16w-B4sW6aLS.js";const i={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},_={menu:"ellipsis"},F={container:"container"},H=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns:1}:host([columns="2"]){--calcite-internal-action-group-columns:2}:host([columns="3"]){--calcite-internal-action-group-columns:3}:host([columns="4"]){--calcite-internal-action-group-columns:4}:host([columns="5"]){--calcite-internal-action-group-columns:5}:host([columns="6"]){--calcite-internal-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)), auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([hidden]){display:none}[hidden]{display:none}',$=H,S=d(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=e=>{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; diff --git a/custom-toc-separator/assets/action-menu-DTIJuZNc-CadEd7O7.js b/custom-toc-separator/assets/action-menu-DTIJuZNc-CadEd7O7.js deleted file mode 100644 index cd046dfb..00000000 --- a/custom-toc-separator/assets/action-menu-DTIJuZNc-CadEd7O7.js +++ /dev/null @@ -1 +0,0 @@ -import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{m as Ee}from"./action-GCQoufcz-Db81jJpr.js";import{m as ye}from"./icon-BXFbBbop-BKvGneFm.js";import{v as we}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3-elIRTcW0.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{c as We}from"./observers-BigwqTsw-BCNzxmob.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-ljy-TIYj.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; diff --git a/custom-toc-separator/assets/action-menu-DTIJuZNc-JfgVVBLH.js b/custom-toc-separator/assets/action-menu-DTIJuZNc-JfgVVBLH.js new file mode 100644 index 00000000..349cdd17 --- /dev/null +++ b/custom-toc-separator/assets/action-menu-DTIJuZNc-JfgVVBLH.js @@ -0,0 +1 @@ +import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{m as Ee}from"./action-GCQoufcz-CMRVbhl9.js";import{m as ye}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as we}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{c as We}from"./observers-BigwqTsw-C0_AGNdr.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; diff --git a/custom-toc-separator/assets/apng-DuERAVke-DKoS_DoG.js b/custom-toc-separator/assets/apng-DuERAVke-DKoS_DoG.js deleted file mode 100644 index d50a73e3..00000000 --- a/custom-toc-separator/assets/apng-DuERAVke-DKoS_DoG.js +++ /dev/null @@ -1 +0,0 @@ -import{t as G}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{$ as B,aN as S}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";var R,T={exports:{}};function V(){return R||(R=1,E=function(){return function(w){var o={};function s(a){if(o[a])return o[a].exports;var l=o[a]={exports:{},id:a,loaded:!1};return w[a].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}return s.m=w,s.c=o,s.p="",s(0)}([function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.isNotPNG=n,o.isNotAPNG=r,o.default=i;var a=v(s(1)),l=s(2);function v(h){return h&&h.__esModule?h:{default:h}}var f=new Error("Not a PNG"),e=new Error("Not an animated PNG");function n(h){return h===f}function r(h){return h===e}var t=new Uint8Array([137,80,78,71,13,10,26,10]);function i(h){var _=new Uint8Array(h);if(Array.prototype.some.call(t,function(L,b){return L!==_[b]}))return f;var y=!1;if(u(_,function(L){return!(y=L==="acTL")}),!y)return e;var d=[],k=[],x=null,c=null,I=0,F=new l.APNG;if(u(_,function(L,b,p,U){var P=new DataView(b.buffer);switch(L){case"IHDR":x=b.subarray(p+8,p+8+U),F.width=P.getUint32(p+8),F.height=P.getUint32(p+12);break;case"acTL":F.numPlays=P.getUint32(p+8+4);break;case"fcTL":c&&(F.frames.push(c),I++),(c=new l.Frame).width=P.getUint32(p+8+4),c.height=P.getUint32(p+8+8),c.left=P.getUint32(p+8+12),c.top=P.getUint32(p+8+16);var M=P.getUint16(p+8+20),N=P.getUint16(p+8+22);N===0&&(N=100),c.delay=1e3*M/N,c.delay<=10&&(c.delay=100),F.playTime+=c.delay,c.disposeOp=P.getUint8(p+8+24),c.blendOp=P.getUint8(p+8+25),c.dataParts=[],I===0&&c.disposeOp===2&&(c.disposeOp=1);break;case"fdAT":c&&c.dataParts.push(b.subarray(p+8+4,p+8+U));break;case"IDAT":c&&c.dataParts.push(b.subarray(p+8,p+8+U));break;case"IEND":k.push(O(b,p,12+U));break;default:d.push(O(b,p,12+U))}}),c&&F.frames.push(c),F.frames.length==0)return e;var j=new Blob(d),C=new Blob(k);return F.frames.forEach(function(L){var b=[];b.push(t),x.set(D(L.width),0),x.set(D(L.height),4),b.push(A("IHDR",x)),b.push(j),L.dataParts.forEach(function(p){return b.push(A("IDAT",p))}),b.push(C),L.imageData=new Blob(b,{type:"image/png"}),delete L.dataParts,b=null}),F}function u(h,_){var y=new DataView(h.buffer),d=8,k=void 0,x=void 0,c=void 0;do x=y.getUint32(d),c=_(k=g(h,d+4,4),h,d,x),d+=12+x;while(c!==!1&&k!="IEND"&&d>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function J(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function W(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function J(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function W(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function W(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function Y(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?W(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:Y(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function At(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function xt(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{xt as createArcadeExecutor,At as createArcadeProfile}; diff --git a/custom-toc-separator/assets/arcade-CaGqU4sP-DEhIUP7F.js b/custom-toc-separator/assets/arcade-CaGqU4sP-DEhIUP7F.js new file mode 100644 index 00000000..cd688e5f --- /dev/null +++ b/custom-toc-separator/assets/arcade-CaGqU4sP-DEhIUP7F.js @@ -0,0 +1 @@ +import{o as w,P,dW as L,r as M,bi as j}from"./story-DT1Ep1ux.js";import{m as T,O,r as g}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{n as I}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import J from"./FeatureLayer-BrRKw5Si-DV01qpqc.js";import{O as z}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./main-BTdHgocv.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import"./LRUCache-C3erQTWv-D3oKynNB.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BKynsqQg.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./heatmapUtils-seiMkkkR-D22mGlP8.js";import"./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js";import"./commonProperties-BtIqvFU_-BAaMjACd.js";import"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import"./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./featureLayerUtils-DgfQQyK4-CkN8Mclp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js";import"./Relationship-PyhUibYK-Dl9eU1qo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./editsZScale-BDsX6vv--CJojmgz5.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./APIKeyMixin-BUMSx9ny-WDHyZfLR.js";import"./ArcGISService-BYA-y6X6-BWJQc6nI.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./CustomParametersMixin-vdKsTHer-D2O-ilop.js";import"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import"./FeatureEffectLayer-Cro89IEC-wxowDxbO.js";import"./FeatureEffect-CDEk9Es7-8jhaVJv-.js";import"./FeatureFilter-BCFHgLVU-DfMwTLEM.js";import"./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js";import"./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js";import"./labelingInfo-DGVNul26-DxpYAQDw.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DbKLfNnN.js";import"./OrderedLayer-6Qsmrd_l-BekPpQJS.js";import"./OrderByInfo-GD2XnU8e-BH2q29Gm.js";import"./PortalLayer-CElnYuSQ-CcA75vOb.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./TemporalLayer-CpOrN_w9-B2VZ6x81.js";import"./TimeInfo-w_HB2CsF-CygrHAJu.js";import"./FeatureTemplate-SPHPD45f-Dk1o48TK.js";import"./FeatureType-C9hJmS6_-zoljUYGr.js";import"./fieldProperties-Bq26w7gt-c4nyNJP6.js";import"./versionUtils-LZYZz-38-esAtUime.js";import"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./popupUtils-B0uZcXX0-mkpGjfro.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let d=null;function E(e,i,r,o={}){const a=i.elementType,n="value",c=a.type==="array"?[{name:n,type:a.type,elementType:a.elementType}]:a.type==="dictionary"?[{name:n,type:a.type,properties:a.properties}]:[{name:n,type:a.type}];return new I(e.map(p=>{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function W(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function Y(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?W(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:Y(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function At(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function xt(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{xt as createArcadeExecutor,At as createArcadeProfile}; diff --git a/custom-toc-separator/assets/arcadeAsyncRuntime-B-LnqhTo-CqF6ldAl.js b/custom-toc-separator/assets/arcadeAsyncRuntime-B-LnqhTo-CqF6ldAl.js new file mode 100644 index 00000000..5312986b --- /dev/null +++ b/custom-toc-separator/assets/arcadeAsyncRuntime-B-LnqhTo-CqF6ldAl.js @@ -0,0 +1,2 @@ +import{C as pt,X as wt,M as dt,L as ht,f as gt,m as mt,s as yt,a as rt,p as vt,N as M,e as y,b as J,D as ot}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{w as Q,b as R,T as l,n as s,B as W,a5 as v,a9 as z,l as p,U as S,a6 as F,a7 as E,N as at,y as g,C as U,S as C,f,t as k,Z as j,M as O,V as bt,o as D,a0 as St,z as xt,a8 as Ft,H as It,a4 as T,r as Rt,ac as Mt,ad as $}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{registerFunctions as At}from"./geomasync-uGYsifQH-DIUO-bgz.js";import{J as nt,d as tt}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./portalUtils-CKN9iXwH-CegMKdRo.js";import"./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js";import"./workers-PiCjreoO-DrDY4oeh.js";const K=100;async function X(e,t){const r=[];for(let o=0;o{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;i{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;ii.map(i=>d[i]); +import{_ as je}from"./main-BTdHgocv.js";import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,O as jr,P as $i,f as ea}from"./story-DT1Ep1ux.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{M as da}from"./number-eRKYXfX9-BO7ByyLZ.js";import{M as hr}from"./shared-D1w-26bA-BBBcUeQg.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Er(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` +`,"*"]);let n="";for(let r=0;rr!=="")}function ho(e,t,n){if(W(e))return uo(m(e),t,n);if(S(e))return An(co(e),t,n);if(_(e))return An(e,t,n);if(P(e))return An(e.toArray(),t,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function fo(e,t,n){const r=Nt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function mo(e,t,n){const r=e.getAngle(t);if(t===Z.quadrant&&n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[ht(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,ht(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===Z.quadrant?[ht(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),ht(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function po(e,t){let n="";switch(e){case w.decimal_degrees:n=t===Z.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case w.degrees_minutes_seconds:n=t===Z.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+mi;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return t===Z.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let wo=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const n of e)isNaN(n)?t.push("NaN"):n===1/0?t.push("Infinity"):n===-1/0?t.push("-Infinity"):n===0?t.push("0"):t.push(n.toString(16));this.update(Sr(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Sr(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const n of this._bufs)e.set(n,t),t+=n.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const n=e;let r=t+vr&4294967295,a=0;if(n.length>=16){const o=[t+lt+ct&4294967295,t+ct&4294967295,t+0&4294967295,t-lt&4294967295],i=e,u=i.length-16;let l=0;for(a=0;(4294967280&a)<=u;a+=4){const f=a,d=i[f]+(i[f+1]<<8),p=i[f+2]+(i[f+3]<<8),g=d*ct+(p*ct<<16);let y=o[l]+g&4294967295;y=y<<13|y>>>19;const b=65535&y,x=y>>>16;o[l]=b*lt+(x*lt<<16)&4294967295,l=l+1&3}r=(o[0]<<1|o[0]>>>31)+(o[1]<<7|o[1]>>>25)+(o[2]<<12|o[2]>>>20)+(o[3]<<18|o[3]>>>14)&4294967295}r=r+e.length&4294967295;const s=e.length-4;for(;a<=s;a+=4){const o=a,i=n[o]+(n[o+1]<<8),u=n[o+2]+(n[o+3]<<8);r=r+(i*Jt+(u*Jt<<16))&4294967295,r=r<<17|r>>>15,r=(65535&r)*br+((r>>>16)*br<<16)&4294967295}for(;a>>21,r=(65535&r)*lt+((r>>>16)*lt<<16)&4294967295;return r^=r>>>15,r=((65535&r)*ct&4294967295)+((r>>>16)*ct<<16),r^=r>>>13,r=((65535&r)*Jt&4294967295)+((r>>>16)*Jt<<16),r^=r>>>16,r<0?r+4294967296:r}};function xo(e){return e.loadStatus==="loaded"&&e.user?.sourceJSON?e.user.sourceJSON:null}function Fo(e,t){return!!e&&Yi(e,t?.restUrl||"")}function Ir(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Ee(e,t,n){if(e!==null)if(_(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(P(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(ce(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(Q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(S(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(X(e))t.updateUint8Array([e===!0?1:0,113]);else{if(W(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Qa)throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof Pn)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof v)){if(K(e))throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof V)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Ee(e.spatialReference.wkid,t,n);if(e instanceof le){t.updateIntArray([1266616829]);for(let r=0;r(D(o,1,1,n,r),new Pn(E(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=Jr(o[0]);if(i==="Unrecognized Type")throw new h(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=m(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&E(o[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=E(o[0]);let f="",d=!0;for(let p=0;p(D(o,1,1,n,r),E(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,1,n,r),o.length>0)switch(E(o[0]).toLowerCase()){case"digits":return Ft().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Ft();case"digits-hyphen-braces":return"{"+Ft()+"}";case"digits-hyphen-parentheses":return"("+Ft()+")"}return"{"+Ft()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=E(o[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,E(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,s,o)=>(o.length===0||(o.length===1?n.console(E(o[0])):n.console(E(o))),I))},e.mid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i))return"";if(i=Math.max(0,i),o.length===2)return E(o[0]).slice(i);let u=m(o[2]);return isNaN(u)?"":(u<0&&(u=0),E(o[0]).slice(i,i+u))})},e.find=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=m(N(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return E(o[1]).indexOf(E(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=m(o[1]);return isNaN(i)?"":(i<0&&(i=0),E(o[0]).slice(0,i))})},e.right=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=m(o[1]);return isNaN(i)||i<=0?"":E(o[0]).slice(-i)})},e.split=function(n,r){return t(n,r,(a,s,o)=>{let i;D(o,2,4,n,r);let u=m(N(o[2],-1));const l=Tt(N(o[3],!1));if(u===-1||u===null||l===!0?i=E(o[0]).split(E(o[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=E(o[0]).split(E(o[1]),u)),l===!1)return i;const f=[];for(let d=0;d=u);d++)i[d]!==""&&i[d]!==void 0&&f.push(i[d]);return f})},e.text=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,2,n,r),qe(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,s,o)=>{const i=[];if(o.length<1)return"";if(_(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}if(P(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}for(let u=0;u{if(D(o,1,1,n,r),_(o[0])){const i=o[0].slice();return i.reverse(),i}if(P(o[0])){const i=o[0].toArray().slice();return i.reverse(),i}throw new h(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,s,o)=>{D(o,3,4,n,r);const i=E(o[0]),u=E(o[1]),l=E(o[2]);return o.length!==4||Tt(o[3])?Tn(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,s,o)=>{if(K(o[0])){const i=ra(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0]))return o[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,3,n,r),K(o[0])){const i=ia(o[0],E(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:hr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},B(n)):v.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:hr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return aa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return oa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof v){let i="";for(const u of o[0].keys()){const l=o[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(E(o[0]))})},e.hash=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=new wo(0);return Ee(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,s,o)=>(D(o,3,3,n,r),yo(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),S(o[0])===!1)throw new h(n,c.InvalidParameter,r);return v.convertJsonToArcade(JSON.parse(E(o[0])),B(n))})},e.expects=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);return I})},e.tocharcode=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);const i=o.map(u=>Math.trunc(m(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);let i;try{i=o.map(u=>Math.trunc(m(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,2,n,r);let i=N(o[1],"");if(i=i===!0||i===!1?"":E(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let u=null;if(u=n.services?.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Fo(o[0].field("url"),u)||!u)return null;if(i===""){const l=xo(u);if(l){const f=JSON.parse(JSON.stringify(l));for(const d of["lastLogin","created","modified"])f[d]!==void 0&&f[d]!==null&&(f[d]=new Date(f[d]));return v.convertObjectToArcadeDictionary(f,B(n))}}return null}throw new h(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,s,o)=>(D(o,0,0,n,r),v.convertObjectToArcadeDictionary(sa(B(n),n.spatialReference),B(n),!0)))}}let Ao=class extends Xr{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r));const i=this.call(n,{arguments:o});return $e(i)?i.then(u=>Kt(u,n,r)):i})}};function xe(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function T(e,t){switch(t.type){case"AssignmentExpression":return Io(e,t);case"UpdateExpression":return vo(e,t);case"TemplateLiteral":return Uo(e,t);case"Identifier":return Zo(e,t);case"MemberExpression":return Lo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return jo(e,t);case"UnaryExpression":return Po(e,t);case"BinaryExpression":return zo(e,t);case"LogicalExpression":return Go(e,t);case"ArrayExpression":return Oo(e,t);case"ObjectExpression":return Co(e,t);default:throw new he(e,c.Unrecognized,t)}}function pe(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return No(e,t);case"BlockStatement":return Rt(e,t);case"FunctionDeclaration":return Mo(e,t);case"ImportDeclaration":return _o(e,t);case"ExportNamedDeclaration":return To(e,t);case"ReturnStatement":return Bo(e,t);case"IfStatement":return gi(e,t);case"ExpressionStatement":return ko(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return bo(e,t);case"ForInStatement":return Eo(e,t);case"WhileStatement":return So(e,t);default:throw new he(e,c.Unrecognized,t)}}function Co(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+s+",'ObjectExpression'),lang.aCheck("+T(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Eo(e,t){const n=be(e),r=be(e),a=be(e);let s="var "+n+" = "+T(e,t.right)+`; +`;t.left.type==="VariableDeclaration"&&(s+=pe(e,t.left));const o=$(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);Ae(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let u="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(s+="lang.chkAssig('"+u+`',runtimeCtx); +`),s+="if ("+n+`===null) { lastStatement = lc.voidOperation; } + `,s+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",s+="var "+r+"="+n+`.length; +`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,s+="else if (lc.isImmutableArray("+n+")) {",s+="var "+r+"="+n+`.length(); +`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,s+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",s+="var "+r+"="+n+`.keys(); +`,s+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { +`,s+=i+"="+r+"["+a+`]; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`,e.isAsync&&(s+="else if (lc.isFeatureSet("+n+")) {",s+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); +`,s+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { +`,s+=i+"="+a+`; +`,s+=pe(e,t.body),s+=` +} +`,s+=` lastStatement = lc.voidOperation; +`,s+=` +} +`),s+=`else { lastStatement = lc.voidOperation; } +`,s}function bo(e,t){let n=`lastStatement = lc.voidOperation; +`;t.init!==null&&(t.init.type==="VariableDeclaration"?n+=pe(e,t.init):n+=T(e,t.init)+"; ");const r=be(e),a=be(e);return n+="var "+r+" = true; ",n+=` + do { `,t.update!==null&&(n+=" if ("+r+`===false) { + `+T(e,t.update)+` +} + `+r+`=false; +`),t.test!==null&&(n+="var "+a+" = "+T(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+c.BooleanConditionRequired+`'); } +`),n+=pe(e,t.body),t.update!==null&&(n+=` + `+T(e,t.update)),n+=` +`+r+` = true; +} while(true); lastStatement = lc.voidOperation; `,n}function vo(e,t){if(t.argument.type==="CallExpression")throw new he(e,c.NeverReach,t);let n;if(t.argument.type==="MemberExpression"){const a=T(e,t.argument.object);return t.argument.computed===!0?n=T(e,t.argument.property):(Ae(t.argument.property.name),n="'"+t.argument.property.name+"'"),"lang.memberupdate("+a+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=$(t.argument);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lang.update(lscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[r]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[r]!==void 0)return"lang.update(gscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[r]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:_e(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new h(e,c.InvalidIdentifier,t)}function So(e,t){let n=`lastStatement = lc.voidOperation; +`;const r=be(e);return n+=` + var ${r} = true; + do { + ${r} = ${T(e,t.test)}; + if (${r}==false) { + break; + } + if (${r}!==true) { + lang.error('${c.BooleanConditionRequired}'); + } + ${pe(e,t.body)} + } + while (${r} !== false); + lastStatement = lc.voidOperation; + `,n}function Io(e,t){const n=T(e,t.right);if(t.left.type==="MemberExpression"){let a;const s=T(e,t.left.object);return t.left.computed===!0?a=T(e,t.left.property):(a="'"+t.left.property.name+"'",Ae(t.left.property.name)),"lang.assignmember("+s+","+a+",'"+t.operator+"',"+n+")"}const r=$(t.left);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const a={manglename:_e(e),node:t.left};return e.undeclaredGlobalsInFunctions.set(r,a),"gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+a.manglename+"'])"}throw new h(e,c.InvalidIdentifier,t)}function ko(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+T(e,t.expression)+`; + `:"lastStatement = "+T(e,t.expression)+"; "}function kr(e,t){return t.type==="BlockStatement"?pe(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?pe(e,t)+"; ":t.type==="ExpressionStatement"?pe(e,t):pe(e,t)+"; "}function gi(e,t){return`if (lang.mustBoolean(${T(e,t.test)}, runtimeCtx) === true) { + ${kr(e,t.consequent)} + } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+gi(e,t.alternate):` else { + ${kr(e,t.alternate)} + } +`:` else { + lastStatement = lc.voidOperation; + } +`)}function Rt(e,t){let n="";for(let r=0;r0&&(s+=", "),s+=T(e,t.arguments[o]);return s+="]",e.isAsync?"(yield lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx))":"lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new he(e,c.FunctionNotFound,t);const n=$(t.callee);if(n==="iif")return Vo(e,t);if(n==="when")return Wo(e,t);if(n==="defaultvalue")return Jo(e,t);if(n==="decode")return qo(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:_e(e),node:t.callee};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let s=0;s0&&(a+=", "),a+=T(e,t.arguments[s]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new he(e,c.FunctionNotFound,t)}catch(n){throw n}}function Vo(e,t){try{if(t.arguments.length!==3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);return`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + + if (${n} === true) { + return ${T(e,t.arguments[1])}; + } + else if (${n} === false) { + return ${T(e,t.arguments[2])}; + } + else { + lang.error('ExecutionErrorCodes.BooleanConditionRequired'); + } + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Jo(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e),r=be(e);return t.arguments.length===3?`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + var ${r} = ${T(e,t.arguments[1])}; + ${n} = lang.getNestedOptionalValue(${n}, ${r}); + return ${n} != null && ${n} !== "" ? ${n} : ${T(e,t.arguments[2])}; + ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${T(e,t.arguments[0])}; + if (${n} === null) { + return ${T(e,t.arguments[1])}; + } + if (${n} === "") { + return ${T(e,t.arguments[1])}; + } + if (${n} === undefined) { + return ${T(e,t.arguments[1])}; + } + return ${n}; + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Wo(e,t){try{if(t.arguments.length<3)throw new he(e,c.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);let r="var ";for(let a=0;a{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.decode=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.when=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.defaultvalue=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}};const Dt={};for(const e in ee)Dt[e]=new nt(ee[e]);li(ee,xe);for(const e in ee)ee[e]=new nt(ee[e]);const Yn=function(){};Yn.prototype=ee;const $n=function(){};function yi(e,t,n){const r={_SymbolsMap:{}};e||(e={}),n||(n={}),r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function wi(e,t,n,r){const a=n?new $n:new Yn;e||(e={}),t||(t={});const s=new v({newline:` +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=s,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const o in t)a[o]=t[o],a._SymbolsMap[o]=1;for(const o in e){const i=e[o];a._SymbolsMap[o]=1,Hr(i)?a[o]=H.createFromGraphic(i,r??null):a[o]=i}return a}$n.prototype=Dt;function rt(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:xe,standardFunctionAsync:xe,evaluateIdentifier:Ho};for(let r=0;r0){if(!n.toLowerCase().startsWith("_t")&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(!n.toLowerCase().startsWith("_t")&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}rt([Rn],"sync"),rt([Rn],"async");let Cn=0;const xi={isNumber:e=>W(e),isArray:e=>_(e),isImmutableArray:e=>P(e),isFeature:e=>K(e),isString:e=>S(e),isDictionary:e=>qn(e),isGeometry:e=>nn(e),geometryMember:(e,t,n,r,a=1)=>mt(e,t,n,r,a),error(e){throw new h(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,s)=>{function o(l){try{u(r.next(l))}catch(f){s(f)}}function i(l){try{u(r.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):l.value?.then?l.value.then(o,i):(Cn++,Cn%100==0?setTimeout(()=>{Cn=0,o(l.value)},0):o(l.value))}u((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new h(null,c.MaximumCallDepth,null);const n=e.apply(this,arguments);return $e(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new h(t,c.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new h(t,c.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>E(e),aCheck(e,t){if(Y(e))throw t==="ArrayExpression"?new h(null,c.NoFunctionInArray,null):t==="ObjectExpression"?new h(null,c.NoFunctionInDictionary,null):new h(null,c.NoFunctionInTemplateLiteral,null);return e===I?null:e},Dictionary:v,Feature:H,UserDefinedCompiledFunction:Ao,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return qr(m(e),m(t),n);case"==":case"=":return Pe(e,t);case"!=":return!Pe(e,t);case"<":case">":case"<=":case">=":return Wr(e,t,n);case"+":return S(e)||S(t)?E(e)+E(t):m(e)+m(t);case"-":return m(e)-m(t);case"*":return m(e)*m(t);case"/":return m(e)/m(t);case"%":return m(e)%m(t);default:throw new h(null,c.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(null,c.UnsupportedOperator,null)}},update(e,t,n,r){const a=m(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:H.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let a;if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new h(null,c.OutOfBounds,null);a=m(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null,{key:t});a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null);a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new h(null,c.ModuleExportNotFound,null);a=m(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new h(null,c.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new h(null,c.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new h(null,c.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new h(null,c.MemberOfNull,null);if(e instanceof v||K(e)){if(S(t))return e.field(t);throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof k){if(S(t))return mt(e,t,null,null);throw new h(null,c.InvalidMemberAccessKey,null)}if(_(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(S(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(P(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new h(null,c.OutOfBounds,null);return e.get(t)}throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof St){if(S(t))return e.global(t);throw new h(null,c.InvalidMemberAccessKey,null)}throw new h(null,c.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof St))throw new h(null,c.FunctionNotFound,null);const a=e.global(n);if(Y(a)===!1)throw new h(null,c.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})},getNestedOptionalValue:(e,t)=>Xn(e,t)};function $t(e){console.log(e)}function Fi(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new on(null,e.loadedModules));const a={isAsync:n,globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let s=Rt(a,e);s===""&&(s="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(g=>{throw new he(t,c.InvalidIdentifier,g.node)});let o="";o=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+s+` + return lastStatement; }); } + return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+s+` + return lastStatement; } + return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-DIUO-bgz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+a+` + return lastStatement; }); } + yield mainBody(); + return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+a+` + return lastStatement; } + mainBody(); + return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,i=r.moduleFactoryMap,u=r.exports,l={};let f;for(f in u)l[f]=r.mangleMap[f]??f;const d={lc:Kr,lang:xi,mangles:r.mangleMap,prepareModule:p=>new St(p),prepare(p,g){let y=p.spatialReference;y==null&&(y=new Pt({wkid:102100}));const b=wi(p.vars,p.customfunctions,g,p.timeZone);return{localStack:[],isAsync:g,exports:u,exportmangle:l,gdefs:{},moduleFactory:o,moduleFactoryMap:i,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:y,globalScope:b,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??$t,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(d)}var Ht={False:"false",Null:"null",True:"true"},z={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},A={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},Zn=["++","--"],Ai=["-","+","!","~"],Ci=["=","/=","*=","%=","+=","-="],Ei=["||","&&"],Qo=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Br={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},C={Unknown:0,BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},Yo=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],F={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},$o={[F.InvalidModuleUri]:"Module uri must be a text literal.",[F.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[F.IdentiferExpected]:"'${value}' is an invalid identifier.",[F.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[F.InvalidExpression]:"Invalid expression.",[F.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[F.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[F.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[F.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[F.InvalidTemplateHead]:"Invalid template structure.",[F.InvalidVariableAssignment]:"Invalid variable assignment.",[F.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[F.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[F.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[F.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[F.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[F.PunctuatorExpected]:"'${value}' expected.",[F.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[F.UnexpectedBoolean]:"Unexpected boolean literal.",[F.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[F.UnexpectedIdentifier]:"Unexpected identifier.",[F.UnexpectedKeyword]:"Unexpected keyword.",[F.UnexpectedNull]:"Unexpected null literal.",[F.UnexpectedNumber]:"Unexpected number.",[F.UnexpectedPunctuator]:"Unexpected ponctuator.",[F.UnexpectedString]:"Unexpected text literal.",[F.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[F.UnexpectedToken]:"Unexpected token '${value}'."},Lt=class bi extends Error{constructor({code:t,index:n,line:r,column:a,len:s=0,description:o,data:i}){super(o??t),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=s,this.data=i,this.description=o,this.range={start:{line:r,column:a-1},end:{line:r,column:a+s}},Error.captureStackTrace?.(this,bi)}};function es(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.Program}function _r(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockStatement}function ts(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockComment}function ns(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.EmptyStatement}function rs(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.VariableDeclarator}function En(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function Tr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}var is=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!_r(e)||e.body.length!==0)return;let t=[];for(let n=this._newComments.length-1;n>=0;n--){let r=this._newComments[n];e.range[1]>=r.range[0]&&(t.unshift(r),this._newComments.splice(n,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(_r(e)&&Tr(t,e))for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];Tr(a,e)&&(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1))}let n=[];if(this._newComments.length>0)for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];En(a,t)?(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1)):En(a,e)&&(n.unshift(a),this._newComments.splice(r,1))}t.trailingComments&&En(t.trailingComments[0],e)&&(n=[...n,...t.trailingComments],delete t.trailingComments),n.length>0&&(e.trailingComments=n)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){let a=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=a.range[0]))break;t=a,this._nodeStack.pop()}let n=[],r=[];if(t!=null){if(!t.leadingComments)return;for(let a=t.leadingComments.length-1;a>=0;a--){let s=t.leadingComments[a];e.range[0]>=s.range[1]?(n.unshift(s),t.leadingComments.splice(a,1)):rs(e)&&!ts(s)&&(r.unshift(s),t.leadingComments.splice(a,1))}return t.leadingComments.length===0&&delete t.leadingComments,n.length&&(e.leadingComments=n),void(r.length&&(e.trailingComments=[...r,...e.trailingComments??[]]))}for(let a=this._newComments.length-1;a>=0;a--){let s=this._newComments[a];e.range[0]>=s.range[0]&&(n.unshift(s),this._newComments.splice(a,1))}n.length&&(e.leadingComments=n)}attachComments(e){if(es(e)&&e.body.length>0){let t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}},as=/\$\{(.*?)\}/gu;function jn(e,t){let n=$o[e];return t?n.replace(as,(r,a)=>t[a]?.toString()??""):n}var os=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??(e.description=jn(e.code,e.data)),new Lt(e)}tolerateError(e){e.description??(e.description=jn(e.code,e.data));let t=new Lt(e);if(!this.tolerant)throw t;this.recordError(t)}};function Mr(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}var Nr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},U={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Nr.NonAsciiIdentifierStart.test(U.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Nr.NonAsciiIdentifierPart.test(U.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Rr(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function bn(e){return"01234567".indexOf(e)}var tt=[[],[],[]];Zn.forEach(e=>tt[e.length-1]?.push(e)),Ai.forEach(e=>tt[e.length-1]?.push(e)),Ei.forEach(e=>tt[e.length-1]?.push(e)),Ci.forEach(e=>tt[e.length-1]?.push(e)),Qo.forEach(e=>tt[e.length-1]?.push(e));var ss=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){let t=[],n=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(this.index+=1,U.isLineTerminator(s)){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};let o={multiLine:!1,start:n+e,end:this.index-1,range:[n,this.index-1],loc:r};return t.push(o),s===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}r.end={line:this.lineNumber,column:this.index-this.lineStart};let a={multiLine:!1,start:n+e,end:this.index,range:[n,this.index],loc:r};return t.push(a),t}skipMultiLineComment(){let e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){let a=this.source.charCodeAt(this.index);if(U.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){this.index+=2,n.end={line:this.lineNumber,column:this.index-this.lineStart};let s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:n};return e.push(s),e}this.index+=1}else this.index+=1}n.end={line:this.lineNumber,column:this.index-this.lineStart};let r={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:n};return e.push(r),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(U.isWhiteSpace(t))this.index+=1;else if(U.isLineTerminator(t))this.index+=1,t===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;let n=this.skipSingleLineComment(2);e=[...e,...n]}else{if(t!==42)break;{this.index+=2;let n=this.skipMultiLineComment();e=[...e,...n]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===z.If||e===z.In;case 3:return e===z.Var||e===z.For;case 4:return e===z.Else;case 5:return e===z.Break||e===z.While;case 6:return e===z.Return||e===z.Import||e===z.Export;case 8:return e===z.Function||e===z.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){let n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t}scanHexEscape(e){let t=e==="u"?4:2,n=0;for(let r=0;r1114111||e!=="}")&&this.throwUnexpectedToken(),U.fromCodePoint(t)}getIdentifier(){let e=this.index;for(this.index+=1;!this.eof();){let t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!U.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),n=U.fromCodePoint(t);for(this.index+=n.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n=e);!this.eof()&&(t=this.codePointAt(this.index),U.isIdentifierPart(t));)e=U.fromCodePoint(t),n+=e,this.index+=e.length,t===92&&(n=n.substring(0,n.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n+=e);return n}octalToDecimal(e){let t=e!=="0",n=bn(e);return!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+bn(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+bn(this.source[this.index]??""),this.index+=1)),{code:n,octal:t}}scanIdentifier(){let e,t=this.index,n=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=n.length===1?C.Identifier:this.isKeyword(n)?C.Keyword:n.toLowerCase()===Ht.Null?C.NullLiteral:n.toLowerCase()===Ht.True||n.toLowerCase()===Ht.False?C.BooleanLiteral:C.Identifier,e!==C.Identifier&&t+n.length!==this.index){let r=this.index;this.index=t,this.tolerateUnexpectedToken(F.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){let e=this.index,t=this.source[this.index]??"";switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let n=tt.length;n>0;n--)if(t=this.source.substring(this.index,this.index+n),tt[n-1]?.includes(t)){this.index+=n;break}}return this.index===e&&this.throwUnexpectedToken(),{type:C.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&U.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return t.length===0&&this.throwUnexpectedToken(),U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){let n=this.source[this.index];if(n!=="0"&&n!=="1")break;t+=this.source[this.index],this.index+=1}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){let n=this.source.charCodeAt(this.index);(U.isIdentifierStart(n)||U.isDecimalDigit(n))&&this.throwUnexpectedToken()}return{type:C.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let n="",r=!1;for(U.isOctalDigit(e.charCodeAt(0))&&(r=!0,n=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;return!r&&n.length===0&&this.throwUnexpectedToken(),(U.isIdentifierStart(this.source.charCodeAt(this.index))||U.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(n,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){let e=this.index,t=this.source[e]??"";Mr(U.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let n="";if(t!=="."){if(n=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"",n==="0"){if(t==="x"||t==="X")return this.index+=1,this.scanHexLiteral(e);if(t==="b"||t==="B")return this.index+=1,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="."){for(n+=this.source[this.index],this.index+=1;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="e"||t==="E")if(n+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",(t==="+"||t==="-")&&(n+=this.source[this.index],this.index+=1),U.isDecimalDigit(this.source.charCodeAt(this.index)))for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){let e=this.index,t=this.source[e];Mr(t==="'"||t==='"',"String literal must starts with a quote"),this.index+=1;let n=!1,r="";for(;!this.eof();){let a=this.source[this.index]??"";if(this.index+=1,a===t){t="";break}if(a==="\\")if(a=this.source[this.index]??"",this.index+=1,a&&U.isLineTerminator(a.charCodeAt(0)))this.lineNumber+=1,a==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index;else switch(a){case"u":if(this.source[this.index]==="{")this.index+=1,r+=this.scanUnicodeCodePointEscape();else{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(),r+=s}break;case"x":{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),r+=s;break}case"n":r+=` +`;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=a,this.tolerateUnexpectedToken();break;default:if(a&&U.isOctalDigit(a.charCodeAt(0))){let s=this.octalToDecimal(a);n=s.octal||n,r+=String.fromCharCode(s.code)}else r+=a}else{if(U.isLineTerminator(a.charCodeAt(0)))break;r+=a}}return t!==""&&(this.index=e,this.throwUnexpectedToken()),{type:C.StringLiteral,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1,n=this.index,r=this.source[n]==="`",a=!1,s=2;for(this.index+=1;!this.eof();){let o=this.source[this.index]??"";if(this.index+=1,o==="`"){s=1,a=!0,t=!0;break}if(o!=="$")if(o!=="\\")U.isLineTerminator(o.charCodeAt(0))?(this.lineNumber+=1,o==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index,e+=` +`):e+=o;else if(o=this.source[this.index]??"",this.index+=1,U.isLineTerminator(o.charCodeAt(0)))this.lineNumber+=1,o==="\r"&&this.source[this.index]===` +`&&(this.index+=1),this.lineStart=this.index;else switch(o){case"n":e+=` +`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")this.index+=1,e+=this.scanUnicodeCodePointEscape();else{let i=this.index,u=this.scanHexEscape(o);u!==null?e+=u:(this.index=i,e+=o)}break;case"x":{let i=this.scanHexEscape(o);i===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),e+=i;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:o==="0"?(U.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(F.TemplateOctalLiteral),e+="\0"):U.isOctalDigit(o.charCodeAt(0))?this.throwUnexpectedToken(F.TemplateOctalLiteral):e+=o}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=o}}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:C.Template,value:this.source.slice(n+1,this.index-s),cooked:e,head:r,tail:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}lex(){if(this.eof())return{type:C.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let e=this.source.charCodeAt(this.index);return U.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?U.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():U.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&U.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},ge={None:0,Function:1,IfClause:2,ForLoop:4,WhileLoop:8},vn={AsObject:0,Automatic:1};function Lr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r-=1),{index:e.start,line:r,column:n}}function Pr(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function Or(e){return e in Br?Br[e]:0}var us=class{constructor(e,t={},n){this.delegate=n,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new is),this.errorHandler=new os(this.options.tolerant),this.scanner=new ss(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:ge.None,curlyParsingType:vn.AsObject},this.rawToken={type:C.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:n,invalidTypes:r}){n?.some(a=>e.type===a)||r?.some(a=>e.type===a)&&this.throwError(F.InvalidExpression,t)}throwError(e,t,n=this.endMarker){let{index:r,line:a,column:s}=t,o=n.index-r-1;this.errorHandler.throwError({code:e,index:r,line:a,column:s+1,len:o})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){let t,{rawToken:n}=e,{code:r,data:a}=e;if(n){if(!r)switch(n.type){case C.EOF:r=F.UnexpectedEndOfScript;break;case C.Identifier:r=F.UnexpectedIdentifier;break;case C.NumericLiteral:r=F.UnexpectedNumber;break;case C.StringLiteral:r=F.UnexpectedString;break;case C.Template:r=F.UnexpectedTemplate}t=n.value.toString()}else t="ILLEGAL";r??(r=F.UnexpectedToken),a||(a={value:t});let s=jn(r,a);if(n){let u=n.start,l=n.lineNumber,f=n.start-n.lineStart+1;return new Lt({code:r,index:u,line:l,column:f,len:n.end-n.start-1,data:a,description:s})}let{index:o,line:i}=this.endMarker;return new Lt({code:r,index:o,line:i,column:this.endMarker.column+1,data:a,description:s})}throwUnexpectedToken(e={}){throw e.rawToken??(e.rawToken=this.rawToken),this.unexpectedTokenError(e)}collectComments(e){let{commentHandler:t}=this;!t||!e.length||e.forEach(n=>{let r={type:n.multiLine?A.BlockComment:A.LineComment,value:this.getSourceValue(n),range:n.range,loc:n.loc};t.collectComment(r)})}peekAhead(e){let t=()=>(this.scanner.scanComments(),this.scanner.lex()),n=this.scanner.saveState(),r=e.call(this,t);return this.scanner.restoreState(n),r}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:Yo[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;let e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==C.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){let t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:F.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==C.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==C.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===C.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===C.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===C.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===C.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){let t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let n=e.call(this);return this.context.isAssignmentTarget=t,n}inheritCoverGrammar(e){var t;let n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let r=e.call(this);return(t=this.context).isAssignmentTarget&&(t.isAssignmentTarget=n),r}withBlockContext(e,t){let n=this.context.blockContext;this.context.blockContext|=e;let r=this.context.curlyParsingType;this.context.curlyParsingType=vn.Automatic;let a=t.call(this);return this.context.blockContext=n,this.context.curlyParsingType=r,a}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===C.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.Identifier:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});case C.NumericLiteral:case C.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case C.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value.toLowerCase()===Ht.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.Template:return this.parseTemplateLiteral();case C.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case C.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let e=this.captureStartMarker();this.expectPunctuator("[");let t=[];for(;!this.matchPunctuator("]");){let n=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(F.InvalidExpression,n)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:A.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.StringLiteral:return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case C.Identifier:case C.BooleanLiteral:case C.NullLiteral:case C.Keyword:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(F.KeyMustBeString,e)}}parseObjectProperty(){let e=this.rawToken,t=this.captureStartMarker(),n=this.parseObjectPropertyKey(),r=!1,a=null;return this.matchPunctuator(":")?(this.readNextRawToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===C.Identifier?(r=!0,a=this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:A.Property,kind:"init",key:n,value:a,shorthand:r,...this.getItemLocation(t)})}parseObjectExpression(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:A.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){let t=this.rawToken;t.type!==C.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:F.InvalidTemplateHead,rawToken:t});let n=this.captureStartMarker();this.readNextRawToken();let{value:r,cooked:a,tail:s}=t,o=this.finalize({type:A.TemplateElement,value:{raw:r,cooked:a},tail:s,...this.getItemLocation(n)});return o.loc.start.column+=1,o.loc.end.column-=s?1:2,o}parseTemplateLiteral(){let e=this.captureStartMarker(),t=[],n=[],r=this.parseTemplateElement(!0);for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize({type:A.TemplateLiteral,quasis:n,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");let e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");let e=[];if(!this.matchPunctuator(")"))for(;;){let t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){let e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==C.NullLiteral&&e.type!==C.Identifier&&e.type!==C.Keyword&&e.type!==C.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){let e,t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),r=this.captureStartMarker();for(;e=this.getMatchingPunctuator("([.");)switch(e){case"(":{this.context.isAssignmentTarget=!1,n.type!==A.Identifier&&n.type!==A.MemberExpression&&this.throwError(F.IdentiferExpected,t,r);let a=this.parseArguments();n=this.finalize({type:A.CallExpression,callee:n,arguments:a,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");let a=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),n=this.finalize({type:A.MemberExpression,computed:!0,object:n,property:a,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");let a=this.parseMemberName();n=this.finalize({type:A.MemberExpression,computed:!1,object:n,property:a,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){let e=this.captureStartMarker(),t=this.getMatchingPunctuator(Zn);if(t){this.readNextRawToken();let s=this.captureStartMarker(),o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return o.type!==A.Identifier&&o.type!==A.MemberExpression&&o.type!==A.CallExpression&&this.throwError(F.InvalidExpression,s),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:o,prefix:!0,...this.getItemLocation(e)})}let n=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),a=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(Zn),!t)?r:(r.type!==A.Identifier&&r.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,n,a),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){let e=this.getMatchingPunctuator(Ai);if(e){let t=this.captureStartMarker();this.readNextRawToken();let n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:A.UnaryExpression,operator:e,argument:n,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){let e=this.rawToken,t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==C.Punctuator)return t;let n=this.rawToken.value,r=Or(n);if(r===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;let a=[e,this.rawToken],s=t,o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)),i=[s,n,o],u=[r];for(;this.rawToken.type===C.Punctuator&&(r=Or(this.rawToken.value))>0;){for(;i.length>2&&r<=u[u.length-1];){o=i.pop();let d=i.pop();u.pop(),s=i.pop(),a.pop();let p=a[a.length-1],g=Lr(p,p.lineStart);i.push(this.finalize(this.createBinaryOrLogicalExpression(g,d,s,o)))}i.push(this.rawToken.value),u.push(r),a.push(this.rawToken),this.readNextRawToken(),i.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let l=i.length-1;t=i[l];let f=a.pop();for(;l>1;){let d=a.pop();if(!d)break;let p=f?.lineStart,g=Lr(d,p),y=i[l-1];t=this.finalize(this.createBinaryOrLogicalExpression(g,y,i[l-2],t)),l-=2,f=d}return t}createBinaryOrLogicalExpression(e,t,n,r){let a=Ei.includes(t)?A.LogicalExpression:A.BinaryExpression;return a===A.BinaryExpression||((n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n)),(r.type===A.AssignmentExpression||r.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n))),{type:a,operator:t,left:n,right:r,...this.getItemLocation(e)}}parseAssignmentExpression(){let e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),n=this.captureStartMarker(),r=this.getMatchingPunctuator(Ci);if(!r)return t;t.type!==A.Identifier&&t.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,e,n),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();let a=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:A.AssignmentExpression,left:t,operator:r,right:a,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){let t=[];for(;this.rawToken.type!==C.EOF&&!this.matchPunctuator(e);){let n=this.parseStatementListItem();ns(n)||t.push(n)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(z.Function)?this.parseFunctionDeclaration():this.matchKeyword(z.Export)?this.parseExportDeclaration():this.matchKeyword(z.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:A.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){let e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===vn.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==C.Identifier&&t.type!==C.StringLiteral||(t=e(),t.type!==C.Punctuator||t.value!==":"))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let e=this.rawToken;if(e.type!==C.Identifier)return null;let t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){let e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.IdentiferExpected});let n=null;if(this.matchPunctuator("=")){this.readNextRawToken();let r=this.rawToken;try{n=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:r,code:F.InvalidVariableAssignment})}}return this.finalize({type:A.VariableDeclarator,id:t,init:n,...this.getItemLocation(e)})}parseVariableDeclarationList(){let e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){let e=this.captureStartMarker();this.expectKeyword(z.Var);let t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:A.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){let e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:A.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){let e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(ge.IfClause,this.parseStatement.bind(this))}parseIfStatement(){let e=this.captureStartMarker();this.expectKeyword(z.If),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.parseIfClause(),s=null;return this.matchKeyword(z.Else)&&(this.readNextRawToken(),s=this.parseIfClause()),this.finalize({type:A.IfStatement,test:n,consequent:a,alternate:s,...this.getItemLocation(e)})}parseWhileStatement(){let e=this.captureStartMarker();this.expectKeyword(z.While),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.withBlockContext(ge.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:A.WhileStatement,test:n,body:a,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,n=null,r=null,a=null,s=this.captureStartMarker();if(this.expectKeyword(z.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(z.Var)){let i=this.captureStartMarker();this.readNextRawToken();let u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(z.In)?(u[0].init&&this.throwError(F.ForInOfLoopInitializer,i),r=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.readNextRawToken(),a=this.parseExpression()):(this.matchKeyword(z.In)&&this.throwError(F.InvalidLeftHandSideInForIn,i),e=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.expectPunctuator(";"))}else{let i=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(z.In)?(this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInForIn,u),e.type!==A.Identifier&&this.throwError(F.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),r=e,a=this.parseExpression(),e=null):(this.context.isAssignmentTarget=i,this.expectPunctuator(";"))}r||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(n=this.isolateCoverGrammar(this.parseExpression.bind(this)))),this.expectPunctuator(")");let o=this.withBlockContext(ge.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return r&&a?this.finalize({type:A.ForInStatement,left:r,right:a,body:o,...this.getItemLocation(s)}):this.finalize({type:A.ForStatement,init:e,test:t,update:n,body:o,...this.getItemLocation(s)})}parseContinueStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Continue),this.consumeSemicolon(),this.finalize({type:A.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Break),this.consumeSemicolon(),this.finalize({type:A.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){let e=this.captureStartMarker();this.expectKeyword(z.Return);let t=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===C.EOF)&&this.rawToken.type!==C.StringLiteral&&this.rawToken.type!==C.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case C.BooleanLiteral:case C.NullLiteral:case C.NumericLiteral:case C.StringLiteral:case C.Template:case C.Identifier:return this.parseExpressionStatement();case C.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case C.Keyword:switch(this.rawToken.value.toLowerCase()){case z.Break:return this.parseBreakStatement();case z.Continue:return this.parseContinueStatement();case z.For:return this.parseForStatement();case z.Function:return this.parseFunctionDeclaration();case z.If:return this.parseIfStatement();case z.Return:return this.parseReturnStatement();case z.Var:return this.parseVariableDeclaration();case z.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==C.EOF;){let t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:F.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&ge.Function)===ge.Function&&this.throwUnexpectedToken({code:F.NoFunctionInsideFunction}),((this.context.blockContext&ge.WhileLoop)===ge.WhileLoop||(this.context.blockContext&ge.IfClause)===ge.IfClause)&&this.throwUnexpectedToken({code:F.NoFunctionInsideBlock});let e=this.captureStartMarker();this.expectKeyword(z.Function);let t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.InvalidFunctionIdentifier});let n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=ge.Function;let a=this.parseBlock();return this.context.blockContext=r,this.finalize({type:A.FunctionDeclaration,id:t,params:n,body:a,...this.getItemLocation(e)})}parseScript(){let e=this.captureStartMarker(),t=this.parseStatements(),n=this.finalize({type:A.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(n.tokens=this.tokens),this.options.tolerant&&(n.errors=this.errorHandler.errors),n}parseExportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleExportRootOnly});let e=null,t=this.captureStartMarker();return this.expectKeyword(z.Export),this.matchKeyword(z.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:F.InvalidExpression}),this.finalize({type:A.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){let e=this.captureStartMarker(),t=this.rawToken;if(t.type===C.StringLiteral)return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(F.InvalidModuleUri,e)}parseDefaultSpecifier(){let e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:F.IdentiferExpected}),this.finalize({type:A.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleImportRootOnly});let e=this.captureStartMarker();this.expectKeyword(z.Import);let t=this.parseDefaultSpecifier();this.expectContextualKeyword(z.From);let n=this.parseModuleSpecifier();return this.finalize({type:A.ImportDeclaration,specifiers:[t],source:n,...this.getItemLocation(e)})}};function ls(e,t,n){return new us(e,t,n).parseScript()}function en(e,t=[]){const n=ls(e);if(n.body===null||n.body===void 0)throw new Lt({index:0,line:0,column:0,data:null,description:"",code:F.InvalidExpression});return n.loadedModules={},Ut(n,t),n}class tn{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!t?.length)return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof tn?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const s=this,o=this._keys.length,i=r||0,u=a!==void 0?a:o-1;if(o===0)return s._keys.push(t),s._values.push(n),s;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[u])return this._values.splice(u,0,n),this;if(t>this._keys[u])return this._keys.splice(u+1,0,t),this._values.splice(u+1,0,n),this;if(t=u)return this;const l=i+Math.floor((u-i)/2);return tthis._keys[l]?this.sortedSet(t,n,l+1,u):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new tn(this.entries())}}class Me{constructor(t=20){this._maxEntries=t,this._values=new tn}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class cs{constructor(t=20){this._maxEntries=t,this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}clear(){this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}getCachedLayerMetadata(t){return this._layerMetadata.get(t)}setCachedLayerMetadata(t,n){this._layerMetadata.put(t,n)}removeCachedLayerMetadata(t,n){this._layerMetadata.get(t)===n&&this._layerMetadata.delete(t)}getCachedServiceMetadata(t){return this._serviceMetadata.get(t)}setCachedServiceMetadata(t,n){this._serviceMetadata.put(t,n)}removeCachedServiceMetadata(t,n){this._serviceMetadata.get(t)===n&&this._serviceMetadata.delete(t)}getCachedPortalItem(t,n){return this._portalItems.get(`${n}:${t}`)}setCachedPortalItem(t,n,r){this._portalItems.put(`${n}:${t}`,r)}removeCachedPortalItem(t,n,r){const a=`${n}:${t}`;this._portalItems.get(a)===r&&this._portalItems.delete(a)}getCachedPortalItemLayer(t,n){return this._portalItemLayers.get(`${n}:${t}`)}setCachedPortalItemLayer(t,n,r){this._portalItemLayers.put(`${n}:${t}`,r)}removeCachedPortalItemLayer(t,n,r){const a=`${n}:${t}`;this._portalItemLayers.get(a)===r&&this._portalItemLayers.delete(a)}}class me{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(t.startsWith("portal+")){let i=t.slice(7),u="",l=i,f=!1;for(const g of[r,s,a]){const y=g.exec(i);if(y!==null){const b=y.groups;l=b.itemid,u=b.portalurl,f=!0;break}}if(f===!1){if(!n.test(i))throw new Dn(gn.UnsupportedUriProtocol,{uri:t});l=i,u=this.portalUri}l.includes("/")&&(l=l.split("/")[0]),l.includes("?")&&(l=l.split("?")[0]);let d="current";const p=o.exec(l);if(p!==null){const g=p.groups;l=g.itemid,d=g.versionstring}return i=new Wn({url:u}).restUrl+"/content/items/"+l+"/resources/"+d+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` + export var hello = 1; + export function helloWorld() { + return "Hello World " + hello; + } + `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new Dn(gn.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(s){throw me.cachedModules.removeFromCache(t.uri),s}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ea(t.url,{responseType:"text",query:{}});if(n.data)return en(n.data,[])}if(t.scheme==="mock")return en(t.data??"",[]);throw new Dn(gn.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new cs(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let hs=class extends Xr{constructor(e,t){super(),this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Sn(this.definition,n,t,null)}}call(e,t){return Je(e,t,(n,r,a)=>{const s={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,t);return Sn(this.definition,s,a,t)})}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r)),Kt(Sn(this.definition,i,o,t),n,r)})}},gt=class extends Kn{constructor(e){super(),this.source=e}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=M(this.executingContext,t.node),t.valueset=!0),Y(t.value)&&!(t.value instanceof ft)){const n=new ft;n.fn=t.value,n.parameterEvaluator=Je,n.context=this.executingContext,t.value=n}return t.value}setGlobal(e,t){if(Y(t))throw new h(null,c.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Pt({wkid:102100})),this.moduleScope=Bi({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new on(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??_i,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},er(this.executingContext,this.source.syntax)}};function ds(e,t){const n=[];for(let r=0;r=a.length)throw new h(e,c.OutOfBounds,t);n=m(a[s]),a[s]=t.operator==="++"?n+1:n-1}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidParameter,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);n=m(a.global(s)),a.setGlobal(s,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}const r=$(t.argument);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new h(e,c.InvalidIdentifier,t)}function Ge(e,t,n,r,a){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(a,c.UnsupportedOperator,r)}}function ws(e,t){if(t.left.type==="MemberExpression"){const a=M(e,t.left.object);let s;if(t.left.computed===!0)s=M(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new h(e,c.InvalidIdentifier,t);s=t.left.property.name}const o=M(e,t.right);if(_(a)){if(!W(s))throw new h(e,c.ArrayAccessorMustBeNumber,t);if(s<0&&(s=a.length+s),s<0||s>a.length)throw new h(e,c.OutOfBounds,t);if(s===a.length){if(t.operator!=="=")throw new h(e,c.OutOfBounds,t);a[s]=Ge(o,t.operator,a[s],t,e)}else a[s]=Ge(o,t.operator,a[s],t,e)}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidIdentifier,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);a.setGlobal(s,Ge(o,t.operator,a.global(s),t,e))}return I}const n=$(t.left),r=M(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Ge(r,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},I;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Ge(r,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},I;throw new h(e,c.InvalidIdentifier,t)}function xs(e,t){const n=M(e,t.expression);return n===I?I:new an(n)}function Fs(e,t){const n=M(e,t.test);if(n===!0)return ke(e,t.consequent);if(n===!1)return t.alternate!==null?ke(e,t.alternate):I;throw new h(e,c.BooleanConditionRequired,t)}function er(e,t){let n=I;for(let r=0;r=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(S(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(P(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(e,c.OutOfBounds,t);return n.get(r)}throw new h(e,c.InvalidMemberAccessKey,t)}throw new h(e,c.InvalidMemberAccessKey,t)}catch(n){throw n}}function Is(e,t){try{const n=M(e,t.argument);if(X(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function ks(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return qr(m(n),m(r),t.operator);case"==":return Pe(n,r);case"!=":return!Pe(n,r);case"<":case">":case"<=":case">=":return Wr(n,r,t.operator);case"+":return S(n)||S(r)?E(n)+E(r):m(n)+m(r);case"-":return m(n)-m(r);case"*":return m(n)*m(r);case"/":return m(n)/m(r);case"%":return m(n)%m(r);default:throw new h(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function _s(e,t){try{const n=M(e,t.left);if(X(n))switch(t.operator){case"||":{if(n===!0)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}case"&&":{if(n===!1)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}default:throw new h(e,c.LogicExpressionOrAnd,t)}throw new h(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Ts(e,t,n){if(Y(e))throw new h(t,c.NoFunctionInTemplateLiteral,n);return e}function Ms(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?E(Ts(M(e,t.expressions[r]),e,t)):"",r++);return n}function Si(e,t){try{const n=$(t);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}throw new h(e,c.InvalidIdentifier,t)}catch(n){throw n}}function Ns(e,t){try{if(t.callee.type==="MemberExpression"){const r=M(e,t.callee.object);if(!(r instanceof gt))throw new h(e,c.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:M(e,t.callee.property);if(!r.hasGlobal(a))throw new h(e,c.FunctionNotFound,t);const s=r.global(a);if(!Y(s))throw new h(e,c.CallNonFunction,t);return s.call(e,t)}if(t.callee.type!=="Identifier")throw new h(e,c.FunctionNotFound,t);const n=$(t.callee);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}throw new h(e,c.FunctionNotFound,t)}catch(n){throw n}}const ue={};function Ii(e,t,n,r){try{const a=t.arguments,s=M(e,a[n]);if(Pe(s,r))return M(e,a[n+1]);{const o=a.length-n;return o===1?M(e,a[n]):o===2?null:o===3?M(e,a[n+2]):Ii(e,t,n+2,r)}}catch(a){throw a}}function ki(e,t,n,r){try{const a=t.arguments;if(r===!0)return M(e,a[n+1]);if(a.length-n===3)return M(e,a[n+2]);{const s=M(e,a[n+2]);if(X(s)===!1)throw new h(e,c.BooleanConditionRequired,a[n+2]);return ki(e,t,n+2,s)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new h(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./geometryEngine-CdPoFSE4-B4-kNUBs.js"),__vite__mapDeps([23,2,3,4,5,24,25,26]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-CqF6ldAl.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,15,16,17,18,19,20,21,22]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-CQZFBQdC.js"),__vite__mapDeps([28,2,3,4,5,1,6,7,8,9,10,11,12,13,14,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O-VujoMv3q.js"),__vite__mapDeps([105,6,2,3,4,5,7,1,8,9,10,11,12,13,14,28,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20,15]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-DXn5ZSC9.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,13,14,29,30,16,17,21,18,19,20,22]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-CcErodTx.js"),__vite__mapDeps([107,6,2,3,4,5,7,1,8,9,10,11,12,13,14,30,18,19,20,21,22]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-BueHZdJS.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-D9I5gLfJ.js"),__vite__mapDeps([109,3,4,2,5,1,6,7,8,9,10,11,12,13,14,15,68,69,91,110,111,112,113,18,19,20,21,22]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Lu=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Lu as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; diff --git a/custom-toc-separator/assets/arcadeUtils-DpP0k7IY-idKUZPHi.js b/custom-toc-separator/assets/arcadeUtils-DpP0k7IY-idKUZPHi.js deleted file mode 100644 index af4deba7..00000000 --- a/custom-toc-separator/assets/arcadeUtils-DpP0k7IY-idKUZPHi.js +++ /dev/null @@ -1,182 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geomasync-uGYsifQH-CCOR2qPB.js","./languageUtils-BYxF9hRA-Dxi5SK_d.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./TimeOnly-DSMefxKy-C9JclgbM.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./shared-D1w-26bA-BhDdbtTQ.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./number-eRKYXfX9-DRLtE8-p.js","./Query-BrwMGK8U-gUIs0TS1.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./portalUtils-CKN9iXwH-BVEO1U-S.js","./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js","./workers-PiCjreoO-mU03Z-E4.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./geometryEngine-CdPoFSE4-csWZJ4px.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BcGP1hGu.js","./arcadeAsyncRuntime-B-LnqhTo-PpjtuT4V.js","./featureSetUtils-wd4FcF3A-BowkCysI.js","./SpatialFilter-BlQBFhwz-ZEGVFVLp.js","./WhereClause-DxwoyBMS-D_DBEuLt.js","./MD5-CHHr-oed-SuyrCYQ0.js","./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./Layer-ChoECxvZ-DxWUU3pP.js","./editsZScale-BDsX6vv--D74kwHO-.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./featuresetbase-BDDCCC0O-Y9F7JkCA.js","./featuresetgeom-BftbGgg3-CaOd3Bh1.js","./featuresetstats-CY6YJ8Jt-CrDUFmTe.js","./featuresetstring-DFELZWNA-C0fmjkkW.js","./knowledgegraph-Dt7zfNlJ-Bsl7byUf.js","./project-DQKhruav-BOvaUqEJ.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./Relationship-Db9GUmYx-D5mx9kys.js"])))=>i.map(i=>d[i]); -import{_ as je}from"./main-lj2zzr_L.js";import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,O as jr,P as $i,f as ea}from"./story-OUarUCIt.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{M as da}from"./number-eRKYXfX9-DRLtE8-p.js";import{M as hr}from"./shared-D1w-26bA-BhDdbtTQ.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Er(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` -`,"*"]);let n="";for(let r=0;rr!=="")}function ho(e,t,n){if(W(e))return uo(m(e),t,n);if(S(e))return An(co(e),t,n);if(_(e))return An(e,t,n);if(P(e))return An(e.toArray(),t,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function fo(e,t,n){const r=Nt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function mo(e,t,n){const r=e.getAngle(t);if(t===Z.quadrant&&n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[ht(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,ht(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===Z.quadrant?[ht(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),ht(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function po(e,t){let n="";switch(e){case w.decimal_degrees:n=t===Z.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case w.degrees_minutes_seconds:n=t===Z.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+mi;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return t===Z.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let wo=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const n of e)isNaN(n)?t.push("NaN"):n===1/0?t.push("Infinity"):n===-1/0?t.push("-Infinity"):n===0?t.push("0"):t.push(n.toString(16));this.update(Sr(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Sr(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const n of this._bufs)e.set(n,t),t+=n.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const n=e;let r=t+vr&4294967295,a=0;if(n.length>=16){const o=[t+lt+ct&4294967295,t+ct&4294967295,t+0&4294967295,t-lt&4294967295],i=e,u=i.length-16;let l=0;for(a=0;(4294967280&a)<=u;a+=4){const f=a,d=i[f]+(i[f+1]<<8),p=i[f+2]+(i[f+3]<<8),g=d*ct+(p*ct<<16);let y=o[l]+g&4294967295;y=y<<13|y>>>19;const b=65535&y,x=y>>>16;o[l]=b*lt+(x*lt<<16)&4294967295,l=l+1&3}r=(o[0]<<1|o[0]>>>31)+(o[1]<<7|o[1]>>>25)+(o[2]<<12|o[2]>>>20)+(o[3]<<18|o[3]>>>14)&4294967295}r=r+e.length&4294967295;const s=e.length-4;for(;a<=s;a+=4){const o=a,i=n[o]+(n[o+1]<<8),u=n[o+2]+(n[o+3]<<8);r=r+(i*Jt+(u*Jt<<16))&4294967295,r=r<<17|r>>>15,r=(65535&r)*br+((r>>>16)*br<<16)&4294967295}for(;a>>21,r=(65535&r)*lt+((r>>>16)*lt<<16)&4294967295;return r^=r>>>15,r=((65535&r)*ct&4294967295)+((r>>>16)*ct<<16),r^=r>>>13,r=((65535&r)*Jt&4294967295)+((r>>>16)*Jt<<16),r^=r>>>16,r<0?r+4294967296:r}};function xo(e){return e.loadStatus==="loaded"&&e.user?.sourceJSON?e.user.sourceJSON:null}function Fo(e,t){return!!e&&Yi(e,t?.restUrl||"")}function Ir(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Ee(e,t,n){if(e!==null)if(_(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(P(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(ce(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(Q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(S(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(X(e))t.updateUint8Array([e===!0?1:0,113]);else{if(W(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Qa)throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof Pn)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof v)){if(K(e))throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof V)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Ee(e.spatialReference.wkid,t,n);if(e instanceof le){t.updateIntArray([1266616829]);for(let r=0;r(D(o,1,1,n,r),new Pn(E(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=Jr(o[0]);if(i==="Unrecognized Type")throw new h(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=m(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&E(o[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=E(o[0]);let f="",d=!0;for(let p=0;p(D(o,1,1,n,r),E(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,1,n,r),o.length>0)switch(E(o[0]).toLowerCase()){case"digits":return Ft().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Ft();case"digits-hyphen-braces":return"{"+Ft()+"}";case"digits-hyphen-parentheses":return"("+Ft()+")"}return"{"+Ft()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=E(o[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,E(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,s,o)=>(o.length===0||(o.length===1?n.console(E(o[0])):n.console(E(o))),I))},e.mid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i))return"";if(i=Math.max(0,i),o.length===2)return E(o[0]).slice(i);let u=m(o[2]);return isNaN(u)?"":(u<0&&(u=0),E(o[0]).slice(i,i+u))})},e.find=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=m(N(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return E(o[1]).indexOf(E(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=m(o[1]);return isNaN(i)?"":(i<0&&(i=0),E(o[0]).slice(0,i))})},e.right=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=m(o[1]);return isNaN(i)||i<=0?"":E(o[0]).slice(-i)})},e.split=function(n,r){return t(n,r,(a,s,o)=>{let i;D(o,2,4,n,r);let u=m(N(o[2],-1));const l=Tt(N(o[3],!1));if(u===-1||u===null||l===!0?i=E(o[0]).split(E(o[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=E(o[0]).split(E(o[1]),u)),l===!1)return i;const f=[];for(let d=0;d=u);d++)i[d]!==""&&i[d]!==void 0&&f.push(i[d]);return f})},e.text=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,2,n,r),qe(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,s,o)=>{const i=[];if(o.length<1)return"";if(_(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}if(P(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}for(let u=0;u{if(D(o,1,1,n,r),_(o[0])){const i=o[0].slice();return i.reverse(),i}if(P(o[0])){const i=o[0].toArray().slice();return i.reverse(),i}throw new h(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,s,o)=>{D(o,3,4,n,r);const i=E(o[0]),u=E(o[1]),l=E(o[2]);return o.length!==4||Tt(o[3])?Tn(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,s,o)=>{if(K(o[0])){const i=ra(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0]))return o[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,3,n,r),K(o[0])){const i=ia(o[0],E(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:hr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},B(n)):v.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:hr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return aa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return oa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof v){let i="";for(const u of o[0].keys()){const l=o[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(E(o[0]))})},e.hash=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=new wo(0);return Ee(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,s,o)=>(D(o,3,3,n,r),yo(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),S(o[0])===!1)throw new h(n,c.InvalidParameter,r);return v.convertJsonToArcade(JSON.parse(E(o[0])),B(n))})},e.expects=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);return I})},e.tocharcode=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);const i=o.map(u=>Math.trunc(m(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);let i;try{i=o.map(u=>Math.trunc(m(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,2,n,r);let i=N(o[1],"");if(i=i===!0||i===!1?"":E(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let u=null;if(u=n.services?.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Fo(o[0].field("url"),u)||!u)return null;if(i===""){const l=xo(u);if(l){const f=JSON.parse(JSON.stringify(l));for(const d of["lastLogin","created","modified"])f[d]!==void 0&&f[d]!==null&&(f[d]=new Date(f[d]));return v.convertObjectToArcadeDictionary(f,B(n))}}return null}throw new h(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,s,o)=>(D(o,0,0,n,r),v.convertObjectToArcadeDictionary(sa(B(n),n.spatialReference),B(n),!0)))}}let Ao=class extends Xr{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r));const i=this.call(n,{arguments:o});return $e(i)?i.then(u=>Kt(u,n,r)):i})}};function xe(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function T(e,t){switch(t.type){case"AssignmentExpression":return Io(e,t);case"UpdateExpression":return vo(e,t);case"TemplateLiteral":return Uo(e,t);case"Identifier":return Zo(e,t);case"MemberExpression":return Lo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return jo(e,t);case"UnaryExpression":return Po(e,t);case"BinaryExpression":return zo(e,t);case"LogicalExpression":return Go(e,t);case"ArrayExpression":return Oo(e,t);case"ObjectExpression":return Co(e,t);default:throw new he(e,c.Unrecognized,t)}}function pe(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return No(e,t);case"BlockStatement":return Rt(e,t);case"FunctionDeclaration":return Mo(e,t);case"ImportDeclaration":return _o(e,t);case"ExportNamedDeclaration":return To(e,t);case"ReturnStatement":return Bo(e,t);case"IfStatement":return gi(e,t);case"ExpressionStatement":return ko(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return bo(e,t);case"ForInStatement":return Eo(e,t);case"WhileStatement":return So(e,t);default:throw new he(e,c.Unrecognized,t)}}function Co(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+s+",'ObjectExpression'),lang.aCheck("+T(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Eo(e,t){const n=be(e),r=be(e),a=be(e);let s="var "+n+" = "+T(e,t.right)+`; -`;t.left.type==="VariableDeclaration"&&(s+=pe(e,t.left));const o=$(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);Ae(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let u="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(s+="lang.chkAssig('"+u+`',runtimeCtx); -`),s+="if ("+n+`===null) { lastStatement = lc.voidOperation; } - `,s+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",s+="var "+r+"="+n+`.length; -`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,s+="else if (lc.isImmutableArray("+n+")) {",s+="var "+r+"="+n+`.length(); -`,s+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,s+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",s+="var "+r+"="+n+`.keys(); -`,s+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { -`,s+=i+"="+r+"["+a+`]; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`,e.isAsync&&(s+="else if (lc.isFeatureSet("+n+")) {",s+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); -`,s+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { -`,s+=i+"="+a+`; -`,s+=pe(e,t.body),s+=` -} -`,s+=` lastStatement = lc.voidOperation; -`,s+=` -} -`),s+=`else { lastStatement = lc.voidOperation; } -`,s}function bo(e,t){let n=`lastStatement = lc.voidOperation; -`;t.init!==null&&(t.init.type==="VariableDeclaration"?n+=pe(e,t.init):n+=T(e,t.init)+"; ");const r=be(e),a=be(e);return n+="var "+r+" = true; ",n+=` - do { `,t.update!==null&&(n+=" if ("+r+`===false) { - `+T(e,t.update)+` -} - `+r+`=false; -`),t.test!==null&&(n+="var "+a+" = "+T(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+c.BooleanConditionRequired+`'); } -`),n+=pe(e,t.body),t.update!==null&&(n+=` - `+T(e,t.update)),n+=` -`+r+` = true; -} while(true); lastStatement = lc.voidOperation; `,n}function vo(e,t){if(t.argument.type==="CallExpression")throw new he(e,c.NeverReach,t);let n;if(t.argument.type==="MemberExpression"){const a=T(e,t.argument.object);return t.argument.computed===!0?n=T(e,t.argument.property):(Ae(t.argument.property.name),n="'"+t.argument.property.name+"'"),"lang.memberupdate("+a+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=$(t.argument);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lang.update(lscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[r]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[r]!==void 0)return"lang.update(gscope, '"+r+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[r]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[r]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:_e(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new h(e,c.InvalidIdentifier,t)}function So(e,t){let n=`lastStatement = lc.voidOperation; -`;const r=be(e);return n+=` - var ${r} = true; - do { - ${r} = ${T(e,t.test)}; - if (${r}==false) { - break; - } - if (${r}!==true) { - lang.error('${c.BooleanConditionRequired}'); - } - ${pe(e,t.body)} - } - while (${r} !== false); - lastStatement = lc.voidOperation; - `,n}function Io(e,t){const n=T(e,t.right);if(t.left.type==="MemberExpression"){let a;const s=T(e,t.left.object);return t.left.computed===!0?a=T(e,t.left.property):(a="'"+t.left.property.name+"'",Ae(t.left.property.name)),"lang.assignmember("+s+","+a+",'"+t.operator+"',"+n+")"}const r=$(t.left);if(Ae(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const a={manglename:_e(e),node:t.left};return e.undeclaredGlobalsInFunctions.set(r,a),"gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+a.manglename+"'])"}throw new h(e,c.InvalidIdentifier,t)}function ko(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+T(e,t.expression)+`; - `:"lastStatement = "+T(e,t.expression)+"; "}function kr(e,t){return t.type==="BlockStatement"?pe(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?pe(e,t)+"; ":t.type==="ExpressionStatement"?pe(e,t):pe(e,t)+"; "}function gi(e,t){return`if (lang.mustBoolean(${T(e,t.test)}, runtimeCtx) === true) { - ${kr(e,t.consequent)} - } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+gi(e,t.alternate):` else { - ${kr(e,t.alternate)} - } -`:` else { - lastStatement = lc.voidOperation; - } -`)}function Rt(e,t){let n="";for(let r=0;r0&&(s+=", "),s+=T(e,t.arguments[o]);return s+="]",e.isAsync?"(yield lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx))":"lang.callModuleFunction("+T(e,t.callee.object)+","+s+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new he(e,c.FunctionNotFound,t);const n=$(t.callee);if(n==="iif")return Vo(e,t);if(n==="when")return Wo(e,t);if(n==="defaultvalue")return Jo(e,t);if(n==="decode")return qo(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:_e(e),node:t.callee};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let s=0;s0&&(a+=", "),a+=T(e,t.arguments[s]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new he(e,c.FunctionNotFound,t)}catch(n){throw n}}function Vo(e,t){try{if(t.arguments.length!==3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);return`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - - if (${n} === true) { - return ${T(e,t.arguments[1])}; - } - else if (${n} === false) { - return ${T(e,t.arguments[2])}; - } - else { - lang.error('ExecutionErrorCodes.BooleanConditionRequired'); - } - ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Jo(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e),r=be(e);return t.arguments.length===3?`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - var ${r} = ${T(e,t.arguments[1])}; - ${n} = lang.getNestedOptionalValue(${n}, ${r}); - return ${n} != null && ${n} !== "" ? ${n} : ${T(e,t.arguments[2])}; - ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?`(yield (function() { - return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${n} = ${T(e,t.arguments[0])}; - if (${n} === null) { - return ${T(e,t.arguments[1])}; - } - if (${n} === "") { - return ${T(e,t.arguments[1])}; - } - if (${n} === undefined) { - return ${T(e,t.arguments[1])}; - } - return ${n}; - ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Wo(e,t){try{if(t.arguments.length<3)throw new he(e,c.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new he(e,c.WrongNumberOfParameters,t);const n=be(e);let r="var ";for(let a=0;a{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.decode=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.when=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}},ee.defaultvalue=function(e,t){try{return xe(e,t,(n,r,a)=>{throw new h(e,c.Unrecognized,t)})}catch(n){throw n}};const Dt={};for(const e in ee)Dt[e]=new nt(ee[e]);li(ee,xe);for(const e in ee)ee[e]=new nt(ee[e]);const Yn=function(){};Yn.prototype=ee;const $n=function(){};function yi(e,t,n){const r={_SymbolsMap:{}};e||(e={}),n||(n={}),r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function wi(e,t,n,r){const a=n?new $n:new Yn;e||(e={}),t||(t={});const s=new v({newline:` -`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=s,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const o in t)a[o]=t[o],a._SymbolsMap[o]=1;for(const o in e){const i=e[o];a._SymbolsMap[o]=1,Hr(i)?a[o]=H.createFromGraphic(i,r??null):a[o]=i}return a}$n.prototype=Dt;function rt(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:xe,standardFunctionAsync:xe,evaluateIdentifier:Ho};for(let r=0;r0){if(!n.toLowerCase().startsWith("_t")&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(!n.toLowerCase().startsWith("_t")&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}rt([Rn],"sync"),rt([Rn],"async");let Cn=0;const xi={isNumber:e=>W(e),isArray:e=>_(e),isImmutableArray:e=>P(e),isFeature:e=>K(e),isString:e=>S(e),isDictionary:e=>qn(e),isGeometry:e=>nn(e),geometryMember:(e,t,n,r,a=1)=>mt(e,t,n,r,a),error(e){throw new h(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,s)=>{function o(l){try{u(r.next(l))}catch(f){s(f)}}function i(l){try{u(r.throw(l))}catch(f){s(f)}}function u(l){l.done?a(l.value):l.value?.then?l.value.then(o,i):(Cn++,Cn%100==0?setTimeout(()=>{Cn=0,o(l.value)},0):o(l.value))}u((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new h(null,c.MaximumCallDepth,null);const n=e.apply(this,arguments);return $e(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new h(t,c.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new h(t,c.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>E(e),aCheck(e,t){if(Y(e))throw t==="ArrayExpression"?new h(null,c.NoFunctionInArray,null):t==="ObjectExpression"?new h(null,c.NoFunctionInDictionary,null):new h(null,c.NoFunctionInTemplateLiteral,null);return e===I?null:e},Dictionary:v,Feature:H,UserDefinedCompiledFunction:Ao,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return qr(m(e),m(t),n);case"==":case"=":return Pe(e,t);case"!=":return!Pe(e,t);case"<":case">":case"<=":case">=":return Wr(e,t,n);case"+":return S(e)||S(t)?E(e)+E(t):m(e)+m(t);case"-":return m(e)-m(t);case"*":return m(e)*m(t);case"/":return m(e)/m(t);case"%":return m(e)%m(t);default:throw new h(null,c.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(null,c.UnsupportedOperator,null)}},update(e,t,n,r){const a=m(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:H.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let a;if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new h(null,c.OutOfBounds,null);a=m(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null,{key:t});a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new h(null,c.FieldNotFound,null);a=m(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new h(null,c.ModuleExportNotFound,null);a=m(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(_(e)){if(!W(t))throw new h(null,c.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new h(null,c.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new h(null,c.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof v){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(K(e)){if(S(t)===!1)throw new h(null,c.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new h(null,c.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(P(e))throw new h(null,c.Immutable,null);if(!(e instanceof St))throw new h(null,c.InvalidIdentifier,null);if(S(t)===!1)throw new h(null,c.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new h(null,c.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new h(null,c.MemberOfNull,null);if(e instanceof v||K(e)){if(S(t))return e.field(t);throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof k){if(S(t))return mt(e,t,null,null);throw new h(null,c.InvalidMemberAccessKey,null)}if(_(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(S(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new h(null,c.OutOfBounds,null);return e[t]}throw new h(null,c.InvalidMemberAccessKey,null)}if(P(e)){if(W(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new h(null,c.OutOfBounds,null);return e.get(t)}throw new h(null,c.InvalidMemberAccessKey,null)}if(e instanceof St){if(S(t))return e.global(t);throw new h(null,c.InvalidMemberAccessKey,null)}throw new h(null,c.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof St))throw new h(null,c.FunctionNotFound,null);const a=e.global(n);if(Y(a)===!1)throw new h(null,c.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})},getNestedOptionalValue:(e,t)=>Xn(e,t)};function $t(e){console.log(e)}function Fi(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new on(null,e.loadedModules));const a={isAsync:n,globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let s=Rt(a,e);s===""&&(s="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(g=>{throw new he(t,c.InvalidIdentifier,g.node)});let o="";o=n?`var runtimeCtx=this.prepare(context, true); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; -return lang.__awaiter(this, void 0, void 0, function* () { - - function mainBody() { - var lastStatement=lc.voidOperation; - return lang.__awaiter(this, void 0, void 0, function* () { -`+s+` - return lastStatement; }); } - return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; - function mainBody() { - var lastStatement=lc.voidOperation; - `+s+` - return lastStatement; } - return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-CCOR2qPB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=n?`var runtimeCtx=this.prepare(context, true); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; -return lang.__awaiter(this, void 0, void 0, function* () { - - function mainBody() { - var lastStatement=lc.voidOperation; - return lang.__awaiter(this, void 0, void 0, function* () { -`+a+` - return lastStatement; }); } - yield mainBody(); - return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); - var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; - function mainBody() { - var lastStatement=lc.voidOperation; - `+a+` - return lastStatement; } - mainBody(); - return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,i=r.moduleFactoryMap,u=r.exports,l={};let f;for(f in u)l[f]=r.mangleMap[f]??f;const d={lc:Kr,lang:xi,mangles:r.mangleMap,prepareModule:p=>new St(p),prepare(p,g){let y=p.spatialReference;y==null&&(y=new Pt({wkid:102100}));const b=wi(p.vars,p.customfunctions,g,p.timeZone);return{localStack:[],isAsync:g,exports:u,exportmangle:l,gdefs:{},moduleFactory:o,moduleFactoryMap:i,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:y,globalScope:b,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??$t,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(d)}var Ht={False:"false",Null:"null",True:"true"},z={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},A={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},Zn=["++","--"],Ai=["-","+","!","~"],Ci=["=","/=","*=","%=","+=","-="],Ei=["||","&&"],Qo=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Br={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},C={Unknown:0,BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},Yo=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],F={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},$o={[F.InvalidModuleUri]:"Module uri must be a text literal.",[F.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[F.IdentiferExpected]:"'${value}' is an invalid identifier.",[F.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[F.InvalidExpression]:"Invalid expression.",[F.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[F.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[F.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[F.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[F.InvalidTemplateHead]:"Invalid template structure.",[F.InvalidVariableAssignment]:"Invalid variable assignment.",[F.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[F.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[F.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[F.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[F.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[F.PunctuatorExpected]:"'${value}' expected.",[F.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[F.UnexpectedBoolean]:"Unexpected boolean literal.",[F.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[F.UnexpectedIdentifier]:"Unexpected identifier.",[F.UnexpectedKeyword]:"Unexpected keyword.",[F.UnexpectedNull]:"Unexpected null literal.",[F.UnexpectedNumber]:"Unexpected number.",[F.UnexpectedPunctuator]:"Unexpected ponctuator.",[F.UnexpectedString]:"Unexpected text literal.",[F.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[F.UnexpectedToken]:"Unexpected token '${value}'."},Lt=class bi extends Error{constructor({code:t,index:n,line:r,column:a,len:s=0,description:o,data:i}){super(o??t),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=s,this.data=i,this.description=o,this.range={start:{line:r,column:a-1},end:{line:r,column:a+s}},Error.captureStackTrace?.(this,bi)}};function es(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.Program}function _r(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockStatement}function ts(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.BlockComment}function ns(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.EmptyStatement}function rs(e){return!!e&&typeof e=="object"&&"type"in e&&e.type===A.VariableDeclarator}function En(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function Tr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}var is=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!_r(e)||e.body.length!==0)return;let t=[];for(let n=this._newComments.length-1;n>=0;n--){let r=this._newComments[n];e.range[1]>=r.range[0]&&(t.unshift(r),this._newComments.splice(n,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(_r(e)&&Tr(t,e))for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];Tr(a,e)&&(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1))}let n=[];if(this._newComments.length>0)for(let r=this._newComments.length-1;r>=0;r--){let a=this._newComments[r];En(a,t)?(t.trailingComments=[...t.trailingComments??[],a],this._newComments.splice(r,1)):En(a,e)&&(n.unshift(a),this._newComments.splice(r,1))}t.trailingComments&&En(t.trailingComments[0],e)&&(n=[...n,...t.trailingComments],delete t.trailingComments),n.length>0&&(e.trailingComments=n)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){let a=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=a.range[0]))break;t=a,this._nodeStack.pop()}let n=[],r=[];if(t!=null){if(!t.leadingComments)return;for(let a=t.leadingComments.length-1;a>=0;a--){let s=t.leadingComments[a];e.range[0]>=s.range[1]?(n.unshift(s),t.leadingComments.splice(a,1)):rs(e)&&!ts(s)&&(r.unshift(s),t.leadingComments.splice(a,1))}return t.leadingComments.length===0&&delete t.leadingComments,n.length&&(e.leadingComments=n),void(r.length&&(e.trailingComments=[...r,...e.trailingComments??[]]))}for(let a=this._newComments.length-1;a>=0;a--){let s=this._newComments[a];e.range[0]>=s.range[0]&&(n.unshift(s),this._newComments.splice(a,1))}n.length&&(e.leadingComments=n)}attachComments(e){if(es(e)&&e.body.length>0){let t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}},as=/\$\{(.*?)\}/gu;function jn(e,t){let n=$o[e];return t?n.replace(as,(r,a)=>t[a]?.toString()??""):n}var os=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??(e.description=jn(e.code,e.data)),new Lt(e)}tolerateError(e){e.description??(e.description=jn(e.code,e.data));let t=new Lt(e);if(!this.tolerant)throw t;this.recordError(t)}};function Mr(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}var Nr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},U={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Nr.NonAsciiIdentifierStart.test(U.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Nr.NonAsciiIdentifierPart.test(U.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Rr(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function bn(e){return"01234567".indexOf(e)}var tt=[[],[],[]];Zn.forEach(e=>tt[e.length-1]?.push(e)),Ai.forEach(e=>tt[e.length-1]?.push(e)),Ei.forEach(e=>tt[e.length-1]?.push(e)),Ci.forEach(e=>tt[e.length-1]?.push(e)),Qo.forEach(e=>tt[e.length-1]?.push(e));var ss=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=F.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){let t=[],n=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(this.index+=1,U.isLineTerminator(s)){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};let o={multiLine:!1,start:n+e,end:this.index-1,range:[n,this.index-1],loc:r};return t.push(o),s===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}r.end={line:this.lineNumber,column:this.index-this.lineStart};let a={multiLine:!1,start:n+e,end:this.index,range:[n,this.index],loc:r};return t.push(a),t}skipMultiLineComment(){let e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){let a=this.source.charCodeAt(this.index);if(U.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){this.index+=2,n.end={line:this.lineNumber,column:this.index-this.lineStart};let s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:n};return e.push(s),e}this.index+=1}else this.index+=1}n.end={line:this.lineNumber,column:this.index-this.lineStart};let r={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:n};return e.push(r),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(U.isWhiteSpace(t))this.index+=1;else if(U.isLineTerminator(t))this.index+=1,t===13&&this.source.charCodeAt(this.index)===10&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;let n=this.skipSingleLineComment(2);e=[...e,...n]}else{if(t!==42)break;{this.index+=2;let n=this.skipMultiLineComment();e=[...e,...n]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===z.If||e===z.In;case 3:return e===z.Var||e===z.For;case 4:return e===z.Else;case 5:return e===z.Break||e===z.While;case 6:return e===z.Return||e===z.Import||e===z.Export;case 8:return e===z.Function||e===z.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){let n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t}scanHexEscape(e){let t=e==="u"?4:2,n=0;for(let r=0;r1114111||e!=="}")&&this.throwUnexpectedToken(),U.fromCodePoint(t)}getIdentifier(){let e=this.index;for(this.index+=1;!this.eof();){let t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!U.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),n=U.fromCodePoint(t);for(this.index+=n.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n=e);!this.eof()&&(t=this.codePointAt(this.index),U.isIdentifierPart(t));)e=U.fromCodePoint(t),n+=e,this.index+=e.length,t===92&&(n=n.substring(0,n.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),this.index+=1,this.source[this.index]==="{"?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(e===null||e==="\\"||!U.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),n+=e);return n}octalToDecimal(e){let t=e!=="0",n=bn(e);return!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+bn(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+bn(this.source[this.index]??""),this.index+=1)),{code:n,octal:t}}scanIdentifier(){let e,t=this.index,n=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=n.length===1?C.Identifier:this.isKeyword(n)?C.Keyword:n.toLowerCase()===Ht.Null?C.NullLiteral:n.toLowerCase()===Ht.True||n.toLowerCase()===Ht.False?C.BooleanLiteral:C.Identifier,e!==C.Identifier&&t+n.length!==this.index){let r=this.index;this.index=t,this.tolerateUnexpectedToken(F.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){let e=this.index,t=this.source[this.index]??"";switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let n=tt.length;n>0;n--)if(t=this.source.substring(this.index,this.index+n),tt[n-1]?.includes(t)){this.index+=n;break}}return this.index===e&&this.throwUnexpectedToken(),{type:C.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&U.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return t.length===0&&this.throwUnexpectedToken(),U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){let n=this.source[this.index];if(n!=="0"&&n!=="1")break;t+=this.source[this.index],this.index+=1}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){let n=this.source.charCodeAt(this.index);(U.isIdentifierStart(n)||U.isDecimalDigit(n))&&this.throwUnexpectedToken()}return{type:C.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let n="",r=!1;for(U.isOctalDigit(e.charCodeAt(0))&&(r=!0,n=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&U.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;return!r&&n.length===0&&this.throwUnexpectedToken(),(U.isIdentifierStart(this.source.charCodeAt(this.index))||U.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseInt(n,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){let e=this.index,t=this.source[e]??"";Mr(U.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let n="";if(t!=="."){if(n=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"",n==="0"){if(t==="x"||t==="X")return this.index+=1,this.scanHexLiteral(e);if(t==="b"||t==="B")return this.index+=1,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="."){for(n+=this.source[this.index],this.index+=1;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if(t==="e"||t==="E")if(n+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",(t==="+"||t==="-")&&(n+=this.source[this.index],this.index+=1),U.isDecimalDigit(this.source.charCodeAt(this.index)))for(;U.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return U.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:C.NumericLiteral,value:Number.parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){let e=this.index,t=this.source[e];Mr(t==="'"||t==='"',"String literal must starts with a quote"),this.index+=1;let n=!1,r="";for(;!this.eof();){let a=this.source[this.index]??"";if(this.index+=1,a===t){t="";break}if(a==="\\")if(a=this.source[this.index]??"",this.index+=1,a&&U.isLineTerminator(a.charCodeAt(0)))this.lineNumber+=1,a==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index;else switch(a){case"u":if(this.source[this.index]==="{")this.index+=1,r+=this.scanUnicodeCodePointEscape();else{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(),r+=s}break;case"x":{let s=this.scanHexEscape(a);s===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),r+=s;break}case"n":r+=` -`;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=a,this.tolerateUnexpectedToken();break;default:if(a&&U.isOctalDigit(a.charCodeAt(0))){let s=this.octalToDecimal(a);n=s.octal||n,r+=String.fromCharCode(s.code)}else r+=a}else{if(U.isLineTerminator(a.charCodeAt(0)))break;r+=a}}return t!==""&&(this.index=e,this.throwUnexpectedToken()),{type:C.StringLiteral,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1,n=this.index,r=this.source[n]==="`",a=!1,s=2;for(this.index+=1;!this.eof();){let o=this.source[this.index]??"";if(this.index+=1,o==="`"){s=1,a=!0,t=!0;break}if(o!=="$")if(o!=="\\")U.isLineTerminator(o.charCodeAt(0))?(this.lineNumber+=1,o==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index,e+=` -`):e+=o;else if(o=this.source[this.index]??"",this.index+=1,U.isLineTerminator(o.charCodeAt(0)))this.lineNumber+=1,o==="\r"&&this.source[this.index]===` -`&&(this.index+=1),this.lineStart=this.index;else switch(o){case"n":e+=` -`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")this.index+=1,e+=this.scanUnicodeCodePointEscape();else{let i=this.index,u=this.scanHexEscape(o);u!==null?e+=u:(this.index=i,e+=o)}break;case"x":{let i=this.scanHexEscape(o);i===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),e+=i;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:o==="0"?(U.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(F.TemplateOctalLiteral),e+="\0"):U.isOctalDigit(o.charCodeAt(0))?this.throwUnexpectedToken(F.TemplateOctalLiteral):e+=o}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=o}}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:C.Template,value:this.source.slice(n+1,this.index-s),cooked:e,head:r,tail:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}lex(){if(this.eof())return{type:C.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let e=this.source.charCodeAt(this.index);return U.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?U.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():U.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&U.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},ge={None:0,Function:1,IfClause:2,ForLoop:4,WhileLoop:8},vn={AsObject:0,Automatic:1};function Lr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r-=1),{index:e.start,line:r,column:n}}function Pr(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function Or(e){return e in Br?Br[e]:0}var us=class{constructor(e,t={},n){this.delegate=n,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new is),this.errorHandler=new os(this.options.tolerant),this.scanner=new ss(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:ge.None,curlyParsingType:vn.AsObject},this.rawToken={type:C.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:n,invalidTypes:r}){n?.some(a=>e.type===a)||r?.some(a=>e.type===a)&&this.throwError(F.InvalidExpression,t)}throwError(e,t,n=this.endMarker){let{index:r,line:a,column:s}=t,o=n.index-r-1;this.errorHandler.throwError({code:e,index:r,line:a,column:s+1,len:o})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){let t,{rawToken:n}=e,{code:r,data:a}=e;if(n){if(!r)switch(n.type){case C.EOF:r=F.UnexpectedEndOfScript;break;case C.Identifier:r=F.UnexpectedIdentifier;break;case C.NumericLiteral:r=F.UnexpectedNumber;break;case C.StringLiteral:r=F.UnexpectedString;break;case C.Template:r=F.UnexpectedTemplate}t=n.value.toString()}else t="ILLEGAL";r??(r=F.UnexpectedToken),a||(a={value:t});let s=jn(r,a);if(n){let u=n.start,l=n.lineNumber,f=n.start-n.lineStart+1;return new Lt({code:r,index:u,line:l,column:f,len:n.end-n.start-1,data:a,description:s})}let{index:o,line:i}=this.endMarker;return new Lt({code:r,index:o,line:i,column:this.endMarker.column+1,data:a,description:s})}throwUnexpectedToken(e={}){throw e.rawToken??(e.rawToken=this.rawToken),this.unexpectedTokenError(e)}collectComments(e){let{commentHandler:t}=this;!t||!e.length||e.forEach(n=>{let r={type:n.multiLine?A.BlockComment:A.LineComment,value:this.getSourceValue(n),range:n.range,loc:n.loc};t.collectComment(r)})}peekAhead(e){let t=()=>(this.scanner.scanComments(),this.scanner.lex()),n=this.scanner.saveState(),r=e.call(this,t);return this.scanner.restoreState(n),r}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:Yo[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;let e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==C.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){let t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:F.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==C.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==C.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===C.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===C.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===C.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===C.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){let t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let n=e.call(this);return this.context.isAssignmentTarget=t,n}inheritCoverGrammar(e){var t;let n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;let r=e.call(this);return(t=this.context).isAssignmentTarget&&(t.isAssignmentTarget=n),r}withBlockContext(e,t){let n=this.context.blockContext;this.context.blockContext|=e;let r=this.context.curlyParsingType;this.context.curlyParsingType=vn.Automatic;let a=t.call(this);return this.context.blockContext=n,this.context.curlyParsingType=r,a}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===C.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.Identifier:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});case C.NumericLiteral:case C.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case C.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value.toLowerCase()===Ht.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:A.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case C.Template:return this.parseTemplateLiteral();case C.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case C.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let e=this.captureStartMarker();this.expectPunctuator("[");let t=[];for(;!this.matchPunctuator("]");){let n=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(F.InvalidExpression,n)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:A.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){let e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case C.StringLiteral:return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case C.Identifier:case C.BooleanLiteral:case C.NullLiteral:case C.Keyword:return this.readNextRawToken(),this.finalize({type:A.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(F.KeyMustBeString,e)}}parseObjectProperty(){let e=this.rawToken,t=this.captureStartMarker(),n=this.parseObjectPropertyKey(),r=!1,a=null;return this.matchPunctuator(":")?(this.readNextRawToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===C.Identifier?(r=!0,a=this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:A.Property,kind:"init",key:n,value:a,shorthand:r,...this.getItemLocation(t)})}parseObjectExpression(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:A.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){let t=this.rawToken;t.type!==C.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:F.InvalidTemplateHead,rawToken:t});let n=this.captureStartMarker();this.readNextRawToken();let{value:r,cooked:a,tail:s}=t,o=this.finalize({type:A.TemplateElement,value:{raw:r,cooked:a},tail:s,...this.getItemLocation(n)});return o.loc.start.column+=1,o.loc.end.column-=s?1:2,o}parseTemplateLiteral(){let e=this.captureStartMarker(),t=[],n=[],r=this.parseTemplateElement(!0);for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize({type:A.TemplateLiteral,quasis:n,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");let e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");let e=[];if(!this.matchPunctuator(")"))for(;;){let t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){let e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==C.NullLiteral&&e.type!==C.Identifier&&e.type!==C.Keyword&&e.type!==C.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){let e,t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),r=this.captureStartMarker();for(;e=this.getMatchingPunctuator("([.");)switch(e){case"(":{this.context.isAssignmentTarget=!1,n.type!==A.Identifier&&n.type!==A.MemberExpression&&this.throwError(F.IdentiferExpected,t,r);let a=this.parseArguments();n=this.finalize({type:A.CallExpression,callee:n,arguments:a,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");let a=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),n=this.finalize({type:A.MemberExpression,computed:!0,object:n,property:a,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");let a=this.parseMemberName();n=this.finalize({type:A.MemberExpression,computed:!1,object:n,property:a,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){let e=this.captureStartMarker(),t=this.getMatchingPunctuator(Zn);if(t){this.readNextRawToken();let s=this.captureStartMarker(),o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return o.type!==A.Identifier&&o.type!==A.MemberExpression&&o.type!==A.CallExpression&&this.throwError(F.InvalidExpression,s),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:o,prefix:!0,...this.getItemLocation(e)})}let n=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),a=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(Zn),!t)?r:(r.type!==A.Identifier&&r.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,n,a),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:A.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){let e=this.getMatchingPunctuator(Ai);if(e){let t=this.captureStartMarker();this.readNextRawToken();let n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:A.UnaryExpression,operator:e,argument:n,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){let e=this.rawToken,t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==C.Punctuator)return t;let n=this.rawToken.value,r=Or(n);if(r===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;let a=[e,this.rawToken],s=t,o=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)),i=[s,n,o],u=[r];for(;this.rawToken.type===C.Punctuator&&(r=Or(this.rawToken.value))>0;){for(;i.length>2&&r<=u[u.length-1];){o=i.pop();let d=i.pop();u.pop(),s=i.pop(),a.pop();let p=a[a.length-1],g=Lr(p,p.lineStart);i.push(this.finalize(this.createBinaryOrLogicalExpression(g,d,s,o)))}i.push(this.rawToken.value),u.push(r),a.push(this.rawToken),this.readNextRawToken(),i.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let l=i.length-1;t=i[l];let f=a.pop();for(;l>1;){let d=a.pop();if(!d)break;let p=f?.lineStart,g=Lr(d,p),y=i[l-1];t=this.finalize(this.createBinaryOrLogicalExpression(g,y,i[l-2],t)),l-=2,f=d}return t}createBinaryOrLogicalExpression(e,t,n,r){let a=Ei.includes(t)?A.LogicalExpression:A.BinaryExpression;return a===A.BinaryExpression||((n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n)),(r.type===A.AssignmentExpression||r.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,...Pr(n))),{type:a,operator:t,left:n,right:r,...this.getItemLocation(e)}}parseAssignmentExpression(){let e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),n=this.captureStartMarker(),r=this.getMatchingPunctuator(Ci);if(!r)return t;t.type!==A.Identifier&&t.type!==A.MemberExpression&&this.throwError(F.InvalidExpression,e,n),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();let a=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:A.AssignmentExpression,left:t,operator:r,right:a,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){let t=[];for(;this.rawToken.type!==C.EOF&&!this.matchPunctuator(e);){let n=this.parseStatementListItem();ns(n)||t.push(n)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(z.Function)?this.parseFunctionDeclaration():this.matchKeyword(z.Export)?this.parseExportDeclaration():this.matchKeyword(z.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let e=this.captureStartMarker();this.expectPunctuator("{");let t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:A.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){let e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===vn.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==C.Identifier&&t.type!==C.StringLiteral||(t=e(),t.type!==C.Punctuator||t.value!==":"))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let e=this.rawToken;if(e.type!==C.Identifier)return null;let t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:A.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){let e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.IdentiferExpected});let n=null;if(this.matchPunctuator("=")){this.readNextRawToken();let r=this.rawToken;try{n=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:r,code:F.InvalidVariableAssignment})}}return this.finalize({type:A.VariableDeclarator,id:t,init:n,...this.getItemLocation(e)})}parseVariableDeclarationList(){let e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){let e=this.captureStartMarker();this.expectKeyword(z.Var);let t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:A.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){let e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:A.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){let e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(ge.IfClause,this.parseStatement.bind(this))}parseIfStatement(){let e=this.captureStartMarker();this.expectKeyword(z.If),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.parseIfClause(),s=null;return this.matchKeyword(z.Else)&&(this.readNextRawToken(),s=this.parseIfClause()),this.finalize({type:A.IfStatement,test:n,consequent:a,alternate:s,...this.getItemLocation(e)})}parseWhileStatement(){let e=this.captureStartMarker();this.expectKeyword(z.While),this.expectPunctuator("(");let t=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===A.AssignmentExpression||n.type===A.UpdateExpression)&&this.throwError(F.InvalidExpression,t,r);let a=this.withBlockContext(ge.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:A.WhileStatement,test:n,body:a,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,n=null,r=null,a=null,s=this.captureStartMarker();if(this.expectKeyword(z.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(z.Var)){let i=this.captureStartMarker();this.readNextRawToken();let u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(z.In)?(u[0].init&&this.throwError(F.ForInOfLoopInitializer,i),r=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.readNextRawToken(),a=this.parseExpression()):(this.matchKeyword(z.In)&&this.throwError(F.InvalidLeftHandSideInForIn,i),e=this.finalize({type:A.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(i)}),this.expectPunctuator(";"))}else{let i=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(z.In)?(this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInForIn,u),e.type!==A.Identifier&&this.throwError(F.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),r=e,a=this.parseExpression(),e=null):(this.context.isAssignmentTarget=i,this.expectPunctuator(";"))}r||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(n=this.isolateCoverGrammar(this.parseExpression.bind(this)))),this.expectPunctuator(")");let o=this.withBlockContext(ge.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return r&&a?this.finalize({type:A.ForInStatement,left:r,right:a,body:o,...this.getItemLocation(s)}):this.finalize({type:A.ForStatement,init:e,test:t,update:n,body:o,...this.getItemLocation(s)})}parseContinueStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Continue),this.consumeSemicolon(),this.finalize({type:A.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){let e=this.captureStartMarker();return this.expectKeyword(z.Break),this.consumeSemicolon(),this.finalize({type:A.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){let e=this.captureStartMarker();this.expectKeyword(z.Return);let t=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===C.EOF)&&this.rawToken.type!==C.StringLiteral&&this.rawToken.type!==C.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:A.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case C.BooleanLiteral:case C.NullLiteral:case C.NumericLiteral:case C.StringLiteral:case C.Template:case C.Identifier:return this.parseExpressionStatement();case C.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case C.Keyword:switch(this.rawToken.value.toLowerCase()){case z.Break:return this.parseBreakStatement();case z.Continue:return this.parseContinueStatement();case z.For:return this.parseForStatement();case z.Function:return this.parseFunctionDeclaration();case z.If:return this.parseIfStatement();case z.Return:return this.parseReturnStatement();case z.Var:return this.parseVariableDeclaration();case z.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==C.EOF;){let t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:F.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&ge.Function)===ge.Function&&this.throwUnexpectedToken({code:F.NoFunctionInsideFunction}),((this.context.blockContext&ge.WhileLoop)===ge.WhileLoop||(this.context.blockContext&ge.IfClause)===ge.IfClause)&&this.throwUnexpectedToken({code:F.NoFunctionInsideBlock});let e=this.captureStartMarker();this.expectKeyword(z.Function);let t=this.parseIdentifier();t||this.throwUnexpectedToken({code:F.InvalidFunctionIdentifier});let n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=ge.Function;let a=this.parseBlock();return this.context.blockContext=r,this.finalize({type:A.FunctionDeclaration,id:t,params:n,body:a,...this.getItemLocation(e)})}parseScript(){let e=this.captureStartMarker(),t=this.parseStatements(),n=this.finalize({type:A.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(n.tokens=this.tokens),this.options.tolerant&&(n.errors=this.errorHandler.errors),n}parseExportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleExportRootOnly});let e=null,t=this.captureStartMarker();return this.expectKeyword(z.Export),this.matchKeyword(z.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:F.InvalidExpression}),this.finalize({type:A.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){let e=this.captureStartMarker(),t=this.rawToken;if(t.type===C.StringLiteral)return this.readNextRawToken(),this.finalize({type:A.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(F.InvalidModuleUri,e)}parseDefaultSpecifier(){let e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:F.IdentiferExpected}),this.finalize({type:A.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==ge.None&&this.throwUnexpectedToken({code:F.ModuleImportRootOnly});let e=this.captureStartMarker();this.expectKeyword(z.Import);let t=this.parseDefaultSpecifier();this.expectContextualKeyword(z.From);let n=this.parseModuleSpecifier();return this.finalize({type:A.ImportDeclaration,specifiers:[t],source:n,...this.getItemLocation(e)})}};function ls(e,t,n){return new us(e,t,n).parseScript()}function en(e,t=[]){const n=ls(e);if(n.body===null||n.body===void 0)throw new Lt({index:0,line:0,column:0,data:null,description:"",code:F.InvalidExpression});return n.loadedModules={},Ut(n,t),n}class tn{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!t?.length)return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof tn?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const s=this,o=this._keys.length,i=r||0,u=a!==void 0?a:o-1;if(o===0)return s._keys.push(t),s._values.push(n),s;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[u])return this._values.splice(u,0,n),this;if(t>this._keys[u])return this._keys.splice(u+1,0,t),this._values.splice(u+1,0,n),this;if(t=u)return this;const l=i+Math.floor((u-i)/2);return tthis._keys[l]?this.sortedSet(t,n,l+1,u):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new tn(this.entries())}}class Me{constructor(t=20){this._maxEntries=t,this._values=new tn}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class cs{constructor(t=20){this._maxEntries=t,this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}clear(){this._cache=new Me(this._maxEntries),this._layerMetadata=new Me(this._maxEntries),this._serviceMetadata=new Me(this._maxEntries),this._portalItems=new Me(this._maxEntries),this._portalItemLayers=new Me(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}getCachedLayerMetadata(t){return this._layerMetadata.get(t)}setCachedLayerMetadata(t,n){this._layerMetadata.put(t,n)}removeCachedLayerMetadata(t,n){this._layerMetadata.get(t)===n&&this._layerMetadata.delete(t)}getCachedServiceMetadata(t){return this._serviceMetadata.get(t)}setCachedServiceMetadata(t,n){this._serviceMetadata.put(t,n)}removeCachedServiceMetadata(t,n){this._serviceMetadata.get(t)===n&&this._serviceMetadata.delete(t)}getCachedPortalItem(t,n){return this._portalItems.get(`${n}:${t}`)}setCachedPortalItem(t,n,r){this._portalItems.put(`${n}:${t}`,r)}removeCachedPortalItem(t,n,r){const a=`${n}:${t}`;this._portalItems.get(a)===r&&this._portalItems.delete(a)}getCachedPortalItemLayer(t,n){return this._portalItemLayers.get(`${n}:${t}`)}setCachedPortalItemLayer(t,n,r){this._portalItemLayers.put(`${n}:${t}`,r)}removeCachedPortalItemLayer(t,n,r){const a=`${n}:${t}`;this._portalItemLayers.get(a)===r&&this._portalItemLayers.delete(a)}}class me{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(t.startsWith("portal+")){let i=t.slice(7),u="",l=i,f=!1;for(const g of[r,s,a]){const y=g.exec(i);if(y!==null){const b=y.groups;l=b.itemid,u=b.portalurl,f=!0;break}}if(f===!1){if(!n.test(i))throw new Dn(gn.UnsupportedUriProtocol,{uri:t});l=i,u=this.portalUri}l.includes("/")&&(l=l.split("/")[0]),l.includes("?")&&(l=l.split("?")[0]);let d="current";const p=o.exec(l);if(p!==null){const g=p.groups;l=g.itemid,d=g.versionstring}return i=new Wn({url:u}).restUrl+"/content/items/"+l+"/resources/"+d+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` - export var hello = 1; - export function helloWorld() { - return "Hello World " + hello; - } - `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new Dn(gn.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(s){throw me.cachedModules.removeFromCache(t.uri),s}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ea(t.url,{responseType:"text",query:{}});if(n.data)return en(n.data,[])}if(t.scheme==="mock")return en(t.data??"",[]);throw new Dn(gn.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new cs(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let hs=class extends Xr{constructor(e,t){super(),this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Sn(this.definition,n,t,null)}}call(e,t){return Je(e,t,(n,r,a)=>{const s={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,t);return Sn(this.definition,s,a,t)})}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r)),Kt(Sn(this.definition,i,o,t),n,r)})}},gt=class extends Kn{constructor(e){super(),this.source=e}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=M(this.executingContext,t.node),t.valueset=!0),Y(t.value)&&!(t.value instanceof ft)){const n=new ft;n.fn=t.value,n.parameterEvaluator=Je,n.context=this.executingContext,t.value=n}return t.value}setGlobal(e,t){if(Y(t))throw new h(null,c.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Pt({wkid:102100})),this.moduleScope=Bi({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new on(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??_i,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},er(this.executingContext,this.source.syntax)}};function ds(e,t){const n=[];for(let r=0;r=a.length)throw new h(e,c.OutOfBounds,t);n=m(a[s]),a[s]=t.operator==="++"?n+1:n-1}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidParameter,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);n=m(a.global(s)),a.setGlobal(s,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}const r=$(t.argument);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new h(e,c.InvalidIdentifier,t)}function Ge(e,t,n,r,a){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(a,c.UnsupportedOperator,r)}}function ws(e,t){if(t.left.type==="MemberExpression"){const a=M(e,t.left.object);let s;if(t.left.computed===!0)s=M(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new h(e,c.InvalidIdentifier,t);s=t.left.property.name}const o=M(e,t.right);if(_(a)){if(!W(s))throw new h(e,c.ArrayAccessorMustBeNumber,t);if(s<0&&(s=a.length+s),s<0||s>a.length)throw new h(e,c.OutOfBounds,t);if(s===a.length){if(t.operator!=="=")throw new h(e,c.OutOfBounds,t);a[s]=Ge(o,t.operator,a[s],t,e)}else a[s]=Ge(o,t.operator,a[s],t,e)}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidIdentifier,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);a.setGlobal(s,Ge(o,t.operator,a.global(s),t,e))}return I}const n=$(t.left),r=M(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Ge(r,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},I;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Ge(r,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},I;throw new h(e,c.InvalidIdentifier,t)}function xs(e,t){const n=M(e,t.expression);return n===I?I:new an(n)}function Fs(e,t){const n=M(e,t.test);if(n===!0)return ke(e,t.consequent);if(n===!1)return t.alternate!==null?ke(e,t.alternate):I;throw new h(e,c.BooleanConditionRequired,t)}function er(e,t){let n=I;for(let r=0;r=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(S(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(P(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(e,c.OutOfBounds,t);return n.get(r)}throw new h(e,c.InvalidMemberAccessKey,t)}throw new h(e,c.InvalidMemberAccessKey,t)}catch(n){throw n}}function Is(e,t){try{const n=M(e,t.argument);if(X(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function ks(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return qr(m(n),m(r),t.operator);case"==":return Pe(n,r);case"!=":return!Pe(n,r);case"<":case">":case"<=":case">=":return Wr(n,r,t.operator);case"+":return S(n)||S(r)?E(n)+E(r):m(n)+m(r);case"-":return m(n)-m(r);case"*":return m(n)*m(r);case"/":return m(n)/m(r);case"%":return m(n)%m(r);default:throw new h(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function _s(e,t){try{const n=M(e,t.left);if(X(n))switch(t.operator){case"||":{if(n===!0)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}case"&&":{if(n===!1)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}default:throw new h(e,c.LogicExpressionOrAnd,t)}throw new h(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Ts(e,t,n){if(Y(e))throw new h(t,c.NoFunctionInTemplateLiteral,n);return e}function Ms(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?E(Ts(M(e,t.expressions[r]),e,t)):"",r++);return n}function Si(e,t){try{const n=$(t);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}throw new h(e,c.InvalidIdentifier,t)}catch(n){throw n}}function Ns(e,t){try{if(t.callee.type==="MemberExpression"){const r=M(e,t.callee.object);if(!(r instanceof gt))throw new h(e,c.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:M(e,t.callee.property);if(!r.hasGlobal(a))throw new h(e,c.FunctionNotFound,t);const s=r.global(a);if(!Y(s))throw new h(e,c.CallNonFunction,t);return s.call(e,t)}if(t.callee.type!=="Identifier")throw new h(e,c.FunctionNotFound,t);const n=$(t.callee);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}throw new h(e,c.FunctionNotFound,t)}catch(n){throw n}}const ue={};function Ii(e,t,n,r){try{const a=t.arguments,s=M(e,a[n]);if(Pe(s,r))return M(e,a[n+1]);{const o=a.length-n;return o===1?M(e,a[n]):o===2?null:o===3?M(e,a[n+2]):Ii(e,t,n+2,r)}}catch(a){throw a}}function ki(e,t,n,r){try{const a=t.arguments;if(r===!0)return M(e,a[n+1]);if(a.length-n===3)return M(e,a[n+2]);{const s=M(e,a[n+2]);if(X(s)===!1)throw new h(e,c.BooleanConditionRequired,a[n+2]);return ki(e,t,n+2,s)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new h(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./geometryEngine-CdPoFSE4-csWZJ4px.js"),__vite__mapDeps([23,2,3,4,5,24,25,26]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-PpjtuT4V.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,15,16,17,18,19,20,21,22]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-BowkCysI.js"),__vite__mapDeps([28,2,3,4,5,1,6,7,8,9,10,11,12,13,14,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O-Y9F7JkCA.js"),__vite__mapDeps([105,6,2,3,4,5,7,1,8,9,10,11,12,13,14,28,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20,15]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-CaOd3Bh1.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,13,14,29,30,16,17,21,18,19,20,22]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-CrDUFmTe.js"),__vite__mapDeps([107,6,2,3,4,5,7,1,8,9,10,11,12,13,14,30,18,19,20,21,22]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-C0fmjkkW.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-Bsl7byUf.js"),__vite__mapDeps([109,3,4,2,5,1,6,7,8,9,10,11,12,13,14,15,68,69,91,110,111,112,113,18,19,20,21,22]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Lu=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Lu as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; diff --git a/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js b/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js new file mode 100644 index 00000000..95b9bac4 --- /dev/null +++ b/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js @@ -0,0 +1 @@ +import{a,d3 as m,d4 as o,d5 as c,cS as S,bX as y}from"./story-DT1Ep1ux.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function I(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function b(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=b(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){S(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=y(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,I as b,f as i,x as j,b as m,h as o,U as x}; diff --git a/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js b/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js deleted file mode 100644 index 41487041..00000000 --- a/custom-toc-separator/assets/arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js +++ /dev/null @@ -1 +0,0 @@ -import{a,d3 as m,d4 as o,d5 as c,cS as S,bX as y}from"./story-OUarUCIt.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function I(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function b(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=b(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){S(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=y(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,I as b,f as i,x as j,b as m,h as o,U as x}; diff --git a/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-BtJ2TJ5e.js b/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-BtJ2TJ5e.js new file mode 100644 index 00000000..e10614f6 --- /dev/null +++ b/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-BtJ2TJ5e.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-CcG_XUkW.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./loadAll-e978YItg-EK1YwFYX.js","./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js","./Layer-ChoECxvZ-ocw70508.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./parser-DyDJ-rlI-BVBmjSW8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-DbKLfNnN.js","./commonProperties-BtIqvFU_-BAaMjACd.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./PortalLayer-CElnYuSQ-CcA75vOb.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./fetchService-DbaKmJhP-DL4bBdhv.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./writeUtils-D5qlLkwk-BD0oSm_9.js"])))=>i.map(i=>d[i]); +import{_ as I}from"./main-BTdHgocv.js";import{o as m,gK as g,a as P,gG as v}from"./story-DT1Ep1ux.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";const F={FeatureLayer:!0,SceneLayer:!0};async function A(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-CcG_XUkW.js");return{default:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{A as fromUrl}; diff --git a/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-CvMogBoG.js b/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-CvMogBoG.js deleted file mode 100644 index 544d66b8..00000000 --- a/custom-toc-separator/assets/arcgisLayers-CL8_MH7S-CvMogBoG.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-Dd5UcbJI.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./loadAll-e978YItg-cyBswBq0.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./Layer-ChoECxvZ-DxWUU3pP.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./fetchService-DbaKmJhP-DoSq_UWg.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./writeUtils-D5qlLkwk-BhsnyRJI.js"])))=>i.map(i=>d[i]); -import{_ as I}from"./main-lj2zzr_L.js";import{o as m,gK as g,a as P,gG as v}from"./story-OUarUCIt.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import"./PortalItem-CctGdnxF-DgukgleB.js";const F={FeatureLayer:!0,SceneLayer:!0};async function A(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-Dd5UcbJI.js");return{default:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{A as fromUrl}; diff --git a/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js b/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js new file mode 100644 index 00000000..a9e3bb17 --- /dev/null +++ b/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js @@ -0,0 +1 @@ +import{o as c,r as j,W as u,f,V as D}from"./story-DT1Ep1ux.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import w from"./PortalItem-CctGdnxF-C39Ug2k8.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; diff --git a/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js b/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js deleted file mode 100644 index 44c7fde4..00000000 --- a/custom-toc-separator/assets/associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js +++ /dev/null @@ -1 +0,0 @@ -import{o as c,r as j,W as u,f,V as D}from"./story-OUarUCIt.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import w from"./PortalItem-CctGdnxF-DgukgleB.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; diff --git a/custom-toc-separator/assets/boundedPlane-DlvE0eNx-D5uXMAZI.js b/custom-toc-separator/assets/boundedPlane-DlvE0eNx-D5uXMAZI.js new file mode 100644 index 00000000..ac4eec4a --- /dev/null +++ b/custom-toc-separator/assets/boundedPlane-DlvE0eNx-D5uXMAZI.js @@ -0,0 +1 @@ +import{hZ as w,i8 as E,cf as rt,ha as st,i9 as _,dg as N,a1 as at}from"./story-DT1Ep1ux.js";import{X as O,p as ct}from"./sphere-BenPORjV-B4r28WKg.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-B27FdgMD.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-CJhaINhC.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-CP4TXD5k.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function jt(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),S(e),e}function j(t,n=$()){return Z(t.origin,t.basis1,t.basis2,n)}function St(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function Z(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),S(e),Ct(e,"fromValues()"),e}function S(t){F(t.basis2,t.basis1,t.origin,t.plane)}function U(t,n,i){t!==i&&j(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),U(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&j(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&j(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),S(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:j,copyWithoutVerify:St,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:U,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:Z,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:S,wrap:jt},Symbol.toStringTag,{value:"Module"}));export{j as M,S as N,Wt as R,$ as h,Z as q}; diff --git a/custom-toc-separator/assets/boundedPlane-DlvE0eNx-DGqkTDRl.js b/custom-toc-separator/assets/boundedPlane-DlvE0eNx-DGqkTDRl.js deleted file mode 100644 index 89da5ae5..00000000 --- a/custom-toc-separator/assets/boundedPlane-DlvE0eNx-DGqkTDRl.js +++ /dev/null @@ -1 +0,0 @@ -import{hZ as w,i8 as E,cf as rt,ha as st,i9 as _,dg as N,a1 as at}from"./story-OUarUCIt.js";import{X as O,p as ct}from"./sphere-BenPORjV-CkV41Bdd.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-CznIGfdF.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-DlxNxa6f.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function jt(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),S(e),e}function j(t,n=$()){return Z(t.origin,t.basis1,t.basis2,n)}function St(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function Z(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),S(e),Ct(e,"fromValues()"),e}function S(t){F(t.basis2,t.basis1,t.origin,t.plane)}function U(t,n,i){t!==i&&j(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),U(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&j(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&j(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),S(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:j,copyWithoutVerify:St,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:U,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:Z,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:S,wrap:jt},Symbol.toStringTag,{value:"Module"}));export{j as M,S as N,Wt as R,$ as h,Z as q}; diff --git a/custom-toc-separator/assets/calcite-action-2fclGKoO-DLPue49J.js b/custom-toc-separator/assets/calcite-action-2fclGKoO-DLPue49J.js deleted file mode 100644 index 45979392..00000000 --- a/custom-toc-separator/assets/calcite-action-2fclGKoO-DLPue49J.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,m as t}from"./action-GCQoufcz-Db81jJpr.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-Bw4n2n3w.js";import"./loadable-DbNDKH4r-DyDwqoXd.js";import"./locale-Cn_GDVD_-CnEFMUdd.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-DI6xkvhp.js";import"./icon-BXFbBbop-BKvGneFm.js";import"./loader-Ch7Jr16w-B4sW6aLS.js";const E=o,b=t;export{E as CalciteAction,b as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-action-2fclGKoO-DqFhtAAB.js b/custom-toc-separator/assets/calcite-action-2fclGKoO-DqFhtAAB.js new file mode 100644 index 00000000..e339fbf7 --- /dev/null +++ b/custom-toc-separator/assets/calcite-action-2fclGKoO-DqFhtAAB.js @@ -0,0 +1 @@ +import{f as o,m as t}from"./action-GCQoufcz-CMRVbhl9.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-C3lhdKPd.js";import"./loadable-DbNDKH4r-BTu-x4Jk.js";import"./locale-Cn_GDVD_-Dy9CelfZ.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-BBqL2zVj.js";import"./icon-BXFbBbop-CoY6CcfD.js";import"./loader-Ch7Jr16w-DWxaqSJX.js";const E=o,b=t;export{E as CalciteAction,b as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-96QZwsBg.js b/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-96QZwsBg.js new file mode 100644 index 00000000..911e3404 --- /dev/null +++ b/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-96QZwsBg.js @@ -0,0 +1 @@ +import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-C2Pw5SgP.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{K as j,q as V}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{c as E}from"./observers-BigwqTsw-C0_AGNdr.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{o as g,l as U}from"./action-group-DhwU7QZv-C03omEu_.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-JfgVVBLH.js";import{m as ee}from"./action-GCQoufcz-CMRVbhl9.js";import{m as te}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as oe}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-C3lhdKPd.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const qe=z,Pe=L;export{qe as CalciteActionBar,Pe as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-DaGQpW5M.js b/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-DaGQpW5M.js deleted file mode 100644 index 817e0907..00000000 --- a/custom-toc-separator/assets/calcite-action-bar-ugh74qU5-DaGQpW5M.js +++ /dev/null @@ -1 +0,0 @@ -import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-BJqhnuaV.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as j,q as V}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{c as E}from"./observers-BigwqTsw-BCNzxmob.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{o as g,l as U}from"./action-group-DhwU7QZv-DKlcERk4.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-CadEd7O7.js";import{m as ee}from"./action-GCQoufcz-Db81jJpr.js";import{m as te}from"./icon-BXFbBbop-BKvGneFm.js";import{v as oe}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3-elIRTcW0.js";import"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import"./FloatingArrow-BG9llDYg-ljy-TIYj.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-Bw4n2n3w.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const qe=z,Pe=L;export{qe as CalciteActionBar,Pe as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Cnd8KdSj.js b/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Cnd8KdSj.js deleted file mode 100644 index e61a5551..00000000 --- a/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Cnd8KdSj.js +++ /dev/null @@ -1 +0,0 @@ -import{c as o,l as t}from"./action-group-DhwU7QZv-DKlcERk4.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-BJqhnuaV.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./loadable-DbNDKH4r-DyDwqoXd.js";import"./locale-Cn_GDVD_-CnEFMUdd.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-DI6xkvhp.js";import"./action-menu-DTIJuZNc-CadEd7O7.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-Db81jJpr.js";import"./interactive-DqhNilgd-Bw4n2n3w.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-BKvGneFm.js";import"./loader-Ch7Jr16w-B4sW6aLS.js";import"./floating-ui-DKFFlLv3-elIRTcW0.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import"./FloatingArrow-BG9llDYg-ljy-TIYj.js";const q=o,v=t;export{q as CalciteActionGroup,v as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Y0Ai_24B.js b/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Y0Ai_24B.js new file mode 100644 index 00000000..11393111 --- /dev/null +++ b/custom-toc-separator/assets/calcite-action-group-qlkUfh_o-Y0Ai_24B.js @@ -0,0 +1 @@ +import{c as o,l as t}from"./action-group-DhwU7QZv-C03omEu_.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-C2Pw5SgP.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./loadable-DbNDKH4r-BTu-x4Jk.js";import"./locale-Cn_GDVD_-Dy9CelfZ.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-BBqL2zVj.js";import"./action-menu-DTIJuZNc-JfgVVBLH.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-CMRVbhl9.js";import"./interactive-DqhNilgd-C3lhdKPd.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-CoY6CcfD.js";import"./loader-Ch7Jr16w-DWxaqSJX.js";import"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";const q=o,v=t;export{q as CalciteActionGroup,v as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-button-Cm9_TJei-C4rXHwXx.js b/custom-toc-separator/assets/calcite-button-Cm9_TJei-C4rXHwXx.js new file mode 100644 index 00000000..a3082d6c --- /dev/null +++ b/custom-toc-separator/assets/calcite-button-Cm9_TJei-C4rXHwXx.js @@ -0,0 +1,11 @@ +import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{D as k,V as m,I as x}from"./form-CRSw616T-DM6mxOFq.js";import{l as w,p as y}from"./interactive-DqhNilgd-C3lhdKPd.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{K as T,q as F}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{c as o}from"./observers-BigwqTsw-C0_AGNdr.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as j}from"./loader-Ch7Jr16w-DWxaqSJX.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,N=H,i=b(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=o("mutation",()=>this.updateHasContent()),this.resizeObserver=o("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:t}=this;this.href||(t==="submit"?k(this):t==="reset"&&m(this))},this.setTooltipText=()=>{const{contentEl:t}=this;t&&(this.tooltipText=t.offsetWidth{this.childEl=t,t&&this.resizeObserver?.observe(t)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.download=!1,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){g(this)}onMessagesChange(){}async connectedCallback(){T(this),R(this),this.setupTextContentObserver(),z(this),this.formEl=x(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),C(this),F(this),M(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){S(this),f()&&(this.updateHasContent(),await $(this))}componentDidLoad(){L(this),this.setTooltipText()}componentDidRender(){w(this)}render(){const t=this.href?"a":"button",l=t,s=this.loading?a("div",{class:e.buttonLoader},a("calcite-loader",{class:this.loading?e.loadingIn:e.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,d=a("calcite-icon",{key:"f1036c0a1bf5740fe63806e3559ea66fac29b726",class:{[e.icon]:!0,[e.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:r(this.scale)}),h=a("calcite-icon",{key:"d2c22ecf9ca23426b4c4a3b42d623f35ee988a44",class:{[e.icon]:!0,[e.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:r(this.scale)}),p=a("span",{key:"d1803021f5fa106c9e296402ec0a1498ecdf36c7",class:e.content,ref:u=>this.contentEl=u},a("slot",{key:"d2f729c16f9c803ffa109b68d58a22a4383dd426"}));return a(y,{key:"2757c795d29f812cf11def4df108837b9971dcdb",disabled:this.disabled},a(l,{key:"e67a4882c8a0c13d6b5f98bc8c5b53c10ba36e3e","aria-busy":D(this.loading),"aria-expanded":this.el.ariaExpanded?this.el.ariaExpanded:null,"aria-label":this.loading?this.messages.loading:E(this),"aria-live":"polite",class:{[e.buttonPadding]:n,[e.buttonPaddingShrunk]:!n,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd},disabled:t==="button"?this.disabled:null,download:t==="a"?this.download===!0||this.download===""?"":this.download||null:null,href:t==="a"&&this.href,name:t==="button"&&this.name,onClick:this.handleClick,ref:this.setChildEl,rel:t==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:t==="a"&&this.target,title:this.tooltipText,type:t==="button"&&this.type},s,this.iconStart?d:null,this.hasContent?p:null,this.iconEnd?h:null))}async setFocus(){await O(this),this.childEl?.focus()}effectiveLocaleChange(){A(this,this.effectiveLocale)}updateHasContent(){const t=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:t}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],download:[520],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function c(){typeof customElements>"u"||["calcite-button","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-button":customElements.get(t)||customElements.define(t,i);break;case"calcite-icon":customElements.get(t)||I();break;case"calcite-loader":customElements.get(t)||j();break}})}c();const nt=i,ot=c;export{nt as CalciteButton,ot as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-button-Cm9_TJei-D0EvxauM.js b/custom-toc-separator/assets/calcite-button-Cm9_TJei-D0EvxauM.js deleted file mode 100644 index b5e486d1..00000000 --- a/custom-toc-separator/assets/calcite-button-Cm9_TJei-D0EvxauM.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{D as k,V as m,I as x}from"./form-CRSw616T-DuqBvFSD.js";import{l as w,p as y}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as T,q as F}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{c as o}from"./observers-BigwqTsw-BCNzxmob.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-BKvGneFm.js";import{v as j}from"./loader-Ch7Jr16w-B4sW6aLS.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - 2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,N=H,i=b(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=o("mutation",()=>this.updateHasContent()),this.resizeObserver=o("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:t}=this;this.href||(t==="submit"?k(this):t==="reset"&&m(this))},this.setTooltipText=()=>{const{contentEl:t}=this;t&&(this.tooltipText=t.offsetWidth{this.childEl=t,t&&this.resizeObserver?.observe(t)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.download=!1,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){g(this)}onMessagesChange(){}async connectedCallback(){T(this),R(this),this.setupTextContentObserver(),z(this),this.formEl=x(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),C(this),F(this),M(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){S(this),f()&&(this.updateHasContent(),await $(this))}componentDidLoad(){L(this),this.setTooltipText()}componentDidRender(){w(this)}render(){const t=this.href?"a":"button",l=t,s=this.loading?a("div",{class:e.buttonLoader},a("calcite-loader",{class:this.loading?e.loadingIn:e.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,d=a("calcite-icon",{key:"f1036c0a1bf5740fe63806e3559ea66fac29b726",class:{[e.icon]:!0,[e.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:r(this.scale)}),h=a("calcite-icon",{key:"d2c22ecf9ca23426b4c4a3b42d623f35ee988a44",class:{[e.icon]:!0,[e.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:r(this.scale)}),p=a("span",{key:"d1803021f5fa106c9e296402ec0a1498ecdf36c7",class:e.content,ref:u=>this.contentEl=u},a("slot",{key:"d2f729c16f9c803ffa109b68d58a22a4383dd426"}));return a(y,{key:"2757c795d29f812cf11def4df108837b9971dcdb",disabled:this.disabled},a(l,{key:"e67a4882c8a0c13d6b5f98bc8c5b53c10ba36e3e","aria-busy":D(this.loading),"aria-expanded":this.el.ariaExpanded?this.el.ariaExpanded:null,"aria-label":this.loading?this.messages.loading:E(this),"aria-live":"polite",class:{[e.buttonPadding]:n,[e.buttonPaddingShrunk]:!n,[e.contentSlotted]:this.hasContent,[e.iconStartEmpty]:!this.iconStart,[e.iconEndEmpty]:!this.iconEnd},disabled:t==="button"?this.disabled:null,download:t==="a"?this.download===!0||this.download===""?"":this.download||null:null,href:t==="a"&&this.href,name:t==="button"&&this.name,onClick:this.handleClick,ref:this.setChildEl,rel:t==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:t==="a"&&this.target,title:this.tooltipText,type:t==="button"&&this.type},s,this.iconStart?d:null,this.hasContent?p:null,this.iconEnd?h:null))}async setFocus(){await O(this),this.childEl?.focus()}effectiveLocaleChange(){A(this,this.effectiveLocale)}updateHasContent(){const t=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:t}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],download:[520],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function c(){typeof customElements>"u"||["calcite-button","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-button":customElements.get(t)||customElements.define(t,i);break;case"calcite-icon":customElements.get(t)||I();break;case"calcite-loader":customElements.get(t)||j();break}})}c();const nt=i,ot=c;export{nt as CalciteButton,ot as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-chip-DE_c-1hr-Do6ZMXLv.js b/custom-toc-separator/assets/calcite-chip-DE_c-1hr-Do6ZMXLv.js new file mode 100644 index 00000000..3cf3ec86 --- /dev/null +++ b/custom-toc-separator/assets/calcite-chip-DE_c-1hr-Do6ZMXLv.js @@ -0,0 +1,21 @@ +import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{l as S,p as I}from"./interactive-DqhNilgd-C3lhdKPd.js";import{K as w,q as M}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-CoY6CcfD.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-C0_AGNdr.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:0}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, 1.5rem);inline-size:var(--calcite-internal-chip-image-size, 1.5rem);padding-inline-start:0;padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, 0.375rem)}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:0.5;color:var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, 1.5rem);inline-size:var(--calcite-internal-chip-icon-size, 1.5rem)}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0px;cursor:pointer;align-items:center;border-radius:50%;border-style:none;outline-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-internal-chip-close-icon-color, var(--calcite-color-text-1))));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,K=L,l=p(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteChipClose=c(this,"calciteChipClose",6),this.calciteChipSelect=c(this,"calciteChipSelect",6),this.calciteInternalChipKeyEvent=c(this,"calciteInternalChipKeyEvent",6),this.calciteInternalChipSelect=c(this,"calciteInternalChipSelect",6),this.calciteInternalSyncSelectedChips=c(this,"calciteInternalSyncSelectedChips",6),this.handleDefaultSlotChange=()=>{this.updateHasText()},this.close=()=>{this.calciteChipClose.emit(),this.selected=!1,this.closed=!0},this.closeButtonKeyDownHandler=e=>{E(e.key)&&(e.preventDefault(),this.close())},this.handleSlotImageChange=e=>{this.hasImage=g(e)},this.handleEmittingEvent=()=>{this.interactive&&this.calciteChipSelect.emit()},this.disabled=!1,this.appearance="solid",this.kind="neutral",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.label=void 0,this.value=void 0,this.closed=!1,this.selectionMode="none",this.selected=!1,this.messageOverrides=void 0,this.messages=void 0,this.interactive=!1,this.parentChipGroup=void 0,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1,this.hasImage=!1}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}onMessagesChange(){}effectiveLocaleChange(){k(this,this.effectiveLocale)}connectedCallback(){w(this),y(this)}componentDidLoad(){b(this),this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}componentDidRender(){S(this)}disconnectedCallback(){M(this),C(this)}async componentWillLoad(){x(this),m()&&(await z(this),this.updateHasText())}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&this.closeButtonEl.focus()}async setFocus(){await f(this),!this.disabled&&this.interactive?this.containerEl?.focus():!this.disabled&&this.closable&&this.closeButtonEl?.focus()}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return i("div",{class:t.imageContainer},i("slot",{name:H.image,onSlotchange:this.handleSlotImageChange}))}renderSelectionIcon(){const e=this.selectionMode==="multiple"?this.selected?a.checkedMultiple:a.uncheckedMultiple:this.selected?a.checkedSingle:void 0;return i("div",{class:{[t.selectIcon]:!0,[t.selectIconActive]:this.selectionMode==="multiple"||this.selected}},e?i("calcite-icon",{icon:e,scale:n(this.scale)}):null)}renderCloseButton(){return i("button",{"aria-label":this.messages.dismissLabel,class:t.close,onClick:this.close,onKeyDown:this.closeButtonKeyDownHandler,ref:e=>this.closeButtonEl=e,tabIndex:this.disabled?-1:0},i("calcite-icon",{icon:a.close,scale:n(this.scale)}))}renderIcon(){return i("calcite-icon",{class:t.chipIcon,flipRtl:this.iconFlipRtl,icon:this.icon,scale:n(this.scale)})}render(){const{disabled:e}=this,o=e||!e&&!this.interactive,r=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":void 0;return i(v,{key:"7feca8bad37627baabfc4abd25cf135e1e9f196b"},i(I,{key:"af2360b4b768ae8c643d52f4bdb9f5d282504114",disabled:e},i("div",{key:"8d905c4ab20d271a211282b95ebcb2d305d76cb7","aria-checked":this.selectionMode!=="none"&&this.interactive?u(this.selected):void 0,"aria-label":this.label,class:{[t.container]:!0,[t.textSlotted]:this.hasText,[t.imageSlotted]:this.hasImage,[t.selectable]:this.selectionMode!=="none",[t.multiple]:this.selectionMode==="multiple",[t.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[t.selected]:this.selected,[t.closable]:this.closable,[t.nonInteractive]:!this.interactive,[t.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)},onClick:this.handleEmittingEvent,ref:h=>this.containerEl=h,role:r,tabIndex:o?-1:0},this.selectionMode!=="none"&&this.renderSelectionIcon(),this.renderChipImage(),this.icon&&this.renderIcon(),i("span",{key:"dab6eae3f8330b85ffac4c7fe1b2fcbb53327196",class:t.title},i("slot",{key:"72ba5bd0c7a97c30f766da119f419261aab24acb",onSlotchange:this.handleDefaultSlotChange})),this.closable&&this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return K}},[1,"calcite-chip",{disabled:[516],appearance:[513],kind:[513],closable:[516],icon:[513],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],label:[1],value:[8],closed:[1540],selectionMode:[1,"selection-mode"],selected:[1540],messageOverrides:[1040],messages:[1040],interactive:[4],parentChipGroup:[16],defaultMessages:[32],effectiveLocale:[32],hasText:[32],hasImage:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[0,"click","clickHandler"]],{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function s(){typeof customElements>"u"||["calcite-chip","calcite-icon"].forEach(e=>{switch(e){case"calcite-chip":customElements.get(e)||customElements.define(e,l);break;case"calcite-icon":customElements.get(e)||D();break}})}s();const J=l,N=s;export{J as CalciteChip,N as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-chip-DE_c-1hr-FcnmBI6s.js b/custom-toc-separator/assets/calcite-chip-DE_c-1hr-FcnmBI6s.js deleted file mode 100644 index 9d2af110..00000000 --- a/custom-toc-separator/assets/calcite-chip-DE_c-1hr-FcnmBI6s.js +++ /dev/null @@ -1,21 +0,0 @@ -import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{l as S,p as I}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{K as w,q as M}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-BKvGneFm.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BCNzxmob.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - 2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.container:not(.text--slotted) .title,.container:not(.image--slotted) .image-container{display:none}.container.is-circle .chip-icon,.container.is-circle .image-container{padding:0}.title{padding-inline:var(--calcite-internal-chip-title-space)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none;block-size:var(--calcite-internal-chip-image-size, 1.5rem);inline-size:var(--calcite-internal-chip-image-size, 1.5rem);padding-inline-start:0;padding-inline-end:var(--calcite-internal-chip-image-space-x-end, 0)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-chip-icon-color, var(--calcite-chip-text-color, var(--calcite-icon-color, currentColor)));padding-inline:var(--calcite-internal-chip-icon-space, 0.375rem)}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:absolute;visibility:hidden;inline-size:auto;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out;color:var(--calcite-chip-select-icon-color, currentColor)}.select-icon.select-icon--active{position:relative;visibility:visible;opacity:0.5;color:var(--calcite-chip-select-icon-color-pressed, var(--calcite-chip-select-icon-color, currentColor))}.multiple .select-icon{display:flex;align-items:center;justify-content:center}.multiple .select-icon,.single .select-icon--active{padding-inline-start:var(--calcite-internal-chip-select-space-x-start);padding-inline-end:var(--calcite-internal-chip-select-space-x-end);block-size:var(--calcite-internal-chip-icon-size, 1.5rem);inline-size:var(--calcite-internal-chip-icon-size, 1.5rem)}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}.close{margin:0px;cursor:pointer;align-items:center;border-radius:50%;border-style:none;outline-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;background-color:var(--calcite-close-background-color, var(--calcite-color-transparent));-webkit-appearance:none;display:flex;align-content:center;justify-content:center;color:var(--calcite-chip-close-icon-color, var(--calcite-close-icon-color, var(--calcite-internal-chip-close-icon-color, var(--calcite-color-text-1))));block-size:var(--calcite-internal-close-size, 1.5rem);inline-size:var(--calcite-internal-close-size, 1.5rem);padding:0}.close:hover,.close:focus{background-color:var(--calcite-close-background-color-hover, var(--calcite-color-transparent-hover))}.close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.close:active{background-color:var(--calcite-close-background-color-press, var(--calcite-color-transparent-press))}.close calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,K=L,l=p(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteChipClose=c(this,"calciteChipClose",6),this.calciteChipSelect=c(this,"calciteChipSelect",6),this.calciteInternalChipKeyEvent=c(this,"calciteInternalChipKeyEvent",6),this.calciteInternalChipSelect=c(this,"calciteInternalChipSelect",6),this.calciteInternalSyncSelectedChips=c(this,"calciteInternalSyncSelectedChips",6),this.handleDefaultSlotChange=()=>{this.updateHasText()},this.close=()=>{this.calciteChipClose.emit(),this.selected=!1,this.closed=!0},this.closeButtonKeyDownHandler=e=>{E(e.key)&&(e.preventDefault(),this.close())},this.handleSlotImageChange=e=>{this.hasImage=g(e)},this.handleEmittingEvent=()=>{this.interactive&&this.calciteChipSelect.emit()},this.disabled=!1,this.appearance="solid",this.kind="neutral",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.label=void 0,this.value=void 0,this.closed=!1,this.selectionMode="none",this.selected=!1,this.messageOverrides=void 0,this.messages=void 0,this.interactive=!1,this.parentChipGroup=void 0,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1,this.hasImage=!1}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}onMessagesChange(){}effectiveLocaleChange(){k(this,this.effectiveLocale)}connectedCallback(){w(this),y(this)}componentDidLoad(){b(this),this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}componentDidRender(){S(this)}disconnectedCallback(){M(this),C(this)}async componentWillLoad(){x(this),m()&&(await z(this),this.updateHasText())}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&this.closeButtonEl.focus()}async setFocus(){await f(this),!this.disabled&&this.interactive?this.containerEl?.focus():!this.disabled&&this.closable&&this.closeButtonEl?.focus()}updateHasText(){this.hasText=this.el.textContent.trim().length>0}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedChips.emit(),!this.parentChipGroup.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalChipSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedChips.emit()}renderChipImage(){return i("div",{class:t.imageContainer},i("slot",{name:H.image,onSlotchange:this.handleSlotImageChange}))}renderSelectionIcon(){const e=this.selectionMode==="multiple"?this.selected?a.checkedMultiple:a.uncheckedMultiple:this.selected?a.checkedSingle:void 0;return i("div",{class:{[t.selectIcon]:!0,[t.selectIconActive]:this.selectionMode==="multiple"||this.selected}},e?i("calcite-icon",{icon:e,scale:n(this.scale)}):null)}renderCloseButton(){return i("button",{"aria-label":this.messages.dismissLabel,class:t.close,onClick:this.close,onKeyDown:this.closeButtonKeyDownHandler,ref:e=>this.closeButtonEl=e,tabIndex:this.disabled?-1:0},i("calcite-icon",{icon:a.close,scale:n(this.scale)}))}renderIcon(){return i("calcite-icon",{class:t.chipIcon,flipRtl:this.iconFlipRtl,icon:this.icon,scale:n(this.scale)})}render(){const{disabled:e}=this,o=e||!e&&!this.interactive,r=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":void 0;return i(v,{key:"7feca8bad37627baabfc4abd25cf135e1e9f196b"},i(I,{key:"af2360b4b768ae8c643d52f4bdb9f5d282504114",disabled:e},i("div",{key:"8d905c4ab20d271a211282b95ebcb2d305d76cb7","aria-checked":this.selectionMode!=="none"&&this.interactive?u(this.selected):void 0,"aria-label":this.label,class:{[t.container]:!0,[t.textSlotted]:this.hasText,[t.imageSlotted]:this.hasImage,[t.selectable]:this.selectionMode!=="none",[t.multiple]:this.selectionMode==="multiple",[t.single]:this.selectionMode==="single"||this.selectionMode==="single-persist",[t.selected]:this.selected,[t.closable]:this.closable,[t.nonInteractive]:!this.interactive,[t.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)},onClick:this.handleEmittingEvent,ref:h=>this.containerEl=h,role:r,tabIndex:o?-1:0},this.selectionMode!=="none"&&this.renderSelectionIcon(),this.renderChipImage(),this.icon&&this.renderIcon(),i("span",{key:"dab6eae3f8330b85ffac4c7fe1b2fcbb53327196",class:t.title},i("slot",{key:"72ba5bd0c7a97c30f766da119f419261aab24acb",onSlotchange:this.handleDefaultSlotChange})),this.closable&&this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return K}},[1,"calcite-chip",{disabled:[516],appearance:[513],kind:[513],closable:[516],icon:[513],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],label:[1],value:[8],closed:[1540],selectionMode:[1,"selection-mode"],selected:[1540],messageOverrides:[1040],messages:[1040],interactive:[4],parentChipGroup:[16],defaultMessages:[32],effectiveLocale:[32],hasText:[32],hasImage:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[0,"click","clickHandler"]],{selected:["watchSelected"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function s(){typeof customElements>"u"||["calcite-chip","calcite-icon"].forEach(e=>{switch(e){case"calcite-chip":customElements.get(e)||customElements.define(e,l);break;case"calcite-icon":customElements.get(e)||D();break}})}s();const J=l,N=s;export{J as CalciteChip,N as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dialog-DAngwHC1-CTBZGPoU.js b/custom-toc-separator/assets/calcite-dialog-DAngwHC1-CTBZGPoU.js deleted file mode 100644 index 247245ea..00000000 --- a/custom-toc-separator/assets/calcite-dialog-DAngwHC1-CTBZGPoU.js +++ /dev/null @@ -1,6 +0,0 @@ -import{p as Ni,b as Ji,W as Ot,a as C,D as Qi}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as Zi,g as tr}from"./dom-N58V0tYi-DBU3jlah.js";import{g as er,H as _n,E as nr,j as ir,K as rr,O as or}from"./action-menu-DTIJuZNc-CadEd7O7.js";import{o as ar,r as sr,f as cr}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{c as lr}from"./observers-BigwqTsw-BCNzxmob.js";import{p as ur}from"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import{K as pr,q as dr}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{h as fr,d as hr,M as vr,l as gr}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{o as mr}from"./component-CWGf1hug-BASJpoEG.js";import{s as V,y as yr}from"./panel-DRUEhsxp-DE_ZqRVb.js";import{m as br}from"./action-GCQoufcz-Db81jJpr.js";import{m as xr}from"./icon-BXFbBbop-BKvGneFm.js";import{v as wr}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{c as Er}from"./scrim-BscQh4v9-DzezRv_f.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./floating-ui-DKFFlLv3-elIRTcW0.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./FloatingArrow-BG9llDYg-ljy-TIYj.js";import"./interactive-DqhNilgd-Bw4n2n3w.js";var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},An={exports:{}};(function(y,A){(function(O,M){y.exports=M()})(kr,function(){function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];nthis.handleMutationObserver()),this.handleKeyDown=y=>{const{key:A,shiftKey:O,defaultPrevented:M}=y,{dragEnabled:I,resizable:D,resizePosition:j,dragPosition:P,transitionEl:W}=this;if(!(M||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(A)))switch(A){case"ArrowUp":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height-st,type:"blockSize"}),j.bottom-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowDown":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height+st,type:"blockSize"}),j.bottom+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowLeft":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width-st,type:"inlineSize"}),j.right-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowRight":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width+st,type:"inlineSize"}),j.right+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break}},this.setTransitionEl=y=>{this.transitionEl=y,this.setupInteractions()},this.openEnd=()=>{this.setFocus(),this.el.removeEventListener("calciteDialogOpen",this.openEnd)},this.handleInternalPanelScroll=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.calciteDialogScroll.emit())},this.handleInternalPanelCloseClick=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.open=!1)},this.handlePanelKeyDown=y=>{this.escapeDisabled&&y.key==="Escape"&&y.preventDefault()},this.handleOutsideClose=()=>{this.outsideCloseDisabled||(this.open=!1)},this.closeDialog=async()=>{if(this.beforeClose)try{await this.beforeClose()}catch{requestAnimationFrame(()=>{this.ignoreOpenChange=!0,this.open=!0,this.ignoreOpenChange=!1});return}ze--,this.opened=!1,this.updateOverflowHiddenClass()},this.updateOverflowHiddenClass=()=>{this.opened&&!this.embedded&&this.modal?this.addOverflowHiddenClass():this.removeOverflowHiddenClass()},this.handleMutationObserver=()=>{this.updateFocusTrapElements()},this.beforeClose=void 0,this.description=void 0,this.dragEnabled=!1,this.closeDisabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.heading=void 0,this.headingLevel=void 0,this.kind=void 0,this.loading=!1,this.menuOpen=!1,this.messages=void 0,this.messageOverrides=void 0,this.modal=!1,this.open=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.widthScale="m",this.opened=!1,this.hasFooter=!0,this.hasContentTop=!1,this.hasContentBottom=!1,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.assistiveText=null}onMessagesChange(){}onModalChange(){this.updateOverflowHiddenClass()}async componentWillLoad(){await fr(this),ar(this),this.open&&this.openDialog()}componentDidLoad(){sr(this)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),pr(this),hr(this),er(this),this.setupInteractions()}disconnectedCallback(){this.removeOverflowHiddenClass(),this.mutationObserver?.disconnect(),_n(this),dr(this),vr(this),this.embedded=!1,this.cleanupInteractions()}render(){const{assistiveText:y,description:A,heading:O,opened:M}=this;return C(Qi,{key:"bf406255eaa6d94c8443af185a74a2b2d58c6d59"},C("div",{key:"de2a34b6da4a82c66e9fafdbdd2056e4e11e1315",class:{[at.container]:!0,[at.containerOpen]:M,[at.containerEmbedded]:this.embedded}},this.modal?C("calcite-scrim",{class:at.scrim,onClick:this.handleOutsideClose}):null,C("div",{key:"be47093e3a955ce45a71c555700143a4a1c7a166","aria-description":A,"aria-label":O,"aria-modal":Zi(this.modal),class:at.dialog,onKeyDown:this.handleKeyDown,ref:this.setTransitionEl,role:"dialog"},y?C("div",{"aria-live":"polite",class:at.assistiveText,key:"assistive-text"},y):null,C("slot",{key:"6ed9f10ae7d5ecc1ec9062d6aba559001d5194e6",name:H.content},C("calcite-panel",{key:"cd6ebaa7d7362cbeb70e9ae623f38298d1e831e3",beforeClose:this.beforeClose,class:at.panel,closable:!this.closeDisabled,closed:!M,description:A,heading:O,headingLevel:this.headingLevel,loading:this.loading,menuOpen:this.menuOpen,messageOverrides:this.messageOverrides,onCalcitePanelClose:this.handleInternalPanelCloseClick,onCalcitePanelScroll:this.handleInternalPanelScroll,onKeyDown:this.handlePanelKeyDown,overlayPositioning:this.overlayPositioning,ref:I=>this.panelEl=I,scale:this.scale},C("slot",{key:"2ce955775c33b09fc849a083d0bcc1c8ce523dd8",name:H.actionBar,slot:V.actionBar}),C("slot",{key:"dd44184de251320af6225baa2e59571b881a23cd",name:H.alerts,slot:V.alerts}),C("slot",{key:"da343a1a10e015b04b37463c10592e612a576e9b",name:H.headerActionsStart,slot:V.headerActionsStart}),C("slot",{key:"6680fde2bd7ad6dc5803c78ea7250d11d4920b7c",name:H.headerActionsEnd,slot:V.headerActionsEnd}),C("slot",{key:"a17ca64188ffe6000792e67eafc838df575ebbc3",name:H.headerContent,slot:V.headerContent}),C("slot",{key:"7e048c4a9104053ca0a61ab2514b018efb4fc872",name:H.headerMenuActions,slot:V.headerMenuActions}),C("slot",{key:"6760c8a6c105a511fcb859cfd222f8c1355a82c4",name:H.fab,slot:V.fab}),C("slot",{key:"e0f2e7644281d408d8c21ce5bf16b08af0a59c3b",name:H.contentTop,slot:V.contentTop}),C("slot",{key:"01889c3b7fc13bc49521c27feb2ab35346552504",name:H.contentBottom,slot:V.contentBottom}),C("slot",{key:"593bad35110b5d7e7b44d598b397e4b87cc28e28",name:H.footerStart,slot:V.footerStart}),C("slot",{key:"5e84099e096a6afb678cce9731b189f4011dc067",name:H.footer,slot:V.footer}),C("slot",{key:"69a805bd0c1f43a6d165939e62db562428f39f11",name:H.footerEnd,slot:V.footerEnd}),C("slot",{key:"b49e14ff6d2c63caaa8fd296920618e7673eb71b"}))))))}effectiveLocaleChange(){gr(this,this.effectiveLocale)}handleInteractionChange(){this.setupInteractions()}updateAssistiveText(){const{messages:y}=this;this.assistiveText=y&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?y.dragEnabled:""} ${this.resizable?y.resizeEnabled:""}`:null}handleEscape(y){this.open&&!this.escapeDisabled&&y.key==="Escape"&&!y.defaultPrevented&&(this.open=!1,y.preventDefault())}async setFocus(){return await cr(this),this.panelEl?.setFocus()??tr(this.el)}async updateFocusTrapElements(){nr(this)}async scrollContentTo(y){await this.panelEl?.scrollContentTo(y)}onBeforeOpen(){this.calciteDialogBeforeOpen.emit()}onOpen(){this.calciteDialogOpen.emit(),ir(this)}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.calciteDialogClose.emit(),_n(this)}toggleDialog(y){this.ignoreOpenChange||(y?this.openDialog():this.closeDialog())}handleOpenedChange(y){this.transitionEl.classList.toggle(at.openingActive,y),ur(this)}async triggerInteractModifiers(){const{interaction:y}=this;y&&(await y.reflow({name:"drag"}),await y.reflow({name:"resize"}))}getTransitionElDOMRect(){return this.transitionEl.getBoundingClientRect()}updateTransform(){const{dragPosition:{x:y,y:A},resizePosition:O,transitionEl:M,dragEnabled:I,resizable:D}=this;if(!M)return;if(!I&&!D){M.style.transform=null;return}const{top:j,right:P,bottom:W,left:$}=this.getAdjustedResizePosition(O),B=Math.round(y+$+P),K=Math.round(A+j+W);M.style.transform=B||K?`translate(${B}px, ${K}px)`:null}updateSize({type:y,size:A}){const{transitionEl:O}=this;O&&(O.style[y]=A!==null?`${Math.round(A)}px`:null)}cleanupInteractions(){this.interaction?.unset(),this.updateSize({size:null,type:"inlineSize"}),this.updateSize({size:null,type:"blockSize"}),this.dragPosition={...In},this.resizePosition={...Mn},this.updateTransform()}setupInteractions(){this.cleanupInteractions();const{el:y,transitionEl:A,resizable:O,dragEnabled:M,resizePosition:I,dragPosition:D}=this;if(!(!A||!this.open)){if((O||M)&&(this.interaction=$t(A,{context:y.ownerDocument})),O){const{minInlineSize:j,minBlockSize:P,maxInlineSize:W,maxBlockSize:$}=window.getComputedStyle(A);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[$t.modifiers.restrictSize({min:{width:this.isPixelValue(j)?parseInt(j,10):0,height:this.isPixelValue(P)?parseInt(P,10):0},max:{width:this.isPixelValue(W)?parseInt(W,10):window.innerWidth,height:this.isPixelValue($)?parseInt($,10):window.innerHeight}}),$t.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:B,deltaRect:K})=>{K&&(I.top+=K.top,I.right+=K.right,I.bottom+=K.bottom,I.left+=K.left),this.updateSize({size:B.width,type:"inlineSize"}),this.updateSize({size:B.height,type:"blockSize"}),this.updateTransform()}}})}M&&this.interaction.draggable({modifiers:[$t.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:j,dy:P})=>{D.x+=j,D.y+=P,this.updateTransform()}}})}}isPixelValue(y){return y.indexOf("px")!==-1}getAdjustedResizePosition({top:y,right:A,bottom:O,left:M}){const I=y/2,D=A/2,j=O/2,P=M/2;switch(this.placement){case"top":return{top:y,right:D,bottom:0,left:P};case"top-start":return{top:y,right:0,bottom:0,left:M};case"top-end":return{top:y,right:A,bottom:0,left:0};case"bottom":return{top:0,right:D,bottom:O,left:P};case"bottom-start":return{top:0,right:0,bottom:O,left:M};case"bottom-end":return{top:0,right:A,bottom:O,left:0};case"cover":case"center":default:return{top:I,right:D,bottom:j,left:P}}}async openDialog(){await mr(this.el),this.el.addEventListener("calciteDialogOpen",this.openEnd),this.opened=!0,this.updateOverflowHiddenClass()}addOverflowHiddenClass(){ze===0&&(Cn=document.documentElement.style.overflow),ze++,document.documentElement.style.setProperty("overflow","hidden")}removeOverflowHiddenClass(){document.documentElement.style.setProperty("overflow",Cn)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}}static get style(){return zr}},[1,"calcite-dialog",{beforeClose:[16],description:[1],dragEnabled:[516,"drag-enabled"],closeDisabled:[516,"close-disabled"],embedded:[1028],escapeDisabled:[516,"escape-disabled"],heading:[1],headingLevel:[514,"heading-level"],kind:[513],loading:[516],menuOpen:[516,"menu-open"],messages:[1040],messageOverrides:[1040],modal:[516],open:[1540],outsideCloseDisabled:[516,"outside-close-disabled"],overlayPositioning:[513,"overlay-positioning"],placement:[513],resizable:[516],scale:[513],widthScale:[513,"width-scale"],opened:[32],hasFooter:[32],hasContentTop:[32],hasContentBottom:[32],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],setFocus:[64],updateFocusTrapElements:[64],scrollContentTo:[64]},[[8,"keydown","handleEscape"]],{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}]);function jn(){typeof customElements>"u"||["calcite-dialog","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(y=>{switch(y){case"calcite-dialog":customElements.get(y)||customElements.define(y,Rn);break;case"calcite-action":customElements.get(y)||br();break;case"calcite-action-menu":customElements.get(y)||or();break;case"calcite-icon":customElements.get(y)||xr();break;case"calcite-loader":customElements.get(y)||wr();break;case"calcite-panel":customElements.get(y)||yr();break;case"calcite-popover":customElements.get(y)||rr();break;case"calcite-scrim":customElements.get(y)||Er();break}})}jn();const $r=Rn,Nr=jn;export{$r as CalciteDialog,Nr as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dialog-DAngwHC1-DxaeZrt2.js b/custom-toc-separator/assets/calcite-dialog-DAngwHC1-DxaeZrt2.js new file mode 100644 index 00000000..d23d9f64 --- /dev/null +++ b/custom-toc-separator/assets/calcite-dialog-DAngwHC1-DxaeZrt2.js @@ -0,0 +1,6 @@ +import{p as Ni,b as Ji,W as Ot,a as C,D as Qi}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{A as Zi,g as tr}from"./dom-N58V0tYi-DBU3jlah.js";import{g as er,H as _n,E as nr,j as ir,K as rr,O as or}from"./action-menu-DTIJuZNc-JfgVVBLH.js";import{o as ar,r as sr,f as cr}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{c as lr}from"./observers-BigwqTsw-C0_AGNdr.js";import{p as ur}from"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import{K as pr,q as dr}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{h as fr,d as hr,M as vr,l as gr}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{o as mr}from"./component-CWGf1hug-BASJpoEG.js";import{s as V,y as yr}from"./panel-DRUEhsxp-Gud9To6U.js";import{m as br}from"./action-GCQoufcz-CMRVbhl9.js";import{m as xr}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as wr}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{c as Er}from"./scrim-BscQh4v9-BkfQZEPV.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";import"./interactive-DqhNilgd-C3lhdKPd.js";var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},An={exports:{}};(function(y,A){(function(O,M){y.exports=M()})(kr,function(){function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];nthis.handleMutationObserver()),this.handleKeyDown=y=>{const{key:A,shiftKey:O,defaultPrevented:M}=y,{dragEnabled:I,resizable:D,resizePosition:j,dragPosition:P,transitionEl:W}=this;if(!(M||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(A)))switch(A){case"ArrowUp":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height-st,type:"blockSize"}),j.bottom-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowDown":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().height+st,type:"blockSize"}),j.bottom+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.y+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowLeft":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width-st,type:"inlineSize"}),j.right-=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x-=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break;case"ArrowRight":O&&D&&W?(this.updateSize({size:this.getTransitionElDOMRect().width+st,type:"inlineSize"}),j.right+=st,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault()):I&&(P.x+=Nt,this.updateTransform(),this.triggerInteractModifiers(),y.preventDefault());break}},this.setTransitionEl=y=>{this.transitionEl=y,this.setupInteractions()},this.openEnd=()=>{this.setFocus(),this.el.removeEventListener("calciteDialogOpen",this.openEnd)},this.handleInternalPanelScroll=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.calciteDialogScroll.emit())},this.handleInternalPanelCloseClick=y=>{y.target===this.panelEl&&(y.stopPropagation(),this.open=!1)},this.handlePanelKeyDown=y=>{this.escapeDisabled&&y.key==="Escape"&&y.preventDefault()},this.handleOutsideClose=()=>{this.outsideCloseDisabled||(this.open=!1)},this.closeDialog=async()=>{if(this.beforeClose)try{await this.beforeClose()}catch{requestAnimationFrame(()=>{this.ignoreOpenChange=!0,this.open=!0,this.ignoreOpenChange=!1});return}ze--,this.opened=!1,this.updateOverflowHiddenClass()},this.updateOverflowHiddenClass=()=>{this.opened&&!this.embedded&&this.modal?this.addOverflowHiddenClass():this.removeOverflowHiddenClass()},this.handleMutationObserver=()=>{this.updateFocusTrapElements()},this.beforeClose=void 0,this.description=void 0,this.dragEnabled=!1,this.closeDisabled=!1,this.embedded=!1,this.escapeDisabled=!1,this.heading=void 0,this.headingLevel=void 0,this.kind=void 0,this.loading=!1,this.menuOpen=!1,this.messages=void 0,this.messageOverrides=void 0,this.modal=!1,this.open=!1,this.outsideCloseDisabled=!1,this.overlayPositioning="absolute",this.placement="center",this.resizable=!1,this.scale="m",this.widthScale="m",this.opened=!1,this.hasFooter=!0,this.hasContentTop=!1,this.hasContentBottom=!1,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.assistiveText=null}onMessagesChange(){}onModalChange(){this.updateOverflowHiddenClass()}async componentWillLoad(){await fr(this),ar(this),this.open&&this.openDialog()}componentDidLoad(){sr(this)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),pr(this),hr(this),er(this),this.setupInteractions()}disconnectedCallback(){this.removeOverflowHiddenClass(),this.mutationObserver?.disconnect(),_n(this),dr(this),vr(this),this.embedded=!1,this.cleanupInteractions()}render(){const{assistiveText:y,description:A,heading:O,opened:M}=this;return C(Qi,{key:"bf406255eaa6d94c8443af185a74a2b2d58c6d59"},C("div",{key:"de2a34b6da4a82c66e9fafdbdd2056e4e11e1315",class:{[at.container]:!0,[at.containerOpen]:M,[at.containerEmbedded]:this.embedded}},this.modal?C("calcite-scrim",{class:at.scrim,onClick:this.handleOutsideClose}):null,C("div",{key:"be47093e3a955ce45a71c555700143a4a1c7a166","aria-description":A,"aria-label":O,"aria-modal":Zi(this.modal),class:at.dialog,onKeyDown:this.handleKeyDown,ref:this.setTransitionEl,role:"dialog"},y?C("div",{"aria-live":"polite",class:at.assistiveText,key:"assistive-text"},y):null,C("slot",{key:"6ed9f10ae7d5ecc1ec9062d6aba559001d5194e6",name:H.content},C("calcite-panel",{key:"cd6ebaa7d7362cbeb70e9ae623f38298d1e831e3",beforeClose:this.beforeClose,class:at.panel,closable:!this.closeDisabled,closed:!M,description:A,heading:O,headingLevel:this.headingLevel,loading:this.loading,menuOpen:this.menuOpen,messageOverrides:this.messageOverrides,onCalcitePanelClose:this.handleInternalPanelCloseClick,onCalcitePanelScroll:this.handleInternalPanelScroll,onKeyDown:this.handlePanelKeyDown,overlayPositioning:this.overlayPositioning,ref:I=>this.panelEl=I,scale:this.scale},C("slot",{key:"2ce955775c33b09fc849a083d0bcc1c8ce523dd8",name:H.actionBar,slot:V.actionBar}),C("slot",{key:"dd44184de251320af6225baa2e59571b881a23cd",name:H.alerts,slot:V.alerts}),C("slot",{key:"da343a1a10e015b04b37463c10592e612a576e9b",name:H.headerActionsStart,slot:V.headerActionsStart}),C("slot",{key:"6680fde2bd7ad6dc5803c78ea7250d11d4920b7c",name:H.headerActionsEnd,slot:V.headerActionsEnd}),C("slot",{key:"a17ca64188ffe6000792e67eafc838df575ebbc3",name:H.headerContent,slot:V.headerContent}),C("slot",{key:"7e048c4a9104053ca0a61ab2514b018efb4fc872",name:H.headerMenuActions,slot:V.headerMenuActions}),C("slot",{key:"6760c8a6c105a511fcb859cfd222f8c1355a82c4",name:H.fab,slot:V.fab}),C("slot",{key:"e0f2e7644281d408d8c21ce5bf16b08af0a59c3b",name:H.contentTop,slot:V.contentTop}),C("slot",{key:"01889c3b7fc13bc49521c27feb2ab35346552504",name:H.contentBottom,slot:V.contentBottom}),C("slot",{key:"593bad35110b5d7e7b44d598b397e4b87cc28e28",name:H.footerStart,slot:V.footerStart}),C("slot",{key:"5e84099e096a6afb678cce9731b189f4011dc067",name:H.footer,slot:V.footer}),C("slot",{key:"69a805bd0c1f43a6d165939e62db562428f39f11",name:H.footerEnd,slot:V.footerEnd}),C("slot",{key:"b49e14ff6d2c63caaa8fd296920618e7673eb71b"}))))))}effectiveLocaleChange(){gr(this,this.effectiveLocale)}handleInteractionChange(){this.setupInteractions()}updateAssistiveText(){const{messages:y}=this;this.assistiveText=y&&(this.dragEnabled||this.resizable)?`${this.dragEnabled?y.dragEnabled:""} ${this.resizable?y.resizeEnabled:""}`:null}handleEscape(y){this.open&&!this.escapeDisabled&&y.key==="Escape"&&!y.defaultPrevented&&(this.open=!1,y.preventDefault())}async setFocus(){return await cr(this),this.panelEl?.setFocus()??tr(this.el)}async updateFocusTrapElements(){nr(this)}async scrollContentTo(y){await this.panelEl?.scrollContentTo(y)}onBeforeOpen(){this.calciteDialogBeforeOpen.emit()}onOpen(){this.calciteDialogOpen.emit(),ir(this)}onBeforeClose(){this.calciteDialogBeforeClose.emit()}onClose(){this.calciteDialogClose.emit(),_n(this)}toggleDialog(y){this.ignoreOpenChange||(y?this.openDialog():this.closeDialog())}handleOpenedChange(y){this.transitionEl.classList.toggle(at.openingActive,y),ur(this)}async triggerInteractModifiers(){const{interaction:y}=this;y&&(await y.reflow({name:"drag"}),await y.reflow({name:"resize"}))}getTransitionElDOMRect(){return this.transitionEl.getBoundingClientRect()}updateTransform(){const{dragPosition:{x:y,y:A},resizePosition:O,transitionEl:M,dragEnabled:I,resizable:D}=this;if(!M)return;if(!I&&!D){M.style.transform=null;return}const{top:j,right:P,bottom:W,left:$}=this.getAdjustedResizePosition(O),B=Math.round(y+$+P),K=Math.round(A+j+W);M.style.transform=B||K?`translate(${B}px, ${K}px)`:null}updateSize({type:y,size:A}){const{transitionEl:O}=this;O&&(O.style[y]=A!==null?`${Math.round(A)}px`:null)}cleanupInteractions(){this.interaction?.unset(),this.updateSize({size:null,type:"inlineSize"}),this.updateSize({size:null,type:"blockSize"}),this.dragPosition={...In},this.resizePosition={...Mn},this.updateTransform()}setupInteractions(){this.cleanupInteractions();const{el:y,transitionEl:A,resizable:O,dragEnabled:M,resizePosition:I,dragPosition:D}=this;if(!(!A||!this.open)){if((O||M)&&(this.interaction=$t(A,{context:y.ownerDocument})),O){const{minInlineSize:j,minBlockSize:P,maxInlineSize:W,maxBlockSize:$}=window.getComputedStyle(A);this.interaction.resizable({edges:{top:!0,right:!0,bottom:!0,left:!0},modifiers:[$t.modifiers.restrictSize({min:{width:this.isPixelValue(j)?parseInt(j,10):0,height:this.isPixelValue(P)?parseInt(P,10):0},max:{width:this.isPixelValue(W)?parseInt(W,10):window.innerWidth,height:this.isPixelValue($)?parseInt($,10):window.innerHeight}}),$t.modifiers.restrict({restriction:"parent"})],listeners:{move:({rect:B,deltaRect:K})=>{K&&(I.top+=K.top,I.right+=K.right,I.bottom+=K.bottom,I.left+=K.left),this.updateSize({size:B.width,type:"inlineSize"}),this.updateSize({size:B.height,type:"blockSize"}),this.updateTransform()}}})}M&&this.interaction.draggable({modifiers:[$t.modifiers.restrictRect({restriction:"parent"})],listeners:{move:({dx:j,dy:P})=>{D.x+=j,D.y+=P,this.updateTransform()}}})}}isPixelValue(y){return y.indexOf("px")!==-1}getAdjustedResizePosition({top:y,right:A,bottom:O,left:M}){const I=y/2,D=A/2,j=O/2,P=M/2;switch(this.placement){case"top":return{top:y,right:D,bottom:0,left:P};case"top-start":return{top:y,right:0,bottom:0,left:M};case"top-end":return{top:y,right:A,bottom:0,left:0};case"bottom":return{top:0,right:D,bottom:O,left:P};case"bottom-start":return{top:0,right:0,bottom:O,left:M};case"bottom-end":return{top:0,right:A,bottom:O,left:0};case"cover":case"center":default:return{top:I,right:D,bottom:j,left:P}}}async openDialog(){await mr(this.el),this.el.addEventListener("calciteDialogOpen",this.openEnd),this.opened=!0,this.updateOverflowHiddenClass()}addOverflowHiddenClass(){ze===0&&(Cn=document.documentElement.style.overflow),ze++,document.documentElement.style.setProperty("overflow","hidden")}removeOverflowHiddenClass(){document.documentElement.style.setProperty("overflow",Cn)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}}static get style(){return zr}},[1,"calcite-dialog",{beforeClose:[16],description:[1],dragEnabled:[516,"drag-enabled"],closeDisabled:[516,"close-disabled"],embedded:[1028],escapeDisabled:[516,"escape-disabled"],heading:[1],headingLevel:[514,"heading-level"],kind:[513],loading:[516],menuOpen:[516,"menu-open"],messages:[1040],messageOverrides:[1040],modal:[516],open:[1540],outsideCloseDisabled:[516,"outside-close-disabled"],overlayPositioning:[513,"overlay-positioning"],placement:[513],resizable:[516],scale:[513],widthScale:[513,"width-scale"],opened:[32],hasFooter:[32],hasContentTop:[32],hasContentBottom:[32],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],setFocus:[64],updateFocusTrapElements:[64],scrollContentTo:[64]},[[8,"keydown","handleEscape"]],{messageOverrides:["onMessagesChange"],modal:["onModalChange"],effectiveLocale:["effectiveLocaleChange"],open:["handleInteractionChange","toggleDialog"],placement:["handleInteractionChange"],resizable:["handleInteractionChange","updateAssistiveText"],dragEnabled:["handleInteractionChange","updateAssistiveText"],messages:["updateAssistiveText"],opened:["handleOpenedChange"]}]);function jn(){typeof customElements>"u"||["calcite-dialog","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(y=>{switch(y){case"calcite-dialog":customElements.get(y)||customElements.define(y,Rn);break;case"calcite-action":customElements.get(y)||br();break;case"calcite-action-menu":customElements.get(y)||or();break;case"calcite-icon":customElements.get(y)||xr();break;case"calcite-loader":customElements.get(y)||wr();break;case"calcite-panel":customElements.get(y)||yr();break;case"calcite-popover":customElements.get(y)||rr();break;case"calcite-scrim":customElements.get(y)||Er();break}})}jn();const $r=Rn,Nr=jn;export{$r as CalciteDialog,Nr as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-CLrG397W-BEizDxoW.js b/custom-toc-separator/assets/calcite-dropdown-CLrG397W-BEizDxoW.js deleted file mode 100644 index 0662d2c4..00000000 --- a/custom-toc-separator/assets/calcite-dropdown-CLrG397W-BEizDxoW.js +++ /dev/null @@ -1 +0,0 @@ -import{p as v,b as D,W as a,a as o,D as E}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{M as p,g as y,A as h,O as r}from"./dom-N58V0tYi-DBU3jlah.js";import{I,U as l,V as O,q as x,j as m,_ as k}from"./floating-ui-DKFFlLv3-elIRTcW0.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as P,p as H}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{n as S}from"./key-CZySMiwx-kmS7VeUz.js";import{f as z,o as T,r as A}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{c as f}from"./observers-BigwqTsw-BCNzxmob.js";import{p as w}from"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const F={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",B=L,u=v(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=a(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=a(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=a(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=a(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=a(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const Q=u,X=g;export{Q as CalciteDropdown,X as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-CLrG397W-Dqy3pc5Y.js b/custom-toc-separator/assets/calcite-dropdown-CLrG397W-Dqy3pc5Y.js new file mode 100644 index 00000000..a48711aa --- /dev/null +++ b/custom-toc-separator/assets/calcite-dropdown-CLrG397W-Dqy3pc5Y.js @@ -0,0 +1 @@ +import{p as v,b as D,W as a,a as o,D as E}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{M as p,g as y,A as h,O as r}from"./dom-N58V0tYi-DBU3jlah.js";import{I,U as l,V as O,q as x,j as m,_ as k}from"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as P,p as H}from"./interactive-DqhNilgd-C3lhdKPd.js";import{n as S}from"./key-CZySMiwx-kmS7VeUz.js";import{f as z,o as T,r as A}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{c as f}from"./observers-BigwqTsw-C0_AGNdr.js";import{p as w}from"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const F={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",B=L,u=v(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=a(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=a(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=a(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=a(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=a(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const Q=u,X=g;export{Q as CalciteDropdown,X as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-BrWCn04w.js b/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-BrWCn04w.js new file mode 100644 index 00000000..ec0b1f3a --- /dev/null +++ b/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-BrWCn04w.js @@ -0,0 +1 @@ +import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{c as d}from"./observers-BigwqTsw-C0_AGNdr.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const v=o,I=r;export{v as CalciteDropdownGroup,I as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-njC2GiTc.js b/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-njC2GiTc.js deleted file mode 100644 index f1f349dc..00000000 --- a/custom-toc-separator/assets/calcite-dropdown-group-0sIPwaDd-njC2GiTc.js +++ /dev/null @@ -1 +0,0 @@ -import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{c as d}from"./observers-BigwqTsw-BCNzxmob.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const v=o,I=r;export{v as CalciteDropdownGroup,I as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-3kui0urS.js b/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-3kui0urS.js new file mode 100644 index 00000000..3783d986 --- /dev/null +++ b/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-3kui0urS.js @@ -0,0 +1,11 @@ +import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-C3lhdKPd.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-CoY6CcfD.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-C0_AGNdr.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host(:focus) .container{color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .dropdown-link,:host(:active:not([disabled])) .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host([selected]) .container:not(.container--none-selection),:host([selected]) .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .dropdown-link calcite-icon{color:var(--calcite-color-brand)}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,C=S,m=g(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownItemSelect=a(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=a(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=a(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=a(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){await y(this),this.el?.focus()}componentWillLoad(){x(this),this.initialize()}componentDidLoad(){E(this)}connectedCallback(){this.initialize()}componentDidRender(){q(this)}render(){const{href:e,selectionMode:o,label:l,iconFlipRtl:n}=this,r=t("calcite-icon",{key:"1ec1c941651dda8f39fa15427592141f04180f3e",class:i.iconStart,flipRtl:n==="start"||n==="both",icon:this.iconStart,scale:s(this.scale)}),c=t("span",{key:"3ab167ed4054ca34b4e13e72b752af6cf25522ae",class:i.itemContent},t("slot",{key:"88cf44809fb48450c66cc8f105bbda008a78157d"})),d=t("calcite-icon",{key:"32fb27182943a032c0037f1f878a95c194d2dff1",class:i.iconEnd,flipRtl:n==="end"||n==="both",icon:this.iconEnd,scale:s(this.scale)}),p=this.iconStart&&this.iconEnd?[r,c,d]:this.iconStart?[r,c]:this.iconEnd?[c,d]:c,b=e?t("a",{"aria-label":l,class:i.link,href:e,ref:v=>this.childLink=v,rel:this.rel,tabIndex:-1,target:this.target},p):p,f=e?null:o==="single"?"menuitemradio":o==="multiple"?"menuitemcheckbox":"menuitem",w=o!=="none"?I(this.selected):null,{disabled:h}=this;return t(D,{key:"beec8e51bf18bdcab1928181828b372cc70bb7ee","aria-checked":w,"aria-label":e?"":l,role:f,tabIndex:h?-1:0},t(z,{key:"5cbbd1074d6c571f4cac3a99e4a2c09bf113db55",disabled:h},t("div",{key:"bff025aeb280c9d0d829e5cf4d94e9392604e607",class:{[i.container]:!0,[i.containerNone]:o==="none"}},o!=="none"?t("calcite-icon",{class:i.icon,icon:o==="multiple"?"check":"bullet-point",scale:s(this.scale)}):null,b)))}onClick(){this.emitRequestedItem()}keyDownHandler(e){switch(e.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),e.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),e.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":e.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break}}updateActiveItemOnChange(e){e.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.determineActiveItem()),e.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),this.selectionMode==="none"&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1;break}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return this}static get style(){return C}},[1,"calcite-dropdown-item",{disabled:[516],href:[513],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],iconEnd:[513,"icon-end"],label:[1],rel:[513],selected:[1540],target:[513],selectionMode:[1,"selection-mode"],scale:[513],setFocus:[64]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"],[16,"calciteInternalDropdownItemChange","updateActiveItemOnChange"]]]);function u(){typeof customElements>"u"||["calcite-dropdown-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-dropdown-item":customElements.get(e)||customElements.define(e,m);break;case"calcite-icon":customElements.get(e)||R();break}})}u();const P=m,N=u;export{P as CalciteDropdownItem,N as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-C6jOH2pP.js b/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-C6jOH2pP.js deleted file mode 100644 index 97c96430..00000000 --- a/custom-toc-separator/assets/calcite-dropdown-item-DpLfv4A0-C6jOH2pP.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-BKvGneFm.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BCNzxmob.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host(:focus) .container{color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);text-decoration-line:none}:host(:hover:not([disabled])) .dropdown-link,:host(:active:not([disabled])) .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host([selected]) .container:not(.container--none-selection),:host([selected]) .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .dropdown-link calcite-icon{color:var(--calcite-color-brand)}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,C=S,m=g(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownItemSelect=a(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=a(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=a(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=a(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){await y(this),this.el?.focus()}componentWillLoad(){x(this),this.initialize()}componentDidLoad(){E(this)}connectedCallback(){this.initialize()}componentDidRender(){q(this)}render(){const{href:e,selectionMode:o,label:l,iconFlipRtl:n}=this,r=t("calcite-icon",{key:"1ec1c941651dda8f39fa15427592141f04180f3e",class:i.iconStart,flipRtl:n==="start"||n==="both",icon:this.iconStart,scale:s(this.scale)}),c=t("span",{key:"3ab167ed4054ca34b4e13e72b752af6cf25522ae",class:i.itemContent},t("slot",{key:"88cf44809fb48450c66cc8f105bbda008a78157d"})),d=t("calcite-icon",{key:"32fb27182943a032c0037f1f878a95c194d2dff1",class:i.iconEnd,flipRtl:n==="end"||n==="both",icon:this.iconEnd,scale:s(this.scale)}),p=this.iconStart&&this.iconEnd?[r,c,d]:this.iconStart?[r,c]:this.iconEnd?[c,d]:c,b=e?t("a",{"aria-label":l,class:i.link,href:e,ref:v=>this.childLink=v,rel:this.rel,tabIndex:-1,target:this.target},p):p,f=e?null:o==="single"?"menuitemradio":o==="multiple"?"menuitemcheckbox":"menuitem",w=o!=="none"?I(this.selected):null,{disabled:h}=this;return t(D,{key:"beec8e51bf18bdcab1928181828b372cc70bb7ee","aria-checked":w,"aria-label":e?"":l,role:f,tabIndex:h?-1:0},t(z,{key:"5cbbd1074d6c571f4cac3a99e4a2c09bf113db55",disabled:h},t("div",{key:"bff025aeb280c9d0d829e5cf4d94e9392604e607",class:{[i.container]:!0,[i.containerNone]:o==="none"}},o!=="none"?t("calcite-icon",{class:i.icon,icon:o==="multiple"?"check":"bullet-point",scale:s(this.scale)}):null,b)))}onClick(){this.emitRequestedItem()}keyDownHandler(e){switch(e.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),e.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),e.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":e.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break}}updateActiveItemOnChange(e){e.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.determineActiveItem()),e.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),this.selectionMode==="none"&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1;break}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return this}static get style(){return C}},[1,"calcite-dropdown-item",{disabled:[516],href:[513],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],iconEnd:[513,"icon-end"],label:[1],rel:[513],selected:[1540],target:[513],selectionMode:[1,"selection-mode"],scale:[513],setFocus:[64]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"],[16,"calciteInternalDropdownItemChange","updateActiveItemOnChange"]]]);function u(){typeof customElements>"u"||["calcite-dropdown-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-dropdown-item":customElements.get(e)||customElements.define(e,m);break;case"calcite-icon":customElements.get(e)||R();break}})}u();const P=m,N=u;export{P as CalciteDropdownItem,N as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-flow-CAdorlph-CWHUt4uF.js b/custom-toc-separator/assets/calcite-flow-CAdorlph-CWHUt4uF.js new file mode 100644 index 00000000..c5d21391 --- /dev/null +++ b/custom-toc-separator/assets/calcite-flow-CAdorlph-CWHUt4uF.js @@ -0,0 +1 @@ +import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{c as g}from"./observers-BigwqTsw-C0_AGNdr.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const D=f,E=d;export{D as CalciteFlow,E as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-flow-CAdorlph-ubsODTb7.js b/custom-toc-separator/assets/calcite-flow-CAdorlph-ubsODTb7.js deleted file mode 100644 index b9c85f9b..00000000 --- a/custom-toc-separator/assets/calcite-flow-CAdorlph-ubsODTb7.js +++ /dev/null @@ -1 +0,0 @@ -import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{c as g}from"./observers-BigwqTsw-BCNzxmob.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-DyDwqoXd.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const D=f,E=d;export{D as CalciteFlow,E as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-CeWzu-0a.js b/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-CeWzu-0a.js deleted file mode 100644 index 07dda5ca..00000000 --- a/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-CeWzu-0a.js +++ /dev/null @@ -1 +0,0 @@ -import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as x,q as A}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{s as o,y as $}from"./panel-DRUEhsxp-DE_ZqRVb.js";import{m as R}from"./action-GCQoufcz-Db81jJpr.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-CadEd7O7.js";import{m as _}from"./icon-BXFbBbop-BKvGneFm.js";import{v as W}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{c as H}from"./scrim-BscQh4v9-DzezRv_f.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./floating-ui-DKFFlLv3-elIRTcW0.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import"./FloatingArrow-BG9llDYg-ljy-TIYj.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const pe=f,ge=b;export{pe as CalciteFlowItem,ge as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-DUNxbO8N.js b/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-DUNxbO8N.js new file mode 100644 index 00000000..394f1ddf --- /dev/null +++ b/custom-toc-separator/assets/calcite-flow-item-uRuGc3ks-DUNxbO8N.js @@ -0,0 +1 @@ +import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-C3lhdKPd.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{K as x,q as A}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{s as o,y as $}from"./panel-DRUEhsxp-Gud9To6U.js";import{m as R}from"./action-GCQoufcz-CMRVbhl9.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-JfgVVBLH.js";import{m as _}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as W}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{c as H}from"./scrim-BscQh4v9-BkfQZEPV.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const pe=f,ge=b;export{pe as CalciteFlowItem,ge as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-icon-laqhdRBY-BPD9clRe.js b/custom-toc-separator/assets/calcite-icon-laqhdRBY-BPD9clRe.js new file mode 100644 index 00000000..afa7b28b --- /dev/null +++ b/custom-toc-separator/assets/calcite-icon-laqhdRBY-BPD9clRe.js @@ -0,0 +1 @@ +import{f as t,m as o}from"./icon-BXFbBbop-CoY6CcfD.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-C0_AGNdr.js";const a=t,c=o;export{a as CalciteIcon,c as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-icon-laqhdRBY-Eh4JVIZU.js b/custom-toc-separator/assets/calcite-icon-laqhdRBY-Eh4JVIZU.js deleted file mode 100644 index 990676ad..00000000 --- a/custom-toc-separator/assets/calcite-icon-laqhdRBY-Eh4JVIZU.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,m as o}from"./icon-BXFbBbop-BKvGneFm.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-BCNzxmob.js";const a=t,c=o;export{a as CalciteIcon,c as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-input-BKRd7MCS-C6GuFEjN.js b/custom-toc-separator/assets/calcite-input-BKRd7MCS-C6GuFEjN.js deleted file mode 100644 index 2df36a1d..00000000 --- a/custom-toc-separator/assets/calcite-input-BKRd7MCS-C6GuFEjN.js +++ /dev/null @@ -1 +0,0 @@ -import{F as t,M as o}from"./input2-eOtqu-iO-l9oxBLp5.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-DuqBvFSD.js";import"./interactive-DqhNilgd-Bw4n2n3w.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-DyDwqoXd.js";import"./locale-Cn_GDVD_-CnEFMUdd.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./t9n-C_hcZMZJ-DI6xkvhp.js";import"./icon-BXFbBbop-BKvGneFm.js";const F=t,I=o;export{F as CalciteInput,I as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-input-BKRd7MCS-CiwokCpm.js b/custom-toc-separator/assets/calcite-input-BKRd7MCS-CiwokCpm.js new file mode 100644 index 00000000..62e01fbc --- /dev/null +++ b/custom-toc-separator/assets/calcite-input-BKRd7MCS-CiwokCpm.js @@ -0,0 +1 @@ +import{F as t,M as o}from"./input2-eOtqu-iO-rjNm5YCZ.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-DM6mxOFq.js";import"./interactive-DqhNilgd-C3lhdKPd.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-BTu-x4Jk.js";import"./locale-Cn_GDVD_-Dy9CelfZ.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./t9n-C_hcZMZJ-BBqL2zVj.js";import"./icon-BXFbBbop-CoY6CcfD.js";const F=t,I=o;export{F as CalciteInput,I as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-label-DMj3M4QR-0gYoQwWb.js b/custom-toc-separator/assets/calcite-label-DMj3M4QR-0gYoQwWb.js new file mode 100644 index 00000000..f4380bca --- /dev/null +++ b/custom-toc-separator/assets/calcite-label-DMj3M4QR-0gYoQwWb.js @@ -0,0 +1 @@ +import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const C=a,w=i;export{C as CalciteLabel,w as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-label-DMj3M4QR-BDZ8Onhu.js b/custom-toc-separator/assets/calcite-label-DMj3M4QR-BDZ8Onhu.js deleted file mode 100644 index 6c974761..00000000 --- a/custom-toc-separator/assets/calcite-label-DMj3M4QR-BDZ8Onhu.js +++ /dev/null @@ -1 +0,0 @@ -import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const C=a,w=i;export{C as CalciteLabel,w as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-BsaXyU3v.js b/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-BsaXyU3v.js deleted file mode 100644 index 6a58c095..00000000 --- a/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-BsaXyU3v.js +++ /dev/null @@ -1,21 +0,0 @@ -import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{K as w,q as D}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-B_MyJQVY.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-Db81jJpr.js";import{m as B}from"./icon-BXFbBbop-BKvGneFm.js";import{v as ee}from"./loader-Ch7Jr16w-B4sW6aLS.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - );color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,ie=ne,ae=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleChange=c(this,"calciteHandleChange",6),this.calciteHandleNudge=c(this,"calciteHandleNudge",6),this.calciteInternalAssistiveTextChange=c(this,"calciteInternalAssistiveTextChange",6),this.handleKeyDown=e=>{if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())},this.selected=!1,this.disabled=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.blurUnselectDisabled=!1,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}onMessagesChange(){}connectedCallback(){H(this),w(this)}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){M(this),D(this)}effectiveLocaleChange(){z(this,this.effectiveLocale)}async setFocus(){await P(this),this.handleButton?.focus()}getTooltip(){const{label:e,messages:t}=this;return t?e?t.dragHandle.replace(b.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){const{setPosition:t,setSize:n,label:l,messages:s,selected:o}=this;return!s||!l||typeof n!="number"||typeof t!="number"?null:(e==="label"?o?s.dragHandleChange:s.dragHandleIdle:o?s.dragHandleActive:s.dragHandleCommit).replace(b.position,t.toString()).replace(b.itemLabel,l).replace(b.total,n.toString())}render(){return i(A,{key:"1a694de393421691c83e7265850275c217ef7ffe",disabled:this.disabled},i("span",{key:"82ff692c15c2d9294ceb814b3f7f06bb4d8ff0e0","aria-checked":this.disabled?null:C(this.selected),"aria-disabled":this.disabled?C(this.disabled):null,"aria-label":this.disabled?null:this.getAriaText("label"),class:{[x.handle]:!0,[x.handleSelected]:!this.disabled&&this.selected},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:e=>{this.handleButton=e},role:"radio",tabIndex:this.disabled?null:0,title:this.getTooltip()},i("calcite-icon",{key:"25862a953826aea2d594507157aaffc21d07001c",icon:te.drag,scale:"s"})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ie}},[1,"calcite-handle",{selected:[1540],disabled:[516],dragHandle:[513,"drag-handle"],messages:[1040],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],blurUnselectDisabled:[4,"blur-unselect-disabled"],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function O(){typeof customElements>"u"||["calcite-handle","calcite-icon"].forEach(e=>{switch(e){case"calcite-handle":customElements.get(e)||customElements.define(e,ae);break;case"calcite-icon":customElements.get(e)||B();break}})}O();const le=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);--calcite-list-item-icon-color:var(--calcite-color-brand)}:host([filter-hidden]),:host([closed]){display:none}.wrapper--bordered{border-block-end:1px solid var(--calcite-color-border-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{box-sizing:border-box;display:flex;flex:1 1 0%;overflow:hidden;background-color:var(--calcite-color-foreground-1)}.container *{box-sizing:border-box}.container--hover:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.container:active{background-color:var(--calcite-color-foreground-1)}.container--border{border-inline-start-width:4px;border-inline-start-style:solid}.container--border-selected{border-inline-start-color:var(--calcite-color-brand)}.container--border-unselected{border-inline-start-color:transparent}.container:hover.container--border-unselected{border-color:var(--calcite-color-border-1)}.nested-container{display:none;flex-direction:column;border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);margin-inline-start:var(--calcite-list-item-spacing-indent, 1.5rem)}.nested-container--open{display:flex}.content-container{display:flex;flex:1 1 auto;-webkit-user-select:none;user-select:none;align-items:stretch;padding:0px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content-container--unavailable{opacity:var(--calcite-opacity-disabled)}tr,td{outline-color:transparent}tr{position:relative}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-color-text-1)}:host([selected]) .label{font-weight:var(--calcite-font-weight-medium)}.description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}:host([selected]) .description{color:var(--calcite-color-text-2)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.content-bottom{display:flex;flex-direction:column}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-block:0px;color:var(--calcite-color-border-input);padding-inline:var(--calcite-spacing-md) var(--calcite-spacing-xxs)}.selection-container--single{color:transparent}:host(:not([disabled]):not([selected])) .container:hover .selection-container--single{color:var(--calcite-color-border-1)}:host([selected]:hover) .selection-container,:host([selected]:hover) .selection-container--single,:host([selected]) .selection-container{color:var(--calcite-list-item-icon-color)}.open-container{color:var(--calcite-color-text-3)}:host(:not([disabled])) .container:hover .open-container{color:var(--calcite-color-text-1)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.actions-start calcite-action,.actions-start calcite-handle,.actions-end calcite-action,.actions-end calcite-handle,.content-start calcite-action,.content-start calcite-handle,.content-end calcite-action,.content-end calcite-handle,.selection-container calcite-action,.selection-container calcite-handle,.drag-container calcite-action,.drag-container calcite-handle,.open-container calcite-action,.open-container calcite-handle{align-self:stretch}.open-container,.selection-container{cursor:pointer}.actions-start,.actions-end{position:relative;padding:0px}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}tr:focus .actions-start,tr:focus .actions-end{inset-block:0.125rem}tr:focus .actions-start .close,tr:focus .actions-start ::slotted(calcite-action),tr:focus .actions-start ::slotted(calcite-action-menu),tr:focus .actions-start ::slotted(calcite-handle),tr:focus .actions-start ::slotted(calcite-dropdown),tr:focus .actions-end .close,tr:focus .actions-end ::slotted(calcite-action),tr:focus .actions-end ::slotted(calcite-action-menu),tr:focus .actions-end ::slotted(calcite-handle),tr:focus .actions-end ::slotted(calcite-dropdown){block-size:calc(100% - 0.25rem)}tr:focus::after,tr:focus::before{position:absolute;content:"";inline-size:0.125rem;z-index:var(--calcite-z-index-header);background-color:var(--calcite-color-brand);inset-block:0}tr:focus::before{inset-inline-start:0}tr:focus::after{inset-inline-end:0}.container--border:focus::before{display:none}::slotted(calcite-list:empty){border-block-start-width:0px}:host([hidden]){display:none}[hidden]{display:none}`,se=le,S=new Map,oe="calcite-list",G=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=c(this,"calciteListItemSelect",6),this.calciteListItemClose=c(this,"calciteListItemClose",6),this.calciteListItemDragHandleChange=c(this,"calciteListItemDragHandleChange",6),this.calciteListItemToggle=c(this,"calciteListItemToggle",6),this.calciteInternalListItemSelect=c(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemSelectMultiple=c(this,"calciteInternalListItemSelectMultiple",6),this.calciteInternalListItemActive=c(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=c(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=c(this,"calciteInternalListItemChange",6),this.calciteInternalListItemToggle=c(this,"calciteInternalListItemToggle",6),this.dragHandleSelectedChangeHandler=e=>{this.dragSelected=e.target.selected,this.calciteListItemDragHandleChange.emit(),e.stopPropagation()},this.emitInternalListItemActive=()=>{this.calciteInternalListItemActive.emit()},this.focusCellHandle=()=>{this.handleCellFocusIn(this.handleGridEl)},this.focusCellActionsStart=()=>{this.handleCellFocusIn(this.actionsStartEl)},this.focusCellContent=()=>{this.handleCellFocusIn(this.contentEl)},this.focusCellActionsEnd=()=>{this.handleCellFocusIn(this.actionsEndEl)},this.handleCloseClick=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=m(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=m(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=m(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=m(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=m(e)},this.handleContentBottomSlotChange=e=>{this.hasContentBottom=m(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.handleToggleClick=()=>{this.toggle()},this.toggle=(e=!this.open)=>{this.open=e,this.calciteListItemToggle.emit()},this.handleItemClick=e=>{e.defaultPrevented||this.toggleSelected(e.shiftKey)},this.toggleSelected=e=>{const{selectionMode:t,selected:n}=this;this.disabled||(t==="multiple"||t==="single"?this.selected=!n:t==="single-persist"&&(this.selected=!0),this.calciteInternalListItemSelectMultiple.emit({selectMultiple:e&&t==="multiple"}),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,n=e.composedPath(),{containerEl:l,actionsStartEl:s,actionsEndEl:o,open:d,openable:u}=this,r=this.getGridCells(),h=r.findIndex(g=>n.includes(g));if(t==="Enter"&&!n.includes(s)&&!n.includes(o))e.preventDefault(),this.toggleSelected(e.shiftKey);else if(t==="ArrowRight"){e.preventDefault();const g=h+1;h===-1?!d&&u?(this.toggle(!0),this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[h]&&r[g]&&this.focusCell(r[g])}else if(t==="ArrowLeft"){e.preventDefault();const g=h-1;h===-1?(this.focusCell(null),d&&u?this.toggle(!1):this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),l.focus()):r[h]&&r[g]&&this.focusCell(r[g])}},this.focusCellNull=()=>{this.focusCell(null)},this.handleCellFocusIn=e=>{this.setFocusCell(e,I(e),!0)},this.setFocusCell=(e,t,n)=>{const{parentListEl:l}=this;n&&S.set(l,null);const s=this.getGridCells();s.forEach(o=>{o.tabIndex=-1,o.removeAttribute(y)}),e&&(e.tabIndex=e===t?0:-1,e.setAttribute(y,""),n&&S.set(l,s.indexOf(e)))},this.focusCell=(e,t=!0)=>{const n=I(e);this.setFocusCell(e,n,t),n?.focus()},this.active=!1,this.bordered=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.dragSelected=!1,this.filterHidden=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.unavailable=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1,this.hasContentBottom=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleOpenChange(){this.emitCalciteInternalListItemToggle()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){z(this,this.effectiveLocale)}connectedCallback(){w(this),H(this);const{el:e}=this;this.parentListEl=e.closest(oe),this.level=J(e)+1,this.setSelectionDefaults()}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){D(this),M(this)}async setFocus(){await P(this);const{containerEl:e,parentListEl:t}=this,n=S.get(t);if(typeof n=="number"){const l=this.getGridCells();l[n]?this.focusCell(l[n]):e?.focus();return}e?.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:n}=this;return t==="none"||n==="border"?null:i("td",{class:{[a.selectionContainer]:!0,[a.selectionContainerSingle]:t==="single"||t==="single-persist"},key:"selection-container",onClick:this.handleItemClick},i("calcite-icon",{icon:e?t==="multiple"?f.selectedMultiple:f.selectedSingle:t==="multiple"?f.unselectedMultiple:f.unselectedSingle,scale:"s"}))}renderDragHandle(){const{label:e,dragHandle:t,dragSelected:n,dragDisabled:l,setPosition:s,setSize:o}=this;return t?i("td",{"aria-label":e,class:a.dragContainer,key:"drag-handle-container",onFocusin:this.focusCellHandle,ref:d=>this.handleGridEl=d,role:"gridcell"},i("calcite-handle",{disabled:l,label:e,onCalciteHandleChange:this.dragHandleSelectedChangeHandler,selected:n,setPosition:s,setSize:o})):null}renderOpen(){const{el:e,open:t,openable:n,messages:l}=this,s=X(e),o=t?f.open:s==="rtl"?f.closedRTL:f.closedLTR,d=t?l.collapse:l.expand;return n?i("td",{class:a.openContainer,key:"open-container",onClick:this.handleToggleClick,title:d},i("calcite-icon",{icon:o,key:o,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return i("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",onFocusin:this.focusCellActionsStart,ref:n=>this.actionsStartEl=n,role:"gridcell"},i("slot",{name:p.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:n,messages:l}=this;return i("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||n),key:"actions-end-container",onFocusin:this.focusCellActionsEnd,ref:s=>this.actionsEndEl=s,role:"gridcell"},i("slot",{name:p.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),n?i("calcite-action",{appearance:"transparent",class:a.close,icon:f.close,key:"close-action",label:l.close,onClick:this.handleCloseClick,text:l.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return i("div",{class:a.contentStart,hidden:!e},i("slot",{name:p.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return i("div",{class:a.customContent,hidden:!e},i("slot",{name:p.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return i("div",{class:a.contentEnd,hidden:!e},i("slot",{name:p.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentBottom(){const{hasContentBottom:e}=this;return i("div",{class:a.contentBottom,hidden:!e},i("slot",{name:p.contentBottom,onSlotchange:this.handleContentBottomSlotChange}))}renderDefaultContainer(){return i("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerOpen]:this.openable&&this.open}},i("slot",{onSlotchange:this.handleDefaultSlotChange,ref:e=>this.defaultSlotEl=e}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:n}=this;return!n&&(e||t)?i("div",{class:a.content,key:"content"},e?i("div",{class:a.label,key:"label"},e):null,t?i("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:n,hasCustomContent:l,unavailable:s}=this,o=l||!!t||!!e,d=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return i("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerUnavailable]:s,[a.contentContainerSelectable]:n!=="none",[a.contentContainerHasCenterContent]:o},key:"content-container",onClick:this.handleItemClick,onFocusin:this.focusCellContent,ref:u=>this.contentEl=u,role:"gridcell"},d)}render(){const{openable:e,open:t,level:n,setPosition:l,setSize:s,active:o,label:d,selected:u,selectionAppearance:r,selectionMode:h,closed:g,filterHidden:_,bordered:U,disabled:N}=this,v=h!=="none"&&r==="border",R=v&&u,j=v&&!u;return i(q,{key:"a610ab740c82b6088400839884d58d4d867829db"},i(A,{key:"f05bf10e82fab03ddfdaf3ab2e100dcbd6d69c63",disabled:N},i("div",{key:"4bf63ed08d2a4a049e060d26d3699656558d495e",class:{[a.wrapper]:!0,[a.wrapperBordered]:U}},i("tr",{key:"d231a113c3bd8ee7f67c2ffb0cf804c142a95fb9","aria-expanded":e?C(t):null,"aria-label":d,"aria-level":n,"aria-posinset":l,"aria-selected":C(u),"aria-setsize":s,class:{[a.container]:!0,[a.containerHover]:!0,[a.containerBorder]:v,[a.containerBorderSelected]:R,[a.containerBorderUnselected]:j},hidden:g||_,onFocus:this.focusCellNull,onFocusin:this.emitInternalListItemActive,onKeyDown:this.handleItemKeyDown,ref:W=>this.containerEl=W,role:"row",tabIndex:o?0:-1},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),this.renderContentBottom()),this.renderDefaultContainer()))}emitCalciteInternalListItemToggle(){this.calciteInternalListItemToggle.emit()}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:n}=this;e&&(t||(this.selectionMode=e.selectionMode),n||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const t=Q(e),n=V(e);Y(t),this.openable=!!t.length||!!n.length}getGridCells(){return[this.handleGridEl,this.actionsStartEl,this.contentEl,this.actionsEndEl].filter(e=>e&&!e.hidden)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return se}},[1,"calcite-list-item",{active:[4],bordered:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragDisabled:[516,"drag-disabled"],dragHandle:[4,"drag-handle"],dragSelected:[1540,"drag-selected"],filterHidden:[516,"filter-hidden"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],unavailable:[516],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],hasContentBottom:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]],{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function K(){typeof customElements>"u"||["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,G);break;case"calcite-action":customElements.get(e)||Z();break;case"calcite-handle":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||B();break;case"calcite-loader":customElements.get(e)||ee();break}})}K();const Ee=G,Ae=K;export{Ee as CalciteListItem,Ae as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-DE-BKmax.js b/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-DE-BKmax.js new file mode 100644 index 00000000..5be45550 --- /dev/null +++ b/custom-toc-separator/assets/calcite-list-item-VYBhSMxV-DE-BKmax.js @@ -0,0 +1,21 @@ +import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-C3lhdKPd.js";import{K as w,q as D}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-BZhnQqr6.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-CMRVbhl9.js";import{m as B}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as ee}from"./loader-Ch7Jr16w-DWxaqSJX.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + );color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1))}:host(:not([disabled])) .handle--selected{color:var(--calcite-handle-icon-color-selected, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-selected, var(--calcite-color-foreground-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}`,ie=ne,ae=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleChange=c(this,"calciteHandleChange",6),this.calciteHandleNudge=c(this,"calciteHandleNudge",6),this.calciteInternalAssistiveTextChange=c(this,"calciteInternalAssistiveTextChange",6),this.handleKeyDown=e=>{if(!this.disabled)switch(e.key){case" ":this.selected=!this.selected,this.calciteHandleChange.emit(),e.preventDefault();break;case"ArrowUp":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.selected)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.blurUnselectDisabled||this.disabled||this.selected&&(this.selected=!1,this.calciteHandleChange.emit())},this.selected=!1,this.disabled=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.blurUnselectDisabled=!1,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalAssistiveTextChange.emit({message:e})}onMessagesChange(){}connectedCallback(){H(this),w(this)}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){M(this),D(this)}effectiveLocaleChange(){z(this,this.effectiveLocale)}async setFocus(){await P(this),this.handleButton?.focus()}getTooltip(){const{label:e,messages:t}=this;return t?e?t.dragHandle.replace(b.itemLabel,e):t.dragHandleUntitled:""}getAriaText(e){const{setPosition:t,setSize:n,label:l,messages:s,selected:o}=this;return!s||!l||typeof n!="number"||typeof t!="number"?null:(e==="label"?o?s.dragHandleChange:s.dragHandleIdle:o?s.dragHandleActive:s.dragHandleCommit).replace(b.position,t.toString()).replace(b.itemLabel,l).replace(b.total,n.toString())}render(){return i(A,{key:"1a694de393421691c83e7265850275c217ef7ffe",disabled:this.disabled},i("span",{key:"82ff692c15c2d9294ceb814b3f7f06bb4d8ff0e0","aria-checked":this.disabled?null:C(this.selected),"aria-disabled":this.disabled?C(this.disabled):null,"aria-label":this.disabled?null:this.getAriaText("label"),class:{[x.handle]:!0,[x.handleSelected]:!this.disabled&&this.selected},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:e=>{this.handleButton=e},role:"radio",tabIndex:this.disabled?null:0,title:this.getTooltip()},i("calcite-icon",{key:"25862a953826aea2d594507157aaffc21d07001c",icon:te.drag,scale:"s"})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ie}},[1,"calcite-handle",{selected:[1540],disabled:[516],dragHandle:[513,"drag-handle"],messages:[1040],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],blurUnselectDisabled:[4,"blur-unselect-disabled"],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],selected:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function O(){typeof customElements>"u"||["calcite-handle","calcite-icon"].forEach(e=>{switch(e){case"calcite-handle":customElements.get(e)||customElements.define(e,ae);break;case"calcite-icon":customElements.get(e)||B();break}})}O();const le=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);--calcite-list-item-icon-color:var(--calcite-color-brand)}:host([filter-hidden]),:host([closed]){display:none}.wrapper--bordered{border-block-end:1px solid var(--calcite-color-border-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{box-sizing:border-box;display:flex;flex:1 1 0%;overflow:hidden;background-color:var(--calcite-color-foreground-1)}.container *{box-sizing:border-box}.container--hover:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}.container:active{background-color:var(--calcite-color-foreground-1)}.container--border{border-inline-start-width:4px;border-inline-start-style:solid}.container--border-selected{border-inline-start-color:var(--calcite-color-brand)}.container--border-unselected{border-inline-start-color:transparent}.container:hover.container--border-unselected{border-color:var(--calcite-color-border-1)}.nested-container{display:none;flex-direction:column;border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);margin-inline-start:var(--calcite-list-item-spacing-indent, 1.5rem)}.nested-container--open{display:flex}.content-container{display:flex;flex:1 1 auto;-webkit-user-select:none;user-select:none;align-items:stretch;padding:0px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content-container--unavailable{opacity:var(--calcite-opacity-disabled)}tr,td{outline-color:transparent}tr{position:relative}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-font-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-color-text-1)}:host([selected]) .label{font-weight:var(--calcite-font-weight-medium)}.description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}:host([selected]) .description{color:var(--calcite-color-text-2)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.content-bottom{display:flex;flex-direction:column}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-block:0px;color:var(--calcite-color-border-input);padding-inline:var(--calcite-spacing-md) var(--calcite-spacing-xxs)}.selection-container--single{color:transparent}:host(:not([disabled]):not([selected])) .container:hover .selection-container--single{color:var(--calcite-color-border-1)}:host([selected]:hover) .selection-container,:host([selected]:hover) .selection-container--single,:host([selected]) .selection-container{color:var(--calcite-list-item-icon-color)}.open-container{color:var(--calcite-color-text-3)}:host(:not([disabled])) .container:hover .open-container{color:var(--calcite-color-text-1)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.actions-start calcite-action,.actions-start calcite-handle,.actions-end calcite-action,.actions-end calcite-handle,.content-start calcite-action,.content-start calcite-handle,.content-end calcite-action,.content-end calcite-handle,.selection-container calcite-action,.selection-container calcite-handle,.drag-container calcite-action,.drag-container calcite-handle,.open-container calcite-action,.open-container calcite-handle{align-self:stretch}.open-container,.selection-container{cursor:pointer}.actions-start,.actions-end{position:relative;padding:0px}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}tr:focus .actions-start,tr:focus .actions-end{inset-block:0.125rem}tr:focus .actions-start .close,tr:focus .actions-start ::slotted(calcite-action),tr:focus .actions-start ::slotted(calcite-action-menu),tr:focus .actions-start ::slotted(calcite-handle),tr:focus .actions-start ::slotted(calcite-dropdown),tr:focus .actions-end .close,tr:focus .actions-end ::slotted(calcite-action),tr:focus .actions-end ::slotted(calcite-action-menu),tr:focus .actions-end ::slotted(calcite-handle),tr:focus .actions-end ::slotted(calcite-dropdown){block-size:calc(100% - 0.25rem)}tr:focus::after,tr:focus::before{position:absolute;content:"";inline-size:0.125rem;z-index:var(--calcite-z-index-header);background-color:var(--calcite-color-brand);inset-block:0}tr:focus::before{inset-inline-start:0}tr:focus::after{inset-inline-end:0}.container--border:focus::before{display:none}::slotted(calcite-list:empty){border-block-start-width:0px}:host([hidden]){display:none}[hidden]{display:none}`,se=le,S=new Map,oe="calcite-list",G=k(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=c(this,"calciteListItemSelect",6),this.calciteListItemClose=c(this,"calciteListItemClose",6),this.calciteListItemDragHandleChange=c(this,"calciteListItemDragHandleChange",6),this.calciteListItemToggle=c(this,"calciteListItemToggle",6),this.calciteInternalListItemSelect=c(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemSelectMultiple=c(this,"calciteInternalListItemSelectMultiple",6),this.calciteInternalListItemActive=c(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=c(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=c(this,"calciteInternalListItemChange",6),this.calciteInternalListItemToggle=c(this,"calciteInternalListItemToggle",6),this.dragHandleSelectedChangeHandler=e=>{this.dragSelected=e.target.selected,this.calciteListItemDragHandleChange.emit(),e.stopPropagation()},this.emitInternalListItemActive=()=>{this.calciteInternalListItemActive.emit()},this.focusCellHandle=()=>{this.handleCellFocusIn(this.handleGridEl)},this.focusCellActionsStart=()=>{this.handleCellFocusIn(this.actionsStartEl)},this.focusCellContent=()=>{this.handleCellFocusIn(this.contentEl)},this.focusCellActionsEnd=()=>{this.handleCellFocusIn(this.actionsEndEl)},this.handleCloseClick=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=m(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=m(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=m(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=m(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=m(e)},this.handleContentBottomSlotChange=e=>{this.hasContentBottom=m(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.handleToggleClick=()=>{this.toggle()},this.toggle=(e=!this.open)=>{this.open=e,this.calciteListItemToggle.emit()},this.handleItemClick=e=>{e.defaultPrevented||this.toggleSelected(e.shiftKey)},this.toggleSelected=e=>{const{selectionMode:t,selected:n}=this;this.disabled||(t==="multiple"||t==="single"?this.selected=!n:t==="single-persist"&&(this.selected=!0),this.calciteInternalListItemSelectMultiple.emit({selectMultiple:e&&t==="multiple"}),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,n=e.composedPath(),{containerEl:l,actionsStartEl:s,actionsEndEl:o,open:d,openable:u}=this,r=this.getGridCells(),h=r.findIndex(g=>n.includes(g));if(t==="Enter"&&!n.includes(s)&&!n.includes(o))e.preventDefault(),this.toggleSelected(e.shiftKey);else if(t==="ArrowRight"){e.preventDefault();const g=h+1;h===-1?!d&&u?(this.toggle(!0),this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[h]&&r[g]&&this.focusCell(r[g])}else if(t==="ArrowLeft"){e.preventDefault();const g=h-1;h===-1?(this.focusCell(null),d&&u?this.toggle(!1):this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),l.focus()):r[h]&&r[g]&&this.focusCell(r[g])}},this.focusCellNull=()=>{this.focusCell(null)},this.handleCellFocusIn=e=>{this.setFocusCell(e,I(e),!0)},this.setFocusCell=(e,t,n)=>{const{parentListEl:l}=this;n&&S.set(l,null);const s=this.getGridCells();s.forEach(o=>{o.tabIndex=-1,o.removeAttribute(y)}),e&&(e.tabIndex=e===t?0:-1,e.setAttribute(y,""),n&&S.set(l,s.indexOf(e)))},this.focusCell=(e,t=!0)=>{const n=I(e);this.setFocusCell(e,n,t),n?.focus()},this.active=!1,this.bordered=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.dragSelected=!1,this.filterHidden=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.unavailable=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1,this.hasContentBottom=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleOpenChange(){this.emitCalciteInternalListItemToggle()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){z(this,this.effectiveLocale)}connectedCallback(){w(this),H(this);const{el:e}=this;this.parentListEl=e.closest(oe),this.level=J(e)+1,this.setSelectionDefaults()}async componentWillLoad(){F(this),await T(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}disconnectedCallback(){D(this),M(this)}async setFocus(){await P(this);const{containerEl:e,parentListEl:t}=this,n=S.get(t);if(typeof n=="number"){const l=this.getGridCells();l[n]?this.focusCell(l[n]):e?.focus();return}e?.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:n}=this;return t==="none"||n==="border"?null:i("td",{class:{[a.selectionContainer]:!0,[a.selectionContainerSingle]:t==="single"||t==="single-persist"},key:"selection-container",onClick:this.handleItemClick},i("calcite-icon",{icon:e?t==="multiple"?f.selectedMultiple:f.selectedSingle:t==="multiple"?f.unselectedMultiple:f.unselectedSingle,scale:"s"}))}renderDragHandle(){const{label:e,dragHandle:t,dragSelected:n,dragDisabled:l,setPosition:s,setSize:o}=this;return t?i("td",{"aria-label":e,class:a.dragContainer,key:"drag-handle-container",onFocusin:this.focusCellHandle,ref:d=>this.handleGridEl=d,role:"gridcell"},i("calcite-handle",{disabled:l,label:e,onCalciteHandleChange:this.dragHandleSelectedChangeHandler,selected:n,setPosition:s,setSize:o})):null}renderOpen(){const{el:e,open:t,openable:n,messages:l}=this,s=X(e),o=t?f.open:s==="rtl"?f.closedRTL:f.closedLTR,d=t?l.collapse:l.expand;return n?i("td",{class:a.openContainer,key:"open-container",onClick:this.handleToggleClick,title:d},i("calcite-icon",{icon:o,key:o,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return i("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",onFocusin:this.focusCellActionsStart,ref:n=>this.actionsStartEl=n,role:"gridcell"},i("slot",{name:p.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:n,messages:l}=this;return i("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||n),key:"actions-end-container",onFocusin:this.focusCellActionsEnd,ref:s=>this.actionsEndEl=s,role:"gridcell"},i("slot",{name:p.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),n?i("calcite-action",{appearance:"transparent",class:a.close,icon:f.close,key:"close-action",label:l.close,onClick:this.handleCloseClick,text:l.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return i("div",{class:a.contentStart,hidden:!e},i("slot",{name:p.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return i("div",{class:a.customContent,hidden:!e},i("slot",{name:p.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return i("div",{class:a.contentEnd,hidden:!e},i("slot",{name:p.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentBottom(){const{hasContentBottom:e}=this;return i("div",{class:a.contentBottom,hidden:!e},i("slot",{name:p.contentBottom,onSlotchange:this.handleContentBottomSlotChange}))}renderDefaultContainer(){return i("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerOpen]:this.openable&&this.open}},i("slot",{onSlotchange:this.handleDefaultSlotChange,ref:e=>this.defaultSlotEl=e}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:n}=this;return!n&&(e||t)?i("div",{class:a.content,key:"content"},e?i("div",{class:a.label,key:"label"},e):null,t?i("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:n,hasCustomContent:l,unavailable:s}=this,o=l||!!t||!!e,d=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return i("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerUnavailable]:s,[a.contentContainerSelectable]:n!=="none",[a.contentContainerHasCenterContent]:o},key:"content-container",onClick:this.handleItemClick,onFocusin:this.focusCellContent,ref:u=>this.contentEl=u,role:"gridcell"},d)}render(){const{openable:e,open:t,level:n,setPosition:l,setSize:s,active:o,label:d,selected:u,selectionAppearance:r,selectionMode:h,closed:g,filterHidden:_,bordered:U,disabled:N}=this,v=h!=="none"&&r==="border",R=v&&u,j=v&&!u;return i(q,{key:"a610ab740c82b6088400839884d58d4d867829db"},i(A,{key:"f05bf10e82fab03ddfdaf3ab2e100dcbd6d69c63",disabled:N},i("div",{key:"4bf63ed08d2a4a049e060d26d3699656558d495e",class:{[a.wrapper]:!0,[a.wrapperBordered]:U}},i("tr",{key:"d231a113c3bd8ee7f67c2ffb0cf804c142a95fb9","aria-expanded":e?C(t):null,"aria-label":d,"aria-level":n,"aria-posinset":l,"aria-selected":C(u),"aria-setsize":s,class:{[a.container]:!0,[a.containerHover]:!0,[a.containerBorder]:v,[a.containerBorderSelected]:R,[a.containerBorderUnselected]:j},hidden:g||_,onFocus:this.focusCellNull,onFocusin:this.emitInternalListItemActive,onKeyDown:this.handleItemKeyDown,ref:W=>this.containerEl=W,role:"row",tabIndex:o?0:-1},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),this.renderContentBottom()),this.renderDefaultContainer()))}emitCalciteInternalListItemToggle(){this.calciteInternalListItemToggle.emit()}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:n}=this;e&&(t||(this.selectionMode=e.selectionMode),n||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const t=Q(e),n=V(e);Y(t),this.openable=!!t.length||!!n.length}getGridCells(){return[this.handleGridEl,this.actionsStartEl,this.contentEl,this.actionsEndEl].filter(e=>e&&!e.hidden)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return se}},[1,"calcite-list-item",{active:[4],bordered:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragDisabled:[516,"drag-disabled"],dragHandle:[4,"drag-handle"],dragSelected:[1540,"drag-selected"],filterHidden:[516,"filter-hidden"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],unavailable:[516],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],hasContentBottom:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]],{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],open:["handleOpenChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function K(){typeof customElements>"u"||["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,G);break;case"calcite-action":customElements.get(e)||Z();break;case"calcite-handle":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||B();break;case"calcite-loader":customElements.get(e)||ee();break}})}K();const Ee=G,Ae=K;export{Ee as CalciteListItem,Ae as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-gyJma6DH.js b/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-gyJma6DH.js new file mode 100644 index 00000000..f41ca8fd --- /dev/null +++ b/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-gyJma6DH.js @@ -0,0 +1 @@ +import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{l as r,p as h}from"./interactive-DqhNilgd-C3lhdKPd.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",m=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return m}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const D=a,S=s;export{D as CalciteListItemGroup,S as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-s3QAS6n5.js b/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-s3QAS6n5.js deleted file mode 100644 index 31e2801d..00000000 --- a/custom-toc-separator/assets/calcite-list-item-group-CuQ2MPLW-s3QAS6n5.js +++ /dev/null @@ -1 +0,0 @@ -import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{l as r,p as h}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",m=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return m}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const D=a,S=s;export{D as CalciteListItemGroup,S as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-rnu1YzAl-6bVX6Odb.js b/custom-toc-separator/assets/calcite-list-rnu1YzAl-6bVX6Odb.js new file mode 100644 index 00000000..5b368600 --- /dev/null +++ b/custom-toc-separator/assets/calcite-list-rnu1YzAl-6bVX6Odb.js @@ -0,0 +1,2 @@ +import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-C3lhdKPd.js";import{c as Hn}from"./observers-BigwqTsw-C0_AGNdr.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-BZhnQqr6.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-CoY6CcfD.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-rjNm5YCZ.js";import{v as Un}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{c as Gn}from"./scrim-BscQh4v9-BkfQZEPV.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-DM6mxOFq.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. + The data argument should be an array of objects`);const o=(r,s,l)=>{if(r?.constant||r?.filterDisabled)return!0;let c=!1;return za(r,(h,u)=>{typeof h=="function"||h==null||l&&!l.includes(u)||(Array.isArray(h)||typeof h=="object"&&h!==null?o(h,s)&&(c=!0):s.test(h)&&(c=!0))}),c};return e.filter(r=>o(r,a,n))},$a={container:"container",searchIcon:"search-icon"},Ba={search:"search",close:"x"},Wa=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-color-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-color-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-color-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Ua=Wa,Ga=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=ce(this,"calciteFilterChange",6),this.filterDebounced=Jt((e,t=!1,n)=>this.updateFiltered(Yt(this.items??[],e,this.filterProps),t,n),jn.filter),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault())},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.filterProps=void 0,this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}filterPropsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async componentWillLoad(){Bt(this),this.updateFiltered(Yt(this.items??[],this.value,this.filterProps)),await Vt(this)}connectedCallback(){Qt(this),Zt(this)}componentDidRender(){zt(this)}disconnectedCallback(){qt(this),Kt(this),this.filterDebounced.cancel()}componentDidLoad(){Wt(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){return await Ut(this),this.textInput?.setFocus()}updateFiltered(e,t=!1,n){this.filteredItems=e,t&&this.calciteFilterChange.emit(),n?.()}render(){const{disabled:e,scale:t}=this;return v($t,{key:"c4a624e52409ed90839b506f5d99ab623767260e",disabled:e},v("div",{key:"1f2ef99156489719dd2f938bc5ce8a05185866bf",class:$a.container},v("label",{key:"6fe8c6cf73f554908be38299263d23380a4ed089"},v("calcite-input",{key:"6765e00d208d6898221540769865d84aa1c64974",clearable:!0,disabled:e,icon:Ba.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:n=>{this.textInput=n},scale:t,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ua}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],filterProps:[16],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]},void 0,{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function Pn(){typeof customElements>"u"||["calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Ga);break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-progress":customElements.get(e)||nn();break}})}Pn();const J={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Va=0,dt={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Za=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-color-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Ka=Za,Xe="calcite-list-item",Qa="calcite-list-item-group, calcite-list-item",kn=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=ce(this,"calciteListChange",6),this.calciteListDragEnd=ce(this,"calciteListDragEnd",6),this.calciteListDragStart=ce(this,"calciteListDragStart",6),this.calciteListFilter=ce(this,"calciteListFilter",6),this.calciteListOrderChange=ce(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=ce(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector=Xe,this.focusableItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Hn("mutation",()=>this.updateListItems({performFilter:!0})),this.visibleItems=[],this.handleDefaultSlotChange=e=>{Yn(zn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=he(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=he(e)},this.handleFilterNoResultsSlotChange=e=>{this.hasFilterNoResults=he(e)},this.setActiveListItem=()=>{const{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.borderItems=()=>{const e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsOpen(t));e.forEach(t=>t.bordered=t!==e[e.length-1])},this.updateFilteredItems=(e=!1)=>{const{visibleItems:t,filteredData:n,filterText:i}=this,a=n.map(l=>l.value),o=t?.filter(l=>t.every(c=>c===l||!l.contains(c))),r=t.filter(l=>!i||a.includes(l.value))||[],s=new WeakSet;o.forEach(l=>this.filterElements({el:l,filteredItems:r,visibleParents:s})),this.filteredItems=r,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Jt(e=>{const t=e?.emitFilterChange??!1,n=e?.performFilter??!1,{selectionAppearance:i,selectionMode:a,dragEnabled:o,el:r,filterEl:s,filterEnabled:l}=this,c=Array.from(this.el.querySelectorAll(Xe));if(c.forEach(h=>{h.selectionAppearance=i,h.selectionMode=a,h.closest("calcite-list")===r&&(h.dragHandle=o)}),this.parentListEl){this.setUpSorting();return}this.listItems=c,l&&n&&(this.dataForFilter=this.getItemData(),s&&(s.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(h=>!h.closed&&!h.hidden),this.updateFilteredItems(t),this.borderItems(),this.focusableItems=this.filteredItems.filter(h=>!h.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()},Va),this.focusRow=e=>{const{focusableItems:t}=this;e&&(t.forEach(n=>n.active=n===e),e.setFocus())},this.isNavigable=e=>{const t=e.parentElement?.closest(Xe);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,n=this.focusableItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(t==="ArrowDown"){e.preventDefault();const a=e.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(t==="ArrowUp"){if(e.preventDefault(),i===0&&this.filterEnabled){this.filterEl?.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(t==="Home"){e.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(t==="End"){e.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.filterProps=void 0,this.messageOverrides=void 0,this.messages=void 0,this.numberingSystem=void 0,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.effectiveLocale="",this.defaultMessages=void 0,this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1}async handleFilterTextChange(){this.performFilter()}async handleFilterPropsChange(){this.performFilter()}onMessagesChange(){}handleListItemChange(){this.updateListItems({performFilter:!0})}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{focusableItems:t}=this,n=t.findIndex(i=>i.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n}=this;n.forEach(i=>{i.active=i===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n,selectionMode:i}=this;t.selected&&(i==="single"||i==="single-persist")&&n.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();const{target:t,detail:n}=e,{focusableItems:i,lastSelectedInfo:a}=this,o=t;if(n.selectMultiple&&a){const r=i.indexOf(o),s=i.indexOf(a.selectedItem),l=Math.min(s,r),c=Math.max(s,r);i.slice(l,c+1).forEach(h=>h.selected=a.selected)}else this.lastSelectedInfo={selectedItem:o,selected:o.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){Qt(this),Zt(this),this.connectObserver(),this.updateListItems({performFilter:!0}),this.setUpSorting(),this.setParentList()}async componentWillLoad(){Bt(this),await Vt(this)}componentDidRender(){zt(this)}componentDidLoad(){Wt(this)}disconnectedCallback(){this.disconnectObserver(),wn(this),qt(this),Kt(this)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async setFocus(){return await Ut(this),this.filterEnabled?this.filterEl?.setFocus():this.focusableItems.find(e=>e.active)?.setFocus()}render(){const{loading:e,label:t,disabled:n,dataForFilter:i,filterEnabled:a,filterPlaceholder:o,filterText:r,filteredItems:s,hasFilterActionsStart:l,hasFilterActionsEnd:c,hasFilterNoResults:h,filterProps:u}=this;return v($t,{key:"c3139afe4fe7c7462578a51a4578971c97473167",disabled:this.disabled},v("div",{key:"5e99dc8b479c35609c5f0318723b3da84ec23ef4",class:J.container},this.dragEnabled?v("span",{"aria-live":"assertive",class:J.assistiveText},this.assistiveText):null,this.renderItemAriaLive(),e?v("calcite-scrim",{class:J.scrim,loading:e}):null,v("table",{key:"a31ba050d3141351e491141365e8244ed3ca5303","aria-busy":Rn(e),"aria-label":t||"",class:J.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||l||c?v("thead",{class:J.sticky},v("tr",null,v("th",{colSpan:Xn},v("calcite-stack",{class:J.stack},v("slot",{name:dt.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:ye.actionsStart}),v("calcite-filter",{"aria-label":o,disabled:n,filterProps:u,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:o,ref:this.setFilterEl,value:r}),v("slot",{name:dt.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:ye.actionsEnd}))))):null,v("tbody",{key:"3ed1b8d9a4387c3ea0f4ff38e5388be35b32d89b",class:J.tableContainer},v("slot",{key:"712562533b4609749cbff0968bd0a9e77d99758e",onSlotchange:this.handleDefaultSlotChange}))),v("div",{key:"3ff977013e0ca0d58229e1305dca702000d91a99","aria-live":"polite","data-test-id":"no-results-container",hidden:!(h&&a&&r&&!s.length)},v("slot",{key:"7c2bf6389c8b5f4b6f617950e4068baf6b1dc358",name:dt.filterNoResults,onSlotchange:this.handleFilterNoResultsSlotChange}))))}renderItemAriaLive(){const{messages:e,filteredItems:t,parentListEl:n,effectiveLocale:i,numberingSystem:a,filterEnabled:o,filterText:r,filteredData:s}=this;return It.numberFormatOptions={locale:i,numberingSystem:a},n?null:v("div",{"aria-live":"polite",class:J.assistiveText},o&&r&&s?.length?v("div",{key:"aria-filter-enabled"},e.filterEnabled):null,v("div",{key:"aria-item-count"},e.total.replace("{count}",It.localize(t.length.toString()))),t.length?v("ol",{key:"aria-item-list"},t.map(l=>v("li",null,l.label))):null)}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Ei(this)}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest("calcite-list")}filterElements({el:e,filteredItems:t,visibleParents:n}){const i=!n.has(e)&&!t.includes(e);e.filterHidden=i;const a=e.parentElement.closest(Qa);a&&(i||n.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:n}))}allParentListItemsOpen(e){const t=e.parentElement?.closest(Xe);if(t){if(!t.open)return!1}else return!0;return this.allParentListItemsOpen(t)}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems({emitFilterChange:e}))}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}performFilter(){const{filterEl:e,filterText:t,filterProps:n}=this;e&&(e.value=t,e.filterProps=n,this.filterAndUpdateData())}handleNudgeEvent(e){const{handleSelector:t,dragSelector:n}=this,{direction:i}=e.detail,a=e.composedPath(),o=a.find(S=>S?.tagName&&S.matches(t)),r=a.find(S=>S?.tagName&&S.matches(n)),s=r?.parentElement;if(!s)return;const{filteredItems:l}=this,c=l.filter(S=>S.parentElement===s),h=c.length-1,u=c.indexOf(r);let y;i==="up"?y=u===0?h:u-1:y=u===h?0:u+1,this.disconnectObserver(),o.blurUnselectDisabled=!0;const m=i==="up"&&y!==h||i==="down"&&y===0?c[y]:c[y].nextSibling;s.insertBefore(r,m),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:s,toEl:s,newIndex:y,oldIndex:u}),o.setFocus().then(()=>o.blurUnselectDisabled=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ka}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],filterProps:[16],messageOverrides:[1040],messages:[1040],numberingSystem:[1,"numbering-system"],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],hasFilterNoResults:[32],setFocus:[64]},[[0,"calciteInternalListItemToggle","handleCalciteListItemToggle"],[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalAssistiveTextChange","handleCalciteInternalAssistiveTextChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemSelectMultiple","handleCalciteInternalListItemSelectMultiple"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]],{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}]);function On(){typeof customElements>"u"||["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,kn);break;case"calcite-filter":customElements.get(e)||Pn();break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-loader":customElements.get(e)||Un();break;case"calcite-progress":customElements.get(e)||nn();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||In();break}})}On();const wo=kn,So=On;export{wo as CalciteList,So as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-list-rnu1YzAl-Vo-4M19I.js b/custom-toc-separator/assets/calcite-list-rnu1YzAl-Vo-4M19I.js deleted file mode 100644 index 62f3c811..00000000 --- a/custom-toc-separator/assets/calcite-list-rnu1YzAl-Vo-4M19I.js +++ /dev/null @@ -1,2 +0,0 @@ -import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{c as Hn}from"./observers-BigwqTsw-BCNzxmob.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-B_MyJQVY.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-BKvGneFm.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-l9oxBLp5.js";import{v as Un}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{c as Gn}from"./scrim-BscQh4v9-DzezRv_f.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-DuqBvFSD.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. - The data argument should be an array of objects`);const o=(r,s,l)=>{if(r?.constant||r?.filterDisabled)return!0;let c=!1;return za(r,(h,u)=>{typeof h=="function"||h==null||l&&!l.includes(u)||(Array.isArray(h)||typeof h=="object"&&h!==null?o(h,s)&&(c=!0):s.test(h)&&(c=!0))}),c};return e.filter(r=>o(r,a,n))},$a={container:"container",searchIcon:"search-icon"},Ba={search:"search",close:"x"},Wa=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-color-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-color-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-color-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Ua=Wa,Ga=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=ce(this,"calciteFilterChange",6),this.filterDebounced=Jt((e,t=!1,n)=>this.updateFiltered(Yt(this.items??[],e,this.filterProps),t,n),jn.filter),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault())},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.filterProps=void 0,this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}filterPropsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async componentWillLoad(){Bt(this),this.updateFiltered(Yt(this.items??[],this.value,this.filterProps)),await Vt(this)}connectedCallback(){Qt(this),Zt(this)}componentDidRender(){zt(this)}disconnectedCallback(){qt(this),Kt(this),this.filterDebounced.cancel()}componentDidLoad(){Wt(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){return await Ut(this),this.textInput?.setFocus()}updateFiltered(e,t=!1,n){this.filteredItems=e,t&&this.calciteFilterChange.emit(),n?.()}render(){const{disabled:e,scale:t}=this;return v($t,{key:"c4a624e52409ed90839b506f5d99ab623767260e",disabled:e},v("div",{key:"1f2ef99156489719dd2f938bc5ce8a05185866bf",class:$a.container},v("label",{key:"6fe8c6cf73f554908be38299263d23380a4ed089"},v("calcite-input",{key:"6765e00d208d6898221540769865d84aa1c64974",clearable:!0,disabled:e,icon:Ba.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:n=>{this.textInput=n},scale:t,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ua}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],filterProps:[16],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]},void 0,{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function Pn(){typeof customElements>"u"||["calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Ga);break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-progress":customElements.get(e)||nn();break}})}Pn();const J={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Va=0,dt={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Za=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-color-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Ka=Za,Xe="calcite-list-item",Qa="calcite-list-item-group, calcite-list-item",kn=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=ce(this,"calciteListChange",6),this.calciteListDragEnd=ce(this,"calciteListDragEnd",6),this.calciteListDragStart=ce(this,"calciteListDragStart",6),this.calciteListFilter=ce(this,"calciteListFilter",6),this.calciteListOrderChange=ce(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=ce(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector=Xe,this.focusableItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Hn("mutation",()=>this.updateListItems({performFilter:!0})),this.visibleItems=[],this.handleDefaultSlotChange=e=>{Yn(zn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=he(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=he(e)},this.handleFilterNoResultsSlotChange=e=>{this.hasFilterNoResults=he(e)},this.setActiveListItem=()=>{const{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.borderItems=()=>{const e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsOpen(t));e.forEach(t=>t.bordered=t!==e[e.length-1])},this.updateFilteredItems=(e=!1)=>{const{visibleItems:t,filteredData:n,filterText:i}=this,a=n.map(l=>l.value),o=t?.filter(l=>t.every(c=>c===l||!l.contains(c))),r=t.filter(l=>!i||a.includes(l.value))||[],s=new WeakSet;o.forEach(l=>this.filterElements({el:l,filteredItems:r,visibleParents:s})),this.filteredItems=r,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Jt(e=>{const t=e?.emitFilterChange??!1,n=e?.performFilter??!1,{selectionAppearance:i,selectionMode:a,dragEnabled:o,el:r,filterEl:s,filterEnabled:l}=this,c=Array.from(this.el.querySelectorAll(Xe));if(c.forEach(h=>{h.selectionAppearance=i,h.selectionMode=a,h.closest("calcite-list")===r&&(h.dragHandle=o)}),this.parentListEl){this.setUpSorting();return}this.listItems=c,l&&n&&(this.dataForFilter=this.getItemData(),s&&(s.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(h=>!h.closed&&!h.hidden),this.updateFilteredItems(t),this.borderItems(),this.focusableItems=this.filteredItems.filter(h=>!h.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()},Va),this.focusRow=e=>{const{focusableItems:t}=this;e&&(t.forEach(n=>n.active=n===e),e.setFocus())},this.isNavigable=e=>{const t=e.parentElement?.closest(Xe);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,n=this.focusableItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(t==="ArrowDown"){e.preventDefault();const a=e.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(t==="ArrowUp"){if(e.preventDefault(),i===0&&this.filterEnabled){this.filterEl?.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(t==="Home"){e.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(t==="End"){e.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.filterProps=void 0,this.messageOverrides=void 0,this.messages=void 0,this.numberingSystem=void 0,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.effectiveLocale="",this.defaultMessages=void 0,this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1}async handleFilterTextChange(){this.performFilter()}async handleFilterPropsChange(){this.performFilter()}onMessagesChange(){}handleListItemChange(){this.updateListItems({performFilter:!0})}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{focusableItems:t}=this,n=t.findIndex(i=>i.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n}=this;n.forEach(i=>{i.active=i===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n,selectionMode:i}=this;t.selected&&(i==="single"||i==="single-persist")&&n.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();const{target:t,detail:n}=e,{focusableItems:i,lastSelectedInfo:a}=this,o=t;if(n.selectMultiple&&a){const r=i.indexOf(o),s=i.indexOf(a.selectedItem),l=Math.min(s,r),c=Math.max(s,r);i.slice(l,c+1).forEach(h=>h.selected=a.selected)}else this.lastSelectedInfo={selectedItem:o,selected:o.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){Qt(this),Zt(this),this.connectObserver(),this.updateListItems({performFilter:!0}),this.setUpSorting(),this.setParentList()}async componentWillLoad(){Bt(this),await Vt(this)}componentDidRender(){zt(this)}componentDidLoad(){Wt(this)}disconnectedCallback(){this.disconnectObserver(),wn(this),qt(this),Kt(this)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async setFocus(){return await Ut(this),this.filterEnabled?this.filterEl?.setFocus():this.focusableItems.find(e=>e.active)?.setFocus()}render(){const{loading:e,label:t,disabled:n,dataForFilter:i,filterEnabled:a,filterPlaceholder:o,filterText:r,filteredItems:s,hasFilterActionsStart:l,hasFilterActionsEnd:c,hasFilterNoResults:h,filterProps:u}=this;return v($t,{key:"c3139afe4fe7c7462578a51a4578971c97473167",disabled:this.disabled},v("div",{key:"5e99dc8b479c35609c5f0318723b3da84ec23ef4",class:J.container},this.dragEnabled?v("span",{"aria-live":"assertive",class:J.assistiveText},this.assistiveText):null,this.renderItemAriaLive(),e?v("calcite-scrim",{class:J.scrim,loading:e}):null,v("table",{key:"a31ba050d3141351e491141365e8244ed3ca5303","aria-busy":Rn(e),"aria-label":t||"",class:J.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||l||c?v("thead",{class:J.sticky},v("tr",null,v("th",{colSpan:Xn},v("calcite-stack",{class:J.stack},v("slot",{name:dt.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:ye.actionsStart}),v("calcite-filter",{"aria-label":o,disabled:n,filterProps:u,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:o,ref:this.setFilterEl,value:r}),v("slot",{name:dt.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:ye.actionsEnd}))))):null,v("tbody",{key:"3ed1b8d9a4387c3ea0f4ff38e5388be35b32d89b",class:J.tableContainer},v("slot",{key:"712562533b4609749cbff0968bd0a9e77d99758e",onSlotchange:this.handleDefaultSlotChange}))),v("div",{key:"3ff977013e0ca0d58229e1305dca702000d91a99","aria-live":"polite","data-test-id":"no-results-container",hidden:!(h&&a&&r&&!s.length)},v("slot",{key:"7c2bf6389c8b5f4b6f617950e4068baf6b1dc358",name:dt.filterNoResults,onSlotchange:this.handleFilterNoResultsSlotChange}))))}renderItemAriaLive(){const{messages:e,filteredItems:t,parentListEl:n,effectiveLocale:i,numberingSystem:a,filterEnabled:o,filterText:r,filteredData:s}=this;return It.numberFormatOptions={locale:i,numberingSystem:a},n?null:v("div",{"aria-live":"polite",class:J.assistiveText},o&&r&&s?.length?v("div",{key:"aria-filter-enabled"},e.filterEnabled):null,v("div",{key:"aria-item-count"},e.total.replace("{count}",It.localize(t.length.toString()))),t.length?v("ol",{key:"aria-item-list"},t.map(l=>v("li",null,l.label))):null)}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Ei(this)}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest("calcite-list")}filterElements({el:e,filteredItems:t,visibleParents:n}){const i=!n.has(e)&&!t.includes(e);e.filterHidden=i;const a=e.parentElement.closest(Qa);a&&(i||n.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:n}))}allParentListItemsOpen(e){const t=e.parentElement?.closest(Xe);if(t){if(!t.open)return!1}else return!0;return this.allParentListItemsOpen(t)}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems({emitFilterChange:e}))}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}performFilter(){const{filterEl:e,filterText:t,filterProps:n}=this;e&&(e.value=t,e.filterProps=n,this.filterAndUpdateData())}handleNudgeEvent(e){const{handleSelector:t,dragSelector:n}=this,{direction:i}=e.detail,a=e.composedPath(),o=a.find(S=>S?.tagName&&S.matches(t)),r=a.find(S=>S?.tagName&&S.matches(n)),s=r?.parentElement;if(!s)return;const{filteredItems:l}=this,c=l.filter(S=>S.parentElement===s),h=c.length-1,u=c.indexOf(r);let y;i==="up"?y=u===0?h:u-1:y=u===h?0:u+1,this.disconnectObserver(),o.blurUnselectDisabled=!0;const m=i==="up"&&y!==h||i==="down"&&y===0?c[y]:c[y].nextSibling;s.insertBefore(r,m),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:s,toEl:s,newIndex:y,oldIndex:u}),o.setFocus().then(()=>o.blurUnselectDisabled=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ka}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],filterProps:[16],messageOverrides:[1040],messages:[1040],numberingSystem:[1,"numbering-system"],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],hasFilterNoResults:[32],setFocus:[64]},[[0,"calciteInternalListItemToggle","handleCalciteListItemToggle"],[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalAssistiveTextChange","handleCalciteInternalAssistiveTextChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemSelectMultiple","handleCalciteInternalListItemSelectMultiple"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]],{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}]);function On(){typeof customElements>"u"||["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,kn);break;case"calcite-filter":customElements.get(e)||Pn();break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-loader":customElements.get(e)||Un();break;case"calcite-progress":customElements.get(e)||nn();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||In();break}})}On();const wo=kn,So=On;export{wo as CalciteList,So as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-loader-CtpHSU2--C7VzgnNq.js b/custom-toc-separator/assets/calcite-loader-CtpHSU2--C7VzgnNq.js new file mode 100644 index 00000000..361c8b0d --- /dev/null +++ b/custom-toc-separator/assets/calcite-loader-CtpHSU2--C7VzgnNq.js @@ -0,0 +1 @@ +import{f as o,v as t}from"./loader-Ch7Jr16w-DWxaqSJX.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-Dy9CelfZ.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-C0_AGNdr.js";const d=o,l=t;export{d as CalciteLoader,l as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-loader-CtpHSU2--ijLDTpyP.js b/custom-toc-separator/assets/calcite-loader-CtpHSU2--ijLDTpyP.js deleted file mode 100644 index 661a2afe..00000000 --- a/custom-toc-separator/assets/calcite-loader-CtpHSU2--ijLDTpyP.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,v as t}from"./loader-Ch7Jr16w-B4sW6aLS.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-CnEFMUdd.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BCNzxmob.js";const d=o,l=t;export{d as CalciteLoader,l as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-notice-DeAGopAs-SWsgCJuf.js b/custom-toc-separator/assets/calcite-notice-DeAGopAs-SWsgCJuf.js deleted file mode 100644 index af7b6975..00000000 --- a/custom-toc-separator/assets/calcite-notice-DeAGopAs-SWsgCJuf.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-BJqhnuaV.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{K as y,q as z}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-BKvGneFm.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BCNzxmob.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host{display:flex}:host([open]) .container{pointer-events:auto;max-block-size:100%;align-items:center;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);overflow:visible}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.notice-close:active{background-color:var(--calcite-color-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-color-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-color:var(--calcite-color-status-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-color:var(--calcite-color-status-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-color-status-warning)}:host([hidden]){display:none}[hidden]{display:none}`,L=O,r=f(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeBeforeClose=n(this,"calciteNoticeBeforeClose",6),this.calciteNoticeBeforeOpen=n(this,"calciteNoticeBeforeOpen",6),this.calciteNoticeClose=n(this,"calciteNoticeClose",6),this.calciteNoticeOpen=n(this,"calciteNoticeOpen",6),this.setTransitionEl=e=>{this.transitionEl=e},this.close=()=>{this.open=!1},this.openTransitionProp="opacity",this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){s(this)}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=c(l,this.icon,this.kind)}connectedCallback(){b(this),y(this),C(this)}disconnectedCallback(){u(this),z(this),E(this)}async componentWillLoad(){v(this),this.requestedIcon=c(l,this.icon,this.kind),await q(this),this.open&&s(this)}componentDidLoad(){x(this)}render(){const{el:e}=this,h=t("button",{key:"52f9306ebe945398929f68fe66615359836ba2d8","aria-label":this.messages.close,class:i.close,onClick:this.close,ref:g=>this.closeButton=g},t("calcite-icon",{key:"f3601ac9547c73219661eebc7e7470db5dee7b52",icon:"x",scale:a(this.scale)})),m=k(e,o.actionsEnd);return t("div",{key:"3f8117ff7cdd08c92ce804ef4ac8af83003156a4",class:i.container,ref:this.setTransitionEl},this.requestedIcon?t("div",{class:i.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:a(this.scale)})):null,t("div",{key:"1b614ee86618bd5ce6e8834b466baf7d2564b5a1",class:i.content},t("slot",{key:"19467ed9718a78c7530c2a08c727028d565dee7b",name:o.title}),t("slot",{key:"191e71caf2f2147c62fd6b73602e41d95dc27558",name:o.message}),t("slot",{key:"d4fbf2b8aaa980cd24c5be89c6c8a36d091658f3",name:o.link})),m?t("div",{class:i.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?h:null)}async setFocus(){await w(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}onBeforeClose(){this.calciteNoticeBeforeClose.emit()}onBeforeOpen(){this.calciteNoticeBeforeOpen.emit()}onClose(){this.calciteNoticeClose.emit()}onOpen(){this.calciteNoticeOpen.emit()}effectiveLocaleChange(){N(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return L}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function d(){typeof customElements>"u"||["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,r);break;case"calcite-icon":customElements.get(e)||B();break}})}d();const A=r,G=d;export{A as CalciteNotice,G as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-notice-DeAGopAs-kC7ujg8g.js b/custom-toc-separator/assets/calcite-notice-DeAGopAs-kC7ujg8g.js new file mode 100644 index 00000000..6b29b1cc --- /dev/null +++ b/custom-toc-separator/assets/calcite-notice-DeAGopAs-kC7ujg8g.js @@ -0,0 +1,11 @@ +import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-C2Pw5SgP.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{K as y,q as z}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-CoY6CcfD.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-C0_AGNdr.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host{display:flex}:host([open]) .container{pointer-events:auto;max-block-size:100%;align-items:center;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);overflow:visible}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.notice-close:active{background-color:var(--calcite-color-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-color-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-color:var(--calcite-color-status-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-color:var(--calcite-color-status-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-color-status-warning)}:host([hidden]){display:none}[hidden]{display:none}`,L=O,r=f(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeBeforeClose=n(this,"calciteNoticeBeforeClose",6),this.calciteNoticeBeforeOpen=n(this,"calciteNoticeBeforeOpen",6),this.calciteNoticeClose=n(this,"calciteNoticeClose",6),this.calciteNoticeOpen=n(this,"calciteNoticeOpen",6),this.setTransitionEl=e=>{this.transitionEl=e},this.close=()=>{this.open=!1},this.openTransitionProp="opacity",this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){s(this)}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=c(l,this.icon,this.kind)}connectedCallback(){b(this),y(this),C(this)}disconnectedCallback(){u(this),z(this),E(this)}async componentWillLoad(){v(this),this.requestedIcon=c(l,this.icon,this.kind),await q(this),this.open&&s(this)}componentDidLoad(){x(this)}render(){const{el:e}=this,h=t("button",{key:"52f9306ebe945398929f68fe66615359836ba2d8","aria-label":this.messages.close,class:i.close,onClick:this.close,ref:g=>this.closeButton=g},t("calcite-icon",{key:"f3601ac9547c73219661eebc7e7470db5dee7b52",icon:"x",scale:a(this.scale)})),m=k(e,o.actionsEnd);return t("div",{key:"3f8117ff7cdd08c92ce804ef4ac8af83003156a4",class:i.container,ref:this.setTransitionEl},this.requestedIcon?t("div",{class:i.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:a(this.scale)})):null,t("div",{key:"1b614ee86618bd5ce6e8834b466baf7d2564b5a1",class:i.content},t("slot",{key:"19467ed9718a78c7530c2a08c727028d565dee7b",name:o.title}),t("slot",{key:"191e71caf2f2147c62fd6b73602e41d95dc27558",name:o.message}),t("slot",{key:"d4fbf2b8aaa980cd24c5be89c6c8a36d091658f3",name:o.link})),m?t("div",{class:i.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?h:null)}async setFocus(){await w(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}onBeforeClose(){this.calciteNoticeBeforeClose.emit()}onBeforeOpen(){this.calciteNoticeBeforeOpen.emit()}onClose(){this.calciteNoticeClose.emit()}onOpen(){this.calciteNoticeOpen.emit()}effectiveLocaleChange(){N(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return L}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]},void 0,{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function d(){typeof customElements>"u"||["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,r);break;case"calcite-icon":customElements.get(e)||B();break}})}d();const A=r,G=d;export{A as CalciteNotice,G as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-B48bXaVz.js b/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-B48bXaVz.js new file mode 100644 index 00000000..1047ec94 --- /dev/null +++ b/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-B48bXaVz.js @@ -0,0 +1 @@ +import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-DBDPUlOe.js";import{$ as x}from"./FloatingArrow-BG9llDYg-Di-yhMoZ.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const F=m,X=u;export{F as CalciteTooltip,X as defineCustomElement}; diff --git a/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-CcXqKF5v.js b/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-CcXqKF5v.js deleted file mode 100644 index 17ca53fe..00000000 --- a/custom-toc-separator/assets/calcite-tooltip-63c9fmIw-CcXqKF5v.js +++ /dev/null @@ -1 +0,0 @@ -import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3-elIRTcW0.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-CRyJWWhi.js";import{$ as x}from"./FloatingArrow-BG9llDYg-ljy-TIYj.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const F=m,X=u;export{F as CalciteTooltip,X as defineCustomElement}; diff --git a/custom-toc-separator/assets/chartCommon-rWfJsTPl-BGwi4Jd-.js b/custom-toc-separator/assets/chartCommon-rWfJsTPl-BGwi4Jd-.js new file mode 100644 index 00000000..410dbd0f --- /dev/null +++ b/custom-toc-separator/assets/chartCommon-rWfJsTPl-BGwi4Jd-.js @@ -0,0 +1 @@ +import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-Cwu0Sicn.js";import{l as L,m as k}from"./Button-MQvwxOnj-K6z9w3ks.js";import{w as U}from"./Tooltip-B0HefZ7r-CIb4Q87H.js";import{i as $}from"./ColorSet-DkIwOmgs-BsDJZ3_f.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class N extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const z=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{N as AnimatedThemeAm5,$ as ColorSetAm5,G as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,U as TooltipAm5,M as colorAm5,z as esriChartColorSet}; diff --git a/custom-toc-separator/assets/chartCommon-rWfJsTPl-ZXAmXzgK.js b/custom-toc-separator/assets/chartCommon-rWfJsTPl-ZXAmXzgK.js deleted file mode 100644 index 0938a5dd..00000000 --- a/custom-toc-separator/assets/chartCommon-rWfJsTPl-ZXAmXzgK.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-DrMnmN3S.js";import{l as L,m as k}from"./Button-MQvwxOnj-bFRWo4ou.js";import{w as U}from"./Tooltip-B0HefZ7r-BDGW0IFP.js";import{i as $}from"./ColorSet-DkIwOmgs-BSZuvnWe.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class N extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const z=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{N as AnimatedThemeAm5,$ as ColorSetAm5,G as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,U as TooltipAm5,M as colorAm5,z as esriChartColorSet}; diff --git a/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DRqSEqV9.js b/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DRqSEqV9.js deleted file mode 100644 index 34c41e9d..00000000 --- a/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DRqSEqV9.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as P}from"./main-lj2zzr_L.js";import{h as ut}from"./story-OUarUCIt.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-DrMnmN3S.js";import{w as $e}from"./Tooltip-B0HefZ7r-BDGW0IFP.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-BpAhXUxl.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Yi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Yi as createRoot}; diff --git a/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DrkEg-ah.js b/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DrkEg-ah.js new file mode 100644 index 00000000..722c8c83 --- /dev/null +++ b/custom-toc-separator/assets/chartUtilsAm5-CtY-kHPy-DrkEg-ah.js @@ -0,0 +1 @@ +import{_ as P}from"./main-BTdHgocv.js";import{h as ut}from"./story-DT1Ep1ux.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-Cwu0Sicn.js";import{w as $e}from"./Tooltip-B0HefZ7r-CIb4Q87H.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-BJrIQ0SQ.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Yi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Yi as createRoot}; diff --git a/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-BUNQAKUj.js b/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-BUNQAKUj.js new file mode 100644 index 00000000..c20d72c2 --- /dev/null +++ b/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-BUNQAKUj.js @@ -0,0 +1 @@ +import{ar as l}from"./story-DT1Ep1ux.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-BKynsqQg.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; diff --git a/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-CX4234se.js b/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-CX4234se.js deleted file mode 100644 index fe929571..00000000 --- a/custom-toc-separator/assets/cimSymbolUtils-CKIzBgMU-CX4234se.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as l}from"./story-OUarUCIt.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-BNEY6jgo.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; diff --git a/custom-toc-separator/assets/clientSideDefaults-BqqayPct-B1aankCm.js b/custom-toc-separator/assets/clientSideDefaults-BqqayPct-B1aankCm.js new file mode 100644 index 00000000..72bd0f9c --- /dev/null +++ b/custom-toc-separator/assets/clientSideDefaults-BqqayPct-B1aankCm.js @@ -0,0 +1,7 @@ +import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./story-DT1Ep1ux.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` + return class AttributesClass$${m++} { + constructor() { + ${r}; + } + } + `)();return()=>new o}catch{return()=>({[s]:null,...t})}}function p(t){return d.test(t)?`.${t}`:`["${t}"]`}function C(t={}){return[{name:"New Feature",description:"",prototype:{attributes:c(t)}}]}function R(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:y,editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{R as $,C as A,$ as d,B as f}; diff --git a/custom-toc-separator/assets/clientSideDefaults-BqqayPct-BCK_HM0i.js b/custom-toc-separator/assets/clientSideDefaults-BqqayPct-BCK_HM0i.js deleted file mode 100644 index aa152d41..00000000 --- a/custom-toc-separator/assets/clientSideDefaults-BqqayPct-BCK_HM0i.js +++ /dev/null @@ -1,7 +0,0 @@ -import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./story-OUarUCIt.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` - return class AttributesClass$${m++} { - constructor() { - ${r}; - } - } - `)();return()=>new o}catch{return()=>({[s]:null,...t})}}function p(t){return d.test(t)?`.${t}`:`["${t}"]`}function C(t={}){return[{name:"New Feature",description:"",prototype:{attributes:c(t)}}]}function R(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryBins:y,editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{R as $,C as A,$ as d,B as f}; diff --git a/custom-toc-separator/assets/colorRamps-q0bZVhs2-D0XKNTvx.js b/custom-toc-separator/assets/colorRamps-q0bZVhs2-D0XKNTvx.js deleted file mode 100644 index 9d4e85fa..00000000 --- a/custom-toc-separator/assets/colorRamps-q0bZVhs2-D0XKNTvx.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./story-OUarUCIt.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; diff --git a/custom-toc-separator/assets/colorRamps-q0bZVhs2-Yy2GlotV.js b/custom-toc-separator/assets/colorRamps-q0bZVhs2-Yy2GlotV.js new file mode 100644 index 00000000..08e081fd --- /dev/null +++ b/custom-toc-separator/assets/colorRamps-q0bZVhs2-Yy2GlotV.js @@ -0,0 +1 @@ +import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./story-DT1Ep1ux.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; diff --git a/custom-toc-separator/assets/colorUtils-Cthpxcks-DXg8vX2o.js b/custom-toc-separator/assets/colorUtils-Cthpxcks-DXg8vX2o.js new file mode 100644 index 00000000..f253992d --- /dev/null +++ b/custom-toc-separator/assets/colorUtils-Cthpxcks-DXg8vX2o.js @@ -0,0 +1 @@ +import{ar as h,eu as w,P,ev as A}from"./story-DT1Ep1ux.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function v(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=v(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=v(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(z(t))}function F(t){return M(L(t))}function G(t){return B(H(z(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; diff --git a/custom-toc-separator/assets/colorUtils-Cthpxcks-DchH3ayn.js b/custom-toc-separator/assets/colorUtils-Cthpxcks-DchH3ayn.js deleted file mode 100644 index af993d54..00000000 --- a/custom-toc-separator/assets/colorUtils-Cthpxcks-DchH3ayn.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as h,eu as w,P,ev as A}from"./story-OUarUCIt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function v(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=v(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=v(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(z(t))}function F(t){return M(L(t))}function G(t){return B(H(z(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; diff --git a/custom-toc-separator/assets/commonProperties-BtIqvFU_-BAaMjACd.js b/custom-toc-separator/assets/commonProperties-BtIqvFU_-BAaMjACd.js new file mode 100644 index 00000000..70592e61 --- /dev/null +++ b/custom-toc-separator/assets/commonProperties-BtIqvFU_-BAaMjACd.js @@ -0,0 +1 @@ +import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,cs as P,cS as k,n as S,J as $}from"./story-DT1Ep1ux.js";import{q}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; diff --git a/custom-toc-separator/assets/commonProperties-BtIqvFU_-CGeXCscf.js b/custom-toc-separator/assets/commonProperties-BtIqvFU_-CGeXCscf.js deleted file mode 100644 index c4e5fc6f..00000000 --- a/custom-toc-separator/assets/commonProperties-BtIqvFU_-CGeXCscf.js +++ /dev/null @@ -1 +0,0 @@ -import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,cs as P,cS as k,n as S,J as $}from"./story-OUarUCIt.js";import{q}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; diff --git a/custom-toc-separator/assets/compilerUtils-CV1QYWI8-BsFCPQiC.js b/custom-toc-separator/assets/compilerUtils-CV1QYWI8-BsFCPQiC.js new file mode 100644 index 00000000..021f7e2e --- /dev/null +++ b/custom-toc-separator/assets/compilerUtils-CV1QYWI8-BsFCPQiC.js @@ -0,0 +1 @@ +import"./story-DT1Ep1ux.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/custom-toc-separator/assets/compilerUtils-CV1QYWI8-yV6K-awH.js b/custom-toc-separator/assets/compilerUtils-CV1QYWI8-yV6K-awH.js deleted file mode 100644 index cda5fcea..00000000 --- a/custom-toc-separator/assets/compilerUtils-CV1QYWI8-yV6K-awH.js +++ /dev/null @@ -1 +0,0 @@ -import"./story-OUarUCIt.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js b/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js deleted file mode 100644 index 0f699be9..00000000 --- a/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js +++ /dev/null @@ -1 +0,0 @@ -import{aC as O,bj as S,dg as R}from"./story-OUarUCIt.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; diff --git a/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js b/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js new file mode 100644 index 00000000..18d3dc6d --- /dev/null +++ b/custom-toc-separator/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js @@ -0,0 +1 @@ +import{aC as O,bj as S,dg as R}from"./story-DT1Ep1ux.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-B27FdgMD.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; diff --git a/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-BJqhnuaV.js b/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-BJqhnuaV.js deleted file mode 100644 index 1507b195..00000000 --- a/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-BJqhnuaV.js +++ /dev/null @@ -1 +0,0 @@ -import{n as i}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{c}from"./observers-BigwqTsw-BCNzxmob.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; diff --git a/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-C2Pw5SgP.js b/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-C2Pw5SgP.js new file mode 100644 index 00000000..480ec9ab --- /dev/null +++ b/custom-toc-separator/assets/conditionalSlot-DsCzytJ4-C2Pw5SgP.js @@ -0,0 +1 @@ +import{n as i}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{c}from"./observers-BigwqTsw-C0_AGNdr.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; diff --git a/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DvAU7l0w.js b/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DvAU7l0w.js new file mode 100644 index 00000000..f40b8915 --- /dev/null +++ b/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DvAU7l0w.js @@ -0,0 +1 @@ +import{$ as m,o as s,P as p}from"./story-DT1Ep1ux.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import"./main-BTdHgocv.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import"./vec3-BazNroeq-xVxXS26y.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-CEZkOwEl.js";async function k(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{k as convertMeshVertexSpace}; diff --git a/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DzCRoPAY.js b/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DzCRoPAY.js deleted file mode 100644 index da9ba7be..00000000 --- a/custom-toc-separator/assets/convertMeshVertexSpace-BO7NR5uA-DzCRoPAY.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as m,o as s,P as p}from"./story-OUarUCIt.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import"./main-lj2zzr_L.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./vec3-BazNroeq-C58EAHFm.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-CF_vNE3j.js";async function k(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{k as convertMeshVertexSpace}; diff --git a/custom-toc-separator/assets/createConnection-CrkuTLXs-CphPkuWc.js b/custom-toc-separator/assets/createConnection-CrkuTLXs-CphPkuWc.js new file mode 100644 index 00000000..dd383c05 --- /dev/null +++ b/custom-toc-separator/assets/createConnection-CrkuTLXs-CphPkuWc.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-DV01qpqc.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./LRUCache-C3erQTWv-D3oKynNB.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js","./commonProperties-BtIqvFU_-BAaMjACd.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-FWeI_AU8.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js","./Relationship-PyhUibYK-Dl9eU1qo.js","./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js","./Layer-ChoECxvZ-ocw70508.js","./workers-PiCjreoO-DrDY4oeh.js","./editsZScale-BDsX6vv--CJojmgz5.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./APIKeyMixin-BUMSx9ny-WDHyZfLR.js","./ArcGISService-BYA-y6X6-BWJQc6nI.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./parser-DyDJ-rlI-BVBmjSW8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./CustomParametersMixin-vdKsTHer-D2O-ilop.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./FeatureEffectLayer-Cro89IEC-wxowDxbO.js","./FeatureEffect-CDEk9Es7-8jhaVJv-.js","./FeatureFilter-BCFHgLVU-DfMwTLEM.js","./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js","./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js","./labelingInfo-DGVNul26-DxpYAQDw.js","./labelUtils-BW14kBqX-B_97vWvS.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DbKLfNnN.js","./OrderedLayer-6Qsmrd_l-BekPpQJS.js","./OrderByInfo-GD2XnU8e-BH2q29Gm.js","./PortalLayer-CElnYuSQ-CcA75vOb.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./TemporalLayer-CpOrN_w9-B2VZ6x81.js","./TimeInfo-w_HB2CsF-CygrHAJu.js","./FeatureTemplate-SPHPD45f-Dk1o48TK.js","./FeatureType-C9hJmS6_-zoljUYGr.js","./fieldProperties-Bq26w7gt-c4nyNJP6.js","./versionUtils-LZYZz-38-esAtUime.js","./styleUtils-ChrJTYIw-DnWMc-4t.js","./popupUtils-B0uZcXX0-mkpGjfro.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); +import{_ as L}from"./main-BTdHgocv.js";import{I as N,o as c,v as d,S as _,i as m,y as b,a1 as a,az as O,b as k,f as x,g as E,J as P}from"./story-DT1Ep1ux.js";import{o as v}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{q as S}from"./query-DFW9-NG_-SSagAgRu.js";import{b as q}from"./Query-BrwMGK8U-FWeI_AU8.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";let p=class extends N.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=v(t,o,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=b(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await O(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const o=new WebSocket(e);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=s=>this._onClose(s),o.onerror=s=>this._onError(s),this._setWebSocketJSONParseHandler(o),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),o=t.onmessage,{filter:s,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),s&&l.filter!==s&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=x(e.path,{query:t,responseType:"json"}),o=(await r).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:o,token:s}=r,n=this._inferWebSocketBaseUrl(o);return b(`${n}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=k(),u=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),s=!0,n.resolve())};return r.onmessage=h,r.send(o),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const o=E(e.geometry);if(o.type!=="extent")throw new c(`Expected extent but found type ${o.type}`);r.geometry=JSON.stringify(o.shiftCentralMeridian())}catch(o){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],o=this._relatedFeatures.get(r);if(!o)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:n}=o;for(const u in s)e.attributes[u]=s[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),o=this._queryArchive(t);await r;const s=await o;if(!s)return;for(const n of s.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await L(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-DV01qpqc.js");return{default:R}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=o?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=u),s)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],o=0){t.start=t.num!=null?o*t.num:null;const{data:s}=await S(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&o<(this._config.maxQueryDepth??0)?(s.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,o+1)):(r.forEach(n=>s.features.push(n)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,o=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const n=s.attributes[o];t.set(n,s)}this._relatedFeatures=t}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._featureZScaler=v(t,o,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function re(e,t,r,o,s,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:I(s,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{re as createConnection}; diff --git a/custom-toc-separator/assets/createConnection-CrkuTLXs-DMli8kp_.js b/custom-toc-separator/assets/createConnection-CrkuTLXs-DMli8kp_.js deleted file mode 100644 index 2e4f0e16..00000000 --- a/custom-toc-separator/assets/createConnection-CrkuTLXs-DMli8kp_.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-gUIs0TS1.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./Layer-ChoECxvZ-DxWUU3pP.js","./workers-PiCjreoO-mU03Z-E4.js","./editsZScale-BDsX6vv--D74kwHO-.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); -import{_ as L}from"./main-lj2zzr_L.js";import{I as N,o as c,v as d,S as _,i as m,y as b,a1 as a,az as O,b as k,f as x,g as E,J as P}from"./story-OUarUCIt.js";import{o as v}from"./projection-BA9M1R7d-Cytmrlsd.js";import{q as S}from"./query-DFW9-NG_-CLOB0soI.js";import{b as q}from"./Query-BrwMGK8U-gUIs0TS1.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";let p=class extends N.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=v(t,o,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=b(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await O(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const o=new WebSocket(e);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=s=>this._onClose(s),o.onerror=s=>this._onError(s),this._setWebSocketJSONParseHandler(o),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),o=t.onmessage,{filter:s,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),s&&l.filter!==s&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=x(e.path,{query:t,responseType:"json"}),o=(await r).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:o,token:s}=r,n=this._inferWebSocketBaseUrl(o);return b(`${n}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=k(),u=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),s=!0,n.resolve())};return r.onmessage=h,r.send(o),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const o=E(e.geometry);if(o.type!=="extent")throw new c(`Expected extent but found type ${o.type}`);r.geometry=JSON.stringify(o.shiftCentralMeridian())}catch(o){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],o=this._relatedFeatures.get(r);if(!o)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:n}=o;for(const u in s)e.attributes[u]=s[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),o=this._queryArchive(t);await r;const s=await o;if(!s)return;for(const n of s.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this).error(new c("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await L(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-_MOPDF8o.js");return{default:R}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=o?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=u),s)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],o=0){t.start=t.num!=null?o*t.num:null;const{data:s}=await S(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&o<(this._config.maxQueryDepth??0)?(s.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,o+1)):(r.forEach(n=>s.features.push(n)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,o=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const n=s.attributes[o];t.set(n,s)}this._relatedFeatures=t}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._featureZScaler=v(t,o,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function re(e,t,r,o,s,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:I(s,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{re as createConnection}; diff --git a/custom-toc-separator/assets/dataUtils-BkPy4R3C-CjC6pTlj.js b/custom-toc-separator/assets/dataUtils-BkPy4R3C-CjC6pTlj.js new file mode 100644 index 00000000..46c68031 --- /dev/null +++ b/custom-toc-separator/assets/dataUtils-BkPy4R3C-CjC6pTlj.js @@ -0,0 +1 @@ +import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,eE as At,aG as Gt,n as Ot,bj as Wt}from"./story-DT1Ep1ux.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; diff --git a/custom-toc-separator/assets/dataUtils-BkPy4R3C-YDmCFwfE.js b/custom-toc-separator/assets/dataUtils-BkPy4R3C-YDmCFwfE.js deleted file mode 100644 index ab2f1b37..00000000 --- a/custom-toc-separator/assets/dataUtils-BkPy4R3C-YDmCFwfE.js +++ /dev/null @@ -1 +0,0 @@ -import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,eE as At,aG as Gt,n as Ot,bj as Wt}from"./story-OUarUCIt.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; diff --git a/custom-toc-separator/assets/deduplicate-D2d-E5Pw-DsVnH-8X.js b/custom-toc-separator/assets/deduplicate-D2d-E5Pw-DsVnH-8X.js deleted file mode 100644 index 9f4fe8ff..00000000 --- a/custom-toc-separator/assets/deduplicate-D2d-E5Pw-DsVnH-8X.js +++ /dev/null @@ -1 +0,0 @@ -import{hb as v}from"./story-OUarUCIt.js";import{h as z,w as O}from"./Indices-DEr2HrWx-Bin5_zrY.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; diff --git a/custom-toc-separator/assets/deduplicate-D2d-E5Pw-UtmvndF2.js b/custom-toc-separator/assets/deduplicate-D2d-E5Pw-UtmvndF2.js new file mode 100644 index 00000000..d24edf74 --- /dev/null +++ b/custom-toc-separator/assets/deduplicate-D2d-E5Pw-UtmvndF2.js @@ -0,0 +1 @@ +import{hb as v}from"./story-DT1Ep1ux.js";import{h as z,w as O}from"./Indices-DEr2HrWx-BChBDP40.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; diff --git a/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-3yiQscxj.js b/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-3yiQscxj.js deleted file mode 100644 index afb15eb0..00000000 --- a/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-3yiQscxj.js +++ /dev/null @@ -1 +0,0 @@ -import{o as f,f as m}from"./story-OUarUCIt.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-Djr5L7DU.js";import"./main-lj2zzr_L.js";async function y(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{y as deleteForwardEdits}; diff --git a/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-DhhRngbW.js b/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-DhhRngbW.js new file mode 100644 index 00000000..2b58f782 --- /dev/null +++ b/custom-toc-separator/assets/deleteForwardEdits-BHWvOnK8-DhhRngbW.js @@ -0,0 +1 @@ +import{o as f,f as m}from"./story-DT1Ep1ux.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-CwJW9dca.js";import"./main-BTdHgocv.js";async function y(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{y as deleteForwardEdits}; diff --git a/custom-toc-separator/assets/details-screen-DE85sbTV-BsTsPhUC.js b/custom-toc-separator/assets/details-screen-DE85sbTV-BsTsPhUC.js deleted file mode 100644 index 0e8521b9..00000000 --- a/custom-toc-separator/assets/details-screen-DE85sbTV-BsTsPhUC.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as F,eU as se,f6 as L,f8 as ie,e$ as t,fb as a,f2 as h,fl as R,fm as Y,f3 as U,fF as ve,f5 as O,fg as I,fx as X,eZ as M,fa as N,fc as A,fo as le,gb as pe,eX as Z,gj as ne,fi as J,f7 as G,f9 as Q,f0 as V,f4 as w,eY as ee,fn as _e,eV as W,fG as ae,e_ as Te,f1 as de,gq as me,fK as je,gp as Me}from"./story-OUarUCIt.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-1eidiLPY.js";import"./main-lj2zzr_L.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=X(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=f=>{f.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=f=>d.getLayerByUid(f),z=f=>{r.value=f,b("selection-changed",f),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return J(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),Q(()=>{c.value.forEach(f=>f()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(f,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,g)=>(t(),a("div",{class:"flex justify-start relative",key:g},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Xe={key:1},Je=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Xe,I(w(k)("details.layers.results.empty")),1))}}),Qe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=X(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let g=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(g)&&(g=d.ui.escapeHtml(g)),g}),E=l=>{if(typeof l=="string"){const g="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=g,x.innerHTML):me(l,{className:g,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const g=l.oidField;l.getIcon(i.data.data[g]).then(x=>{b.value=x})}},f=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Je}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const g=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(g,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${g}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(g).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return J(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(l=>l())}),(l,g)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Qe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,g[1]||(g[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:g[0]||(g[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,g[2]||(g[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,g[3]||(g[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(f.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},ft={class:"flex"},gt=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=X(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),f=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),g=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},fe=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,f.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},ge=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),J(()=>{E.value.push(G(B,()=>{e.value||(fe(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),Q(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(g.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",ft,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>ge())},I(w(o)("details.item.see.list")),9,gt)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(f.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&f.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,f.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=X(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let f;if(H)f=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),g=new Set(l.map(x=>x[0]));f=[],g.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);f.push([x,T])}),f.sort((x,T)=>T[0]-x[0])}if(f.length===0){d.activeGreedy=0,b.value=!0;return}const P=f[f.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(f.pop(),E(m,f))})};return J(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const f=Te("panel-screen");return t(),V(f,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Bt=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Bt as default}; diff --git a/custom-toc-separator/assets/details-screen-DE85sbTV-DTHCDQTr.js b/custom-toc-separator/assets/details-screen-DE85sbTV-DTHCDQTr.js new file mode 100644 index 00000000..5ca37da9 --- /dev/null +++ b/custom-toc-separator/assets/details-screen-DE85sbTV-DTHCDQTr.js @@ -0,0 +1 @@ +import{eT as F,eU as se,f6 as L,f8 as ie,e$ as t,fb as a,f2 as h,fl as R,fm as Y,f3 as U,fF as ve,f5 as O,fg as I,fx as X,eZ as M,fa as N,fc as A,fo as le,gb as pe,eX as Z,gj as ne,fi as J,f7 as G,f9 as Q,f0 as V,f4 as w,eY as ee,fn as _e,eV as W,fG as ae,e_ as Te,f1 as de,gq as me,fK as je,gp as Me}from"./story-DT1Ep1ux.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-GDrthgIt.js";import"./main-BTdHgocv.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=X(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=f=>{f.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=f=>d.getLayerByUid(f),z=f=>{r.value=f,b("selection-changed",f),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return J(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),Q(()=>{c.value.forEach(f=>f()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(f,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,g)=>(t(),a("div",{class:"flex justify-start relative",key:g},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Xe={key:1},Je=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Xe,I(w(k)("details.layers.results.empty")),1))}}),Qe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=X(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let g=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(g)&&(g=d.ui.escapeHtml(g)),g}),E=l=>{if(typeof l=="string"){const g="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=g,x.innerHTML):me(l,{className:g,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const g=l.oidField;l.getIcon(i.data.data[g]).then(x=>{b.value=x})}},f=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Je}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const g=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(g,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${g}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(g).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return J(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(l=>l())}),(l,g)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Qe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,g[1]||(g[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:g[0]||(g[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,g[2]||(g[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,g[3]||(g[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(f.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},ft={class:"flex"},gt=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=X(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),f=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),g=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},fe=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,f.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},ge=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),J(()=>{E.value.push(G(B,()=>{e.value||(fe(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),Q(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(g.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",ft,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>ge())},I(w(o)("details.item.see.list")),9,gt)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(f.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&f.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,f.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=X(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let f;if(H)f=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),g=new Set(l.map(x=>x[0]));f=[],g.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);f.push([x,T])}),f.sort((x,T)=>T[0]-x[0])}if(f.length===0){d.activeGreedy=0,b.value=!0;return}const P=f[f.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(f.pop(),E(m,f))})};return J(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const f=Te("panel-screen");return t(),V(f,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Bt=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Bt as default}; diff --git a/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-DpL4XxiB.js b/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-DpL4XxiB.js new file mode 100644 index 00000000..e2f2676c --- /dev/null +++ b/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-DpL4XxiB.js @@ -0,0 +1 @@ +import{ag as g,bU as D,j as w}from"./story-DT1Ep1ux.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; diff --git a/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-JVwNDDxH.js b/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-JVwNDDxH.js deleted file mode 100644 index 222745cd..00000000 --- a/custom-toc-separator/assets/diffUtils-Cz3Fi8Xb-JVwNDDxH.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as g,bU as D,j as w}from"./story-OUarUCIt.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; diff --git a/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-2iUYAy9z.js b/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-2iUYAy9z.js deleted file mode 100644 index 097b8295..00000000 --- a/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-2iUYAy9z.js +++ /dev/null @@ -1 +0,0 @@ -import{n as m,p as c}from"./story-OUarUCIt.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; diff --git a/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-Da6Q2jMK.js b/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-Da6Q2jMK.js new file mode 100644 index 00000000..b6a3e414 --- /dev/null +++ b/custom-toc-separator/assets/drapedUtils-BZ1SGPtE-Da6Q2jMK.js @@ -0,0 +1 @@ +import{n as m,p as c}from"./story-DT1Ep1ux.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; diff --git a/custom-toc-separator/assets/edgeProcessing-CALv8P-b-BbULsEOo.js b/custom-toc-separator/assets/edgeProcessing-CALv8P-b-BbULsEOo.js new file mode 100644 index 00000000..e2d17250 --- /dev/null +++ b/custom-toc-separator/assets/edgeProcessing-CALv8P-b-BbULsEOo.js @@ -0,0 +1 @@ +import{v as It}from"./deduplicate-D2d-E5Pw-UtmvndF2.js";import{R as F}from"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import{T as l}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{p as Q}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{c$ as tt,ha as St,dg as w,bj as ht,ae as Ot,eE as At}from"./story-DT1Ep1ux.js";import{g as Et,_ as j,A as st,y as H,W as wt,S as dt,r as rt,l as pt,j as Tt}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";const Mt=F().vec3f(l.POSITION).u16(l.COMPONENTINDEX).freeze(),Rt=F().vec2u8(l.SIDENESS).freeze();Q(Rt);const q=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze(),G=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).vec2i16(l.NORMAL2COMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze();l.POSITION0,l.POSITION1,l.COMPONENTINDEX,l.VARIANTOFFSET,l.VARIANTSTROKE,l.VARIANTEXTENSION,l.NORMALCOMPRESSED,l.NORMAL2COMPRESSED,l.SIDENESS;let yt=class{constructor(){this.position0=w(),this.position1=w(),this.faceNormal0=w(),this.faceNormal1=w(),this.componentIndex=0,this.cosAngle=0}};const U=-1;function vt(t,n,o){const r=t.vertices.position,i=t.vertices.componentIndex,c=S.position0,d=S.position1,g=S.faceNormal0,m=S.faceNormal1,{edges:a,normals:h}=Ct(t),N=a.length/4,A=n.allocate(N);let V=0;const _=N,T=o?.allocate(_);let B=0,e=0,s=0;W.length=0;for(let p=0;pR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,d),ot){const E=3*et;j(g,h.data[E],h.data[E+1],h.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,h.data[E],h.data[E+1],h.data[E+2]),E=3*nt,j(m,h.data[E],h.data[E+1],h.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(dt(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=ht(4),Lt=Math.cos(gt),Ft=ht(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),d=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,h=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(h)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),d=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,d)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;oR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,d),ot){const E=3*et;j(g,h.data[E],h.data[E+1],h.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,h.data[E],h.data[E+1],h.data[E+2]),E=3*nt,j(m,h.data[E],h.data[E+1],h.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(dt(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=ht(4),Lt=Math.cos(gt),Ft=ht(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),d=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,h=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(h)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),d=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,d)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;o{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);return s.addFeatures?.length||s.updateFeatures?.length||s.deleteFeatures?.length||s.addAttachments?.length||s.updateAttachments?.length||s.deleteAttachments?.length?{edits:s,results:await t.applyEdits(s,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(X(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>Z(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>N(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await H(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities?.data.supportsM===!1)throw new n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=U(d,a),u=o||y(d)&&(y(a)||j(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function Z(e,t,r,a){f(e,t,r,a),I(e,t)}function N(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=B())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function X(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function H(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function le(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{de as applyEdits,X as checkEditingCapabilities,oe as isFeatureIdentifierArrayWithGlobalId,ne as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,le as uploadAssets}; diff --git a/custom-toc-separator/assets/editingSupport-gUqP9iyf-C1Nc4Ce5.js b/custom-toc-separator/assets/editingSupport-gUqP9iyf-C1Nc4Ce5.js new file mode 100644 index 00000000..871cf2f3 --- /dev/null +++ b/custom-toc-separator/assets/editingSupport-gUqP9iyf-C1Nc4Ce5.js @@ -0,0 +1 @@ +import{b as A,P as v,o as n,bF as $,bE as w,a1 as E,dG as S,ag as R,bi as O,jg as k,cZ as L,aC as U,dc as y,dd as j}from"./story-DT1Ep1ux.js";import{a as B}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{B as G}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{B as T,z}from"./EditBusLayer-Df29OyJh-CAoDB1e-.js";import{g as M}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./main-BTdHgocv.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";function F(e){return e?.applyEdits!=null}function V(e){return typeof e=="object"&&e!=null&&"objectId"in e&&!!e.objectId}function ne(e){return e.every(V)}function W(e){return typeof e=="object"&&e!=null&&"globalId"in e&&!!e.globalId}function oe(e){return e.every(W)}async function de(e,t,r,a={}){let s;const d="gdbVersion"in e?e.gdbVersion:null,p=a.gdbVersion??d;if(T(e)&&e.url)s=z(e.url,e.layerId,p,a.returnServiceEditsOption==="original-and-current-features");else{s=A(),s.promise.then(o=>{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);return s.addFeatures?.length||s.updateFeatures?.length||s.deleteFeatures?.length||s.addAttachments?.length||s.updateAttachments?.length||s.deleteAttachments?.length?{edits:s,results:await t.applyEdits(s,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(X(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>Z(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>N(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await H(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities?.data.supportsM===!1)throw new n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=U(d,a),u=o||y(d)&&(y(a)||j(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function Z(e,t,r,a){f(e,t,r,a),I(e,t)}function N(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=B())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function X(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function H(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function le(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{de as applyEdits,X as checkEditingCapabilities,oe as isFeatureIdentifierArrayWithGlobalId,ne as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,le as uploadAssets}; diff --git a/custom-toc-separator/assets/editingTools-BZ3yVmXf-Cimue3-F.js b/custom-toc-separator/assets/editingTools-BZ3yVmXf-Cimue3-F.js deleted file mode 100644 index 28abeeba..00000000 --- a/custom-toc-separator/assets/editingTools-BZ3yVmXf-Cimue3-F.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-D0EvxauM.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-DuqBvFSD.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-Bw4n2n3w.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-DyDwqoXd.js","./locale-Cn_GDVD_-CnEFMUdd.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-BCNzxmob.js","./t9n-C_hcZMZJ-DI6xkvhp.js","./icon-BXFbBbop-BKvGneFm.js","./loader-Ch7Jr16w-B4sW6aLS.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Eh4JVIZU.js","./calcite-input-BKRd7MCS-C6GuFEjN.js","./input2-eOtqu-iO-l9oxBLp5.js","./calcite-dropdown-CLrG397W-BEizDxoW.js","./floating-ui-DKFFlLv3-elIRTcW0.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-CRyJWWhi.js","./calcite-dropdown-item-DpLfv4A0-C6jOH2pP.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-njC2GiTc.js"])))=>i.map(i=>d[i]); -import{_ as It}from"./main-lj2zzr_L.js";import{v as a,S as c,i as x,ar as _i,e2 as pi,e0 as Ne,w as C,dg as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as U,ax as ke,aA as dt,aL as es,aF as Il,av as $s,L as di,k8 as So,as as Us,i1 as Hs,ay as Ll,dx as Po,bi as Lt,a2 as Y,j as tt,d8 as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,d$ as Dl,eK as li,e as kr,m as fi,aO as Gn,es as Dn,d_ as zl,ag as ss,aw as Mo,d9 as $l,di as fn,j_ as Ul,k9 as Hl,d6 as Nl,b7 as Fl,ka as Zl,dj as Bl,h$ as Yl,kb as Cr,hq as Fe,D as Wl,kc as Xl,bt as ko,$ as ql,az as jl,bx as Rr,dh as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,et as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,dn as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as $r,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as $n,i4 as dc,c3 as Ci,dd as Zs,ko as Bs,h_ as Ao,hh as fc,dc as gc,de as mc,db as yc,kp as _c}from"./story-OUarUCIt.js";import{i as q,j as Ys,A as vc,l as Be,S as _e,y as qt,M as sn,m as Yt,x as xc,g as bc,b as Un,v as Oo,I as Ur,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ws,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-CdnDHDm4.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as $c,g as Uc,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as Ye,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import Xs from"./GraphicsLayer-DfeGaYc1-CVunY75r.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-vCqdY65r.js";import{simplify as Zc,distance as Bc,geodesicArea as Yc,geodesicLength as Yr}from"./geometryEngine-CdPoFSE4-csWZJ4px.js";import{U as Wc}from"./Tile-D75RMC64-DDmsm7e7.js";import{T as Xc,P as Wr,J as qc,Q as we,_ as Xr,u as $o,O as jc}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as Uo}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as We,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-lQMKFlS3.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{y as at,_ as js,w as Ae,D as Ks,N as $e,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-DlxNxa6f.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-CkV41Bdd.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-DnaZZmrr.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import{P as $h}from"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as Uh}from"./projection-BA9M1R7d-Cytmrlsd.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-yV6K-awH.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-CX4234se.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-2iUYAy9z.js";import{W as Fo}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-BcGP1hGu.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./signal-CETehA7D-TD-k6B-y.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-CznIGfdF.js";import"./utils-SPbpQbmm-BNEY6jgo.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ws(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Yh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ws(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Wh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Wh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new Lt({geometry:e,symbol:t});return this._graphicsLayer.add(i),Y(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return $l()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&Ul[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Yl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=$o(),this.transformInv=$o(),this.transform=jc(e),Wc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=Uo(),this.localToWorldTransform=Uo(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Yo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Wl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Wo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),$i.x=Re[0],$i.y=Ve[1],$i.z=Ve[2];const n=i.localToMap($i);return n!=null?Me(n,i.spatialReference):null}const $i=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(W){const gt=Math.cos(W),lt=Math.sin(W);return k(u*gt+h.x,p*lt+h.y)}for(let W=0;Wt.localToMap(W)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N(Ui,b,S,I),n.toRenderCoords(Ui,h,Ui);const K=w/o.computeScreenPixelSizeAt(Ui);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Yt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return Ut(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Yn);const s=pt(Yn,Yn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Yn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class $u extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class Uu extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Yt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function Ut(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return Ut(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return Ye(n,i)?e:void 0}if(Rt(e)){if(vt(t))return Ut(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Yu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Wu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return Ut(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return Ut(t,e);if(Vt(t))return Wn(ya(e.planeLike,t.planeLike));if(At(t))return Wn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return Ut(t,e);if(At(t))return Wn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return Ut(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return Ut(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return Ut(t,e);if(Ft(t))return}}const Yu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Wu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=$e(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const W=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||W.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||W.push(lt),Pt(W)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye($e(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Wn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof Uu}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new $u(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Yh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ws(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},Ue={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Wr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),Y(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let $=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],$.prototype,"hidden",void 0),a([c()],$.prototype,"mode",void 0),a([c()],$.prototype,"title",void 0),a([c()],$.prototype,"value",void 0),$=a([x("esri.views.interactive.tooltip.components.TooltipField")],$);const Dp={base:`${Q}-value-by-value`};let Wt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Wt.prototype,"left",void 0),a([c()],Wt.prototype,"divider",void 0),a([c()],Wt.prototype,"right",void 0),Wt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Wt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Ya)}function od(e){return Ha(e,Wa)}function rd(e){return Na(e,Ya)}function ad(e){return Na(e,Wa)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",Ua,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),Ua)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Ya=new Qs(-180,180),Wa=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case Ue.next:return this._onNextKey(e);case Ue.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-C6GuFEjN.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v($,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v($,{title:o.size,value:v(Wt,{left:r.length(i),right:r.length(n)})}):null,s.area?v($,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===Ue.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case Ue.commit:return this.field.onCommit("commit-and-exit",t,this.context);case Ue.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles(U(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-Eh4JVIZU.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-C6GuFEjN.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-D0EvxauM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dropdown:()=>It(()=>import("./calcite-dropdown-CLrG397W-BEizDxoW.js"),__vite__mapDeps([23,1,2,3,4,5,6,8,24,25,19,9,14,12,15,26]),import.meta.url),"dropdown-item":()=>It(()=>import("./calcite-dropdown-item-DpLfv4A0-C6jOH2pP.js"),__vite__mapDeps([27,1,2,3,4,5,6,8,12,11,9,28,17,15]),import.meta.url),"dropdown-group":()=>It(()=>import("./calcite-dropdown-group-0sIPwaDd-njC2GiTc.js"),__vite__mapDeps([29,1,2,3,4,5,6,15,28]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v($,{title:s.size,value:v(Wt,{left:o.length(t),right:o.length(i)})}):null,n.area?v($,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v($,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v($,{title:i.size,value:v(Wt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v($,{title:i.scale,value:v(Wt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v($,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v($,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v($,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v($,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v($,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([U(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),U(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),U(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),U(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},$s),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=Us(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),Us(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles(U(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return Ye(e,Hs)?1:Ye(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==Ue.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=We}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function $d(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:We,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function Ud(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=Ud(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=$d(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=We}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Yd(e,t=vo()){return Wd(e,t,!1)}function Wd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??We:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?We:Ka(t)??We}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),U(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},$s)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new Lt({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(Y(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Yo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Yo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Wo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Wo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return Y()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return Y()}onCursorEdgeChanged(e){return Y()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return Ur(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return Ye(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function $f(e,t){const i=$r(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,$f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":Uf(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function Uf(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Yf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Wf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=$e(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ys(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&Ye($e(this._plane),$e(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&Ye(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Wf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return Y(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Yf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),Y(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return Y();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return Y(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return Y(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:W}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,W),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=U(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=U(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([U(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),U(()=>this.view.viewpoint,(l,h)=>{l&&h&&$h(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(U(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),U(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),U(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=Us(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(U(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),Y()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return Y();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,Y()):(this._visualElementGraphics.activeVertex=new Lt({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,Y()):(this._visualElementGraphics.activeEdge=new Lt({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,Y()):(this._visualElementGraphics.regularVertices=new Lt({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=U(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},$s)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const $t={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Wr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new Lt({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==$t.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==$t.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==$t.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===$t.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===$t.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===$t.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===$t.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===$t.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===$t.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Yt(ii.get(),e[1],-e[0]),o=Yt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Yt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Yt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Yt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=$r(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},W=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:W,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Yt(this._axisCache,u.basis1[0],u.basis1[1]);Ys(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ys(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new Lt({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new Lt({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new Lt({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new Lt({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),U(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),U(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),U(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; diff --git a/custom-toc-separator/assets/editingTools-BZ3yVmXf-DEwlvZF_.js b/custom-toc-separator/assets/editingTools-BZ3yVmXf-DEwlvZF_.js new file mode 100644 index 00000000..34cca7d5 --- /dev/null +++ b/custom-toc-separator/assets/editingTools-BZ3yVmXf-DEwlvZF_.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-C4rXHwXx.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-DM6mxOFq.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-C3lhdKPd.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-BTu-x4Jk.js","./locale-Cn_GDVD_-Dy9CelfZ.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-C0_AGNdr.js","./t9n-C_hcZMZJ-BBqL2zVj.js","./icon-BXFbBbop-CoY6CcfD.js","./loader-Ch7Jr16w-DWxaqSJX.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-BPD9clRe.js","./calcite-input-BKRd7MCS-CiwokCpm.js","./input2-eOtqu-iO-rjNm5YCZ.js","./calcite-dropdown-CLrG397W-Dqy3pc5Y.js","./floating-ui-DKFFlLv3-Bi8PSsgj.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-DBDPUlOe.js","./calcite-dropdown-item-DpLfv4A0-3kui0urS.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-BrWCn04w.js"])))=>i.map(i=>d[i]); +import{_ as It}from"./main-BTdHgocv.js";import{v as a,S as c,i as x,ar as _i,e2 as pi,e0 as Ne,w as C,dg as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as U,ax as ke,aA as dt,aL as es,aF as Il,av as $s,L as di,k8 as So,as as Us,i1 as Hs,ay as Ll,dx as Po,bi as Lt,a2 as Y,j as tt,d8 as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,d$ as Dl,eK as li,e as kr,m as fi,aO as Gn,es as Dn,d_ as zl,ag as ss,aw as Mo,d9 as $l,di as fn,j_ as Ul,k9 as Hl,d6 as Nl,b7 as Fl,ka as Zl,dj as Bl,h$ as Yl,kb as Cr,hq as Fe,D as Wl,kc as Xl,bt as ko,$ as ql,az as jl,bx as Rr,dh as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,et as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,dn as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as $r,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as $n,i4 as dc,c3 as Ci,dd as Zs,ko as Bs,h_ as Ao,hh as fc,dc as gc,de as mc,db as yc,kp as _c}from"./story-DT1Ep1ux.js";import{i as q,j as Ys,A as vc,l as Be,S as _e,y as qt,M as sn,m as Yt,x as xc,g as bc,b as Un,v as Oo,I as Ur,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ws,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-DFXrlpsW.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as $c,g as Uc,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as Ye,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import Xs from"./GraphicsLayer-DfeGaYc1-shHP2mZF.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-CbCbq6vS.js";import{simplify as Zc,distance as Bc,geodesicArea as Yc,geodesicLength as Yr}from"./geometryEngine-CdPoFSE4-B4-kNUBs.js";import{U as Wc}from"./Tile-D75RMC64-XRkD8ADC.js";import{T as Xc,P as Wr,J as qc,Q as we,_ as Xr,u as $o,O as jc}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-Cqne66qw.js";import{e as Uo}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as We,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-C2vgvXwY.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import{y as at,_ as js,w as Ae,D as Ks,N as $e,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-CP4TXD5k.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-B4r28WKg.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./MeshTransform-C--IG09w-DmlAOJ8b.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-XgXaXzy3.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import{P as $h}from"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as Uh}from"./projection-BA9M1R7d-DTN1X2Bt.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-Da6Q2jMK.js";import{W as Fo}from"./colorUtils-Cthpxcks-DXg8vX2o.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-D5uXMAZI.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./BlendLayer-D1WkSmwP-DaCYrII3.js";import"./jsonUtils-wIllKWI4-ChoaxSoX.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-Bf311639.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./signal-CETehA7D-o0XgAOKb.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-CJhaINhC.js";import"./utils-SPbpQbmm-BKynsqQg.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ws(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Yh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ws(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Wh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Wh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new Lt({geometry:e,symbol:t});return this._graphicsLayer.add(i),Y(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return $l()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&Ul[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Yl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=$o(),this.transformInv=$o(),this.transform=jc(e),Wc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=Uo(),this.localToWorldTransform=Uo(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Yo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Wl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Wo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),$i.x=Re[0],$i.y=Ve[1],$i.z=Ve[2];const n=i.localToMap($i);return n!=null?Me(n,i.spatialReference):null}const $i=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(W){const gt=Math.cos(W),lt=Math.sin(W);return k(u*gt+h.x,p*lt+h.y)}for(let W=0;Wt.localToMap(W)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N(Ui,b,S,I),n.toRenderCoords(Ui,h,Ui);const K=w/o.computeScreenPixelSizeAt(Ui);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Yt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return Ut(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Yn);const s=pt(Yn,Yn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Yn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class $u extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class Uu extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Yt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function Ut(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return Ut(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return Ye(n,i)?e:void 0}if(Rt(e)){if(vt(t))return Ut(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Yu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Wu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return Ut(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return Ut(t,e);if(Vt(t))return Wn(ya(e.planeLike,t.planeLike));if(At(t))return Wn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return Ut(t,e);if(At(t))return Wn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return Ut(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return Ut(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return Ut(t,e);if(Ft(t))return}}const Yu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Wu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=$e(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const W=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||W.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||W.push(lt),Pt(W)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye($e(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Wn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof Uu}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new $u(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Yh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ws(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},Ue={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Wr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),Y(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let $=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],$.prototype,"hidden",void 0),a([c()],$.prototype,"mode",void 0),a([c()],$.prototype,"title",void 0),a([c()],$.prototype,"value",void 0),$=a([x("esri.views.interactive.tooltip.components.TooltipField")],$);const Dp={base:`${Q}-value-by-value`};let Wt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Wt.prototype,"left",void 0),a([c()],Wt.prototype,"divider",void 0),a([c()],Wt.prototype,"right",void 0),Wt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Wt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Ya)}function od(e){return Ha(e,Wa)}function rd(e){return Na(e,Ya)}function ad(e){return Na(e,Wa)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",Ua,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),Ua)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Ya=new Qs(-180,180),Wa=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case Ue.next:return this._onNextKey(e);case Ue.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-CiwokCpm.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v($,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v($,{title:o.size,value:v(Wt,{left:r.length(i),right:r.length(n)})}):null,s.area?v($,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===Ue.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case Ue.commit:return this.field.onCommit("commit-and-exit",t,this.context);case Ue.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles(U(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-BPD9clRe.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-CiwokCpm.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-C4rXHwXx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dropdown:()=>It(()=>import("./calcite-dropdown-CLrG397W-Dqy3pc5Y.js"),__vite__mapDeps([23,1,2,3,4,5,6,8,24,25,19,9,14,12,15,26]),import.meta.url),"dropdown-item":()=>It(()=>import("./calcite-dropdown-item-DpLfv4A0-3kui0urS.js"),__vite__mapDeps([27,1,2,3,4,5,6,8,12,11,9,28,17,15]),import.meta.url),"dropdown-group":()=>It(()=>import("./calcite-dropdown-group-0sIPwaDd-BrWCn04w.js"),__vite__mapDeps([29,1,2,3,4,5,6,15,28]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v($,{title:s.size,value:v(Wt,{left:o.length(t),right:o.length(i)})}):null,n.area?v($,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v($,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v($,{title:i.size,value:v(Wt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v($,{title:i.scale,value:v(Wt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v($,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v($,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v($,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v($,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v($,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([U(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),U(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),U(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),U(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},$s),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=Us(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),Us(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles(U(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return Ye(e,Hs)?1:Ye(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==Ue.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=We}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function $d(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:We,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function Ud(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=Ud(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=$d(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=We}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Yd(e,t=vo()){return Wd(e,t,!1)}function Wd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??We:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?We:Ka(t)??We}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),U(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},$s)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new Lt({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(Y(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Yo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Yo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Wo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Wo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return Y()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return Y()}onCursorEdgeChanged(e){return Y()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return Ur(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return Ye(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function $f(e,t){const i=$r(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,$f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":Uf(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function Uf(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Yf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Wf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=$e(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ys(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&Ye($e(this._plane),$e(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&Ye(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Wf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return Y(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Yf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),Y(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return Y();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return Y(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return Y(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:W}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,W),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=U(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=U(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([U(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),U(()=>this.view.viewpoint,(l,h)=>{l&&h&&$h(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(U(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),U(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),U(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=Us(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(U(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),Y()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return Y();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,Y()):(this._visualElementGraphics.activeVertex=new Lt({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,Y()):(this._visualElementGraphics.activeEdge=new Lt({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,Y()):(this._visualElementGraphics.regularVertices=new Lt({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=U(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},$s)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const $t={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Wr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new Lt({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==$t.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==$t.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==$t.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===$t.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===$t.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===$t.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===$t.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===$t.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===$t.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Yt(ii.get(),e[1],-e[0]),o=Yt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Yt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Yt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Yt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=$r(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},W=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:W,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Yt(this._axisCache,u.basis1[0],u.basis1[1]);Ys(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ys(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new Lt({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new Lt({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new Lt({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new Lt({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),U(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),U(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),U(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; diff --git a/custom-toc-separator/assets/editsZScale-BDsX6vv--CJojmgz5.js b/custom-toc-separator/assets/editsZScale-BDsX6vv--CJojmgz5.js new file mode 100644 index 00000000..9d670523 --- /dev/null +++ b/custom-toc-separator/assets/editsZScale-BDsX6vv--CJojmgz5.js @@ -0,0 +1 @@ +import{dh as a,aC as c}from"./story-DT1Ep1ux.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function p(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{p as c}; diff --git a/custom-toc-separator/assets/editsZScale-BDsX6vv--D74kwHO-.js b/custom-toc-separator/assets/editsZScale-BDsX6vv--D74kwHO-.js deleted file mode 100644 index 808cebea..00000000 --- a/custom-toc-separator/assets/editsZScale-BDsX6vv--D74kwHO-.js +++ /dev/null @@ -1 +0,0 @@ -import{dh as a,aC as c}from"./story-OUarUCIt.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function p(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{p as c}; diff --git a/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-CN_TctvZ.js b/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-CN_TctvZ.js deleted file mode 100644 index 6712f3be..00000000 --- a/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-CN_TctvZ.js +++ /dev/null @@ -1 +0,0 @@ -import{jw as g,di as m}from"./story-OUarUCIt.js";import{j as h}from"./ElevationInfo-yv2-9tj6-CvgTP051.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; diff --git a/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-Dolgdnjb.js b/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-Dolgdnjb.js new file mode 100644 index 00000000..598bde15 --- /dev/null +++ b/custom-toc-separator/assets/elevationInfoUtils-mOZsPH2J-Dolgdnjb.js @@ -0,0 +1 @@ +import{jw as g,di as m}from"./story-DT1Ep1ux.js";import{j as h}from"./ElevationInfo-yv2-9tj6-BtRqJcOf.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; diff --git a/custom-toc-separator/assets/executeBinsQuery-26-59HNS-CAw0ShUR.js b/custom-toc-separator/assets/executeBinsQuery-26-59HNS-CAw0ShUR.js new file mode 100644 index 00000000..e7b20042 --- /dev/null +++ b/custom-toc-separator/assets/executeBinsQuery-26-59HNS-CAw0ShUR.js @@ -0,0 +1 @@ +import{y as u}from"./utils-9sQxfkoa-CwJW9dca.js";import{a as p,f,bX as y,bM as m,bK as S,aC as c}from"./story-DT1Ep1ux.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{f as R}from"./query-DFW9-NG_-SSagAgRu.js";import g from"./BinsQuery-DjwQZqB8-BqGeRmeR.js";import{O}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./main-BTdHgocv.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?p(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return f(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function D(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{D as executeBinsQuery}; diff --git a/custom-toc-separator/assets/executeBinsQuery-26-59HNS-DM7KQ_00.js b/custom-toc-separator/assets/executeBinsQuery-26-59HNS-DM7KQ_00.js deleted file mode 100644 index 7fc69ae0..00000000 --- a/custom-toc-separator/assets/executeBinsQuery-26-59HNS-DM7KQ_00.js +++ /dev/null @@ -1 +0,0 @@ -import{y as u}from"./utils-9sQxfkoa-Djr5L7DU.js";import{a as p,f,bX as y,bM as m,bK as S,aC as c}from"./story-OUarUCIt.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{f as R}from"./query-DFW9-NG_-CLOB0soI.js";import g from"./BinsQuery-DjwQZqB8-xSRrS-fI.js";import{O}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./main-lj2zzr_L.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?p(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return f(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function D(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{D as executeBinsQuery}; diff --git a/custom-toc-separator/assets/executeForIds-Z1gkLduF-BLtp2DWt.js b/custom-toc-separator/assets/executeForIds-Z1gkLduF-BLtp2DWt.js deleted file mode 100644 index 6ee24d67..00000000 --- a/custom-toc-separator/assets/executeForIds-Z1gkLduF-BLtp2DWt.js +++ /dev/null @@ -1 +0,0 @@ -import{y as c}from"./utils-9sQxfkoa-Djr5L7DU.js";import{P as m,N as f}from"./query-DFW9-NG_-CLOB0soI.js";import{b as i}from"./Query-BrwMGK8U-gUIs0TS1.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/custom-toc-separator/assets/executeForIds-Z1gkLduF-CKWTLnam.js b/custom-toc-separator/assets/executeForIds-Z1gkLduF-CKWTLnam.js new file mode 100644 index 00000000..ad20b2f7 --- /dev/null +++ b/custom-toc-separator/assets/executeForIds-Z1gkLduF-CKWTLnam.js @@ -0,0 +1 @@ +import{y as c}from"./utils-9sQxfkoa-CwJW9dca.js";import{P as m,N as f}from"./query-DFW9-NG_-SSagAgRu.js";import{b as i}from"./Query-BrwMGK8U-FWeI_AU8.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Bt3EwZwA.js b/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Bt3EwZwA.js new file mode 100644 index 00000000..c5e95976 --- /dev/null +++ b/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Bt3EwZwA.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-CwJW9dca.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-ChckWHgQ.js";import a from"./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";async function j(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{j as executeForTopCount}; diff --git a/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Dh8nZiiP.js b/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Dh8nZiiP.js deleted file mode 100644 index 9b53fb2e..00000000 --- a/custom-toc-separator/assets/executeForTopCount-Dx1gCDe1-Dh8nZiiP.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Djr5L7DU.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-B2OySQ6g.js";import a from"./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";async function j(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{j as executeForTopCount}; diff --git a/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-CDRqhE8I.js b/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-CDRqhE8I.js new file mode 100644 index 00000000..15b68adf --- /dev/null +++ b/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-CDRqhE8I.js @@ -0,0 +1 @@ +import{n as a}from"./story-DT1Ep1ux.js";import{y as n}from"./utils-9sQxfkoa-CwJW9dca.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-ChckWHgQ.js";import x from"./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";async function b(m,r,i){const p=n(m),o=await e(p,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:a.fromJSON(t)}}export{b as executeForTopExtents}; diff --git a/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-D9Zdubzg.js b/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-D9Zdubzg.js deleted file mode 100644 index 417307e4..00000000 --- a/custom-toc-separator/assets/executeForTopExtents-3NOTiZTn-D9Zdubzg.js +++ /dev/null @@ -1 +0,0 @@ -import{n as a}from"./story-OUarUCIt.js";import{y as n}from"./utils-9sQxfkoa-Djr5L7DU.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-B2OySQ6g.js";import x from"./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js";import"./main-lj2zzr_L.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";async function b(m,r,i){const p=n(m),o=await e(p,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:a.fromJSON(t)}}export{b as executeForTopExtents}; diff --git a/custom-toc-separator/assets/executeForTopIds-BWxBZygF-BPk9RKm-.js b/custom-toc-separator/assets/executeForTopIds-BWxBZygF-BPk9RKm-.js new file mode 100644 index 00000000..6c38be45 --- /dev/null +++ b/custom-toc-separator/assets/executeForTopIds-BWxBZygF-BPk9RKm-.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-CwJW9dca.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-ChckWHgQ.js";import a from"./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";async function h(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{h as executeForTopIds}; diff --git a/custom-toc-separator/assets/executeForTopIds-BWxBZygF-U3ALYew8.js b/custom-toc-separator/assets/executeForTopIds-BWxBZygF-U3ALYew8.js deleted file mode 100644 index 48a4b805..00000000 --- a/custom-toc-separator/assets/executeForTopIds-BWxBZygF-U3ALYew8.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Djr5L7DU.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-B2OySQ6g.js";import a from"./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";async function h(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{h as executeForTopIds}; diff --git a/custom-toc-separator/assets/executeQueryJSON-CcHnccia-BAMZ5LEx.js b/custom-toc-separator/assets/executeQueryJSON-CcHnccia-BAMZ5LEx.js new file mode 100644 index 00000000..52c823c6 --- /dev/null +++ b/custom-toc-separator/assets/executeQueryJSON-CcHnccia-BAMZ5LEx.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-CwJW9dca.js";import{q as s}from"./query-DFW9-NG_-SSagAgRu.js";import{O as c}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{b as e}from"./Query-BrwMGK8U-FWeI_AU8.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/custom-toc-separator/assets/executeQueryJSON-CcHnccia-C6q0seac.js b/custom-toc-separator/assets/executeQueryJSON-CcHnccia-C6q0seac.js deleted file mode 100644 index 4252e759..00000000 --- a/custom-toc-separator/assets/executeQueryJSON-CcHnccia-C6q0seac.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-Djr5L7DU.js";import{q as s}from"./query-DFW9-NG_-CLOB0soI.js";import{O as c}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{b as e}from"./Query-BrwMGK8U-gUIs0TS1.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/custom-toc-separator/assets/executeQueryPBF-o8010HS9-Bi7xykzy.js b/custom-toc-separator/assets/executeQueryPBF-o8010HS9-Bi7xykzy.js new file mode 100644 index 00000000..ec7e23f5 --- /dev/null +++ b/custom-toc-separator/assets/executeQueryPBF-o8010HS9-Bi7xykzy.js @@ -0,0 +1 @@ +import{n as f,O as m}from"./story-DT1Ep1ux.js";import{y as u}from"./utils-9sQxfkoa-CwJW9dca.js";import{w as _,J as p}from"./query-DFW9-NG_-SSagAgRu.js";import{b as l}from"./Query-BrwMGK8U-FWeI_AU8.js";import{o as y}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; diff --git a/custom-toc-separator/assets/executeQueryPBF-o8010HS9-DA2vEqjE.js b/custom-toc-separator/assets/executeQueryPBF-o8010HS9-DA2vEqjE.js deleted file mode 100644 index 17775298..00000000 --- a/custom-toc-separator/assets/executeQueryPBF-o8010HS9-DA2vEqjE.js +++ /dev/null @@ -1 +0,0 @@ -import{n as f,O as m}from"./story-OUarUCIt.js";import{y as u}from"./utils-9sQxfkoa-Djr5L7DU.js";import{w as _,J as p}from"./query-DFW9-NG_-CLOB0soI.js";import{b as l}from"./Query-BrwMGK8U-gUIs0TS1.js";import{o as y}from"./projection-BA9M1R7d-Cytmrlsd.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; diff --git a/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-BPTwePaV.js b/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-BPTwePaV.js deleted file mode 100644 index 59ed7dc8..00000000 --- a/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-BPTwePaV.js +++ /dev/null @@ -1 +0,0 @@ -import{y as m}from"./utils-9sQxfkoa-Djr5L7DU.js";import{f as p,bM as y}from"./story-OUarUCIt.js";import{f as j}from"./query-DFW9-NG_-CLOB0soI.js";import{O as R}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./main-lj2zzr_L.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=y(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return p(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function V(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function $(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{V as executeRelationshipQuery,$ as executeRelationshipQueryForCount}; diff --git a/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js b/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js new file mode 100644 index 00000000..f764653b --- /dev/null +++ b/custom-toc-separator/assets/executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js @@ -0,0 +1 @@ +import{y as m}from"./utils-9sQxfkoa-CwJW9dca.js";import{f as p,bM as y}from"./story-DT1Ep1ux.js";import{f as j}from"./query-DFW9-NG_-SSagAgRu.js";import{O as R}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=y(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return p(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function V(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function $(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{V as executeRelationshipQuery,$ as executeRelationshipQueryForCount}; diff --git a/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js b/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js new file mode 100644 index 00000000..548f5c8a --- /dev/null +++ b/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js @@ -0,0 +1 @@ +import{y as f}from"./utils-9sQxfkoa-CwJW9dca.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-ChckWHgQ.js";import{O as u}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import n from"./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";async function v(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{v as executeTopFeaturesQuery}; diff --git a/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js b/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js deleted file mode 100644 index dcb46aad..00000000 --- a/custom-toc-separator/assets/executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js +++ /dev/null @@ -1 +0,0 @@ -import{y as f}from"./utils-9sQxfkoa-Djr5L7DU.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-B2OySQ6g.js";import{O as u}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import n from"./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";async function v(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{v as executeTopFeaturesQuery}; diff --git a/custom-toc-separator/assets/fabric-Df28hv38-CA5QxRI5.js b/custom-toc-separator/assets/fabric-Df28hv38-CA5QxRI5.js new file mode 100644 index 00000000..dbad5fc2 --- /dev/null +++ b/custom-toc-separator/assets/fabric-Df28hv38-CA5QxRI5.js @@ -0,0 +1,437 @@ +import{fA as Ct}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";function St(Z,f){for(var ft=0;ftht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;u0){var v=f.util.hasStyleChanged(l,p,!0);v?u.push({start:i,end:i+1,style:p}):u[u.length-1].end++}l=p||{}}}return u},stylesFromArray:function(t,n){if(!Array.isArray(t))return t;for(var a=n.split(` +`),i=-1,l=0,u={},d=0;d0?nt-=2*w:x===1&&nt<0&&(nt+=2*w);for(var rt=Math.ceil(Math.abs(nt/w*2)),ot=[],st=nt/rt,ut=8/3*Math.sin(st/4)*Math.sin(st/4)/Math.sin(st/2),dt=it+st,at=0;at=P?x-P:2*Math.PI-(P-x)}function t(m,C,S,b,P,x,y,w){var k;if(f.cachesBoundsOfCurve&&(k=c.call(arguments),f.boundsOfCurveCache[k]))return f.boundsOfCurveCache[k];var M=Math.sqrt,E=Math.min,R=Math.max,Y=Math.abs,z=[],j=[[],[]],O,I,L,D,B,H,tt,Q;I=6*m-12*S+6*P,O=-3*m+9*S-9*P+3*y,L=3*S-3*m;for(var F=0;F<2;++F){if(F>0&&(I=6*C-12*b+6*x,O=-3*C+9*b-9*x+3*w,L=3*b-3*C),Y(O)<1e-12){if(Y(I)<1e-12)continue;D=-L/I,01e-4;)y=P(S),E=S,w=i(x.x,x.y,y.x,y.y),w+b>C?(S-=k,k/=2):(x=y,S+=k,b+=w);return y.angle=M(E),y}function U(m){for(var C=0,S=m.length,b,P=0,x=0,y=0,w=0,k=[],M,E,R,Y=0;Y0&&btt)for(var F=1,$=O.length;F<$;F+=tt)C.push([L].concat(O.slice(F,F+tt))),L=Q;else C.push(O)}return C}function J(m,C){var S=[],b,P=new f.Point(m[0].x,m[0].y),x=new f.Point(m[1].x,m[1].y),y=m.length,w=1,k=0,M=y>2;for(C=C||0,M&&(w=m[2].xm[b-2].x?1:P.x===m[b-2].x?0:-1,k=P.y>m[b-2].y?1:P.y===m[b-2].y?0:-1),S.push(["L",P.x+w*C,P.y+k*C]),S}function K(m,C,S){return S&&(C=f.util.multiplyTransformMatrices(C,[1,0,0,1,-S.x,-S.y])),m.map(function(b){for(var P=b.slice(0),x={},y=1;y=i})}function o(t,n){return r(t,n,function(a,i){return a/g,">")}function o(r){var t=0,n,a=[];for(t=0,n;t57343)return r.charAt(t);if(55296<=n&&n<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";var a=r.charCodeAt(t+1);if(56320>a||a>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";var i=r.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}f.util.string={camelize:c,capitalize:s,escapeXml:h,graphemeSplit:o}}(),function(){var c=Array.prototype.slice,s=function(){},h=function(){for(var n in{toString:1})if(n==="toString")return!1;return!0}(),o=function(n,a,i){for(var l in a)l in n.prototype&&typeof n.prototype[l]=="function"&&(a[l]+"").indexOf("callSuper")>-1?n.prototype[l]=function(u){return function(){var d=this.constructor.superclass;this.constructor.superclass=i;var g=a[u].apply(this,arguments);if(this.constructor.superclass=d,u!=="initialize")return g}}(l):n.prototype[l]=a[l],h&&(a.toString!==Object.prototype.toString&&(n.prototype.toString=a.toString),a.valueOf!==Object.prototype.valueOf&&(n.prototype.valueOf=a.valueOf))};function e(){}function r(n){for(var a=null,i=this;i.constructor.superclass;){var l=i.constructor.superclass.prototype[n];if(i[n]!==l){a=l;break}i=i.constructor.superclass.prototype}return a?arguments.length>1?a.apply(this,c.call(arguments,1)):a.call(this):console.log("tried to callSuper "+n+", method not found in prototype chain",this)}function t(){var n=null,a=c.call(arguments,0);typeof a[0]=="function"&&(n=a.shift());function i(){this.initialize.apply(this,arguments)}i.superclass=n,i.subclasses=[],n&&(e.prototype=n.prototype,i.prototype=new e,n.subclasses.push(i));for(var l=0,u=a.length;l-1||o.pointerType==="touch"}}(),function(){function c(t,n){var a=t.style;if(!a)return t;if(typeof n=="string")return t.style.cssText+=";"+n,n.indexOf("opacity")>-1?r(t,n.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in n)if(i==="opacity")r(t,n[i]);else{var l=i==="float"||i==="cssFloat"?typeof a.styleFloat>"u"?"cssFloat":"styleFloat":i;a.setProperty(l,n[i])}return t}var s=f.document.createElement("div"),h=typeof s.style.opacity=="string",o=typeof s.style.filter=="string",e=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,r=function(t){return t};h?r=function(t,n){return t.style.opacity=n,t}:o&&(r=function(t,n){var a=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(a.zoom=1),e.test(a.filter)?(n=n>=.9999?"":"alpha(opacity="+n*100+")",a.filter=a.filter.replace(e,n)):a.filter+=" alpha(opacity="+n*100+")",t}),f.util.setStyle=c}(),function(){var c=Array.prototype.slice;function s(g){return typeof g=="string"?f.document.getElementById(g):g}var h,o=function(g){return c.call(g,0)};try{h=o(f.document.childNodes)instanceof Array}catch{}h||(o=function(g){for(var p=new Array(g.length),v=g.length;v--;)p[v]=g[v];return p});function e(g,p){var v=f.document.createElement(g);for(var _ in p)_==="class"?v.className=p[_]:_==="for"?v.htmlFor=p[_]:v.setAttribute(_,p[_]);return v}function r(g,p){g&&(" "+g.className+" ").indexOf(" "+p+" ")===-1&&(g.className+=(g.className?" ":"")+p)}function t(g,p,v){return typeof p=="string"&&(p=e(p,v)),g.parentNode&&g.parentNode.replaceChild(p,g),p.appendChild(g),p}function n(g){for(var p=0,v=0,_=f.document.documentElement,T=f.document.body||{scrollLeft:0,scrollTop:0};g&&(g.parentNode||g.host)&&(g=g.parentNode||g.host,g===f.document?(p=T.scrollLeft||_.scrollLeft||0,v=T.scrollTop||_.scrollTop||0):(p+=g.scrollLeft||0,v+=g.scrollTop||0),!(g.nodeType===1&&g.style.position==="fixed")););return{left:p,top:v}}function a(g){var p,v=g&&g.ownerDocument,_={left:0,top:0},T={left:0,top:0},A,X={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!v)return T;for(var W in X)T[X[W]]+=parseInt(i(g,W),10)||0;return p=v.documentElement,typeof g.getBoundingClientRect<"u"&&(_=g.getBoundingClientRect()),A=n(g),{left:_.left+A.left-(p.clientLeft||0)+T.left,top:_.top+A.top-(p.clientTop||0)+T.top}}var i;f.document.defaultView&&f.document.defaultView.getComputedStyle?i=function(g,p){var v=f.document.defaultView.getComputedStyle(g,null);return v?v[p]:void 0}:i=function(g,p){var v=g.style[p];return!v&&g.currentStyle&&(v=g.currentStyle[p]),v},function(){var g=f.document.documentElement.style,p="userSelect"in g?"userSelect":"MozUserSelect"in g?"MozUserSelect":"WebkitUserSelect"in g?"WebkitUserSelect":"KhtmlUserSelect"in g?"KhtmlUserSelect":"";function v(T){return typeof T.onselectstart<"u"&&(T.onselectstart=f.util.falseFunction),p?T.style[p]="none":typeof T.unselectable=="string"&&(T.unselectable="on"),T}function _(T){return typeof T.onselectstart<"u"&&(T.onselectstart=null),p?T.style[p]="":typeof T.unselectable=="string"&&(T.unselectable=""),T}f.util.makeElementUnselectable=v,f.util.makeElementSelectable=_}();function l(g){var p=f.jsdomImplForWrapper(g);return p._canvas||p._image}function u(g){if(f.isLikelyNode){var p=f.jsdomImplForWrapper(g);p&&(p._image=null,p._canvas=null,p._currentSrc=null,p._attributes=null,p._classList=null)}}function d(g,p){g.imageSmoothingEnabled=g.imageSmoothingEnabled||g.webkitImageSmoothingEnabled||g.mozImageSmoothingEnabled||g.msImageSmoothingEnabled||g.oImageSmoothingEnabled,g.imageSmoothingEnabled=p}f.util.setImageSmoothing=d,f.util.getById=s,f.util.toArray=o,f.util.addClass=r,f.util.makeElement=e,f.util.wrapElement=t,f.util.getScrollLeftTop=n,f.util.getElementOffset=a,f.util.getNodeCanvas=l,f.util.cleanUpJsdomNode=u}(),function(){function c(o,e){return o+(/\?/.test(o)?"&":"?")+e}function s(){}function h(o,e){e||(e={});var r=e.method?e.method.toUpperCase():"GET",t=e.onComplete||function(){},n=new f.window.XMLHttpRequest,a=e.body||e.parameters;return n.onreadystatechange=function(){n.readyState===4&&(t(n),n.onreadystatechange=s)},r==="GET"&&(a=null,typeof e.parameters=="string"&&(o=c(o,e.parameters))),n.open(r,o,!0),(r==="POST"||r==="PUT")&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(a),n}f.util.request=h}(),f.log=console.log,f.warn=console.warn,function(){var c=f.util.object.extend,s=f.util.object.clone,h=[];f.util.object.extend(h,{cancelAll:function(){var l=this.splice(0);return l.forEach(function(u){u.cancel()}),l},cancelByCanvas:function(l){if(!l)return[];var u=this.filter(function(d){return typeof d.target=="object"&&d.target.canvas===l});return u.forEach(function(d){d.cancel()}),u},cancelByTarget:function(l){var u=this.findAnimationsByTarget(l);return u.forEach(function(d){d.cancel()}),u},findAnimationIndex:function(l){return this.indexOf(this.findAnimation(l))},findAnimation:function(l){return this.find(function(u){return u.cancel===l})},findAnimationsByTarget:function(l){return l?this.filter(function(u){return u.target===l}):[]}});function o(){return!1}function e(l,u,d,g){return-d*Math.cos(l/g*(Math.PI/2))+d+u}function r(l){l||(l={});var u=!1,d,g=function(){var p=f.runningAnimations.indexOf(d);return p>-1&&f.runningAnimations.splice(p,1)[0]};return d=c(s(l),{cancel:function(){return u=!0,g()},currentValue:"startValue"in l?l.startValue:0,completionRate:0,durationRate:0}),f.runningAnimations.push(d),a(function(p){var v=p||+new Date,_=l.duration||500,T=v+_,A,X=l.onChange||o,W=l.abort||o,N=l.onComplete||o,V=l.easing||e,U="startValue"in l?l.startValue.length>0:!1,G="startValue"in l?l.startValue:0,q="endValue"in l?l.endValue:100,J=l.byValue||(U?G.map(function(K,m){return q[m]-G[m]}):q-G);l.onStart&&l.onStart(),function K(m){A=m||+new Date;var C=A>T?_:A-v,S=C/_,b=U?G.map(function(x,y){return V(C,G[y],J[y],_)}):V(C,G,J,_),P=Math.abs(U?(b[0]-G[0])/J[0]:(b-G)/J);if(d.currentValue=U?b.slice():b,d.completionRate=P,d.durationRate=S,!u){if(W(b,P,S)){g();return}if(A>T){d.currentValue=U?q.slice():q,d.completionRate=1,d.durationRate=1,X(U?q.slice():q,1,1),N(q,1,1),g();return}else X(b,P,S),a(K)}}(v)}),d.cancel}var t=f.window.requestAnimationFrame||f.window.webkitRequestAnimationFrame||f.window.mozRequestAnimationFrame||f.window.oRequestAnimationFrame||f.window.msRequestAnimationFrame||function(l){return f.window.setTimeout(l,1e3/60)},n=f.window.cancelAnimationFrame||f.window.clearTimeout;function a(){return t.apply(f.window,arguments)}function i(){return n.apply(f.window,arguments)}f.util.animate=r,f.util.requestAnimFrame=a,f.util.cancelAnimFrame=i,f.runningAnimations=h}(),function(){function c(h,o,e){var r="rgba("+parseInt(h[0]+e*(o[0]-h[0]),10)+","+parseInt(h[1]+e*(o[1]-h[1]),10)+","+parseInt(h[2]+e*(o[2]-h[2]),10);return r+=","+(h&&o?parseFloat(h[3]+e*(o[3]-h[3])):1),r+=")",r}function s(h,o,e,r){var t=new f.Color(h).getSource(),n=new f.Color(o).getSource(),a=r.onComplete,i=r.onChange;return r=r||{},f.util.animate(f.util.object.extend(r,{duration:e||500,startValue:t,endValue:n,byValue:n,easing:function(l,u,d,g){var p=r.colorEasing?r.colorEasing(l,g):1-Math.cos(l/g*(Math.PI/2));return c(u,d,p)},onComplete:function(l,u,d){if(a)return a(c(n,n,0),u,d)},onChange:function(l,u,d){if(i){if(Array.isArray(l))return i(c(l,l,0),u,d);i(l,u,d)}}}))}f.util.animateColor=s}(),function(){function c(m,C,S,b){return m-1&&Y>-1&&Y-1)&&(y="stroke")}else{if(x==="href"||x==="xlink:href"||x==="font")return y;if(x==="imageSmoothing")return y==="optimizeQuality";E=M?y.map(r):r(y,k)}}return!M&&isNaN(E)?y:E}function T(x){return new RegExp("^("+x.join("|")+")\\b","i")}function A(x){for(var y in d)if(!(typeof x[d[y]]>"u"||x[y]==="")){if(typeof x[y]>"u"){if(!s.Object.prototype[y])continue;x[y]=s.Object.prototype[y]}if(x[y].indexOf("url(")!==0){var w=new s.Color(x[y]);x[y]=w.setAlpha(e(w.getAlpha()*x[d[y]],2)).toRgba()}}return x}function X(x,y){var w,k=[],M,E,R;for(E=0,R=y.length;E1;)et.shift(),it=s.util.multiplyTransformMatrices(it,et[0]);return it}}();function W(x,y){var w,k;x.replace(/;\s*$/,"").split(";").forEach(function(M){var E=M.split(":");w=E[0].trim().toLowerCase(),k=E[1].trim(),y[w]=k})}function N(x,y){var w,k;for(var M in x)typeof x[M]>"u"||(w=M.toLowerCase(),k=x[M],y[w]=k)}function V(x,y){var w={};for(var k in s.cssRules[y])if(U(x,k.split(" ")))for(var M in s.cssRules[y][k])w[M]=s.cssRules[y][k][M];return w}function U(x,y){var w,k=!0;return w=q(x,y.pop()),w&&y.length&&(k=G(x,y)),w&&k&&y.length===0}function G(x,y){for(var w,k=!0;x.parentNode&&x.parentNode.nodeType===1&&y.length;)k&&(w=y.pop()),x=x.parentNode,k=q(x,w);return y.length===0}function q(x,y){var w=x.nodeName,k=x.getAttribute("class"),M=x.getAttribute("id"),E,R;if(E=new RegExp("^"+w,"i"),y=y.replace(E,""),M&&y.length&&(E=new RegExp("#"+M+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"")),k&&y.length)for(k=k.split(" "),R=k.length;R--;)E=new RegExp("\\."+k[R]+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"");return y.length===0}function J(x,y){var w;if(x.getElementById&&(w=x.getElementById(y)),w)return w;var k,M,E,R=x.getElementsByTagName("*");for(M=0,E=R.length;Mk?k:w),B.meetOrSlice==="slice"&&(k=w=w>k?w:k),et=F.width-R*w,it=F.height-Y*w,B.alignX==="Mid"&&(et/=2),B.alignY==="Mid"&&(it/=2),B.alignX==="Min"&&(et=0),B.alignY==="Min"&&(it=0)),w===1&&k===1&&M===0&&E===0&&L===0&&D===0)return F;if((L||D)&&x.parentNode.nodeName!=="#document"&&($=" translate("+r(L)+" "+r(D)+") "),z=$+" matrix("+w+" 0 0 "+k+" "+(M*w+et)+" "+(E*k+it)+") ",x.nodeName==="svg"){for(j=x.ownerDocument.createElementNS(s.svgNS,"g");x.firstChild;)j.appendChild(x.firstChild);x.appendChild(j)}else j=x,j.removeAttribute("x"),j.removeAttribute("y"),z=j.getAttribute("transform")+z;return j.setAttribute("transform",z),F}function S(x,y){for(;x&&(x=x.parentNode);)if(x.nodeName&&y.test(x.nodeName.replace("svg:",""))&&!x.getAttribute("instantiated_by_use"))return!0;return!1}s.parseSVGDocument=function(x,y,w,k){if(x){K(x);var M=s.Object.__uid++,E,R,Y=C(x),z=s.util.toArray(x.getElementsByTagName("*"));if(Y.crossOrigin=k&&k.crossOrigin,Y.svgUid=M,z.length===0&&s.isLikelyNode){z=x.selectNodes('//*[name(.)!="svg"]');var j=[];for(E=0,R=z.length;E"u"&&(w=x.getAttribute("svgUid")),x.parentNode&&s.svgValidParentsRegEx.test(x.parentNode.nodeName)&&(M=s.parseAttributes(x.parentNode,y,w));var Y=y.reduce(function(B,H){return k=x.getAttribute(H),k&&(B[H]=k),B},{}),z=h(V(x,w),s.parseStyleAttribute(x));Y=h(Y,z),z[p]&&x.setAttribute(p,z[p]),E=R=M.fontSize||s.Text.DEFAULT_SVG_FONT_SIZE,Y[g]&&(Y[g]=E=r(Y[g],R));var j,O,I={};for(var L in Y)j=v(L),O=_(j,Y[L],M,E),I[j]=O;I&&I.font&&s.parseFontDeclaration(I.font,I);var D=h(M,I);return s.svgValidParentsRegEx.test(x.nodeName)?D:A(D)}},parseElements:function(x,y,w,k,M){new s.ElementsParser(x,y,w,k,M).parse()},parseStyleAttribute:function(x){var y={},w=x.getAttribute("style");return w&&(typeof w=="string"?W(w,y):N(w,y)),y},parsePointsAttribute:function(x){if(!x)return null;x=x.replace(/,/g," ").trim(),x=x.split(/\s+/);var y=[],w,k;for(w=0,k=x.length;wo.x&&this.y>o.y},gte:function(o){return this.x>=o.x&&this.y>=o.y},lerp:function(o,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new h(this.x+(o.x-this.x)*e,this.y+(o.y-this.y)*e)},distanceFrom:function(o){var e=this.x-o.x,r=this.y-o.y;return Math.sqrt(e*e+r*r)},midPointFrom:function(o){return this.lerp(o)},min:function(o){return new h(Math.min(this.x,o.x),Math.min(this.y,o.y))},max:function(o){return new h(Math.max(this.x,o.x),Math.max(this.y,o.y))},toString:function(){return this.x+","+this.y},setXY:function(o,e){return this.x=o,this.y=e,this},setX:function(o){return this.x=o,this},setY:function(o){return this.y=o,this},setFromPoint:function(o){return this.x=o.x,this.y=o.y,this},swap:function(o){var e=this.x,r=this.y;this.x=o.x,this.y=o.y,o.x=e,o.y=r},clone:function(){return new h(this.x,this.y)}}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Intersection){s.warn("fabric.Intersection is already defined");return}function h(o){this.status=o,this.points=[]}s.Intersection=h,s.Intersection.prototype={constructor:h,appendPoint:function(o){return this.points.push(o),this},appendPoints:function(o){return this.points=this.points.concat(o),this}},s.Intersection.intersectLineLine=function(o,e,r,t){var n,a=(t.x-r.x)*(o.y-r.y)-(t.y-r.y)*(o.x-r.x),i=(e.x-o.x)*(o.y-r.y)-(e.y-o.y)*(o.x-r.x),l=(t.y-r.y)*(e.x-o.x)-(t.x-r.x)*(e.y-o.y);if(l!==0){var u=a/l,d=i/l;0<=u&&u<=1&&0<=d&&d<=1?(n=new h("Intersection"),n.appendPoint(new s.Point(o.x+u*(e.x-o.x),o.y+u*(e.y-o.y)))):n=new h}else a===0||i===0?n=new h("Coincident"):n=new h("Parallel");return n},s.Intersection.intersectLinePolygon=function(o,e,r){var t=new h,n=r.length,a,i,l,u;for(u=0;u0&&(t.status="Intersection"),t},s.Intersection.intersectPolygonPolygon=function(o,e){var r=new h,t=o.length,n;for(n=0;n0&&(r.status="Intersection"),r},s.Intersection.intersectPolygonRectangle=function(o,e,r){var t=e.min(r),n=e.max(r),a=new s.Point(n.x,t.y),i=new s.Point(t.x,n.y),l=h.intersectLinePolygon(t,a,o),u=h.intersectLinePolygon(a,n,o),d=h.intersectLinePolygon(n,i,o),g=h.intersectLinePolygon(i,t,o),p=new h;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(g.points),p.points.length>0&&(p.status="Intersection"),p}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Color){s.warn("fabric.Color is already defined.");return}function h(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}s.Color=h,s.Color.prototype={_tryParsingColor:function(e){var r;e in h.colorNameMap&&(e=h.colorNameMap[e]),e==="transparent"&&(r=[255,255,255,0]),r||(r=h.sourceFromHex(e)),r||(r=h.sourceFromRgb(e)),r||(r=h.sourceFromHsl(e)),r||(r=[0,0,0,1]),r&&this.setSource(r)},_rgbToHsl:function(e,r,t){e/=255,r/=255,t/=255;var n,a,i,l=s.util.array.max([e,r,t]),u=s.util.array.min([e,r,t]);if(i=(l+u)/2,l===u)n=a=0;else{var d=l-u;switch(a=i>.5?d/(2-l-u):d/(l+u),l){case e:n=(r-t)/d+(r1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}s.Color.fromRgb=function(e){return h.fromSource(h.sourceFromRgb(e))},s.Color.sourceFromRgb=function(e){var r=e.match(h.reRGBa);if(r){var t=parseInt(r[1],10)/(/%$/.test(r[1])?100:1)*(/%$/.test(r[1])?255:1),n=parseInt(r[2],10)/(/%$/.test(r[2])?100:1)*(/%$/.test(r[2])?255:1),a=parseInt(r[3],10)/(/%$/.test(r[3])?100:1)*(/%$/.test(r[3])?255:1);return[parseInt(t,10),parseInt(n,10),parseInt(a,10),r[4]?parseFloat(r[4]):1]}},s.Color.fromRgba=h.fromRgb,s.Color.fromHsl=function(e){return h.fromSource(h.sourceFromHsl(e))},s.Color.sourceFromHsl=function(e){var r=e.match(h.reHSLa);if(r){var t=(parseFloat(r[1])%360+360)%360/360,n=parseFloat(r[2])/(/%$/.test(r[2])?100:1),a=parseFloat(r[3])/(/%$/.test(r[3])?100:1),i,l,u;if(n===0)i=l=u=a;else{var d=a<=.5?a*(n+1):a+n-a*n,g=a*2-d;i=o(g,d,t+1/3),l=o(g,d,t),u=o(g,d,t-1/3)}return[Math.round(i*255),Math.round(l*255),Math.round(u*255),r[4]?parseFloat(r[4]):1]}},s.Color.fromHsla=h.fromHsl,s.Color.fromHex=function(e){return h.fromSource(h.sourceFromHex(e))},s.Color.sourceFromHex=function(e){if(e.match(h.reHex)){var r=e.slice(e.indexOf("#")+1),t=r.length===3||r.length===4,n=r.length===8||r.length===4,a=t?r.charAt(0)+r.charAt(0):r.substring(0,2),i=t?r.charAt(1)+r.charAt(1):r.substring(2,4),l=t?r.charAt(2)+r.charAt(2):r.substring(4,6),u=n?t?r.charAt(3)+r.charAt(3):r.substring(6,8):"FF";return[parseInt(a,16),parseInt(i,16),parseInt(l,16),parseFloat((parseInt(u,16)/255).toFixed(2))]}},s.Color.fromSource=function(e){var r=new h;return r.setSource(e),r}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=["e","se","s","sw","w","nw","n","ne","e"],o=["ns","nesw","ew","nwse"],e={},r="left",t="top",n="right",a="bottom",i="center",l={top:a,bottom:t,left:n,right:r,center:i},u=s.util.radiansToDegrees,d=Math.sign||function(j){return(j>0)-(j<0)||+j};function g(j,O){var I=j.angle+u(Math.atan2(O.y,O.x))+360;return Math.round(I%360/45)}function p(j,O){var I=O.transform.target,L=I.canvas,D=s.util.object.clone(O);D.target=I,L&&L.fire("object:"+j,D),I.fire(j,O)}function v(j,O){var I=O.canvas,L=I.uniScaleKey,D=j[L];return I.uniformScaling&&!D||!I.uniformScaling&&D}function _(j){return j.originX===i&&j.originY===i}function T(j,O,I){var L=j.lockScalingX,D=j.lockScalingY;return!!(L&&D||!O&&(L||D)&&I||L&&O==="x"||D&&O==="y")}function A(j,O,I){var L="not-allowed",D=v(j,I),B="";if(O.x!==0&&O.y===0?B="x":O.x===0&&O.y!==0&&(B="y"),T(I,B,D))return L;var H=g(I,O);return h[H]+"-resize"}function X(j,O,I){var L="not-allowed";if(O.x!==0&&I.lockSkewingY||O.y!==0&&I.lockSkewingX)return L;var D=g(I,O)%4;return o[D]+"-resize"}function W(j,O,I){return j[I.canvas.altActionKey]?e.skewCursorStyleHandler(j,O,I):e.scaleCursorStyleHandler(j,O,I)}function N(j,O,I){var L=j[I.canvas.altActionKey];if(O.x===0)return L?"skewX":"scaleY";if(O.y===0)return L?"skewY":"scaleX"}function V(j,O,I){return I.lockRotation?"not-allowed":O.cursorStyle}function U(j,O,I,L){return{e:j,transform:O,pointer:{x:I,y:L}}}function G(j){return function(O,I,L,D){var B=I.target,H=B.getCenterPoint(),tt=B.translateToOriginPoint(H,I.originX,I.originY),Q=j(O,I,L,D);return B.setPositionByOrigin(tt,I.originX,I.originY),Q}}function q(j,O){return function(I,L,D,B){var H=O(I,L,D,B);return H&&p(j,U(I,L,D,B)),H}}function J(j,O,I,L,D){var B=j.target,H=B.controls[j.corner],tt=B.canvas.getZoom(),Q=B.padding/tt,F=B.toLocalPoint(new s.Point(L,D),O,I);return F.x>=Q&&(F.x-=Q),F.x<=-Q&&(F.x+=Q),F.y>=Q&&(F.y-=Q),F.y<=Q&&(F.y+=Q),F.x-=H.offsetX,F.y-=H.offsetY,F}function K(j){return j.flipX!==j.flipY}function m(j,O,I,L,D){if(j[O]!==0){var B=j._getTransformedDimensions()[L],H=D/B*j[I];j.set(I,H)}}function C(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(0,D.skewY),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.x*2)-B.x,Q=D.skewX,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleX,B.y/D.scaleY)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().y;D.set("skewX",F),m(D,"skewY","scaleY","y",et)}return $}function S(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(D.skewX,0),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.y*2)-B.y,Q=D.skewY,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleY,B.x/D.scaleX)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().x;D.set("skewY",F),m(D,"skewX","scaleX","x",et)}return $}function b(j,O,I,L){var D=O.target,B=D.skewX,H,tt=O.originY;if(D.lockSkewingX)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.x>0?H=r:H=n}else B>0&&(H=tt===t?r:n),B<0&&(H=tt===t?n:r),K(D)&&(H=H===r?n:r);O.originX=H;var F=q("skewing",G(C));return F(j,O,I,L)}function P(j,O,I,L){var D=O.target,B=D.skewY,H,tt=O.originX;if(D.lockSkewingY)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.y>0?H=t:H=a}else B>0&&(H=tt===r?t:a),B<0&&(H=tt===r?a:t),K(D)&&(H=H===t?a:t);O.originY=H;var F=q("skewing",G(S));return F(j,O,I,L)}function x(j,O,I,L){var D=O,B=D.target,H=B.translateToOriginPoint(B.getCenterPoint(),D.originX,D.originY);if(B.lockRotation)return!1;var tt=Math.atan2(D.ey-H.y,D.ex-H.x),Q=Math.atan2(L-H.y,I-H.x),F=u(Q-tt+D.theta),$=!0;if(B.snapAngle>0){var et=B.snapAngle,it=B.snapThreshold||et,nt=Math.ceil(F/et)*et,rt=Math.floor(F/et)*et;Math.abs(F-rt)d?(A=u,t.scale(1,d/u),T=a*u/d):d>u?(A=d,t.scale(u/d,1),_=n*d/u):A=u,t.lineWidth=1,t.beginPath(),t.arc(_,T,A/2,0,2*Math.PI,!1),t[p](),v&&t.stroke(),t.restore()}function r(t,n,a,i,l){i=i||{};var u=this.sizeX||i.cornerSize||l.cornerSize,d=this.sizeY||i.cornerSize||l.cornerSize,g=typeof i.transparentCorners<"u"?i.transparentCorners:l.transparentCorners,p=g?"stroke":"fill",v=!g&&(i.cornerStrokeColor||l.cornerStrokeColor),_=u/2,T=d/2;t.save(),t.fillStyle=i.cornerColor||l.cornerColor,t.strokeStyle=i.cornerStrokeColor||l.cornerStrokeColor,t.lineWidth=1,t.translate(n,a),t.rotate(h(l.angle)),t[p+"Rect"](-_,-T,u,d),v&&t.strokeRect(-_,-T,u,d),t.restore()}o.renderCircleControl=e,o.renderSquareControl=r}(Z),function(c){var s=c.fabric||(c.fabric={});function h(o){for(var e in o)this[e]=o[e]}s.Control=h,s.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(o,e){return e.cursorStyle},getActionName:function(o,e){return e.actionName},getVisibility:function(o,e){var r=o._controlsVisibility;return r&&typeof r[e]<"u"?r[e]:this.visible},setVisibility:function(o){this.visible=o},positionHandler:function(o,e){var r=s.util.transformPoint({x:this.x*o.x+this.offsetX,y:this.y*o.y+this.offsetY},e);return r},calcCornerCoords:function(o,e,r,t,n){var a,i,l,u,d=n?this.touchSizeX:this.sizeX,g=n?this.touchSizeY:this.sizeY;if(d&&g&&d!==g){var p=Math.atan2(g,d),v=Math.sqrt(d*d+g*g)/2,_=p-s.util.degreesToRadians(o),T=Math.PI/2-p-s.util.degreesToRadians(o);a=v*s.util.cos(_),i=v*s.util.sin(_),l=v*s.util.cos(T),u=v*s.util.sin(T)}else{var A=d&&g?d:e;v=A*.7071067812;var _=s.util.degreesToRadians(45-o);a=l=v*s.util.cos(_),i=u=v*s.util.sin(_)}return{tl:{x:r-u,y:t-l},tr:{x:r+a,y:t-i},bl:{x:r-a,y:t+i},br:{x:r+u,y:t+l}}},render:function(o,e,r,t,n){switch(t=t||{},t.cornerStyle||n.cornerStyle){case"circle":s.controlsUtils.renderCircleControl.call(this,o,e,r,t,n);break;default:s.controlsUtils.renderSquareControl.call(this,o,e,r,t,n)}}}}(Z),function(){function c(r,t){var n=r.getAttribute("style"),a=r.getAttribute("offset")||0,i,l,u,d;if(a=parseFloat(a)/(/%$/.test(a)?100:1),a=a<0?0:a>1?1:a,n){var g=n.split(/\s*;\s*/);for(g[g.length-1]===""&&g.pop(),d=g.length;d--;){var p=g[d].split(/\s*:\s*/),v=p[0].trim(),_=p[1].trim();v==="stop-color"?i=_:v==="stop-opacity"&&(u=_)}}return i||(i=r.getAttribute("stop-color")||"rgb(0,0,0)"),u||(u=r.getAttribute("stop-opacity")),i=new f.Color(i),l=i.getAlpha(),u=isNaN(parseFloat(u))?1:parseFloat(u),u*=l*t,{offset:a,color:i.toRgb(),opacity:u}}function s(r){return{x1:r.getAttribute("x1")||0,y1:r.getAttribute("y1")||0,x2:r.getAttribute("x2")||"100%",y2:r.getAttribute("y2")||0}}function h(r){return{x1:r.getAttribute("fx")||r.getAttribute("cx")||"50%",y1:r.getAttribute("fy")||r.getAttribute("cy")||"50%",r1:0,x2:r.getAttribute("cx")||"50%",y2:r.getAttribute("cy")||"50%",r2:r.getAttribute("r")||"50%"}}var o=f.util.object.clone;f.Gradient=f.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(r){r||(r={}),r.coords||(r.coords={});var t,n=this;Object.keys(r).forEach(function(a){n[a]=r[a]}),this.id?this.id+="_"+f.Object.__uid++:this.id=f.Object.__uid++,t={x1:r.coords.x1||0,y1:r.coords.y1||0,x2:r.coords.x2||0,y2:r.coords.y2||0},this.type==="radial"&&(t.r1=r.coords.r1||0,t.r2=r.coords.r2||0),this.coords=t,this.colorStops=r.colorStops.slice()},addColorStop:function(r){for(var t in r){var n=new f.Color(r[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(r){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return f.util.populateWithProperties(this,t,r),t},toSVG:function(r,l){var n=o(this.coords,!0),a,i,l=l||{},u,d,g=o(this.colorStops,!0),p=n.r1>n.r2,v=this.gradientTransform?this.gradientTransform.concat():f.iMatrix.concat(),_=-this.offsetX,T=-this.offsetY,A=!!l.additionalTransform,X=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(g.sort(function(G,q){return G.offset-q.offset}),X==="objectBoundingBox"?(_/=r.width,T/=r.height):(_+=r.width/2,T+=r.height/2),r.type==="path"&&this.gradientUnits!=="percentage"&&(_-=r.pathOffset.x,T-=r.pathOffset.y),v[4]-=_,v[5]-=T,d='id="SVGID_'+this.id+'" gradientUnits="'+X+'"',d+=' gradientTransform="'+(A?l.additionalTransform+" ":"")+f.util.matrixToSVG(v)+'" ',this.type==="linear"?u=[" +`]:this.type==="radial"&&(u=[" +`]),this.type==="radial"){if(p)for(g=g.concat(),g.reverse(),a=0,i=g.length;a0){var N=Math.max(n.r1,n.r2),V=W/N;for(a=0,i=g.length;a +`)}return u.push(this.type==="linear"?` +`:` +`),u.join("")},toLive:function(r){var t,n=f.util.object.clone(this.coords),a,i;if(this.type){for(this.type==="linear"?t=r.createLinearGradient(n.x1,n.y1,n.x2,n.y2):this.type==="radial"&&(t=r.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),a=0,i=this.colorStops.length;a1?1:i,isNaN(i)&&(i=1);var l=r.getElementsByTagName("stop"),u,d=r.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",g=r.getAttribute("gradientTransform")||"",p=[],v,_,T=0,A=0,X;for(r.nodeName==="linearGradient"||r.nodeName==="LINEARGRADIENT"?(u="linear",v=s(r)):(u="radial",v=h(r)),_=l.length;_--;)p.push(c(l[_],i));X=f.parseTransformAttribute(g),e(t,v,a,d),d==="pixels"&&(T=-t.left,A=-t.top);var W=new f.Gradient({id:r.getAttribute("id"),type:u,coords:v,colorStops:p,gradientUnits:d,gradientTransform:X,offsetX:T,offsetY:A});return W}});function e(r,t,n,a){var i,l;Object.keys(t).forEach(function(u){i=t[u],i==="Infinity"?l=1:i==="-Infinity"?l=0:(l=parseFloat(t[u],10),typeof i=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(l*=.01,a==="pixels"&&((u==="x1"||u==="x2"||u==="r2")&&(l*=n.viewBoxWidth||n.width),(u==="y1"||u==="y2")&&(l*=n.viewBoxHeight||n.height)))),t[u]=l})}}(),function(){var c=f.util.toFixed;f.Pattern=f.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(s,h){if(s||(s={}),this.id=f.Object.__uid++,this.setOptions(s),!s.source||s.source&&typeof s.source!="string"){h&&h(this);return}else{var o=this;this.source=f.util.createImage(),f.util.loadImage(s.source,function(e,r){o.source=e,h&&h(o,r)},null,this.crossOrigin)}},toObject:function(s){var h=f.Object.NUM_FRACTION_DIGITS,o,e;return typeof this.source.src=="string"?o=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(o=this.source.toDataURL()),e={type:"pattern",source:o,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:c(this.offsetX,h),offsetY:c(this.offsetY,h),patternTransform:this.patternTransform?this.patternTransform.concat():null},f.util.populateWithProperties(this,e,s),e},toSVG:function(s){var h=typeof this.source=="function"?this.source():this.source,o=h.width/s.width,e=h.height/s.height,r=this.offsetX/s.width,t=this.offsetY/s.height,n="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(e=1,t&&(e+=Math.abs(t))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(o=1,r&&(o+=Math.abs(r))),h.src?n=h.src:h.toDataURL&&(n=h.toDataURL()),' + + +`},setOptions:function(s){for(var h in s)this[h]=s[h]},toLive:function(s){var h=this.source;return!h||typeof h.src<"u"&&(!h.complete||h.naturalWidth===0||h.naturalHeight===0)?"":s.createPattern(h,this.repeat)}})}(),function(c){var s=c.fabric||(c.fabric={}),h=s.util.toFixed;if(s.Shadow){s.warn("fabric.Shadow is already defined.");return}s.Shadow=s.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(o){typeof o=="string"&&(o=this._parseShadow(o));for(var e in o)this[e]=o[e];this.id=s.Object.__uid++},_parseShadow:function(o){var e=o.trim(),r=s.Shadow.reOffsetsAndBlur.exec(e)||[],t=e.replace(s.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:t.trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(o){var e=40,r=40,t=s.Object.NUM_FRACTION_DIGITS,n=s.util.rotateVector({x:this.offsetX,y:this.offsetY},s.util.degreesToRadians(-o.angle)),a=20,i=new s.Color(this.color);return o.width&&o.height&&(e=h((Math.abs(n.x)+this.blur)/o.width,t)*100+a,r=h((Math.abs(n.y)+this.blur)/o.height,t)*100+a),o.flipX&&(n.x*=-1),o.flipY&&(n.y*=-1),' + + + + + + + + + +`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var o={},e=s.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(r){this[r]!==e[r]&&(o[r]=this[r])},this),o}}),s.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(Z),function(){if(f.StaticCanvas){f.warn("fabric.StaticCanvas is already defined.");return}var c=f.util.object.extend,s=f.util.getElementOffset,h=f.util.removeFromArray,o=f.util.toFixed,e=f.util.transformPoint,r=f.util.invertTransform,t=f.util.getNodeCanvas,n=f.util.createCanvasElement,a=new Error("Could not initialize `canvas` element");f.StaticCanvas=f.util.createClass(f.CommonMethods,{initialize:function(i,l){l||(l={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(i,l)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:f.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(i,l){var u=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(i),this._initOptions(l),this.interactive||this._initRetinaScaling(),l.overlayImage&&this.setOverlayImage(l.overlayImage,u),l.backgroundImage&&this.setBackgroundImage(l.backgroundImage,u),l.backgroundColor&&this.setBackgroundColor(l.backgroundColor,u),l.overlayColor&&this.setOverlayColor(l.overlayColor,u),this.calcOffset()},_isRetinaScaling:function(){return f.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,f.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var i=f.devicePixelRatio;this.__initRetinaScaling(i,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(i,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(i,l,u){l.setAttribute("width",this.width*i),l.setAttribute("height",this.height*i),u.scale(i,i)},calcOffset:function(){return this._offset=s(this.lowerCanvasEl),this},setOverlayImage:function(i,l,u){return this.__setBgOverlayImage("overlayImage",i,l,u)},setBackgroundImage:function(i,l,u){return this.__setBgOverlayImage("backgroundImage",i,l,u)},setOverlayColor:function(i,l){return this.__setBgOverlayColor("overlayColor",i,l)},setBackgroundColor:function(i,l){return this.__setBgOverlayColor("backgroundColor",i,l)},__setBgOverlayImage:function(i,l,u,d){return typeof l=="string"?f.util.loadImage(l,function(g,p){if(g){var v=new f.Image(g,d);this[i]=v,v.canvas=this}u&&u(g,p)},this,d&&d.crossOrigin):(d&&l.setOptions(d),this[i]=l,l&&(l.canvas=this),u&&u(l,!1)),this},__setBgOverlayColor:function(i,l,u){return this[i]=l,this._initGradient(l,i),this._initPattern(l,i,u),this},_createCanvasElement:function(){var i=n();if(!i||(i.style||(i.style={}),typeof i.getContext>"u"))throw a;return i},_initOptions:function(i){var l=this.lowerCanvasEl;this._setOptions(i),this.width=this.width||parseInt(l.width,10)||0,this.height=this.height||parseInt(l.height,10)||0,this.lowerCanvasEl.style&&(l.width=this.width,l.height=this.height,l.style.width=this.width+"px",l.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(i){i&&i.getContext?this.lowerCanvasEl=i:this.lowerCanvasEl=f.util.getById(i)||this._createCanvasElement(),f.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(i,l){return this.setDimensions({width:i},l)},setHeight:function(i,l){return this.setDimensions({height:i},l)},setDimensions:function(i,l){var u;l=l||{};for(var d in i)u=i[d],l.cssOnly||(this._setBackstoreDimension(d,i[d]),u+="px",this.hasLostContext=!0),l.backstoreOnly||this._setCssDimension(d,u);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),l.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(i,l){return this.lowerCanvasEl[i]=l,this.upperCanvasEl&&(this.upperCanvasEl[i]=l),this.cacheCanvasEl&&(this.cacheCanvasEl[i]=l),this[i]=l,this},_setCssDimension:function(i,l){return this.lowerCanvasEl.style[i]=l,this.upperCanvasEl&&(this.upperCanvasEl.style[i]=l),this.wrapperEl&&(this.wrapperEl.style[i]=l),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(i){var l=this._activeObject,u=this.backgroundImage,d=this.overlayImage,g,p,v;for(this.viewportTransform=i,p=0,v=this._objects.length;p +`),this._setSVGBgOverlayColor(u,"background"),this._setSVGBgOverlayImage(u,"backgroundImage",l),this._setSVGObjects(u,l),this.clipPath&&u.push(` +`),this._setSVGBgOverlayColor(u,"overlay"),this._setSVGBgOverlayImage(u,"overlayImage",l),u.push(""),u.join("")},_setSVGPreamble:function(i,l){l.suppressPreamble||i.push(' +`,' +`)},_setSVGHeader:function(i,l){var u=l.width||this.width,d=l.height||this.height,g,p='viewBox="0 0 '+this.width+" "+this.height+'" ',v=f.Object.NUM_FRACTION_DIGITS;l.viewBox?p='viewBox="'+l.viewBox.x+" "+l.viewBox.y+" "+l.viewBox.width+" "+l.viewBox.height+'" ':this.svgViewportTransformation&&(g=this.viewportTransform,p='viewBox="'+o(-g[4]/g[0],v)+" "+o(-g[5]/g[3],v)+" "+o(this.width/g[0],v)+" "+o(this.height/g[3],v)+'" '),i.push(" +`,"Created with Fabric.js ",f.version,` +`,` +`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(l),` +`)},createSVGClipPathMarkup:function(i){var l=this.clipPath;return l?(l.clipPathId="CLIPPATH_"+f.Object.__uid++,' +`+this.clipPath.toClipPathSVG(i.reviver)+` +`):""},createSVGRefElementsMarkup:function(){var i=this,l=["background","overlay"].map(function(u){var d=i[u+"Color"];if(d&&d.toLive){var g=i[u+"Vpt"],p=i.viewportTransform,v={width:i.width/(g?p[0]:1),height:i.height/(g?p[3]:1)};return d.toSVG(v,{additionalTransform:g?f.util.matrixToSVG(p):""})}});return l.join("")},createSVGFontFacesMarkup:function(){var i="",l={},u,d,g,p,v,_,T,A,X,W=f.fontPaths,N=[];for(this._objects.forEach(function U(G){N.push(G),G._objects&&G._objects.forEach(U)}),A=0,X=N.length;A',` +`,i,"",` +`].join("")),i},_setSVGObjects:function(i,l){var u,d,g,p=this._objects;for(d=0,g=p.length;d +`)}else i.push(' +`)},sendToBack:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=g.length;u--;)d=g[u],h(this._objects,d),this._objects.unshift(d);else h(this._objects,i),this._objects.unshift(i);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=0;u0+T&&(v=p-1,h(this._objects,g),this._objects.splice(v,0,g)),T++;else p=this._objects.indexOf(i),p!==0&&(v=this._findNewLowerIndex(i,p,l),h(this._objects,i),this._objects.splice(v,0,i));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(i,l,u){var d,g;if(u)for(d=l,g=l-1;g>=0;--g){var p=i.intersectsWithObject(this._objects[g])||i.isContainedWithinObject(this._objects[g])||this._objects[g].isContainedWithinObject(i);if(p){d=g;break}}else d=l-1;return d},bringForward:function(i,l){if(!i)return this;var u=this._activeObject,d,g,p,v,_,T=0;if(i===u&&i.type==="activeSelection")for(_=u._objects,d=_.length;d--;)g=_[d],p=this._objects.indexOf(g),p"}}),c(f.StaticCanvas.prototype,f.Observable),c(f.StaticCanvas.prototype,f.Collection),c(f.StaticCanvas.prototype,f.DataURLExporter),c(f.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(i){var l=n();if(!l||!l.getContext)return null;var u=l.getContext("2d");if(!u)return null;switch(i){case"setLineDash":return typeof u.setLineDash<"u";default:return null}}}),f.StaticCanvas.prototype.toJSON=f.StaticCanvas.prototype.toObject,f.isLikelyNode&&(f.StaticCanvas.prototype.createPNGStream=function(){var i=t(this.lowerCanvasEl);return i&&i.createPNGStream()},f.StaticCanvas.prototype.createJPEGStream=function(i){var l=t(this.lowerCanvasEl);return l&&l.createJPEGStream(i)})}(),f.BaseBrush=f.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(c){c.strokeStyle=this.color,c.lineWidth=this.width,c.lineCap=this.strokeLineCap,c.miterLimit=this.strokeMiterLimit,c.lineJoin=this.strokeLineJoin,c.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(c){var s=this.canvas.viewportTransform;c.save(),c.transform(s[0],s[1],s[2],s[3],s[4],s[5])},_setShadow:function(){if(this.shadow){var c=this.canvas,s=this.shadow,h=c.contextTop,o=c.getZoom();c&&c._isRetinaScaling()&&(o*=f.devicePixelRatio),h.shadowColor=s.color,h.shadowBlur=s.blur*o,h.shadowOffsetX=s.offsetX*o,h.shadowOffsetY=s.offsetY*o}},needsFullRender:function(){var c=new f.Color(this.color);return c.getAlpha()<1||!!this.shadow},_resetShadow:function(){var c=this.canvas.contextTop;c.shadowColor="",c.shadowBlur=c.shadowOffsetX=c.shadowOffsetY=0},_isOutSideCanvas:function(c){return c.x<0||c.x>this.canvas.getWidth()||c.y<0||c.y>this.canvas.getHeight()}}),function(){f.PencilBrush=f.util.createClass(f.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(c){this.canvas=c,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(c,s,h){var o=s.midPointFrom(h);return c.quadraticCurveTo(s.x,s.y,o.x,o.y),o},onMouseDown:function(c,s){this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],this._prepareForDrawing(c),this._captureDrawingPath(c),this._render())},onMouseMove:function(c,s){if(this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(c))&&this._captureDrawingPath(c)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var h=this._points,o=h.length,e=this.canvas.contextTop;this._saveAndTransform(e),this.oldEnd&&(e.beginPath(),e.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(e,h[o-2],h[o-1],!0),e.stroke(),e.restore()}},onMouseUp:function(c){return this.canvas._isMainEvent(c.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(c){var s=new f.Point(c.x,c.y);this._reset(),this._addPoint(s),this.canvas.contextTop.moveTo(s.x,s.y)},_addPoint:function(c){return this._points.length>1&&c.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(c),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(c){var s=new f.Point(c.x,c.y);return this._addPoint(s)},_render:function(c){var s,h,o=this._points[0],e=this._points[1];if(c=c||this.canvas.contextTop,this._saveAndTransform(c),c.beginPath(),this._points.length===2&&o.x===e.x&&o.y===e.y){var r=this.width/1e3;o=new f.Point(o.x,o.y),e=new f.Point(e.x,e.y),o.x-=r,e.x+=r}for(c.moveTo(o.x,o.y),s=1,h=this._points.length;s=o&&(t=c[e],n.push(t));return n.push(c[r]),n},_finalizeAndAddPath:function(){var c=this.canvas.contextTop;c.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var s=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(s)){this.canvas.requestRenderAll();return}var h=this.createPath(s);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:h}),this.canvas.add(h),this.canvas.requestRenderAll(),h.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:h})}})}(),f.CircleBrush=f.util.createClass(f.BaseBrush,{width:10,initialize:function(c){this.canvas=c,this.points=[]},drawDot:function(c){var s=this.addPoint(c),h=this.canvas.contextTop;this._saveAndTransform(h),this.dot(h,s),h.restore()},dot:function(c,s){c.fillStyle=s.fill,c.beginPath(),c.arc(s.x,s.y,s.radius,0,Math.PI*2,!1),c.closePath(),c.fill()},onMouseDown:function(c){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(c)},_render:function(){var c=this.canvas.contextTop,s,h,o=this.points;for(this._saveAndTransform(c),s=0,h=o.length;s0&&!this.preserveObjectStacking){t=[],n=[];for(var a=0,i=this._objects.length;a1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var t=e.calcTransformMatrix(),n=f.util.invertTransform(t),a=this.restorePointerVpt(r);return f.util.transformPoint(a,n)},isTargetTransparent:function(e,r,t){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:r,y:t}),a=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),i=Math.max(e.cacheTranslationY+n.y*e.zoomY,0),g=f.util.isTransparent(e._cacheContext,Math.round(a),Math.round(i),this.targetFindTolerance);return g}var l=this.contextCache,u=e.selectionBackgroundColor,d=this.viewportTransform;e.selectionBackgroundColor="",this.clearContext(l),l.save(),l.transform(d[0],d[1],d[2],d[3],d[4],d[5]),e.render(l),l.restore(),e.selectionBackgroundColor=u;var g=f.util.isTransparent(l,r,t,this.targetFindTolerance);return g},_isSelectionKeyPressed:function(e){var r=!1;return Array.isArray(this.selectionKey)?r=!!this.selectionKey.find(function(t){return e[t]===!0}):r=e[this.selectionKey],r},_shouldClearSelection:function(e,r){var t=this.getActiveObjects(),n=this._activeObject;return!r||r&&n&&t.length>1&&t.indexOf(r)===-1&&n!==r&&!this._isSelectionKeyPressed(e)||r&&!r.evented||r&&!r.selectable&&n&&n!==r},_shouldCenterTransform:function(e,r,t){if(e){var n;return r==="scale"||r==="scaleX"||r==="scaleY"||r==="resizing"?n=this.centeredScaling||e.centeredScaling:r==="rotate"&&(n=this.centeredRotation||e.centeredRotation),n?!t:t}},_getOriginFromCorner:function(e,r){var t={x:e.originX,y:e.originY};return r==="ml"||r==="tl"||r==="bl"?t.x="right":(r==="mr"||r==="tr"||r==="br")&&(t.x="left"),r==="tl"||r==="mt"||r==="tr"?t.y="bottom":(r==="bl"||r==="mb"||r==="br")&&(t.y="top"),t},_getActionFromCorner:function(e,r,t,n){if(!r||!e)return"drag";var a=n.controls[r];return a.getActionName(t,a,n)},_setupCurrentTransform:function(e,r,t){if(r){var n=this.getPointer(e),a=r.__corner,i=r.controls[a],l=t&&a?i.getActionHandler(e,r,i):f.controlsUtils.dragHandler,u=this._getActionFromCorner(t,a,e,r),d=this._getOriginFromCorner(r,a),g=e[this.centeredKey],p={target:r,action:u,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:n.x-r.left,offsetY:n.y-r.top,originX:d.x,originY:d.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:s(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:g,original:f.util.saveObjectTransform(r)};this._shouldCenterTransform(r,u,g)&&(p.originX="center",p.originY="center"),p.original.originX=d.x,p.original.originY=d.y,this._currentTransform=p,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,t=new f.Point(r.ex,r.ey),n=f.util.transformPoint(t,this.viewportTransform),a=new f.Point(r.ex+r.left,r.ey+r.top),i=f.util.transformPoint(a,this.viewportTransform),l=Math.min(n.x,i.x),u=Math.min(n.y,i.y),d=Math.max(n.x,i.x),g=Math.max(n.y,i.y),p=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(l,u,d-l,g-u)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,l+=p,u+=p,d-=p,g-=p,f.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(l,u,d-l,g-u))},findTarget:function(e,r){if(!this.skipTargetFind){var t=!0,n=this.getPointer(e,t),a=this._activeObject,i=this.getActiveObjects(),l,u,d=h(e),g=i.length>1&&!r||i.length===1;if(this.targets=[],g&&a._findTargetCorner(n,d)||i.length>1&&!r&&a===this._searchPossibleTargets([a],n))return a;if(i.length===1&&a===this._searchPossibleTargets([a],n))if(this.preserveObjectStacking)l=a,u=this.targets,this.targets=[];else return a;var p=this._searchPossibleTargets(this._objects,n);return e[this.altSelectionKey]&&p&&l&&p!==l&&(p=l,this.targets=u),p}},_checkTarget:function(e,r,t){if(r&&r.visible&&r.evented&&r.containsPoint(e))if((this.perPixelTargetFind||r.perPixelTargetFind)&&!r.isEditing){var n=this.isTargetTransparent(r,t.x,t.y);if(!n)return!0}else return!0},_searchPossibleTargets:function(e,r){for(var t,n=e.length,a;n--;){var i=e[n],l=i.group?this._normalizePointer(i.group,r):r;if(this._checkTarget(l,i,r)){t=e[n],t.subTargetCheck&&t instanceof f.Group&&(a=this._searchPossibleTargets(t._objects,r),a&&this.targets.push(a));break}}return t},restorePointerVpt:function(e){return f.util.transformPoint(e,f.util.invertTransform(this.viewportTransform))},getPointer:function(e,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var t=c(e),n=this.upperCanvasEl,a=n.getBoundingClientRect(),i=a.width||0,l=a.height||0,u;(!i||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(i=Math.abs(a.right-a.left))),this.calcOffset(),t.x=t.x-this._offset.left,t.y=t.y-this._offset.top,r||(t=this.restorePointerVpt(t));var d=this.getRetinaScaling();return d!==1&&(t.x/=d,t.y/=d),i===0||l===0?u={width:1,height:1}:u={width:n.width/i,height:n.height/l},{x:t.x*u.width,y:t.y*u.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,t=this.upperCanvasEl;t?t.className="":(t=this._createCanvasElement(),this.upperCanvasEl=t),f.util.addClass(t,"upper-canvas "+e),this.wrapperEl.appendChild(t),this._copyCanvasStyle(r,t),this._applyCanvasStyle(t),this.contextTop=t.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=f.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),f.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),f.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,t=this.height||e.height;f.util.setStyle(e,{position:"absolute",width:r+"px",height:t+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=t,f.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,r){r.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type==="activeSelection"&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,r){var t=!1,n=this.getActiveObjects(),a=[],i=[];e.forEach(function(l){n.indexOf(l)===-1&&(t=!0,l.fire("deselected",{e:r,target:l}),i.push(l))}),n.forEach(function(l){e.indexOf(l)===-1&&(t=!0,l.fire("selected",{e:r,target:l}),a.push(l))}),e.length>0&&n.length>0?t&&this.fire("selection:updated",{e:r,selected:a,deselected:i}):n.length>0?this.fire("selection:created",{e:r,selected:a}):e.length>0&&this.fire("selection:cleared",{e:r,deselected:i})},setActiveObject:function(e,r){var t=this.getActiveObjects();return this._setActiveObject(e,r),this._fireSelectionEvents(t,r),this},_setActiveObject:function(e,r){return this._activeObject===e||!this._discardActiveObject(r,e)||e.onSelect({e:r})?!1:(this._activeObject=e,!0)},_discardActiveObject:function(e,r){var t=this._activeObject;if(t){if(t.onDeselect({e,object:r}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var r=this.getActiveObjects(),t=this.getActiveObject();return r.length&&this.fire("before:selection:cleared",{target:t,e}),this._discardActiveObject(e),this._fireSelectionEvents(r,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(r){f.util.cleanUpJsdomNode(this[r]),this[r]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,f.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var r=this._activeObject;r&&r._renderControls(e)},_toObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(e),a=this.callSuper("_toObject",e,r,t);return this._unwindGroupTransformOnObject(e,n),a},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type==="activeSelection"&&this._activeObject===e.group){var r=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],t={};return r.forEach(function(n){t[n]=e[n]}),f.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}else return null},_unwindGroupTransformOnObject:function(e,r){r&&e.set(r)},_setSVGObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(r);this.callSuper("_setSVGObject",e,r,t),this._unwindGroupTransformOnObject(r,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),f.StaticCanvas.prototype.setViewportTransform.call(this,e)}});for(var o in f.StaticCanvas)o!=="prototype"&&(f.Canvas[o]=f.StaticCanvas[o])}(),function(){var c=f.util.addListener,s=f.util.removeListener,h=3,o=2,e=1,r={passive:!1};function t(n,a){return n.button&&n.button===a-1}f.util.object.extend(f.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(c,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(n,a){var i=this.upperCanvasEl,l=this._getEventPrefix();n(f.window,"resize",this._onResize),n(i,l+"down",this._onMouseDown),n(i,l+"move",this._onMouseMove,r),n(i,l+"out",this._onMouseOut),n(i,l+"enter",this._onMouseEnter),n(i,"wheel",this._onMouseWheel),n(i,"contextmenu",this._onContextMenu),n(i,"dblclick",this._onDoubleClick),n(i,"dragover",this._onDragOver),n(i,"dragenter",this._onDragEnter),n(i,"dragleave",this._onDragLeave),n(i,"drop",this._onDrop),this.enablePointerEvents||n(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&a in eventjs&&(eventjs[a](i,"gesture",this._onGesture),eventjs[a](i,"drag",this._onDrag),eventjs[a](i,"orientation",this._onOrientationChange),eventjs[a](i,"shake",this._onShake),eventjs[a](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(s,"remove");var n=this._getEventPrefix();s(f.document,n+"up",this._onMouseUp),s(f.document,"touchend",this._onTouchEnd,r),s(f.document,n+"move",this._onMouseMove,r),s(f.document,"touchmove",this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(n,a){this.__onTransformGesture&&this.__onTransformGesture(n,a)},_onDrag:function(n,a){this.__onDrag&&this.__onDrag(n,a)},_onMouseWheel:function(n){this.__onMouseWheel(n)},_onMouseOut:function(n){var a=this._hoveredTarget;this.fire("mouse:out",{target:a,e:n}),this._hoveredTarget=null,a&&a.fire("mouseout",{e:n});var i=this;this._hoveredTargets.forEach(function(l){i.fire("mouse:out",{target:a,e:n}),l&&a.fire("mouseout",{e:n})}),this._hoveredTargets=[]},_onMouseEnter:function(n){!this._currentTransform&&!this.findTarget(n)&&(this.fire("mouse:over",{target:null,e:n}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(n,a){this.__onOrientationChange&&this.__onOrientationChange(n,a)},_onShake:function(n,a){this.__onShake&&this.__onShake(n,a)},_onLongPress:function(n,a){this.__onLongPress&&this.__onLongPress(n,a)},_onDragOver:function(n){n.preventDefault();var a=this._simpleEventHandler("dragover",n);this._fireEnterLeaveEvents(a,n)},_onDrop:function(n){return this._simpleEventHandler("drop:before",n),this._simpleEventHandler("drop",n)},_onContextMenu:function(n){return this.stopContextMenu&&(n.stopPropagation(),n.preventDefault()),!1},_onDoubleClick:function(n){this._cacheTransformEventData(n),this._handleEvent(n,"dblclick"),this._resetTransformEventData(n)},getPointerId:function(n){var a=n.changedTouches;return a?a[0]&&a[0].identifier:this.enablePointerEvents?n.pointerId:-1},_isMainEvent:function(n){return n.isPrimary===!0?!0:n.isPrimary===!1?!1:n.type==="touchend"&&n.touches.length===0?!0:n.changedTouches?n.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(n){n.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();c(f.document,"touchend",this._onTouchEnd,r),c(f.document,"touchmove",this._onMouseMove,r),s(a,i+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();s(a,i+"move",this._onMouseMove,r),c(f.document,i+"up",this._onMouseUp),c(f.document,i+"move",this._onMouseMove,r)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var a=this._getEventPrefix();s(f.document,"touchend",this._onTouchEnd,r),s(f.document,"touchmove",this._onMouseMove,r);var i=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){c(i.upperCanvasEl,a+"down",i._onMouseDown),i._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(n)&&(s(f.document,i+"up",this._onMouseUp),s(f.document,i+"move",this._onMouseMove,r),c(a,i+"move",this._onMouseMove,r))},_onMouseMove:function(n){!this.allowTouchScrolling&&n.preventDefault&&n.preventDefault(),this.__onMouseMove(n)},_onResize:function(){this.calcOffset()},_shouldRender:function(n){var a=this._activeObject;return!!a!=!!n||a&&n&&a!==n?!0:(a&&a.isEditing,!1)},__onMouseUp:function(n){var a,i=this._currentTransform,l=this._groupSelector,u=!1,d=!l||l.left===0&&l.top===0;if(this._cacheTransformEventData(n),a=this._target,this._handleEvent(n,"up:before"),t(n,h)){this.fireRightClick&&this._handleEvent(n,"up",h,d);return}if(t(n,o)){this.fireMiddleClick&&this._handleEvent(n,"up",o,d),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(n);return}if(this._isMainEvent(n)){if(i&&(this._finalizeCurrentTransform(n),u=i.actionPerformed),!d){var g=a===this._activeObject;this._maybeGroupObjects(n),u||(u=this._shouldRender(a)||!g&&a===this._activeObject)}var p,v;if(a){if(p=a._findTargetCorner(this.getPointer(n,!0),f.util.isTouchEvent(n)),a.selectable&&a!==this._activeObject&&a.activeOn==="up")this.setActiveObject(a,n),u=!0;else{var _=a.controls[p],T=_&&_.getMouseUpHandler(n,a,_);T&&(v=this.getPointer(n),T(n,i,v.x,v.y))}a.isMoving=!1}if(i&&(i.target!==a||i.corner!==p)){var A=i.target&&i.target.controls[i.corner],X=A&&A.getMouseUpHandler(n,a,_);v=v||this.getPointer(n),X&&X(n,i,v.x,v.y)}this._setCursorFromEvent(n,a),this._handleEvent(n,"up",e,d),this._groupSelector=null,this._currentTransform=null,a&&(a.__corner=0),u?this.requestRenderAll():d||this.renderTop()}},_simpleEventHandler:function(n,a){var i=this.findTarget(a),l=this.targets,u={e:a,target:i,subTargets:l};if(this.fire(n,u),i&&i.fire(n,u),!l)return i;for(var d=0;d1&&(e=new f.ActiveSelection(o.reverse(),{canvas:this}),this.setActiveObject(e,h))},_collectObjects:function(h){for(var o=[],e,r=this._groupSelector.ex,t=this._groupSelector.ey,n=r+this._groupSelector.left,a=t+this._groupSelector.top,i=new f.Point(c(r,n),c(t,a)),l=new f.Point(s(r,n),s(t,a)),u=!this.selectionFullyContained,d=r===n&&t===a,g=this._objects.length;g--&&(e=this._objects[g],!(!(!e||!e.selectable||!e.visible)&&(u&&e.intersectsWithRect(i,l,!0)||e.isContainedWithinRect(i,l,!0)||u&&e.containsPoint(i,null,!0)||u&&e.containsPoint(l,null,!0))&&(o.push(e),d))););return o.length>1&&(o=o.filter(function(p){return!p.onSelect({e:h})})),o},_maybeGroupObjects:function(h){this.selection&&this._groupSelector&&this._groupSelectedObjects(h),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){f.util.object.extend(f.StaticCanvas.prototype,{toDataURL:function(c){c||(c={});var s=c.format||"png",h=c.quality||1,o=(c.multiplier||1)*(c.enableRetinaScaling?this.getRetinaScaling():1),e=this.toCanvasElement(o,c);return f.util.toDataURL(e,s,h)},toCanvasElement:function(c,s){c=c||1,s=s||{};var h=(s.width||this.width)*c,o=(s.height||this.height)*c,e=this.getZoom(),r=this.width,t=this.height,n=e*c,a=this.viewportTransform,i=(a[4]-(s.left||0))*c,l=(a[5]-(s.top||0))*c,u=this.interactive,d=[n,0,0,n,i,l],g=this.enableRetinaScaling,p=f.util.createCanvasElement(),v=this.contextTop;return p.width=h,p.height=o,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=h,this.height=o,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=a,this.width=r,this.height=t,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),f.util.object.extend(f.StaticCanvas.prototype,{loadFromJSON:function(c,s,h){if(c){var o=typeof c=="string"?JSON.parse(c):f.util.object.clone(c),e=this,r=o.clipPath,t=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete o.clipPath,this._enlivenObjects(o.objects,function(n){e.clear(),e._setBgOverlay(o,function(){r?e._enlivenObjects([r],function(a){e.clipPath=a[0],e.__setupCanvas.call(e,o,n,t,s)}):e.__setupCanvas.call(e,o,n,t,s)})},h),this}},__setupCanvas:function(c,s,h,o){var e=this;s.forEach(function(r,t){e.insertAt(r,t)}),this.renderOnAddRemove=h,delete c.objects,delete c.backgroundImage,delete c.overlayImage,delete c.background,delete c.overlay,this._setOptions(c),this.renderAll(),o&&o()},_setBgOverlay:function(c,s){var h={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!c.backgroundImage&&!c.overlayImage&&!c.background&&!c.overlay){s&&s();return}var o=function(){h.backgroundImage&&h.overlayImage&&h.backgroundColor&&h.overlayColor&&s&&s()};this.__setBgOverlay("backgroundImage",c.backgroundImage,h,o),this.__setBgOverlay("overlayImage",c.overlayImage,h,o),this.__setBgOverlay("backgroundColor",c.background,h,o),this.__setBgOverlay("overlayColor",c.overlay,h,o)},__setBgOverlay:function(c,s,h,o){var e=this;if(!s){h[c]=!0,o&&o();return}c==="backgroundImage"||c==="overlayImage"?f.util.enlivenObjects([s],function(r){e[c]=r[0],h[c]=!0,o&&o()}):this["set"+f.util.string.capitalize(c,!0)](s,function(){h[c]=!0,o&&o()})},_enlivenObjects:function(c,s,h){if(!c||c.length===0){s&&s([]);return}f.util.enlivenObjects(c,function(o){s&&s(o)},null,h)},_toDataURL:function(c,s){this.clone(function(h){s(h.toDataURL(c))})},_toDataURLWithMultiplier:function(c,s,h){this.clone(function(o){h(o.toDataURLWithMultiplier(c,s))})},clone:function(c,s){var h=JSON.stringify(this.toJSON(s));this.cloneWithoutData(function(o){o.loadFromJSON(h,function(){c&&c(o)})})},cloneWithoutData:function(c){var s=f.util.createCanvasElement();s.width=this.width,s.height=this.height;var h=new f.Canvas(s);this.backgroundImage?(h.setBackgroundImage(this.backgroundImage.src,function(){h.renderAll(),c&&c(h)}),h.backgroundImageOpacity=this.backgroundImageOpacity,h.backgroundImageStretch=this.backgroundImageStretch):c&&c(h)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e=s.util.toFixed,r=s.util.string.capitalize,t=s.util.degreesToRadians,n=!s.isLikelyNode,a=2;s.Object||(s.Object=s.util.createClass(s.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(i){i&&this.setOptions(i)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=s.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(i){var l=s.perfLimitSizeTotal,u=i.width,d=i.height,g=s.maxCacheSideLimit,p=s.minCacheSideLimit;if(u<=g&&d<=g&&u*d<=l)return uA&&(i.zoomX/=u/A,i.width=A,i.capped=!0),d>X&&(i.zoomY/=d/X,i.height=X,i.capped=!0),i},_getCacheCanvasDimensions:function(){var i=this.getTotalObjectScaling(),l=this._getTransformedDimensions(0,0),u=l.x*i.scaleX/this.scaleX,d=l.y*i.scaleY/this.scaleY;return{width:u+a,height:d+a,zoomX:i.scaleX,zoomY:i.scaleY,x:u,y:d}},_updateCacheCanvas:function(){var i=this.canvas;if(this.noScaleCache&&i&&i._currentTransform){var l=i._currentTransform.target,u=i._currentTransform.action;if(this===l&&u.slice&&u.slice(0,5)==="scale")return!1}var d=this._cacheCanvas,g=this._limitCacheSize(this._getCacheCanvasDimensions()),p=s.minCacheSideLimit,v=g.width,_=g.height,T,A,X=g.zoomX,W=g.zoomY,N=v!==this.cacheWidth||_!==this.cacheHeight,V=this.zoomX!==X||this.zoomY!==W,U=N||V,G=0,q=0,J=!1;if(N){var K=this._cacheCanvas.width,m=this._cacheCanvas.height,C=v>K||_>m,S=(vp&&m>p;J=C||S,C&&!g.capped&&(v>p||_>p)&&(G=v*.1,q=_*.1)}return this instanceof s.Text&&this.path&&(U=!0,J=!0,G+=this.getHeightOfLine(0)*this.zoomX,q+=this.getHeightOfLine(0)*this.zoomY),U?(J?(d.width=Math.ceil(v+G),d.height=Math.ceil(_+q)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,d.width,d.height)),T=g.x/2,A=g.y/2,this.cacheTranslationX=Math.round(d.width/2-T)+T,this.cacheTranslationY=Math.round(d.height/2-A)+A,this.cacheWidth=v,this.cacheHeight=_,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(X,W),this.zoomX=X,this.zoomY=W,!0):!1},setOptions:function(i){this._setOptions(i),this._initGradient(i.fill,"fill"),this._initGradient(i.stroke,"stroke"),this._initPattern(i.fill,"fill"),this._initPattern(i.stroke,"stroke")},transform:function(i){var l=this.group&&!this.group._transformDone||this.group&&this.canvas&&i===this.canvas.contextTop,u=this.calcTransformMatrix(!l);i.transform(u[0],u[1],u[2],u[3],u[4],u[5])},toObject:function(i){var l=s.Object.NUM_FRACTION_DIGITS,u={type:this.type,version:s.version,originX:this.originX,originY:this.originY,left:e(this.left,l),top:e(this.top,l),width:e(this.width,l),height:e(this.height,l),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:e(this.strokeWidth,l),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:e(this.strokeMiterLimit,l),scaleX:e(this.scaleX,l),scaleY:e(this.scaleY,l),angle:e(this.angle,l),flipX:this.flipX,flipY:this.flipY,opacity:e(this.opacity,l),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:e(this.skewX,l),skewY:e(this.skewY,l)};return this.clipPath&&!this.clipPath.excludeFromExport&&(u.clipPath=this.clipPath.toObject(i),u.clipPath.inverted=this.clipPath.inverted,u.clipPath.absolutePositioned=this.clipPath.absolutePositioned),s.util.populateWithProperties(this,u,i),this.includeDefaultValues||(u=this._removeDefaultValues(u)),u},toDatalessObject:function(i){return this.toObject(i)},_removeDefaultValues:function(i){var l=s.util.getKlass(i.type).prototype,u=l.stateProperties;return u.forEach(function(d){d==="left"||d==="top"||(i[d]===l[d]&&delete i[d],Array.isArray(i[d])&&Array.isArray(l[d])&&i[d].length===0&&l[d].length===0&&delete i[d])}),i},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var i=s.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(i.scaleX),scaleY:Math.abs(i.scaleY)}},getTotalObjectScaling:function(){var i=this.getObjectScaling(),l=i.scaleX,u=i.scaleY;if(this.canvas){var d=this.canvas.getZoom(),g=this.canvas.getRetinaScaling();l*=d*g,u*=d*g}return{scaleX:l,scaleY:u}},getObjectOpacity:function(){var i=this.opacity;return this.group&&(i*=this.group.getObjectOpacity()),i},_set:function(i,l){var u=i==="scaleX"||i==="scaleY",d=this[i]!==l,g=!1;return u&&(l=this._constrainScale(l)),i==="scaleX"&&l<0?(this.flipX=!this.flipX,l*=-1):i==="scaleY"&&l<0?(this.flipY=!this.flipY,l*=-1):i==="shadow"&&l&&!(l instanceof s.Shadow)?l=new s.Shadow(l):i==="dirty"&&this.group&&this.group.set("dirty",l),this[i]=l,d&&(g=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(i)>-1?(this.dirty=!0,g&&this.group.set("dirty",!0)):g&&this.stateProperties.indexOf(i)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:s.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(i){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(i.save(),this._setupCompositeOperation(i),this.drawSelectionBackground(i),this.transform(i),this._setOpacity(i),this._setShadow(i,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(i)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(i),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),i.restore())},renderCache:function(i){i=i||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,i.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(i,l){if(i.save(),l.inverted?i.globalCompositeOperation="destination-out":i.globalCompositeOperation="destination-in",l.absolutePositioned){var u=s.util.invertTransform(this.calcTransformMatrix());i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}l.transform(i),i.scale(1/l.zoomX,1/l.zoomY),i.drawImage(l._cacheCanvas,-l.cacheTranslationX,-l.cacheTranslationY),i.restore()},drawObject:function(i,l){var u=this.fill,d=this.stroke;l?(this.fill="black",this.stroke="",this._setClippingProperties(i)):this._renderBackground(i),this._render(i),this._drawClipPath(i,this.clipPath),this.fill=u,this.stroke=d},_drawClipPath:function(i,l){l&&(l.canvas=this.canvas,l.shouldCache(),l._transformDone=!0,l.renderCache({forClipping:!0}),this.drawClipPathOnCache(i,l))},drawCacheOnCanvas:function(i){i.scale(1/this.zoomX,1/this.zoomY),i.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(i){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!i&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!i){var l=this.cacheWidth/this.zoomX,u=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-l/2,-u/2,l,u)}return!0}return!1},_renderBackground:function(i){if(this.backgroundColor){var l=this._getNonTransformedDimensions();i.fillStyle=this.backgroundColor,i.fillRect(-l.x/2,-l.y/2,l.x,l.y),this._removeShadow(i)}},_setOpacity:function(i){this.group&&!this.group._transformDone?i.globalAlpha=this.getObjectOpacity():i.globalAlpha*=this.opacity},_setStrokeStyles:function(i,l){var u=l.stroke;u&&(i.lineWidth=l.strokeWidth,i.lineCap=l.strokeLineCap,i.lineDashOffset=l.strokeDashOffset,i.lineJoin=l.strokeLineJoin,i.miterLimit=l.strokeMiterLimit,u.toLive?u.gradientUnits==="percentage"||u.gradientTransform||u.patternTransform?this._applyPatternForTransformedGradient(i,u):(i.strokeStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,u)):i.strokeStyle=l.stroke)},_setFillStyles:function(i,l){var u=l.fill;u&&(u.toLive?(i.fillStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,l.fill)):i.fillStyle=u)},_setClippingProperties:function(i){i.globalAlpha=1,i.strokeStyle="transparent",i.fillStyle="#000000"},_setLineDash:function(i,l){!l||l.length===0||(1&l.length&&l.push.apply(l,l),i.setLineDash(l))},_renderControls:function(i,l){var u=this.getViewportTransform(),d=this.calcTransformMatrix(),g,p,v;l=l||{},p=typeof l.hasBorders<"u"?l.hasBorders:this.hasBorders,v=typeof l.hasControls<"u"?l.hasControls:this.hasControls,d=s.util.multiplyTransformMatrices(u,d),g=s.util.qrDecompose(d),i.save(),i.translate(g.translateX,g.translateY),i.lineWidth=1*this.borderScaleFactor,this.group||(i.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(g.angle-=180),i.rotate(t(this.group?g.angle:this.angle)),l.forActiveSelection||this.group?p&&this.drawBordersInGroup(i,g,l):p&&this.drawBorders(i,l),v&&this.drawControls(i,l),i.restore()},_setShadow:function(i){if(this.shadow){var l=this.shadow,u=this.canvas,d,g=u&&u.viewportTransform[0]||1,p=u&&u.viewportTransform[3]||1;l.nonScaling?d={scaleX:1,scaleY:1}:d=this.getObjectScaling(),u&&u._isRetinaScaling()&&(g*=s.devicePixelRatio,p*=s.devicePixelRatio),i.shadowColor=l.color,i.shadowBlur=l.blur*s.browserShadowBlurConstant*(g+p)*(d.scaleX+d.scaleY)/4,i.shadowOffsetX=l.offsetX*g*d.scaleX,i.shadowOffsetY=l.offsetY*p*d.scaleY}},_removeShadow:function(i){this.shadow&&(i.shadowColor="",i.shadowBlur=i.shadowOffsetX=i.shadowOffsetY=0)},_applyPatternGradientTransform:function(i,l){if(!l||!l.toLive)return{offsetX:0,offsetY:0};var u=l.gradientTransform||l.patternTransform,d=-this.width/2+l.offsetX||0,g=-this.height/2+l.offsetY||0;return l.gradientUnits==="percentage"?i.transform(this.width,0,0,this.height,d,g):i.transform(1,0,0,1,d,g),u&&i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),{offsetX:d,offsetY:g}},_renderPaintInOrder:function(i){this.paintFirst==="stroke"?(this._renderStroke(i),this._renderFill(i)):(this._renderFill(i),this._renderStroke(i))},_render:function(){},_renderFill:function(i){this.fill&&(i.save(),this._setFillStyles(i,this),this.fillRule==="evenodd"?i.fill("evenodd"):i.fill(),i.restore())},_renderStroke:function(i){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(i),i.save(),this.strokeUniform&&this.group){var l=this.getObjectScaling();i.scale(1/l.scaleX,1/l.scaleY)}else this.strokeUniform&&i.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(i,this.strokeDashArray),this._setStrokeStyles(i,this),i.stroke(),i.restore()}},_applyPatternForTransformedGradient:function(i,l){var u=this._limitCacheSize(this._getCacheCanvasDimensions()),d=s.util.createCanvasElement(),g,p=this.canvas.getRetinaScaling(),v=u.x/this.scaleX/p,_=u.y/this.scaleY/p;d.width=v,d.height=_,g=d.getContext("2d"),g.beginPath(),g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,_),g.lineTo(0,_),g.closePath(),g.translate(v/2,_/2),g.scale(u.zoomX/this.scaleX/p,u.zoomY/this.scaleY/p),this._applyPatternGradientTransform(g,l),g.fillStyle=l.toLive(i),g.fill(),i.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),i.scale(p*this.scaleX/u.zoomX,p*this.scaleY/u.zoomY),i.strokeStyle=g.createPattern(d,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var i=s.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",i.scaleX),this.set("scaleY",i.scaleY),this.angle=i.angle,this.skewX=i.skewX,this.skewY=0}},_removeTransformMatrix:function(i){var l=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),l=s.util.transformPoint(l,this.transformMatrix)),this.transformMatrix=null,i&&(this.scaleX*=i.scaleX,this.scaleY*=i.scaleY,this.cropX=i.cropX,this.cropY=i.cropY,l.x+=i.offsetLeft,l.y+=i.offsetTop,this.width=i.width,this.height=i.height),this.setPositionByOrigin(l,"center","center")},clone:function(i,l){var u=this.toObject(l);this.constructor.fromObject?this.constructor.fromObject(u,i):s.Object._fromObject("Object",u,i)},cloneAsImage:function(i,l){var u=this.toCanvasElement(l);return i&&i(new s.Image(u)),this},toCanvasElement:function(i){i||(i={});var l=s.util,u=l.saveObjectTransform(this),d=this.group,g=this.shadow,p=Math.abs,v=(i.multiplier||1)*(i.enableRetinaScaling?s.devicePixelRatio:1);delete this.group,i.withoutTransform&&l.resetObjectTransform(this),i.withoutShadow&&(this.shadow=null);var _=s.util.createCanvasElement(),T=this.getBoundingRect(!0,!0),A=this.shadow,X,W={x:0,y:0},N,V,U;A&&(N=A.blur,A.nonScaling?X={scaleX:1,scaleY:1}:X=this.getObjectScaling(),W.x=2*Math.round(p(A.offsetX)+N)*p(X.scaleX),W.y=2*Math.round(p(A.offsetY)+N)*p(X.scaleY)),V=T.width+W.x,U=T.height+W.y,_.width=Math.ceil(V),_.height=Math.ceil(U);var G=new s.StaticCanvas(_,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});i.format==="jpeg"&&(G.backgroundColor="#fff"),this.setPositionByOrigin(new s.Point(G.width/2,G.height/2),"center","center");var q=this.canvas;G.add(this);var J=G.toCanvasElement(v||1,i);return this.shadow=g,this.set("canvas",q),d&&(this.group=d),this.set(u).setCoords(),G._objects=[],G.dispose(),G=null,J},toDataURL:function(i){return i||(i={}),s.util.toDataURL(this.toCanvasElement(i),i.format||"png",i.quality||1)},isType:function(i){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===i},complexity:function(){return 1},toJSON:function(i){return this.toObject(i)},rotate:function(i){var l=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return l&&this._setOriginToCenter(),this.set("angle",i),l&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(i,l){l=l||this.canvas.getPointer(i);var u=new s.Point(l.x,l.y),d=this._getLeftTopCoords();return this.angle&&(u=s.util.rotatePoint(u,d,t(-this.angle))),{x:u.x-d.x,y:u.y-d.y}},_setupCompositeOperation:function(i){this.globalCompositeOperation&&(i.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){s.runningAnimations&&s.runningAnimations.cancelByTarget(this)}}),s.util.createAccessors&&s.util.createAccessors(s.Object),h(s.Object.prototype,s.Observable),s.Object.NUM_FRACTION_DIGITS=2,s.Object.ENLIVEN_PROPS=["clipPath"],s.Object._fromObject=function(i,l,u,d){var g=s[i];l=o(l,!0),s.util.enlivenPatterns([l.fill,l.stroke],function(p){typeof p[0]<"u"&&(l.fill=p[0]),typeof p[1]<"u"&&(l.stroke=p[1]),s.util.enlivenObjectEnlivables(l,l,function(){var v=d?new g(l[d],l):new g(l);u&&u(v)})})},s.Object.__uid=0)}(Z),function(){var c=f.util.degreesToRadians,s={left:-.5,center:0,right:.5},h={top:-.5,center:0,bottom:.5};f.util.object.extend(f.Object.prototype,{translateToGivenOrigin:function(o,e,r,t,n){var a=o.x,i=o.y,l,u,d;return typeof e=="string"?e=s[e]:e-=.5,typeof t=="string"?t=s[t]:t-=.5,l=t-e,typeof r=="string"?r=h[r]:r-=.5,typeof n=="string"?n=h[n]:n-=.5,u=n-r,(l||u)&&(d=this._getTransformedDimensions(),a=o.x+l*d.x,i=o.y+u*d.y),new f.Point(a,i)},translateToCenterPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,e,r,"center","center");return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},translateToOriginPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,"center","center",e,r);return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},getCenterPoint:function(){var o=new f.Point(this.left,this.top);return this.translateToCenterPoint(o,this.originX,this.originY)},getPointByOrigin:function(o,e){var r=this.getCenterPoint();return this.translateToOriginPoint(r,o,e)},toLocalPoint:function(o,e,r){var t=this.getCenterPoint(),n,a;return typeof e<"u"&&typeof r<"u"?n=this.translateToGivenOrigin(t,"center","center",e,r):n=new f.Point(this.left,this.top),a=new f.Point(o.x,o.y),this.angle&&(a=f.util.rotatePoint(a,t,-c(this.angle))),a.subtractEquals(n)},setPositionByOrigin:function(o,e,r){var t=this.translateToCenterPoint(o,e,r),n=this.translateToOriginPoint(t,this.originX,this.originY);this.set("left",n.x),this.set("top",n.y)},adjustPosition:function(o){var e=c(this.angle),r=this.getScaledWidth(),t=f.util.cos(e)*r,n=f.util.sin(e)*r,a,i;typeof this.originX=="string"?a=s[this.originX]:a=this.originX-.5,typeof o=="string"?i=s[o]:i=o-.5,this.left+=t*(i-a),this.top+=n*(i-a),this.setCoords(),this.originX=o},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var o=this.getCenterPoint();this.originX="center",this.originY="center",this.left=o.x,this.top=o.y},_resetOrigin:function(){var o=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=o.x,this.top=o.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function c(r){return[new f.Point(r.tl.x,r.tl.y),new f.Point(r.tr.x,r.tr.y),new f.Point(r.br.x,r.br.y),new f.Point(r.bl.x,r.bl.y)]}var s=f.util,h=s.degreesToRadians,o=s.multiplyTransformMatrices,e=s.transformPoint;s.object.extend(f.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(r,t){return t?r?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),r?this.aCoords:this.lineCoords)},getCoords:function(r,t){return c(this._getCoords(r,t))},intersectsWithRect:function(r,t,n,a){var i=this.getCoords(n,a),l=f.Intersection.intersectPolygonRectangle(i,r,t);return l.status==="Intersection"},intersectsWithObject:function(r,t,n){var a=f.Intersection.intersectPolygonPolygon(this.getCoords(t,n),r.getCoords(t,n));return a.status==="Intersection"||r.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(r,t,n)},isContainedWithinObject:function(r,t,n){for(var a=this.getCoords(t,n),i=t?r.aCoords:r.lineCoords,l=0,u=r._getImageLines(i);l<4;l++)if(!r.containsPoint(a[l],u))return!1;return!0},isContainedWithinRect:function(r,t,n,a){var i=this.getBoundingRect(n,a);return i.left>=r.x&&i.left+i.width<=t.x&&i.top>=r.y&&i.top+i.height<=t.y},containsPoint:function(r,l,n,a){var i=this._getCoords(n,a),l=l||this._getImageLines(i),u=this._findCrossPoints(r,l);return u!==0&&u%2===1},isOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br,a=this.getCoords(!0,r);return a.some(function(i){return i.x<=n.x&&i.x>=t.x&&i.y<=n.y&&i.y>=t.y})||this.intersectsWithRect(t,n,!0,r)?!0:this._containsCenterOfCanvas(t,n,r)},_containsCenterOfCanvas:function(r,t,n){var a={x:(r.x+t.x)/2,y:(r.y+t.y)/2};return!!this.containsPoint(a,null,!0,n)},isPartiallyOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;if(this.intersectsWithRect(t,n,!0,r))return!0;var a=this.getCoords(!0,r).every(function(i){return(i.x>=n.x||i.x<=t.x)&&(i.y>=n.y||i.y<=t.y)});return a&&this._containsCenterOfCanvas(t,n,r)},_getImageLines:function(r){var t={topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}};return t},_findCrossPoints:function(r,t){var n,a,i,l,u,d=0,g;for(var p in t)if(g=t[p],!(g.o.y=r.y&&g.d.y>=r.y)&&(g.o.x===g.d.x&&g.o.x>=r.x?u=g.o.x:(n=0,a=(g.d.y-g.o.y)/(g.d.x-g.o.x),i=r.y-n*r.x,l=g.o.y-a*g.o.x,u=-(i-l)/(n-a)),u>=r.x&&(d+=1),d===2))break;return d},getBoundingRect:function(r,t){var n=this.getCoords(r,t);return s.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(r){return Math.abs(r)"u"&&(r=this.skewX),typeof t>"u"&&(t=this.skewY);var n,a,i,l=r===0&&t===0;if(this.strokeUniform?(a=this.width,i=this.height):(n=this._getNonTransformedDimensions(),a=n.x,i=n.y),l)return this._finalizeDimensions(a*this.scaleX,i*this.scaleY);var u=s.sizeAfterTransform(a,i,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:r,skewY:t});return this._finalizeDimensions(u.x,u.y)},_finalizeDimensions:function(r,t){return this.strokeUniform?{x:r+this.strokeWidth,y:t+this.strokeWidth}:{x:r,y:t}},_calculateCurrentDimensions:function(){var r=this.getViewportTransform(),t=this._getTransformedDimensions(),n=e(t,r,!0);return n.scalarAdd(2*this.padding)}})}(),f.util.object.extend(f.Object.prototype,{sendToBack:function(){return this.group?f.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?f.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(c){return this.group?f.StaticCanvas.prototype.sendBackwards.call(this.group,this,c):this.canvas&&this.canvas.sendBackwards(this,c),this},bringForward:function(c){return this.group?f.StaticCanvas.prototype.bringForward.call(this.group,this,c):this.canvas&&this.canvas.bringForward(this,c),this},moveTo:function(c){return this.group&&this.group.type!=="activeSelection"?f.StaticCanvas.prototype.moveTo.call(this.group,this,c):this.canvas&&this.canvas.moveTo(this,c),this}}),function(){function c(h,o){if(o){if(o.toLive)return h+": url(#SVGID_"+o.id+"); ";var e=new f.Color(o),r=h+": "+e.toRgb()+"; ",t=e.getAlpha();return t!==1&&(r+=h+"-opacity: "+t.toString()+"; "),r}else return h+": none; "}var s=f.util.toFixed;f.util.object.extend(f.Object.prototype,{getSvgStyles:function(h){var o=this.fillRule?this.fillRule:"nonzero",e=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",t=this.strokeDashOffset?this.strokeDashOffset:"0",n=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",i=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=h?"":this.getSvgFilter(),g=c("fill",this.fill),p=c("stroke",this.stroke);return[p,"stroke-width: ",e,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",n,"; ","stroke-dashoffset: ",t,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",i,"; ",g,"fill-rule: ",o,"; ","opacity: ",l,";",d,u].join("")},getSvgSpanStyles:function(h,o){var e="; ",t=h.fontFamily?"font-family: "+(h.fontFamily.indexOf("'")===-1&&h.fontFamily.indexOf('"')===-1?"'"+h.fontFamily+"'":h.fontFamily)+e:"",r=h.strokeWidth?"stroke-width: "+h.strokeWidth+e:"",t=t,n=h.fontSize?"font-size: "+h.fontSize+"px"+e:"",a=h.fontStyle?"font-style: "+h.fontStyle+e:"",i=h.fontWeight?"font-weight: "+h.fontWeight+e:"",l=h.fill?c("fill",h.fill):"",u=h.stroke?c("stroke",h.stroke):"",d=this.getSvgTextDecoration(h),g=h.deltaY?"baseline-shift: "+-h.deltaY+"; ":"";return d&&(d="text-decoration: "+d+e),[u,r,t,n,a,i,d,l,g,o?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(h){return["overline","underline","line-through"].filter(function(o){return h[o.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(h,o){var e=h?this.calcTransformMatrix():this.calcOwnMatrix(),r='transform="'+f.util.matrixToSVG(e);return r+(o||"")+'" '},_setSVGBg:function(h){if(this.backgroundColor){var o=f.Object.NUM_FRACTION_DIGITS;h.push(" +`)}},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(h),{reviver:h})},toClipPathSVG:function(h){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(h),{reviver:h})},_createBaseClipPathSVGMarkup:function(h,o){o=o||{};var e=o.reviver,r=o.additionalTransform||"",t=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=h.indexOf("COMMON_PARTS");return h[n]=t,e?e(h.join("")):h.join("")},_createBaseSVGMarkup:function(h,o){o=o||{};var e=o.noStyle,r=o.reviver,t=e?"":'style="'+this.getSvgStyles()+'" ',n=o.withShadow?'style="'+this.getSvgFilter()+'" ':"",a=this.clipPath,i=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=a&&a.absolutePositioned,u=this.stroke,d=this.fill,g=this.shadow,p,v=[],_,T=h.indexOf("COMMON_PARTS"),A=o.additionalTransform;return a&&(a.clipPathId="CLIPPATH_"+f.Object.__uid++,_=' +`+a.toClipPathSVG(r)+` +`),l&&v.push(" +`),v.push(" +`),p=[t,i,e?"":this.addPaintOrder()," ",A?'transform="'+A+'" ':""].join(""),h[T]=p,d&&d.toLive&&v.push(d.toSVG(this)),u&&u.toLive&&v.push(u.toSVG(this)),g&&v.push(g.toSVG(this)),a&&v.push(_),v.push(h.join("")),v.push(` +`),l&&v.push(` +`),r?r(v.join("")):v.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var c=f.util.object.extend,s="stateProperties";function h(e,r,t){var n={},a=!0;t.forEach(function(i){n[i]=e[i]}),c(e[r],n,a)}function o(e,r,t){if(e===r)return!0;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0,a=e.length;n=0;a--)if(i=n[a],!!this.isControlVisible(i)&&(t=this._getImageLines(h?this.oCoords[i].touchCorner:this.oCoords[i].corner),r=this._findCrossPoints({x:o,y:e},t),r!==0&&r%2===1))return this.__corner=i,i;return!1},forEachControl:function(s){for(var h in this.controls)s(this.controls[h],h,this)},_setCornerCoords:function(){var s=this.oCoords;for(var h in s){var o=this.controls[h];s[h].corner=o.calcCornerCoords(this.angle,this.cornerSize,s[h].x,s[h].y,!1),s[h].touchCorner=o.calcCornerCoords(this.angle,this.touchCornerSize,s[h].x,s[h].y,!0)}},drawSelectionBackground:function(s){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;s.save();var h=this.getCenterPoint(),o=this._calculateCurrentDimensions(),e=this.canvas.viewportTransform;return s.translate(h.x,h.y),s.scale(1/e[0],1/e[3]),s.rotate(c(this.angle)),s.fillStyle=this.selectionBackgroundColor,s.fillRect(-o.x/2,-o.y/2,o.x,o.y),s.restore(),this},drawBorders:function(s,h){h=h||{};var o=this._calculateCurrentDimensions(),e=this.borderScaleFactor,r=o.x+e,t=o.y+e,n=typeof h.hasControls<"u"?h.hasControls:this.hasControls,a=!1;return s.save(),s.strokeStyle=h.borderColor||this.borderColor,this._setLineDash(s,h.borderDashArray||this.borderDashArray),s.strokeRect(-r/2,-t/2,r,t),n&&(s.beginPath(),this.forEachControl(function(i,l,u){i.withConnection&&i.getVisibility(u,l)&&(a=!0,s.moveTo(i.x*r,i.y*t),s.lineTo(i.x*r+i.offsetX,i.y*t+i.offsetY))}),a&&s.stroke()),s.restore(),this},drawBordersInGroup:function(s,h,o){o=o||{};var e=f.util.sizeAfterTransform(this.width,this.height,h),r=this.strokeWidth,t=this.strokeUniform,n=this.borderScaleFactor,a=e.x+r*(t?this.canvas.getZoom():h.scaleX)+n,i=e.y+r*(t?this.canvas.getZoom():h.scaleY)+n;return s.save(),this._setLineDash(s,o.borderDashArray||this.borderDashArray),s.strokeStyle=o.borderColor||this.borderColor,s.strokeRect(-a/2,-i/2,a,i),s.restore(),this},drawControls:function(s,h){h=h||{},s.save();var o=this.canvas.getRetinaScaling(),e,r;return s.setTransform(o,0,0,o,0,0),s.strokeStyle=s.fillStyle=h.cornerColor||this.cornerColor,this.transparentCorners||(s.strokeStyle=h.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(s,h.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(e=this.group.calcTransformMatrix()),this.forEachControl(function(t,n,a){r=a.oCoords[n],t.getVisibility(a,n)&&(e&&(r=f.util.transformPoint(r,e)),t.render(s,r.x,r.y,h,a))}),s.restore(),this},isControlVisible:function(s){return this.controls[s]&&this.controls[s].getVisibility(this,s)},setControlVisible:function(s,h){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[s]=h,this},setControlsVisibility:function(s){s||(s={});for(var h in s)this.setControlVisible(h,s[h]);return this},onDeselect:function(){},onSelect:function(){}})}(),f.util.object.extend(f.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){c.set("left",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxCenterObjectV:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){c.set("top",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxRemove:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){c.set("opacity",t),r.requestRenderAll(),e()},onComplete:function(){r.remove(c),o()}})}}),f.util.object.extend(f.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var c=[],s,h,o=[];for(s in arguments[0])c.push(s);for(var e=0,r=c.length;e-1||r&&e.colorProperties.indexOf(r[1])>-1,n=r?this.get(r[0])[r[1]]:this.get(c);"from"in h||(h.from=n),t||(~s.indexOf("=")?s=n+parseFloat(s.replace("=","")):s=parseFloat(s));var a={target:this,startValue:h.from,endValue:s,byValue:h.by,easing:h.easing,duration:h.duration,abort:h.abort&&function(i,l,u){return h.abort.call(e,i,l,u)},onChange:function(i,l,u){r?e[r[0]][r[1]]=i:e.set(c,i),!o&&h.onChange&&h.onChange(i,l,u)},onComplete:function(i,l,u){o||(e.setCoords(),h.onComplete&&h.onComplete(i,l,u))}};return t?f.util.animateColor(a.startValue,a.endValue,a.duration,a):f.util.animate(a)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e={x1:1,x2:1,y1:1,y2:1};if(s.Line){s.warn("fabric.Line is already defined");return}s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,n){t||(t=[0,0,0,0]),this.callSuper("initialize",n),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(n)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,n){return this.callSuper("_set",t,n),typeof e[t]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:r({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:r({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var n=this.calcLinePoints();t.moveTo(n.x1,n.y1),t.lineTo(n.x2,n.y2),t.lineWidth=this.strokeWidth;var a=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=a},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return h(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(t.y-=this.strokeWidth),this.height===0&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,n=this.y1<=this.y2?-1:1,a=t*this.width*.5,i=n*this.height*.5,l=t*this.width*-.5,u=n*this.height*-.5;return{x1:a,x2:l,y1:i,y2:u}},_toSVG:function(){var t=this.calcLinePoints();return[" +`]}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,n,a){a=a||{};var i=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),l=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];n(new s.Line(l,h(i,a)))},s.Line.fromObject=function(t,n){function a(l){delete l.points,n&&n(l)}var i=o(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,a,"points")};function r(t,n){var a=t.origin,i=t.axis1,l=t.axis2,u=t.dimension,d=n.nearest,g=n.center,p=n.farthest;return function(){switch(this.get(a)){case d:return Math.min(this.get(i),this.get(l));case g:return Math.min(this.get(i),this.get(l))+.5*this.get(u);case p:return Math.max(this.get(i),this.get(l))}}}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.degreesToRadians;if(s.Circle){s.warn("fabric.Circle is already defined.");return}s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,r){return this.callSuper("_set",e,r),e==="radius"&&this.setRadius(r),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=0,t=0,n=(this.endAngle-this.startAngle)%360;if(n===0)e=[" +`];else{var a=h(this.startAngle),i=h(this.endAngle),l=this.radius,u=s.util.cos(a)*l,d=s.util.sin(a)*l,g=s.util.cos(i)*l,p=s.util.sin(i)*l,v=n>180?"1":"0";e=[' +`]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,h(this.startAngle),h(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",e*2).set("height",e*2)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(e,r){var t=s.parseAttributes(e,s.Circle.ATTRIBUTE_NAMES);if(!o(t))throw new Error("value of `r` attribute is required and can not be negative");t.left=(t.left||0)-t.radius,t.top=(t.top||0)-t.radius,r(new s.Circle(t))};function o(e){return"radius"in e&&e.radius>=0}s.Circle.fromObject=function(e,r){s.Object._fromObject("Circle",e,r)}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Triangle){s.warn("fabric.Triangle is already defined");return}s.Triangle=s.util.createClass(s.Object,{type:"triangle",width:100,height:100,_render:function(h){var o=this.width/2,e=this.height/2;h.beginPath(),h.moveTo(-o,e),h.lineTo(0,-e),h.lineTo(o,e),h.closePath(),this._renderPaintInOrder(h)},_toSVG:function(){var h=this.width/2,o=this.height/2,e=[-h+" "+o,"0 "+-o,h+" "+o].join(",");return["']}}),s.Triangle.fromObject=function(h,o){return s.Object._fromObject("Triangle",h,o)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=Math.PI*2;if(s.Ellipse){s.warn("fabric.Ellipse is already defined.");return}s.Ellipse=s.util.createClass(s.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this.set("rx",o&&o.rx||0),this.set("ry",o&&o.ry||0)},_set:function(o,e){switch(this.callSuper("_set",o,e),o){case"rx":this.rx=e,this.set("width",e*2);break;case"ry":this.ry=e,this.set("height",e*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){return[" +`]},_render:function(o){o.beginPath(),o.save(),o.transform(1,0,0,this.ry/this.rx,0,0),o.arc(0,0,this.rx,0,h,!1),o.restore(),this._renderPaintInOrder(o)}}),s.Ellipse.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),s.Ellipse.fromElement=function(o,e){var r=s.parseAttributes(o,s.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,e(new s.Ellipse(r))},s.Ellipse.fromObject=function(o,e){s.Object._fromObject("Ellipse",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend;if(s.Rect){s.warn("fabric.Rect is already defined");return}s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(o){var e=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,t=this.width,n=this.height,a=-this.width/2,i=-this.height/2,l=e!==0||r!==0,u=1-.5522847498;o.beginPath(),o.moveTo(a+e,i),o.lineTo(a+t-e,i),l&&o.bezierCurveTo(a+t-u*e,i,a+t,i+u*r,a+t,i+r),o.lineTo(a+t,i+n-r),l&&o.bezierCurveTo(a+t,i+n-u*r,a+t-u*e,i+n,a+t-e,i+n),o.lineTo(a+e,i+n),l&&o.bezierCurveTo(a+u*e,i+n,a,i+n-u*r,a,i+n-r),o.lineTo(a,i+r),l&&o.bezierCurveTo(a,i+u*r,a+u*e,i,a+e,i),o.closePath(),this._renderPaintInOrder(o)},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){var o=-this.width/2,e=-this.height/2;return[" +`]}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(o,e,r){if(!o)return e(null);r=r||{};var t=s.parseAttributes(o,s.Rect.ATTRIBUTE_NAMES);t.left=t.left||0,t.top=t.top||0,t.height=t.height||0,t.width=t.width||0;var n=new s.Rect(h(r?s.util.object.clone(r):{},t));n.visible=n.visible&&n.width>0&&n.height>0,e(n)},s.Rect.fromObject=function(o,e){return s.Object._fromObject("Rect",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.array.min,e=s.util.array.max,r=s.util.toFixed,t=s.util.projectStrokeOnPoints;if(s.Polyline){s.warn("fabric.Polyline is already defined");return}s.Polyline=s.util.createClass(s.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:s.Object.prototype.cacheProperties.concat("points"),initialize:function(n,a){a=a||{},this.points=n||[],this.callSuper("initialize",a),this._setPositionDimensions(a)},_projectStrokeOnPoints:function(){return t(this.points,this,!0)},_setPositionDimensions:function(n){var a=this._calcDimensions(n),i,l=this.exactBoundingBox?this.strokeWidth:0;this.width=a.width-l,this.height=a.height-l,n.fromSVG||(i=this.translateToGivenOrigin({x:a.left-this.strokeWidth/2+l/2,y:a.top-this.strokeWidth/2+l/2},"left","top",this.originX,this.originY)),typeof n.left>"u"&&(this.left=n.fromSVG?a.left:i.x),typeof n.top>"u"&&(this.top=n.fromSVG?a.top:i.y),this.pathOffset={x:a.left+this.width/2+l/2,y:a.top+this.height/2+l/2}},_calcDimensions:function(){var n=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,a=o(n,"x")||0,i=o(n,"y")||0,l=e(n,"x")||0,u=e(n,"y")||0,d=l-a,g=u-i;return{left:a,top:i,width:d,height:g}},toObject:function(n){return h(this.callSuper("toObject",n),{points:this.points.concat()})},_toSVG:function(){for(var n=[],a=this.pathOffset.x,i=this.pathOffset.y,l=s.Object.NUM_FRACTION_DIGITS,u=0,d=this.points.length;u +`]},commonRender:function(n){var a,i=this.points.length,l=this.pathOffset.x,u=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;n.beginPath(),n.moveTo(this.points[0].x-l,this.points[0].y-u);for(var d=0;d"},toObject:function(n){return e(this.callSuper("toObject",n),{path:this.path.map(function(a){return a.slice()})})},toDatalessObject:function(n){var a=this.toObject(["sourcePath"].concat(n));return a.sourcePath&&delete a.path,a},_toSVG:function(){var n=s.util.joinPath(this.path);return[" +`]},_getOffsetTransform:function(){var n=s.Object.NUM_FRACTION_DIGITS;return" translate("+t(-this.pathOffset.x,n)+", "+t(-this.pathOffset.y,n)+")"},toClipPathSVG:function(n){var a=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},toSVG:function(n){var a=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var n=[],a=[],i,l=0,u=0,d=0,g=0,p,v=0,_=this.path.length;v<_;++v){switch(i=this.path[v],i[0]){case"L":d=i[1],g=i[2],p=[];break;case"M":d=i[1],g=i[2],l=d,u=g,p=[];break;case"C":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[3],i[4],i[5],i[6]),d=i[5],g=i[6];break;case"Q":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[1],i[2],i[3],i[4]),d=i[3],g=i[4];break;case"z":case"Z":d=l,g=u;break}p.forEach(function(U){n.push(U.x),a.push(U.y)}),n.push(d),a.push(g)}var T=h(n)||0,A=h(a)||0,X=o(n)||0,W=o(a)||0,N=X-T,V=W-A;return{left:T,top:A,width:N,height:V}}}),s.Path.fromObject=function(n,a){if(typeof n.sourcePath=="string"){var i=n.sourcePath;s.loadSVGFromURL(i,function(l){var u=l[0];u.setOptions(n),n.clipPath?s.util.enlivenObjects([n.clipPath],function(d){u.clipPath=d[0],a&&a(u)}):a&&a(u)})}else s.Object._fromObject("Path",n,a,"path")},s.Path.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat(["d"]),s.Path.fromElement=function(n,a,i){var l=s.parseAttributes(n,s.Path.ATTRIBUTE_NAMES);l.fromSVG=!0,a(new s.Path(l.d,e(l,i)))}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.array.min,o=s.util.array.max;s.Group||(s.Group=s.util.createClass(s.Object,s.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,r,t){r=r||{},this._objects=[],t&&this.callSuper("initialize",r),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(t)this._updateObjectsACoords();else{var a=r&&r.centerPoint;r.originX!==void 0&&(this.originX=r.originX),r.originY!==void 0&&(this.originY=r.originY),a||this._calcBounds(),this._updateObjectsCoords(a),delete r.centerPoint,this.callSuper("initialize",r)}this.setCoords()},_updateObjectsACoords:function(){for(var e=!0,r=this._objects.length;r--;)this._objects[r].setCoords(e)},_updateObjectsCoords:function(e){for(var e=e||this.getCenterPoint(),r=this._objects.length;r--;)this._updateObjectCoords(this._objects[r],e)},_updateObjectCoords:function(e,r){var t=e.left,n=e.top,a=!0;e.set({left:t-r.x,top:n-r.y}),e.group=this,e.setCoords(a)},toString:function(){return"#"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),s.util.resetObjectTransform(this),e&&(r&&s.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),s.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var t=this._objects.length;if(this.useSetOnGroup)for(;t--;)this._objects[t].setOnGroup(e,r);if(e==="canvas")for(;t--;)this._objects[t]._set(e,r);s.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,t=this._objects.filter(function(a){return!a.excludeFromExport}).map(function(a){var i=a.includeDefaultValues;a.includeDefaultValues=r;var l=a.toObject(e);return a.includeDefaultValues=i,l}),n=s.Object.prototype.toObject.call(this,e);return n.objects=t,n},toDatalessObject:function(e){var r,t=this.sourcePath;if(t)r=t;else{var n=this.includeDefaultValues;r=this._objects.map(function(i){var l=i.includeDefaultValues;i.includeDefaultValues=n;var u=i.toDatalessObject(e);return i.includeDefaultValues=l,u})}var a=s.Object.prototype.toDatalessObject.call(this,e);return a.objects=r,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=s.Object.prototype.shouldCache.call(this);if(e){for(var r=0,t=this._objects.length;r +`],t=0,n=this._objects.length;t +`),r},getSvgStyles:function(){var e=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",r=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),r].join("")},toClipPathSVG:function(e){for(var r=[],t=0,n=this._objects.length;t"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(h,o,e){h.save(),h.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",h,o),e=e||{},typeof e.hasControls>"u"&&(e.hasControls=!1),e.forActiveSelection=!0;for(var r=0,t=this._objects.length;r +`,' +`,` +`),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(i='" image-rendering="optimizeSpeed'),o.push(" +`),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=[" +`],this.fill=u}return this.paintFirst!=="fill"?h=h.concat(e,o):h=h.concat(o,e),h},getSrc:function(h){var o=h?this._element:this._originalElement;return o?o.toDataURL?o.toDataURL():this.srcFromAttribute?o.getAttribute("src"):o.src:this.src||""},setSrc:function(h,o,e){return f.util.loadImage(h,function(r,t){this.setElement(r,e),this._setWidthHeight(),o&&o(this,t)},this,e&&e.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var h=this.resizeFilter,o=this.minimumScaleTrigger,e=this.getTotalObjectScaling(),r=e.scaleX,t=e.scaleY,n=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!h||r>o&&t>o){this._element=n,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,this._lastScaleY=t;return}f.filterBackend||(f.filterBackend=f.initFilterBackend());var a=f.util.createCanvasElement(),i=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=n.width,u=n.height;a.width=l,a.height=u,this._element=a,this._lastScaleX=h.scaleX=r,this._lastScaleY=h.scaleY=t,f.filterBackend.applyFilters([h],n,l,u,this._element,i),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(h){if(h=h||this.filters||[],h=h.filter(function(n){return n&&!n.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),h.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var o=this._originalElement,e=o.naturalWidth||o.width,r=o.naturalHeight||o.height;if(this._element===this._originalElement){var t=f.util.createCanvasElement();t.width=e,t.height=r,this._element=t,this._filteredEl=t}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,e,r),this._lastScaleX=1,this._lastScaleY=1;return f.filterBackend||(f.filterBackend=f.initFilterBackend()),f.filterBackend.applyFilters(h,this._originalElement,e,r,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(h),this._renderPaintInOrder(h)},drawCacheOnCanvas:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),f.Object.prototype.drawCacheOnCanvas.call(this,h)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(h){var o=this._element;if(o){var e=this._filterScalingX,r=this._filterScalingY,t=this.width,n=this.height,a=Math.min,i=Math.max,l=i(this.cropX,0),u=i(this.cropY,0),d=o.naturalWidth||o.width,g=o.naturalHeight||o.height,p=l*e,v=u*r,_=a(t*e,d-p),T=a(n*r,g-v),A=-t/2,X=-n/2,W=a(t,d/e-l),N=a(n,g/r-u);o&&h.drawImage(o,p,v,_,T,A,X,W,N)}},_needsResize:function(){var h=this.getTotalObjectScaling();return h.scaleX!==this._lastScaleX||h.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(h,o){this.setElement(f.util.getById(h),o),f.util.addClass(this.getElement(),f.Image.CSS_CANVAS)},_initConfig:function(h){h||(h={}),this.setOptions(h),this._setWidthHeight(h)},_initFilters:function(h,o){h&&h.length?f.util.enlivenObjects(h,function(e){o&&o(e)},"fabric.Image.filters"):o&&o()},_setWidthHeight:function(h){h||(h={});var o=this.getElement();this.width=h.width||o.naturalWidth||o.width||0,this.height=h.height||o.naturalHeight||o.height||0},parsePreserveAspectRatioAttribute:function(){var h=f.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),o=this._element.width,e=this._element.height,r=1,t=1,n=0,a=0,i=0,l=0,u,d=this.width,g=this.height,p={width:d,height:g};return h&&(h.alignX!=="none"||h.alignY!=="none")?(h.meetOrSlice==="meet"&&(r=t=f.util.findScaleToFit(this._element,p),u=(d-o*r)/2,h.alignX==="Min"&&(n=-u),h.alignX==="Max"&&(n=u),u=(g-e*t)/2,h.alignY==="Min"&&(a=-u),h.alignY==="Max"&&(a=u)),h.meetOrSlice==="slice"&&(r=t=f.util.findScaleToCover(this._element,p),u=o-d/r,h.alignX==="Mid"&&(i=u/2),h.alignX==="Max"&&(i=u),u=e-g/t,h.alignY==="Mid"&&(l=u/2),h.alignY==="Max"&&(l=u),o=d/r,e=g/t)):(r=d/o,t=g/e),{width:o,height:e,scaleX:r,scaleY:t,offsetLeft:n,offsetTop:a,cropX:i,cropY:l}}}),f.Image.CSS_CANVAS="canvas-img",f.Image.prototype.getSvgSrc=f.Image.prototype.getSrc,f.Image.fromObject=function(h,o){var e=f.util.object.clone(h);f.util.loadImage(e.src,function(r,t){if(t){o&&o(null,!0);return}f.Image.prototype._initFilters.call(e,e.filters,function(n){e.filters=n||[],f.Image.prototype._initFilters.call(e,[e.resizeFilter],function(a){e.resizeFilter=a[0],f.util.enlivenObjectEnlivables(e,e,function(){var i=new f.Image(r,e);o(i,!1)})})})},null,e.crossOrigin)},f.Image.fromURL=function(h,o,e){f.util.loadImage(h,function(r,t){o&&o(new f.Image(r,e),t)},null,e&&e.crossOrigin)},f.Image.ATTRIBUTE_NAMES=f.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),f.Image.fromElement=function(h,o,e){var r=f.parseAttributes(h,f.Image.ATTRIBUTE_NAMES);f.Image.fromURL(r["xlink:href"],o,s(e?f.util.object.clone(e):{},r))}}(Z),f.util.object.extend(f.Object.prototype,{_getAngleValueForStraighten:function(){var c=this.angle%360;return c>0?Math.round((c-1)/90)*90:Math.round(c/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(c){c=c||{};var s=function(){},h=c.onComplete||s,o=c.onChange||s,e=this;return f.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(r){e.rotate(r),o()},onComplete:function(){e.setCoords(),h()}})}}),f.util.object.extend(f.StaticCanvas.prototype,{straightenObject:function(c){return c.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(c){return c.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function c(h,o){var e="precision "+o+` float; +void main(){}`,r=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(r,e),h.compileShader(r),!!h.getShaderParameter(r,h.COMPILE_STATUS)}f.isWebglSupported=function(h){if(f.isLikelyNode)return!1;h=h||f.WebglFilterBackend.prototype.tileSize;var o=document.createElement("canvas"),e=o.getContext("webgl")||o.getContext("experimental-webgl"),r=!1;if(e){f.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),r=f.maxTextureSize>=h;for(var t=["highp","mediump","lowp"],n=0;n<3;n++)if(c(e,t[n])){f.webGlPrecision=t[n];break}}return this.isSupported=r,r},f.WebglFilterBackend=s;function s(h){h&&h.tileSize&&(this.tileSize=h.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}s.prototype={tileSize:2048,resources:{},setupGLContext:function(h,o){this.dispose(),this.createWebGLCanvas(h,o),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(h,o)},chooseFastestCopyGLTo2DMethod:function(h,o){var e=typeof window.performance<"u",r;try{new ImageData(1,1),r=!0}catch{r=!1}var t=typeof ArrayBuffer<"u",n=typeof Uint8ClampedArray<"u";if(e&&r&&t&&n){var a=f.util.createCanvasElement(),i=new ArrayBuffer(h*o*4);if(f.forceGLPutImageData){this.imageBuffer=i,this.copyGLTo2D=gt;return}var l={imageBuffer:i,destinationWidth:h,destinationHeight:o,targetCanvas:a},u,d,g;a.width=h,a.height=o,u=window.performance.now(),ct.call(l,this.gl,l),d=window.performance.now()-u,u=window.performance.now(),gt.call(l,this.gl,l),g=window.performance.now()-u,d>g?(this.imageBuffer=i,this.copyGLTo2D=gt):this.copyGLTo2D=ct}},createWebGLCanvas:function(h,o){var e=f.util.createCanvasElement();e.width=h,e.height=o;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},t=e.getContext("webgl",r);t||(t=e.getContext("experimental-webgl",r)),t&&(t.clearColor(0,0,0,0),this.canvas=e,this.gl=t)},applyFilters:function(h,o,e,r,t,n){var a=this.gl,i;n&&(i=this.getCachedTexture(n,o));var l={originalWidth:o.width||o.originalWidth,originalHeight:o.height||o.originalHeight,sourceWidth:e,sourceHeight:r,destinationWidth:e,destinationHeight:r,context:a,sourceTexture:this.createTexture(a,e,r,!i&&o),targetTexture:this.createTexture(a,e,r),originalTexture:i||this.createTexture(a,e,r,!i&&o),passes:h.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:t},u=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,u),h.forEach(function(d){d&&d.applyTo(l)}),lt(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(u),t.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(h,o,e,r,t){var n=h.createTexture();return h.bindTexture(h.TEXTURE_2D,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),r?h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,r):h.texImage2D(h.TEXTURE_2D,0,h.RGBA,o,e,0,h.RGBA,h.UNSIGNED_BYTE,null),n},getCachedTexture:function(h,o){if(this.textureCache[h])return this.textureCache[h];var e=this.createTexture(this.gl,o.width,o.height,o);return this.textureCache[h]=e,e},evictCachesForKey:function(h){this.textureCache[h]&&(this.gl.deleteTexture(this.textureCache[h]),delete this.textureCache[h])},copyGLTo2D:ct,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var h=this.gl,o={renderer:"",vendor:""};if(!h)return o;var e=h.getExtension("WEBGL_debug_renderer_info");if(e){var r=h.getParameter(e.UNMASKED_RENDERER_WEBGL),t=h.getParameter(e.UNMASKED_VENDOR_WEBGL);r&&(o.renderer=r.toLowerCase()),t&&(o.vendor=t.toLowerCase())}return this.gpuInfo=o,o}}}();function lt(c){var s=c.targetCanvas,h=s.width,o=s.height,e=c.destinationWidth,r=c.destinationHeight;(h!==e||o!==r)&&(s.width=e,s.height=r)}function ct(c,s){var h=c.canvas,o=s.targetCanvas,e=o.getContext("2d");e.translate(0,o.height),e.scale(1,-1);var r=h.height-o.height;e.drawImage(h,0,r,o.width,o.height,0,0,o.width,o.height)}function gt(c,s){var h=s.targetCanvas,o=h.getContext("2d"),e=s.destinationWidth,r=s.destinationHeight,t=e*r*4,n=new Uint8Array(this.imageBuffer,0,t),a=new Uint8ClampedArray(this.imageBuffer,0,t);c.readPixels(0,0,e,r,c.RGBA,c.UNSIGNED_BYTE,n);var i=new ImageData(a,e,r);o.putImageData(i,0,0)}(function(){var c=function(){};f.Canvas2dFilterBackend=s;function s(){}s.prototype={evictCachesForKey:c,dispose:c,clearWebGLCaches:c,resources:{},applyFilters:function(h,o,e,r,t){var n=t.getContext("2d");n.drawImage(o,0,0,e,r);var a=n.getImageData(0,0,e,r),i=n.getImageData(0,0,e,r),l={sourceWidth:e,sourceHeight:r,imageData:a,originalEl:o,originalImageData:i,canvasEl:t,ctx:n,filterBackend:this};return h.forEach(function(u){u.applyTo(l)}),(l.imageData.width!==e||l.imageData.height!==r)&&(t.width=l.imageData.width,t.height=l.imageData.height),n.putImageData(l.imageData,0,0),l}}})(),f.Image=f.Image||{},f.Image.filters=f.Image.filters||{},f.Image.filters.BaseFilter=f.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; +varying vec2 vTexCoord; +void main() { +vTexCoord = aPosition; +gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); +}`,fragmentSource:`precision highp float; +varying vec2 vTexCoord; +uniform sampler2D uTexture; +void main() { +gl_FragColor = texture2D(uTexture, vTexCoord); +}`,initialize:function(c){c&&this.setOptions(c)},setOptions:function(c){for(var s in c)this[s]=c[s]},createProgram:function(c,s,h){s=s||this.fragmentSource,h=h||this.vertexSource,f.webGlPrecision!=="highp"&&(s=s.replace(/precision highp float/g,"precision "+f.webGlPrecision+" float"));var o=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(o,h),c.compileShader(o),!c.getShaderParameter(o,c.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+c.getShaderInfoLog(o));var e=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(e,s),c.compileShader(e),!c.getShaderParameter(e,c.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+c.getShaderInfoLog(e));var r=c.createProgram();if(c.attachShader(r,o),c.attachShader(r,e),c.linkProgram(r),!c.getProgramParameter(r,c.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+c.getProgramInfoLog(r));var t=this.getAttributeLocations(c,r),n=this.getUniformLocations(c,r)||{};return n.uStepW=c.getUniformLocation(r,"uStepW"),n.uStepH=c.getUniformLocation(r,"uStepH"),{program:r,attributeLocations:t,uniformLocations:n}},getAttributeLocations:function(c,s){return{aPosition:c.getAttribLocation(s,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(c,s,h){var o=s.aPosition,e=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o),c.vertexAttribPointer(o,2,c.FLOAT,!1,0,0),c.bufferData(c.ARRAY_BUFFER,h,c.STATIC_DRAW)},_setupFrameBuffer:function(c){var s=c.context,h,o;c.passes>1?(h=c.destinationWidth,o=c.destinationHeight,(c.sourceWidth!==h||c.sourceHeight!==o)&&(s.deleteTexture(c.targetTexture),c.targetTexture=c.filterBackend.createTexture(s,h,o)),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,c.targetTexture,0)):(s.bindFramebuffer(s.FRAMEBUFFER,null),s.finish())},_swapTextures:function(c){c.passes--,c.pass++;var s=c.targetTexture;c.targetTexture=c.sourceTexture,c.sourceTexture=s},isNeutralState:function(){var c=this.mainParameter,s=f.Image.filters[this.type].prototype;if(c)if(Array.isArray(s[c])){for(var h=s[c].length;h--;)if(this[c][h]!==s[c][h])return!1;return!0}else return s[c]===this[c];else return!1},applyTo:function(c){c.webgl?(this._setupFrameBuffer(c),this.applyToWebGL(c),this._swapTextures(c)):this.applyTo2d(c)},retrieveShader:function(c){return c.programCache.hasOwnProperty(this.type)||(c.programCache[this.type]=this.createProgram(c.context)),c.programCache[this.type]},applyToWebGL:function(c){var s=c.context,h=this.retrieveShader(c);c.pass===0&&c.originalTexture?s.bindTexture(s.TEXTURE_2D,c.originalTexture):s.bindTexture(s.TEXTURE_2D,c.sourceTexture),s.useProgram(h.program),this.sendAttributeData(s,h.attributeLocations,c.aPosition),s.uniform1f(h.uniformLocations.uStepW,1/c.sourceWidth),s.uniform1f(h.uniformLocations.uStepH,1/c.sourceHeight),this.sendUniformData(s,h.uniformLocations),s.viewport(0,0,c.destinationWidth,c.destinationHeight),s.drawArrays(s.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(c,s,h){c.activeTexture(h),c.bindTexture(c.TEXTURE_2D,s),c.activeTexture(c.TEXTURE0)},unbindAdditionalTexture:function(c,s){c.activeTexture(s),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(c){this[this.mainParameter]=c},sendUniformData:function(){},createHelpLayer:function(c){if(!c.helpLayer){var s=document.createElement("canvas");s.width=c.sourceWidth,s.height=c.sourceHeight,c.helpLayer=s}},toObject:function(){var c={type:this.type},s=this.mainParameter;return s&&(c[s]=this[s]),c},toJSON:function(){return this.toObject()}}),f.Image.filters.BaseFilter.fromObject=function(c,s){var h=new f.Image.filters[c.type](c);return s&&s(h),h},function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.ColorMatrix=o(h.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +varying vec2 vTexCoord; +uniform mat4 uColorMatrix; +uniform vec4 uConstants; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +color *= uColorMatrix; +color += uConstants; +gl_FragColor = color; +}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a=this.matrix,i,l,u,d,g,p=this.colorsOnly;for(g=0;g=d||N<0||N>=u)&&(U=(V*u+N)*4,G=a[m*i+K],_+=n[U]*G,T+=n[U+1]*G,A+=n[U+2]*G,v||(X+=n[U+3]*G));p[W]=_,p[W+1]=T,p[W+2]=A,v?p[W+3]=n[W+3]:p[W+3]=X}r.imageData=g},getUniformLocations:function(r,t){return{uMatrix:r.getUniformLocation(t,"uMatrix"),uOpaque:r.getUniformLocation(t,"uOpaque"),uHalfSize:r.getUniformLocation(t,"uHalfSize"),uSize:r.getUniformLocation(t,"uSize")}},sendUniformData:function(r,t){r.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return h(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),s.Image.filters.Convolute.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Grayscale=o(h.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; +uniform sampler2D uTexture; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +float average = (color.r + color.b + color.g) / 3.0; +gl_FragColor = vec4(average, average, average, color.a); +}`,lightness:`precision highp float; +uniform sampler2D uTexture; +uniform int uMode; +varying vec2 vTexCoord; +void main() { +vec4 col = texture2D(uTexture, vTexCoord); +float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0; +gl_FragColor = vec4(average, average, average, col.a); +}`,luminosity:`precision highp float; +uniform sampler2D uTexture; +uniform int uMode; +varying vec2 vTexCoord; +void main() { +vec4 col = texture2D(uTexture, vTexCoord); +float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; +gl_FragColor = vec4(average, average, average, col.a); +}`},mode:"average",mainParameter:"mode",applyTo2d:function(e){var r=e.imageData,t=r.data,n,a=t.length,i,l=this.mode;for(n=0;np[0]&&u>p[1]&&d>p[2]&&l 0.0) { +`+this.fragmentSource[e]+`} +}`},retrieveShader:function(e){var r=this.type+"_"+this.mode,t;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a,i,l,u,d,g,p,v=1-this.alpha;p=new s.Color(this.color).getSource(),a=p[0]*this.alpha,i=p[1]*this.alpha,l=p[2]*this.alpha;for(var _=0;_=u||d<=-u)return 0;if(d<11920929e-14&&d>-11920929e-14)return 1;d*=Math.PI;var g=d/u;return n(d)/d*n(g)/g}},applyTo2d:function(u){var d=u.imageData,g=this.scaleX,p=this.scaleY;this.rcpScaleX=1/g,this.rcpScaleY=1/p;var v=d.width,_=d.height,T=t(v*g),A=t(_*p),X;this.resizeType==="sliceHack"?X=this.sliceByTwo(u,v,_,T,A):this.resizeType==="hermite"?X=this.hermiteFastResize(u,v,_,T,A):this.resizeType==="bilinear"?X=this.bilinearFiltering(u,v,_,T,A):this.resizeType==="lanczos"&&(X=this.lanczosResize(u,v,_,T,A)),u.imageData=X},sliceByTwo:function(u,d,g,p,v){var _=u.imageData,T=.5,A=!1,X=!1,W=d*T,N=g*T,V=s.filterBackend.resources,U,G,q=0,J=0,K=d,m=0;for(V.sliceByTwo||(V.sliceByTwo=document.createElement("canvas")),U=V.sliceByTwo,(U.width=d)){Y=o(1e3*r(P-m.x)),K[Y]||(K[Y]={});for(var j=C.y-J;j<=C.y+J;j++)j<0||j>=g||(z=o(1e3*r(j-m.y)),K[Y][z]||(K[Y][z]=W(e(h(Y*U,2)+h(z*G,2))/1e3)),x=K[Y][z],x>0&&(y=(j*d+P)*4,w+=x,k+=x*T[y],M+=x*T[y+1],E+=x*T[y+2],R+=x*T[y+3]))}y=(b*p+S)*4,X[y]=k/w,X[y+1]=M/w,X[y+2]=E/w,X[y+3]=R/w}return++S1&&z<-1||(K=2*z*z*z-3*z*z+1,K>0&&(Y=4*(R+w*d),x+=K*N[Y+3],C+=K,N[Y+3]<255&&(K=K*N[Y+3]/250),S+=K*N[Y],b+=K*N[Y+1],P+=K*N[Y+2],m+=K))}U[J]=S/m,U[J+1]=b/m,U[J+2]=P/m,U[J+3]=x/C}return V},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),s.Image.filters.Resize.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Contrast=o(h.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +uniform float uContrast; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); +color.rgb = contrastF * (color.rgb - 0.5) + 0.5; +gl_FragColor = color; +}`,contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(this.contrast!==0){var r=e.imageData,t,a,n=r.data,a=n.length,i=Math.floor(this.contrast*255),l=259*(i+255)/(255*(259-i));for(t=0;t1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?r[0]=t:r[1]=t,r}}),h.Blur.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Gamma=o(h.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; +uniform sampler2D uTexture; +uniform vec3 uGamma; +varying vec2 vTexCoord; +void main() { +vec4 color = texture2D(uTexture, vTexCoord); +vec3 correction = (1.0 / uGamma); +color.r = pow(color.r, correction.r); +color.g = pow(color.g, correction.g); +color.b = pow(color.b, correction.b); +gl_FragColor = color; +gl_FragColor.rgb *= color.a; +}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],h.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=this.gamma,a=t.length,i=1/n[0],l=1/n[1],u=1/n[2],d;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),d=0,a=256;d'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),r=this.fontSize;return e.width+=r*e.zoomX,e.height+=r*e.zoomY,e},_render:function(e){var r=this.path;r&&!r.isNotVisible()&&r._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){this.paintFirst==="stroke"?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,r,t){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom";break}e.font=this._getFontDeclaration(r,t)},calcTextWidth:function(){for(var e=this.getLineWidth(0),r=1,t=this._textLines.length;re&&(e=n)}return e},_renderTextLine:function(e,r,t,n,a,i){this._renderChars(e,r,t,n,a,i)},_renderTextLinesBackground:function(e){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var r,t,n=e.fillStyle,a,i,l=this._getLeftOffset(),u=this._getTopOffset(),d=0,g=0,p,v,_=this.path,T,A=0,X=this._textLines.length;A=0:tv?g%=v:g<0&&(g+=v),this._setGraphemeOnPath(g,l,p),g+=l.kernedWidth}return{width:r,numOfSpaces:u}},_setGraphemeOnPath:function(e,r,t){var n=e+r.kernedWidth/2,a=this.path,i=s.util.getPointOnPath(a.path,n,a.segmentsInfo);r.renderLeft=i.x-t.x,r.renderTop=i.y-t.y,r.angle=i.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(e,r,t,n,a){var i=this.getCompleteStyleDeclaration(r,t),l=n?this.getCompleteStyleDeclaration(r,t-1):{},u=this._measureChar(e,i,n,l),d=u.kernedWidth,g=u.width,p;this.charSpacing!==0&&(p=this._getWidthOfCharSpacing(),g+=p,d+=p);var v={width:g,left:0,height:i.fontSize,kernedWidth:d,deltaY:i.deltaY};if(t>0&&!a){var _=this.__charBounds[r][t-1];v.left=_.left+_.width+u.kernedWidth-u.width}return v},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var r=this._textLines[e],t=this.getHeightOfChar(e,0),n=1,a=r.length;n0){var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),g&&U&&(e.fillStyle=U,e.fillRect(b,_+J*n+l,A,this.fontSize/15)),T=X.left,A=X.width,g=W,U=V,n=a,l=u}else A+=X.kernedWidth;var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),e.fillStyle=V,W&&V&&e.fillRect(b,_+J*n+l,A-q,this.fontSize/15),v+=t}this._removeShadow(e)}},_getFontDeclaration:function(e,r){var t=e||this,n=this.fontFamily,a=s.Text.genericFonts.indexOf(n.toLowerCase())>-1,i=n===void 0||n.indexOf("'")>-1||n.indexOf(",")>-1||n.indexOf('"')>-1||a?t.fontFamily:'"'+t.fontFamily+'"';return[s.isLikelyNode?t.fontWeight:t.fontStyle,s.isLikelyNode?t.fontStyle:t.fontWeight,r?this.CACHE_FONT_SIZE+"px":t.fontSize+"px",i].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),t=new Array(r.length),n=[` +`],a=[],i=0;i"u"?this.styles:{line:this.styles[c]};for(var h in s)for(var o in s[h])for(var e in s[h][o])return!1;return!0},styleHas:function(c,s){if(!this.styles||!c||c===""||typeof s<"u"&&!this.styles[s])return!1;var h=typeof s>"u"?this.styles:{0:this.styles[s]};for(var o in h)for(var e in h[o])if(typeof h[o][e][c]<"u")return!0;return!1},cleanStyle:function(c){if(!this.styles||!c||c==="")return!1;var s=this.styles,h=0,o,e,r=!0,t=0,n;for(var a in s){o=0;for(var i in s[a]){var n=s[a][i],l=n.hasOwnProperty(c);h++,l?(e?n[c]!==e&&(r=!1):e=n[c],n[c]===this[c]&&delete n[c]):r=!1,Object.keys(n).length!==0?o++:delete s[a][i]}o===0&&delete s[a]}for(var u=0;u"u"&&(c=this.selectionStart);for(var h=s?this._unwrappedTextLines:this._textLines,o=h.length,e=0;e"u"&&(c=this.selectionStart||0),typeof s>"u"&&(s=this.selectionEnd||c);for(var o=[],e=c;e"u"&&(s=this.selectionStart||0),typeof h>"u"&&(h=this.selectionEnd||s);for(var o=s;o"u"?this[e]:h[e];return o},_setStyleDeclaration:function(c,s,h){this.styles[c][s]=h},_deleteStyleDeclaration:function(c,s){delete this.styles[c][s]},_getLineStyle:function(c){return!!this.styles[c]},_setLineStyle:function(c){this.styles[c]={}},_deleteLineStyle:function(c){delete this.styles[c]}})}(),function(){function c(s){s.textDecoration&&(s.textDecoration.indexOf("underline")>-1&&(s.underline=!0),s.textDecoration.indexOf("line-through")>-1&&(s.linethrough=!0),s.textDecoration.indexOf("overline")>-1&&(s.overline=!0),delete s.textDecoration)}f.IText=f.util.createClass(f.Text,f.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(s,h){this.callSuper("initialize",s,h),this.initBehavior()},setSelectionStart:function(s){s=Math.max(s,0),this._updateAndFire("selectionStart",s)},setSelectionEnd:function(s){s=Math.min(s,this.text.length),this._updateAndFire("selectionEnd",s)},_updateAndFire:function(s,h){this[s]!==h&&(this._fireSelectionChanged(),this[s]=h),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(s){this.clearContextTop(),this.callSuper("render",s),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(s){this.callSuper("_render",s)},clearContextTop:function(s){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var h=this.canvas.contextTop,o=this.canvas.viewportTransform;h.save(),h.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this.transform(h),this._clearTextArea(h),s||h.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var s=this._getCursorBoundaries(),h=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(s,h):this.renderSelection(s,h),h.restore()}},_clearTextArea:function(s){var h=this.width+4,o=this.height+4;s.clearRect(-h/2,-o/2,h,o)},_getCursorBoundaries:function(s){typeof s>"u"&&(s=this.selectionStart);var h=this._getLeftOffset(),o=this._getTopOffset(),e=this._getCursorBoundariesOffsets(s);return{left:h,top:o,leftOffset:e.left,topOffset:e.top}},_getCursorBoundariesOffsets:function(s){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var h,o,e,r=0,t=0,n,a=this.get2DCursorLocation(s);e=a.charIndex,o=a.lineIndex;for(var i=0;i0?t:0)},this.direction==="rtl"&&(n.left*=-1),this.cursorOffsetCache=n,this.cursorOffsetCache},renderCursor:function(s,h){var o=this.get2DCursorLocation(),e=o.lineIndex,r=o.charIndex>0?o.charIndex-1:0,t=this.getValueOfPropertyAt(e,r,"fontSize"),n=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/n,i=s.topOffset,l=this.getValueOfPropertyAt(e,r,"deltaY");i+=(1-this._fontSizeFraction)*this.getHeightOfLine(e)/this.lineHeight-t*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(s,h),h.fillStyle=this.cursorColor||this.getValueOfPropertyAt(e,r,"fill"),h.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,h.fillRect(s.left+s.leftOffset-a/2,i+s.top+l,a,t)},renderSelection:function(s,h){for(var o=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,e=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=this.textAlign.indexOf("justify")!==-1,t=this.get2DCursorLocation(o),n=this.get2DCursorLocation(e),a=t.lineIndex,i=n.lineIndex,l=t.charIndex<0?0:t.charIndex,u=n.charIndex<0?0:n.charIndex,d=a;d<=i;d++){var g=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),v=0,_=0,T=0;if(d===a&&(_=this.__charBounds[a][l].left),d>=a&&d1)&&(p/=this.lineHeight);var X=s.left+g+_,W=T-_,N=p,V=0;this.inCompositionMode?(h.fillStyle=this.compositionColor||"black",N=1,V=p):h.fillStyle=this.selectionColor,this.direction==="rtl"&&(X=this.width-X-W),h.fillRect(X,s.top+s.topOffset+V,W,N),s.topOffset+=v}},getCurrentCharFontSize:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fontSize")},getCurrentCharColor:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fill")},_getCurrentCharIndex:function(){var s=this.get2DCursorLocation(this.selectionStart,!0),h=s.charIndex>0?s.charIndex-1:0;return{l:s.lineIndex,c:h}}}),f.IText.fromObject=function(s,h){var o=f.util.stylesFromArray(s.styles,s.text),e=Object.assign({},s,{styles:o});if(c(e),e.styles)for(var r in e.styles)for(var t in e.styles[r])c(e.styles[r][t]);f.Object._fromObject("IText",e,h,"text")}}(),function(){var c=f.util.object.clone;f.util.object.extend(f.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var s=this;this.on("added",function(){var h=s.canvas;h&&(h._hasITextHandlers||(h._hasITextHandlers=!0,s._initCanvasHandlers(h)),h._iTextInstances=h._iTextInstances||[],h._iTextInstances.push(s))})},initRemovedHandler:function(){var s=this;this.on("removed",function(){var h=s.canvas;h&&(h._iTextInstances=h._iTextInstances||[],f.util.removeFromArray(h._iTextInstances,s),h._iTextInstances.length===0&&(h._hasITextHandlers=!1,s._removeCanvasHandlers(h)))})},_initCanvasHandlers:function(s){s._mouseUpITextHandler=function(){s._iTextInstances&&s._iTextInstances.forEach(function(h){h.__isMousedown=!1})},s.on("mouse:up",s._mouseUpITextHandler)},_removeCanvasHandlers:function(s){s.off("mouse:up",s._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(s,h,o,e){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},s.animate("_currentCursorOpacity",h,{duration:o,onComplete:function(){r.isAborted||s[e]()},onChange:function(){s.canvas&&s.selectionStart===s.selectionEnd&&s.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var s=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){s._currentTickCompleteState=s._animateCursor(s,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(s){var h=this,o=s?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){h._tick()},o)},abortCursorAnimation:function(){var s=this._currentTickState||this._currentTickCompleteState,h=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,s&&h&&h.clearContext(h.contextTop||h.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(s){var h=0,o=s-1;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o--;for(;/\S/.test(this._text[o])&&o>-1;)h++,o--;return s-h},findWordBoundaryRight:function(s){var h=0,o=s;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o++;for(;/\S/.test(this._text[o])&&o-1;)h++,o--;return s-h},findLineBoundaryRight:function(s){for(var h=0,o=s;!/\n/.test(this._text[o])&&o0&&ethis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=h):(this.selectionStart=h,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==o||this.selectionEnd!==e)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(s,h,o){var e=o.slice(0,s),r=f.util.string.graphemeSplit(e).length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=f.util.string.graphemeSplit(t).length;return{selectionStart:r,selectionEnd:r+n}},fromGraphemeToStringSelection:function(s,h,o){var e=o.slice(0,s),r=e.join("").length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=t.join("").length;return{selectionStart:r,selectionEnd:r+n}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var s=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=s.selectionStart,this.hiddenTextarea.selectionEnd=s.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var s=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=s.selectionEnd,this.inCompositionMode||(this.selectionStart=s.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var s=this._calcTextareaPosition();this.hiddenTextarea.style.left=s.left,this.hiddenTextarea.style.top=s.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var s=this.inCompositionMode?this.compositionStart:this.selectionStart,h=this._getCursorBoundaries(s),o=this.get2DCursorLocation(s),e=o.lineIndex,r=o.charIndex,t=this.getValueOfPropertyAt(e,r,"fontSize")*this.lineHeight,n=h.leftOffset,a=this.calcTransformMatrix(),i={x:h.left+n,y:h.top+h.topOffset+t},l=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,d=u.width/l,g=u.height/l,p=d-t,v=g-t,_=u.clientWidth/d,T=u.clientHeight/g;return i=f.util.transformPoint(i,a),i=f.util.transformPoint(i,this.canvas.viewportTransform),i.x*=_,i.y*=T,i.x<0&&(i.x=0),i.x>p&&(i.x=p),i.y<0&&(i.y=0),i.y>v&&(i.y=v),i.x+=this.canvas._offset.left,i.y+=this.canvas._offset.top,{left:i.x+"px",top:i.y+"px",fontSize:t+"px",charHeight:t}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var s=this._textBeforeEdit!==this.text,h=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,h&&(h.blur&&h.blur(),h.parentNode&&h.parentNode.removeChild(h)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),s&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),s&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var s in this.styles)this._textLines[s]||delete this.styles[s]},removeStyleFromTo:function(s,h){var o=this.get2DCursorLocation(s,!0),e=this.get2DCursorLocation(h,!0),r=o.lineIndex,t=o.charIndex,n=e.lineIndex,a=e.charIndex,i,l;if(r!==n){if(this.styles[r])for(i=t;i=a&&(l[d-u]=l[g],delete l[g])}},shiftLineStyles:function(s,h){var o=c(this.styles);for(var e in this.styles){var r=parseInt(e,10);r>s&&(this.styles[r+h]=o[r],o[r-h]||delete this.styles[r])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(s,h,o,e){var r,t={},n=!1,a=this._unwrappedTextLines[s].length===h;o||(o=1),this.shiftLineStyles(s,o),this.styles[s]&&(r=this.styles[s][h===0?h:h-1]);for(var i in this.styles[s]){var l=parseInt(i,10);l>=h&&(n=!0,t[l-h]=this.styles[s][i],a&&h===0||delete this.styles[s][i])}var u=!1;for(n&&!a&&(this.styles[s+o]=t,u=!0),u&&o--;o>0;)e&&e[o-1]?this.styles[s+o]={0:c(e[o-1])}:r?this.styles[s+o]={0:c(r)}:delete this.styles[s+o],o--;this._forceClearCache=!0},insertCharStyleObject:function(s,h,o,e){this.styles||(this.styles={});var r=this.styles[s],t=r?c(r):{};o||(o=1);for(var n in t){var a=parseInt(n,10);a>=h&&(r[a+o]=t[a],t[a-o]||delete r[a])}if(this._forceClearCache=!0,e){for(;o--;)Object.keys(e[o]).length&&(this.styles[s]||(this.styles[s]={}),this.styles[s][h+o]=c(e[o]));return}if(r)for(var i=r[h?h-1:1];i&&o--;)this.styles[s][h+o]=c(i)},insertNewStyleBlock:function(s,h,o){for(var e=this.get2DCursorLocation(h,!0),r=[0],t=0,n=0;n0&&(this.insertCharStyleObject(e.lineIndex,e.charIndex,r[0],o),o=o&&o.slice(r[0]+1)),t&&this.insertNewlineStyleObject(e.lineIndex,e.charIndex+r[0],t);for(var n=1;n0?this.insertCharStyleObject(e.lineIndex+n,0,r[n],o):o&&this.styles[e.lineIndex+n]&&o[0]&&(this.styles[e.lineIndex+n][0]=o[0]),o=o&&o.slice(r[n]+1);r[n]>0&&this.insertCharStyleObject(e.lineIndex+n,0,r[n],o)},setSelectionStartEndWithShift:function(s,h,o){o<=s?(h===s?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=s),this.selectionStart=o):o>s&&os?this.selectionStart=s:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>s?this.selectionEnd=s:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),f.util.object.extend(f.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(c){if(this.canvas){this.__newClickTime=+new Date;var s=c.pointer;this.isTripleClick(s)&&(this.fire("tripleclick",c),this._stopEvent(c.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=s,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(c){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===c.x&&this.__lastPointer.y===c.y},_stopEvent:function(c){c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(c){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(c.e))},tripleClickHandler:function(c){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(c.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(c.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(c){if(this.__isMousedown=!1,!(!this.editable||this.group||c.transform&&c.transform.actionPerformed||c.e.button&&c.e.button!==1)){if(this.canvas){var s=this.canvas._activeObject;if(s&&s!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(c.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(c){var s=this.getSelectionStartFromPointer(c),h=this.selectionStart,o=this.selectionEnd;c.shiftKey?this.setSelectionStartEndWithShift(h,o,s):(this.selectionStart=s,this.selectionEnd=s),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(c){for(var s=this.getLocalPointer(c),h=0,o=0,e=0,r=0,t=0,n,a,i=0,l=this._textLines.length;i0&&(r+=this._textLines[i-1].length+this.missingNewlineOffset(i-1));n=this._getLineLeftOffset(t),o=n*this.scaleX,a=this._textLines[t],this.direction==="rtl"&&(s.x=this.width*this.scaleX-s.x+o);for(var u=0,d=a.length;ur||t<0?0:1,a=o+n;return this.flipX&&(a=e-a),a>this._text.length&&(a=this._text.length),a}}),f.util.object.extend(f.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=f.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var c=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+c.top+"; left: "+c.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+c.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):f.document.body.appendChild(this.hiddenTextarea),f.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),f.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),f.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),f.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(f.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(c){if(this.isEditing){var s=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(c.keyCode in s)this[s[c.keyCode]](c);else if(c.keyCode in this.ctrlKeysMapDown&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapDown[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),c.keyCode>=33&&c.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(c){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(c.keyCode in this.ctrlKeysMapUp&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapUp[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(c){var s=this.fromPaste;if(this.fromPaste=!1,c&&c.stopPropagation(),!!this.isEditing){var h=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,o=this._text.length,e=h.length,r,t,n=e-o,a=this.selectionStart,i=this.selectionEnd,l=a!==i,u,d,g;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=a>p.selectionStart;l?(r=this._text.slice(a,i),n+=i-a):e0&&(o=this.__charBounds[c][s-1],h+=o.left+o.width),h},getDownCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===this._textLines.length-1||c.metaKey||c.keyCode===34)return this._text.length-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e+1,t),a=this._textLines[e].slice(r);return a.length+n+1+this.missingNewlineOffset(e)},_getSelectionForOffset:function(c,s){return c.shiftKey&&this.selectionStart!==this.selectionEnd&&s?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===0||c.metaKey||c.keyCode===33)return-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e-1,t),a=this._textLines[e].slice(0,r),i=this.missingNewlineOffset(e-1);return-this._textLines[e-1].length+n-a.length+(1-i)},_getIndexOnLine:function(c,s){for(var h=this._textLines[c],o=this._getLineLeftOffset(c),e=o,r=0,t,n,a=0,i=h.length;as){n=!0;var l=e-t,u=e,d=Math.abs(l-s),g=Math.abs(u-s);r=g=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",c)},moveCursorUp:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",c)},_moveCursorUpOrDown:function(c,s){var h="get"+c+"CursorOffset",o=this[h](s,this._selectionDirection==="right");s.shiftKey?this.moveCursorWithShift(o):this.moveCursorWithoutShift(o),o!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(c){var s=this._selectionDirection==="left"?this.selectionStart+c:this.selectionEnd+c;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,s),c!==0},moveCursorWithoutShift:function(c){return c<0?(this.selectionStart+=c,this.selectionEnd=this.selectionStart):(this.selectionEnd+=c,this.selectionStart=this.selectionEnd),c!==0},moveCursorLeft:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",c)},_move:function(c,s,h){var o;if(c.altKey)o=this["findWordBoundary"+h](this[s]);else if(c.metaKey||c.keyCode===35||c.keyCode===36)o=this["findLineBoundary"+h](this[s]);else return this[s]+=h==="Left"?-1:1,!0;if(typeof o<"u"&&this[s]!==o)return this[s]=o,!0},_moveLeft:function(c,s){return this._move(c,s,"Left")},_moveRight:function(c,s){return this._move(c,s,"Right")},moveCursorLeftWithoutShift:function(c){var s=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(s=this._moveLeft(c,"selectionStart")),this.selectionEnd=this.selectionStart,s},moveCursorLeftWithShift:function(c){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(c,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(c,"selectionStart")},moveCursorRight:function(c){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",c)},_moveCursorLeftOrRight:function(c,s){var h="moveCursor"+c+"With";this._currentCursorOpacity=1,s.shiftKey?h+="Shift":h+="outShift",this[h](s)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(c){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(c,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(c,"selectionEnd")},moveCursorRightWithoutShift:function(c){var s=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(s=this._moveRight(c,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,s},removeChars:function(c,s){typeof s>"u"&&(s=c+1),this.removeStyleFromTo(c,s),this._text.splice(c,s-c),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(c,s,h,o){typeof o>"u"&&(o=h),o>h&&this.removeStyleFromTo(h,o);var e=f.util.string.graphemeSplit(c);this.insertNewStyleBlock(e,h,s),this._text=[].concat(this._text.slice(0,h),e,this._text.slice(o)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var c=f.util.toFixed,s=/ +/g;f.util.object.extend(f.Text.prototype,{_toSVG:function(){var h=this._getSVGLeftTopOffsets(),o=this._getSVGTextAndBg(h.textTop,h.textLeft);return this._wrapSVGTextAndBg(o)},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(),{reviver:h,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(h){var o=!0,e=this.getSvgTextDecoration(this);return[h.textBgRects.join(""),' ",h.textSpans.join(""),` +`]},_getSVGTextAndBg:function(h,o){var e=[],r=[],t=h,n;this._setSVGBg(r);for(var a=0,i=this._textLines.length;a",f.util.string.escapeXml(h),""].join("")},_setSVGTextLineText:function(h,o,e,r){var t=this.getHeightOfLine(o),n=this.textAlign.indexOf("justify")!==-1,a,i,l="",u,d,g=0,p=this._textLines[o],v;r+=t*(1-this._fontSizeFraction)/this.lineHeight;for(var _=0,T=p.length-1;_<=T;_++)v=_===T||this.charSpacing,l+=p[_],u=this.__charBounds[o][_],g===0?(e+=u.kernedWidth-u.width,g+=u.width):g+=u.kernedWidth,n&&!v&&this._reSpaceAndTab.test(p[_])&&(v=!0),v||(a=a||this.getCompleteStyleDeclaration(o,_),i=this.getCompleteStyleDeclaration(o,_+1),v=f.util.hasStyleChanged(a,i,!0)),v&&(d=this._getStyleDeclaration(o,_)||{},h.push(this._createTextCharSpan(l,d,e,r)),l="",a=i,e+=g,g=0)},_pushTextBgRect:function(h,o,e,r,t,n){var a=f.Object.NUM_FRACTION_DIGITS;h.push(" +`)},_setSVGTextLineBg:function(h,o,e,r){for(var t=this._textLines[o],n=this.getHeightOfLine(o)/this.lineHeight,a=0,i=0,l,u,d=this.getValueOfPropertyAt(o,0,"textBackgroundColor"),g=0,p=t.length;gthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(h){for(var o=0,e=0,r=0,t={},n=0;n0?(e=0,r++,o++):!this.splitByGrapheme&&this._reSpaceAndTab.test(h.graphemeText[r])&&n>0&&(e++,r++),t[n]={line:o,offset:e},r+=h.graphemeLines[n].length,e+=h.graphemeLines[n].length;return t},styleHas:function(h,o){if(this._styleMap&&!this.isWrapping){var e=this._styleMap[o];e&&(o=e.line)}return s.Text.prototype.styleHas.call(this,h,o)},isEmptyStyles:function(h){if(!this.styles)return!0;var o=0,e=h+1,r,t,n=!1,a=this._styleMap[h],i=this._styleMap[h+1];a&&(h=a.line,o=a.offset),i&&(e=i.line,n=e===h,r=i.offset),t=typeof h>"u"?this.styles:{line:this.styles[h]};for(var l in t)for(var u in t[l])if(u>=o&&(!n||ue&&!T?(a.push(i),i=[],t=p,T=!0):t+=A,!T&&!n&&i.push(g),i=i.concat(u),v=n?0:this._measureWord([g],o,d),d++,T=!1,p>_&&(_=p);return W&&a.push(i),_+X>this.dynamicMinWidth&&(this.dynamicMinWidth=_-A+X),a},isEndOfWrapping:function(h){return!this._styleMap[h+1]||this._styleMap[h+1].line!==this._styleMap[h].line},missingNewlineOffset:function(h){return this.splitByGrapheme?this.isEndOfWrapping(h)?1:0:1},_splitTextIntoLines:function(h){for(var o=s.Text.prototype._splitTextIntoLines.call(this,h),e=this._wrapText(o.lines,this.width),r=new Array(e.length),t=0;tht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;u0){var v=f.util.hasStyleChanged(l,p,!0);v?u.push({start:i,end:i+1,style:p}):u[u.length-1].end++}l=p||{}}}return u},stylesFromArray:function(t,n){if(!Array.isArray(t))return t;for(var a=n.split(` -`),i=-1,l=0,u={},d=0;d0?nt-=2*w:x===1&&nt<0&&(nt+=2*w);for(var rt=Math.ceil(Math.abs(nt/w*2)),ot=[],st=nt/rt,ut=8/3*Math.sin(st/4)*Math.sin(st/4)/Math.sin(st/2),dt=it+st,at=0;at=P?x-P:2*Math.PI-(P-x)}function t(m,C,S,b,P,x,y,w){var k;if(f.cachesBoundsOfCurve&&(k=c.call(arguments),f.boundsOfCurveCache[k]))return f.boundsOfCurveCache[k];var M=Math.sqrt,E=Math.min,R=Math.max,Y=Math.abs,z=[],j=[[],[]],O,I,L,D,B,H,tt,Q;I=6*m-12*S+6*P,O=-3*m+9*S-9*P+3*y,L=3*S-3*m;for(var F=0;F<2;++F){if(F>0&&(I=6*C-12*b+6*x,O=-3*C+9*b-9*x+3*w,L=3*b-3*C),Y(O)<1e-12){if(Y(I)<1e-12)continue;D=-L/I,01e-4;)y=P(S),E=S,w=i(x.x,x.y,y.x,y.y),w+b>C?(S-=k,k/=2):(x=y,S+=k,b+=w);return y.angle=M(E),y}function U(m){for(var C=0,S=m.length,b,P=0,x=0,y=0,w=0,k=[],M,E,R,Y=0;Y0&&btt)for(var F=1,$=O.length;F<$;F+=tt)C.push([L].concat(O.slice(F,F+tt))),L=Q;else C.push(O)}return C}function J(m,C){var S=[],b,P=new f.Point(m[0].x,m[0].y),x=new f.Point(m[1].x,m[1].y),y=m.length,w=1,k=0,M=y>2;for(C=C||0,M&&(w=m[2].xm[b-2].x?1:P.x===m[b-2].x?0:-1,k=P.y>m[b-2].y?1:P.y===m[b-2].y?0:-1),S.push(["L",P.x+w*C,P.y+k*C]),S}function K(m,C,S){return S&&(C=f.util.multiplyTransformMatrices(C,[1,0,0,1,-S.x,-S.y])),m.map(function(b){for(var P=b.slice(0),x={},y=1;y=i})}function o(t,n){return r(t,n,function(a,i){return a/g,">")}function o(r){var t=0,n,a=[];for(t=0,n;t57343)return r.charAt(t);if(55296<=n&&n<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";var a=r.charCodeAt(t+1);if(56320>a||a>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";var i=r.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}f.util.string={camelize:c,capitalize:s,escapeXml:h,graphemeSplit:o}}(),function(){var c=Array.prototype.slice,s=function(){},h=function(){for(var n in{toString:1})if(n==="toString")return!1;return!0}(),o=function(n,a,i){for(var l in a)l in n.prototype&&typeof n.prototype[l]=="function"&&(a[l]+"").indexOf("callSuper")>-1?n.prototype[l]=function(u){return function(){var d=this.constructor.superclass;this.constructor.superclass=i;var g=a[u].apply(this,arguments);if(this.constructor.superclass=d,u!=="initialize")return g}}(l):n.prototype[l]=a[l],h&&(a.toString!==Object.prototype.toString&&(n.prototype.toString=a.toString),a.valueOf!==Object.prototype.valueOf&&(n.prototype.valueOf=a.valueOf))};function e(){}function r(n){for(var a=null,i=this;i.constructor.superclass;){var l=i.constructor.superclass.prototype[n];if(i[n]!==l){a=l;break}i=i.constructor.superclass.prototype}return a?arguments.length>1?a.apply(this,c.call(arguments,1)):a.call(this):console.log("tried to callSuper "+n+", method not found in prototype chain",this)}function t(){var n=null,a=c.call(arguments,0);typeof a[0]=="function"&&(n=a.shift());function i(){this.initialize.apply(this,arguments)}i.superclass=n,i.subclasses=[],n&&(e.prototype=n.prototype,i.prototype=new e,n.subclasses.push(i));for(var l=0,u=a.length;l-1||o.pointerType==="touch"}}(),function(){function c(t,n){var a=t.style;if(!a)return t;if(typeof n=="string")return t.style.cssText+=";"+n,n.indexOf("opacity")>-1?r(t,n.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in n)if(i==="opacity")r(t,n[i]);else{var l=i==="float"||i==="cssFloat"?typeof a.styleFloat>"u"?"cssFloat":"styleFloat":i;a.setProperty(l,n[i])}return t}var s=f.document.createElement("div"),h=typeof s.style.opacity=="string",o=typeof s.style.filter=="string",e=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,r=function(t){return t};h?r=function(t,n){return t.style.opacity=n,t}:o&&(r=function(t,n){var a=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(a.zoom=1),e.test(a.filter)?(n=n>=.9999?"":"alpha(opacity="+n*100+")",a.filter=a.filter.replace(e,n)):a.filter+=" alpha(opacity="+n*100+")",t}),f.util.setStyle=c}(),function(){var c=Array.prototype.slice;function s(g){return typeof g=="string"?f.document.getElementById(g):g}var h,o=function(g){return c.call(g,0)};try{h=o(f.document.childNodes)instanceof Array}catch{}h||(o=function(g){for(var p=new Array(g.length),v=g.length;v--;)p[v]=g[v];return p});function e(g,p){var v=f.document.createElement(g);for(var _ in p)_==="class"?v.className=p[_]:_==="for"?v.htmlFor=p[_]:v.setAttribute(_,p[_]);return v}function r(g,p){g&&(" "+g.className+" ").indexOf(" "+p+" ")===-1&&(g.className+=(g.className?" ":"")+p)}function t(g,p,v){return typeof p=="string"&&(p=e(p,v)),g.parentNode&&g.parentNode.replaceChild(p,g),p.appendChild(g),p}function n(g){for(var p=0,v=0,_=f.document.documentElement,T=f.document.body||{scrollLeft:0,scrollTop:0};g&&(g.parentNode||g.host)&&(g=g.parentNode||g.host,g===f.document?(p=T.scrollLeft||_.scrollLeft||0,v=T.scrollTop||_.scrollTop||0):(p+=g.scrollLeft||0,v+=g.scrollTop||0),!(g.nodeType===1&&g.style.position==="fixed")););return{left:p,top:v}}function a(g){var p,v=g&&g.ownerDocument,_={left:0,top:0},T={left:0,top:0},A,X={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!v)return T;for(var W in X)T[X[W]]+=parseInt(i(g,W),10)||0;return p=v.documentElement,typeof g.getBoundingClientRect<"u"&&(_=g.getBoundingClientRect()),A=n(g),{left:_.left+A.left-(p.clientLeft||0)+T.left,top:_.top+A.top-(p.clientTop||0)+T.top}}var i;f.document.defaultView&&f.document.defaultView.getComputedStyle?i=function(g,p){var v=f.document.defaultView.getComputedStyle(g,null);return v?v[p]:void 0}:i=function(g,p){var v=g.style[p];return!v&&g.currentStyle&&(v=g.currentStyle[p]),v},function(){var g=f.document.documentElement.style,p="userSelect"in g?"userSelect":"MozUserSelect"in g?"MozUserSelect":"WebkitUserSelect"in g?"WebkitUserSelect":"KhtmlUserSelect"in g?"KhtmlUserSelect":"";function v(T){return typeof T.onselectstart<"u"&&(T.onselectstart=f.util.falseFunction),p?T.style[p]="none":typeof T.unselectable=="string"&&(T.unselectable="on"),T}function _(T){return typeof T.onselectstart<"u"&&(T.onselectstart=null),p?T.style[p]="":typeof T.unselectable=="string"&&(T.unselectable=""),T}f.util.makeElementUnselectable=v,f.util.makeElementSelectable=_}();function l(g){var p=f.jsdomImplForWrapper(g);return p._canvas||p._image}function u(g){if(f.isLikelyNode){var p=f.jsdomImplForWrapper(g);p&&(p._image=null,p._canvas=null,p._currentSrc=null,p._attributes=null,p._classList=null)}}function d(g,p){g.imageSmoothingEnabled=g.imageSmoothingEnabled||g.webkitImageSmoothingEnabled||g.mozImageSmoothingEnabled||g.msImageSmoothingEnabled||g.oImageSmoothingEnabled,g.imageSmoothingEnabled=p}f.util.setImageSmoothing=d,f.util.getById=s,f.util.toArray=o,f.util.addClass=r,f.util.makeElement=e,f.util.wrapElement=t,f.util.getScrollLeftTop=n,f.util.getElementOffset=a,f.util.getNodeCanvas=l,f.util.cleanUpJsdomNode=u}(),function(){function c(o,e){return o+(/\?/.test(o)?"&":"?")+e}function s(){}function h(o,e){e||(e={});var r=e.method?e.method.toUpperCase():"GET",t=e.onComplete||function(){},n=new f.window.XMLHttpRequest,a=e.body||e.parameters;return n.onreadystatechange=function(){n.readyState===4&&(t(n),n.onreadystatechange=s)},r==="GET"&&(a=null,typeof e.parameters=="string"&&(o=c(o,e.parameters))),n.open(r,o,!0),(r==="POST"||r==="PUT")&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(a),n}f.util.request=h}(),f.log=console.log,f.warn=console.warn,function(){var c=f.util.object.extend,s=f.util.object.clone,h=[];f.util.object.extend(h,{cancelAll:function(){var l=this.splice(0);return l.forEach(function(u){u.cancel()}),l},cancelByCanvas:function(l){if(!l)return[];var u=this.filter(function(d){return typeof d.target=="object"&&d.target.canvas===l});return u.forEach(function(d){d.cancel()}),u},cancelByTarget:function(l){var u=this.findAnimationsByTarget(l);return u.forEach(function(d){d.cancel()}),u},findAnimationIndex:function(l){return this.indexOf(this.findAnimation(l))},findAnimation:function(l){return this.find(function(u){return u.cancel===l})},findAnimationsByTarget:function(l){return l?this.filter(function(u){return u.target===l}):[]}});function o(){return!1}function e(l,u,d,g){return-d*Math.cos(l/g*(Math.PI/2))+d+u}function r(l){l||(l={});var u=!1,d,g=function(){var p=f.runningAnimations.indexOf(d);return p>-1&&f.runningAnimations.splice(p,1)[0]};return d=c(s(l),{cancel:function(){return u=!0,g()},currentValue:"startValue"in l?l.startValue:0,completionRate:0,durationRate:0}),f.runningAnimations.push(d),a(function(p){var v=p||+new Date,_=l.duration||500,T=v+_,A,X=l.onChange||o,W=l.abort||o,N=l.onComplete||o,V=l.easing||e,U="startValue"in l?l.startValue.length>0:!1,G="startValue"in l?l.startValue:0,q="endValue"in l?l.endValue:100,J=l.byValue||(U?G.map(function(K,m){return q[m]-G[m]}):q-G);l.onStart&&l.onStart(),function K(m){A=m||+new Date;var C=A>T?_:A-v,S=C/_,b=U?G.map(function(x,y){return V(C,G[y],J[y],_)}):V(C,G,J,_),P=Math.abs(U?(b[0]-G[0])/J[0]:(b-G)/J);if(d.currentValue=U?b.slice():b,d.completionRate=P,d.durationRate=S,!u){if(W(b,P,S)){g();return}if(A>T){d.currentValue=U?q.slice():q,d.completionRate=1,d.durationRate=1,X(U?q.slice():q,1,1),N(q,1,1),g();return}else X(b,P,S),a(K)}}(v)}),d.cancel}var t=f.window.requestAnimationFrame||f.window.webkitRequestAnimationFrame||f.window.mozRequestAnimationFrame||f.window.oRequestAnimationFrame||f.window.msRequestAnimationFrame||function(l){return f.window.setTimeout(l,1e3/60)},n=f.window.cancelAnimationFrame||f.window.clearTimeout;function a(){return t.apply(f.window,arguments)}function i(){return n.apply(f.window,arguments)}f.util.animate=r,f.util.requestAnimFrame=a,f.util.cancelAnimFrame=i,f.runningAnimations=h}(),function(){function c(h,o,e){var r="rgba("+parseInt(h[0]+e*(o[0]-h[0]),10)+","+parseInt(h[1]+e*(o[1]-h[1]),10)+","+parseInt(h[2]+e*(o[2]-h[2]),10);return r+=","+(h&&o?parseFloat(h[3]+e*(o[3]-h[3])):1),r+=")",r}function s(h,o,e,r){var t=new f.Color(h).getSource(),n=new f.Color(o).getSource(),a=r.onComplete,i=r.onChange;return r=r||{},f.util.animate(f.util.object.extend(r,{duration:e||500,startValue:t,endValue:n,byValue:n,easing:function(l,u,d,g){var p=r.colorEasing?r.colorEasing(l,g):1-Math.cos(l/g*(Math.PI/2));return c(u,d,p)},onComplete:function(l,u,d){if(a)return a(c(n,n,0),u,d)},onChange:function(l,u,d){if(i){if(Array.isArray(l))return i(c(l,l,0),u,d);i(l,u,d)}}}))}f.util.animateColor=s}(),function(){function c(m,C,S,b){return m-1&&Y>-1&&Y-1)&&(y="stroke")}else{if(x==="href"||x==="xlink:href"||x==="font")return y;if(x==="imageSmoothing")return y==="optimizeQuality";E=M?y.map(r):r(y,k)}}return!M&&isNaN(E)?y:E}function T(x){return new RegExp("^("+x.join("|")+")\\b","i")}function A(x){for(var y in d)if(!(typeof x[d[y]]>"u"||x[y]==="")){if(typeof x[y]>"u"){if(!s.Object.prototype[y])continue;x[y]=s.Object.prototype[y]}if(x[y].indexOf("url(")!==0){var w=new s.Color(x[y]);x[y]=w.setAlpha(e(w.getAlpha()*x[d[y]],2)).toRgba()}}return x}function X(x,y){var w,k=[],M,E,R;for(E=0,R=y.length;E1;)et.shift(),it=s.util.multiplyTransformMatrices(it,et[0]);return it}}();function W(x,y){var w,k;x.replace(/;\s*$/,"").split(";").forEach(function(M){var E=M.split(":");w=E[0].trim().toLowerCase(),k=E[1].trim(),y[w]=k})}function N(x,y){var w,k;for(var M in x)typeof x[M]>"u"||(w=M.toLowerCase(),k=x[M],y[w]=k)}function V(x,y){var w={};for(var k in s.cssRules[y])if(U(x,k.split(" ")))for(var M in s.cssRules[y][k])w[M]=s.cssRules[y][k][M];return w}function U(x,y){var w,k=!0;return w=q(x,y.pop()),w&&y.length&&(k=G(x,y)),w&&k&&y.length===0}function G(x,y){for(var w,k=!0;x.parentNode&&x.parentNode.nodeType===1&&y.length;)k&&(w=y.pop()),x=x.parentNode,k=q(x,w);return y.length===0}function q(x,y){var w=x.nodeName,k=x.getAttribute("class"),M=x.getAttribute("id"),E,R;if(E=new RegExp("^"+w,"i"),y=y.replace(E,""),M&&y.length&&(E=new RegExp("#"+M+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"")),k&&y.length)for(k=k.split(" "),R=k.length;R--;)E=new RegExp("\\."+k[R]+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"");return y.length===0}function J(x,y){var w;if(x.getElementById&&(w=x.getElementById(y)),w)return w;var k,M,E,R=x.getElementsByTagName("*");for(M=0,E=R.length;Mk?k:w),B.meetOrSlice==="slice"&&(k=w=w>k?w:k),et=F.width-R*w,it=F.height-Y*w,B.alignX==="Mid"&&(et/=2),B.alignY==="Mid"&&(it/=2),B.alignX==="Min"&&(et=0),B.alignY==="Min"&&(it=0)),w===1&&k===1&&M===0&&E===0&&L===0&&D===0)return F;if((L||D)&&x.parentNode.nodeName!=="#document"&&($=" translate("+r(L)+" "+r(D)+") "),z=$+" matrix("+w+" 0 0 "+k+" "+(M*w+et)+" "+(E*k+it)+") ",x.nodeName==="svg"){for(j=x.ownerDocument.createElementNS(s.svgNS,"g");x.firstChild;)j.appendChild(x.firstChild);x.appendChild(j)}else j=x,j.removeAttribute("x"),j.removeAttribute("y"),z=j.getAttribute("transform")+z;return j.setAttribute("transform",z),F}function S(x,y){for(;x&&(x=x.parentNode);)if(x.nodeName&&y.test(x.nodeName.replace("svg:",""))&&!x.getAttribute("instantiated_by_use"))return!0;return!1}s.parseSVGDocument=function(x,y,w,k){if(x){K(x);var M=s.Object.__uid++,E,R,Y=C(x),z=s.util.toArray(x.getElementsByTagName("*"));if(Y.crossOrigin=k&&k.crossOrigin,Y.svgUid=M,z.length===0&&s.isLikelyNode){z=x.selectNodes('//*[name(.)!="svg"]');var j=[];for(E=0,R=z.length;E"u"&&(w=x.getAttribute("svgUid")),x.parentNode&&s.svgValidParentsRegEx.test(x.parentNode.nodeName)&&(M=s.parseAttributes(x.parentNode,y,w));var Y=y.reduce(function(B,H){return k=x.getAttribute(H),k&&(B[H]=k),B},{}),z=h(V(x,w),s.parseStyleAttribute(x));Y=h(Y,z),z[p]&&x.setAttribute(p,z[p]),E=R=M.fontSize||s.Text.DEFAULT_SVG_FONT_SIZE,Y[g]&&(Y[g]=E=r(Y[g],R));var j,O,I={};for(var L in Y)j=v(L),O=_(j,Y[L],M,E),I[j]=O;I&&I.font&&s.parseFontDeclaration(I.font,I);var D=h(M,I);return s.svgValidParentsRegEx.test(x.nodeName)?D:A(D)}},parseElements:function(x,y,w,k,M){new s.ElementsParser(x,y,w,k,M).parse()},parseStyleAttribute:function(x){var y={},w=x.getAttribute("style");return w&&(typeof w=="string"?W(w,y):N(w,y)),y},parsePointsAttribute:function(x){if(!x)return null;x=x.replace(/,/g," ").trim(),x=x.split(/\s+/);var y=[],w,k;for(w=0,k=x.length;wo.x&&this.y>o.y},gte:function(o){return this.x>=o.x&&this.y>=o.y},lerp:function(o,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new h(this.x+(o.x-this.x)*e,this.y+(o.y-this.y)*e)},distanceFrom:function(o){var e=this.x-o.x,r=this.y-o.y;return Math.sqrt(e*e+r*r)},midPointFrom:function(o){return this.lerp(o)},min:function(o){return new h(Math.min(this.x,o.x),Math.min(this.y,o.y))},max:function(o){return new h(Math.max(this.x,o.x),Math.max(this.y,o.y))},toString:function(){return this.x+","+this.y},setXY:function(o,e){return this.x=o,this.y=e,this},setX:function(o){return this.x=o,this},setY:function(o){return this.y=o,this},setFromPoint:function(o){return this.x=o.x,this.y=o.y,this},swap:function(o){var e=this.x,r=this.y;this.x=o.x,this.y=o.y,o.x=e,o.y=r},clone:function(){return new h(this.x,this.y)}}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Intersection){s.warn("fabric.Intersection is already defined");return}function h(o){this.status=o,this.points=[]}s.Intersection=h,s.Intersection.prototype={constructor:h,appendPoint:function(o){return this.points.push(o),this},appendPoints:function(o){return this.points=this.points.concat(o),this}},s.Intersection.intersectLineLine=function(o,e,r,t){var n,a=(t.x-r.x)*(o.y-r.y)-(t.y-r.y)*(o.x-r.x),i=(e.x-o.x)*(o.y-r.y)-(e.y-o.y)*(o.x-r.x),l=(t.y-r.y)*(e.x-o.x)-(t.x-r.x)*(e.y-o.y);if(l!==0){var u=a/l,d=i/l;0<=u&&u<=1&&0<=d&&d<=1?(n=new h("Intersection"),n.appendPoint(new s.Point(o.x+u*(e.x-o.x),o.y+u*(e.y-o.y)))):n=new h}else a===0||i===0?n=new h("Coincident"):n=new h("Parallel");return n},s.Intersection.intersectLinePolygon=function(o,e,r){var t=new h,n=r.length,a,i,l,u;for(u=0;u0&&(t.status="Intersection"),t},s.Intersection.intersectPolygonPolygon=function(o,e){var r=new h,t=o.length,n;for(n=0;n0&&(r.status="Intersection"),r},s.Intersection.intersectPolygonRectangle=function(o,e,r){var t=e.min(r),n=e.max(r),a=new s.Point(n.x,t.y),i=new s.Point(t.x,n.y),l=h.intersectLinePolygon(t,a,o),u=h.intersectLinePolygon(a,n,o),d=h.intersectLinePolygon(n,i,o),g=h.intersectLinePolygon(i,t,o),p=new h;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(g.points),p.points.length>0&&(p.status="Intersection"),p}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Color){s.warn("fabric.Color is already defined.");return}function h(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}s.Color=h,s.Color.prototype={_tryParsingColor:function(e){var r;e in h.colorNameMap&&(e=h.colorNameMap[e]),e==="transparent"&&(r=[255,255,255,0]),r||(r=h.sourceFromHex(e)),r||(r=h.sourceFromRgb(e)),r||(r=h.sourceFromHsl(e)),r||(r=[0,0,0,1]),r&&this.setSource(r)},_rgbToHsl:function(e,r,t){e/=255,r/=255,t/=255;var n,a,i,l=s.util.array.max([e,r,t]),u=s.util.array.min([e,r,t]);if(i=(l+u)/2,l===u)n=a=0;else{var d=l-u;switch(a=i>.5?d/(2-l-u):d/(l+u),l){case e:n=(r-t)/d+(r1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}s.Color.fromRgb=function(e){return h.fromSource(h.sourceFromRgb(e))},s.Color.sourceFromRgb=function(e){var r=e.match(h.reRGBa);if(r){var t=parseInt(r[1],10)/(/%$/.test(r[1])?100:1)*(/%$/.test(r[1])?255:1),n=parseInt(r[2],10)/(/%$/.test(r[2])?100:1)*(/%$/.test(r[2])?255:1),a=parseInt(r[3],10)/(/%$/.test(r[3])?100:1)*(/%$/.test(r[3])?255:1);return[parseInt(t,10),parseInt(n,10),parseInt(a,10),r[4]?parseFloat(r[4]):1]}},s.Color.fromRgba=h.fromRgb,s.Color.fromHsl=function(e){return h.fromSource(h.sourceFromHsl(e))},s.Color.sourceFromHsl=function(e){var r=e.match(h.reHSLa);if(r){var t=(parseFloat(r[1])%360+360)%360/360,n=parseFloat(r[2])/(/%$/.test(r[2])?100:1),a=parseFloat(r[3])/(/%$/.test(r[3])?100:1),i,l,u;if(n===0)i=l=u=a;else{var d=a<=.5?a*(n+1):a+n-a*n,g=a*2-d;i=o(g,d,t+1/3),l=o(g,d,t),u=o(g,d,t-1/3)}return[Math.round(i*255),Math.round(l*255),Math.round(u*255),r[4]?parseFloat(r[4]):1]}},s.Color.fromHsla=h.fromHsl,s.Color.fromHex=function(e){return h.fromSource(h.sourceFromHex(e))},s.Color.sourceFromHex=function(e){if(e.match(h.reHex)){var r=e.slice(e.indexOf("#")+1),t=r.length===3||r.length===4,n=r.length===8||r.length===4,a=t?r.charAt(0)+r.charAt(0):r.substring(0,2),i=t?r.charAt(1)+r.charAt(1):r.substring(2,4),l=t?r.charAt(2)+r.charAt(2):r.substring(4,6),u=n?t?r.charAt(3)+r.charAt(3):r.substring(6,8):"FF";return[parseInt(a,16),parseInt(i,16),parseInt(l,16),parseFloat((parseInt(u,16)/255).toFixed(2))]}},s.Color.fromSource=function(e){var r=new h;return r.setSource(e),r}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=["e","se","s","sw","w","nw","n","ne","e"],o=["ns","nesw","ew","nwse"],e={},r="left",t="top",n="right",a="bottom",i="center",l={top:a,bottom:t,left:n,right:r,center:i},u=s.util.radiansToDegrees,d=Math.sign||function(j){return(j>0)-(j<0)||+j};function g(j,O){var I=j.angle+u(Math.atan2(O.y,O.x))+360;return Math.round(I%360/45)}function p(j,O){var I=O.transform.target,L=I.canvas,D=s.util.object.clone(O);D.target=I,L&&L.fire("object:"+j,D),I.fire(j,O)}function v(j,O){var I=O.canvas,L=I.uniScaleKey,D=j[L];return I.uniformScaling&&!D||!I.uniformScaling&&D}function _(j){return j.originX===i&&j.originY===i}function T(j,O,I){var L=j.lockScalingX,D=j.lockScalingY;return!!(L&&D||!O&&(L||D)&&I||L&&O==="x"||D&&O==="y")}function A(j,O,I){var L="not-allowed",D=v(j,I),B="";if(O.x!==0&&O.y===0?B="x":O.x===0&&O.y!==0&&(B="y"),T(I,B,D))return L;var H=g(I,O);return h[H]+"-resize"}function X(j,O,I){var L="not-allowed";if(O.x!==0&&I.lockSkewingY||O.y!==0&&I.lockSkewingX)return L;var D=g(I,O)%4;return o[D]+"-resize"}function W(j,O,I){return j[I.canvas.altActionKey]?e.skewCursorStyleHandler(j,O,I):e.scaleCursorStyleHandler(j,O,I)}function N(j,O,I){var L=j[I.canvas.altActionKey];if(O.x===0)return L?"skewX":"scaleY";if(O.y===0)return L?"skewY":"scaleX"}function V(j,O,I){return I.lockRotation?"not-allowed":O.cursorStyle}function U(j,O,I,L){return{e:j,transform:O,pointer:{x:I,y:L}}}function G(j){return function(O,I,L,D){var B=I.target,H=B.getCenterPoint(),tt=B.translateToOriginPoint(H,I.originX,I.originY),Q=j(O,I,L,D);return B.setPositionByOrigin(tt,I.originX,I.originY),Q}}function q(j,O){return function(I,L,D,B){var H=O(I,L,D,B);return H&&p(j,U(I,L,D,B)),H}}function J(j,O,I,L,D){var B=j.target,H=B.controls[j.corner],tt=B.canvas.getZoom(),Q=B.padding/tt,F=B.toLocalPoint(new s.Point(L,D),O,I);return F.x>=Q&&(F.x-=Q),F.x<=-Q&&(F.x+=Q),F.y>=Q&&(F.y-=Q),F.y<=Q&&(F.y+=Q),F.x-=H.offsetX,F.y-=H.offsetY,F}function K(j){return j.flipX!==j.flipY}function m(j,O,I,L,D){if(j[O]!==0){var B=j._getTransformedDimensions()[L],H=D/B*j[I];j.set(I,H)}}function C(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(0,D.skewY),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.x*2)-B.x,Q=D.skewX,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleX,B.y/D.scaleY)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().y;D.set("skewX",F),m(D,"skewY","scaleY","y",et)}return $}function S(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(D.skewX,0),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.y*2)-B.y,Q=D.skewY,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleY,B.x/D.scaleX)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().x;D.set("skewY",F),m(D,"skewX","scaleX","x",et)}return $}function b(j,O,I,L){var D=O.target,B=D.skewX,H,tt=O.originY;if(D.lockSkewingX)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.x>0?H=r:H=n}else B>0&&(H=tt===t?r:n),B<0&&(H=tt===t?n:r),K(D)&&(H=H===r?n:r);O.originX=H;var F=q("skewing",G(C));return F(j,O,I,L)}function P(j,O,I,L){var D=O.target,B=D.skewY,H,tt=O.originX;if(D.lockSkewingY)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.y>0?H=t:H=a}else B>0&&(H=tt===r?t:a),B<0&&(H=tt===r?a:t),K(D)&&(H=H===t?a:t);O.originY=H;var F=q("skewing",G(S));return F(j,O,I,L)}function x(j,O,I,L){var D=O,B=D.target,H=B.translateToOriginPoint(B.getCenterPoint(),D.originX,D.originY);if(B.lockRotation)return!1;var tt=Math.atan2(D.ey-H.y,D.ex-H.x),Q=Math.atan2(L-H.y,I-H.x),F=u(Q-tt+D.theta),$=!0;if(B.snapAngle>0){var et=B.snapAngle,it=B.snapThreshold||et,nt=Math.ceil(F/et)*et,rt=Math.floor(F/et)*et;Math.abs(F-rt)d?(A=u,t.scale(1,d/u),T=a*u/d):d>u?(A=d,t.scale(u/d,1),_=n*d/u):A=u,t.lineWidth=1,t.beginPath(),t.arc(_,T,A/2,0,2*Math.PI,!1),t[p](),v&&t.stroke(),t.restore()}function r(t,n,a,i,l){i=i||{};var u=this.sizeX||i.cornerSize||l.cornerSize,d=this.sizeY||i.cornerSize||l.cornerSize,g=typeof i.transparentCorners<"u"?i.transparentCorners:l.transparentCorners,p=g?"stroke":"fill",v=!g&&(i.cornerStrokeColor||l.cornerStrokeColor),_=u/2,T=d/2;t.save(),t.fillStyle=i.cornerColor||l.cornerColor,t.strokeStyle=i.cornerStrokeColor||l.cornerStrokeColor,t.lineWidth=1,t.translate(n,a),t.rotate(h(l.angle)),t[p+"Rect"](-_,-T,u,d),v&&t.strokeRect(-_,-T,u,d),t.restore()}o.renderCircleControl=e,o.renderSquareControl=r}(Z),function(c){var s=c.fabric||(c.fabric={});function h(o){for(var e in o)this[e]=o[e]}s.Control=h,s.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(o,e){return e.cursorStyle},getActionName:function(o,e){return e.actionName},getVisibility:function(o,e){var r=o._controlsVisibility;return r&&typeof r[e]<"u"?r[e]:this.visible},setVisibility:function(o){this.visible=o},positionHandler:function(o,e){var r=s.util.transformPoint({x:this.x*o.x+this.offsetX,y:this.y*o.y+this.offsetY},e);return r},calcCornerCoords:function(o,e,r,t,n){var a,i,l,u,d=n?this.touchSizeX:this.sizeX,g=n?this.touchSizeY:this.sizeY;if(d&&g&&d!==g){var p=Math.atan2(g,d),v=Math.sqrt(d*d+g*g)/2,_=p-s.util.degreesToRadians(o),T=Math.PI/2-p-s.util.degreesToRadians(o);a=v*s.util.cos(_),i=v*s.util.sin(_),l=v*s.util.cos(T),u=v*s.util.sin(T)}else{var A=d&&g?d:e;v=A*.7071067812;var _=s.util.degreesToRadians(45-o);a=l=v*s.util.cos(_),i=u=v*s.util.sin(_)}return{tl:{x:r-u,y:t-l},tr:{x:r+a,y:t-i},bl:{x:r-a,y:t+i},br:{x:r+u,y:t+l}}},render:function(o,e,r,t,n){switch(t=t||{},t.cornerStyle||n.cornerStyle){case"circle":s.controlsUtils.renderCircleControl.call(this,o,e,r,t,n);break;default:s.controlsUtils.renderSquareControl.call(this,o,e,r,t,n)}}}}(Z),function(){function c(r,t){var n=r.getAttribute("style"),a=r.getAttribute("offset")||0,i,l,u,d;if(a=parseFloat(a)/(/%$/.test(a)?100:1),a=a<0?0:a>1?1:a,n){var g=n.split(/\s*;\s*/);for(g[g.length-1]===""&&g.pop(),d=g.length;d--;){var p=g[d].split(/\s*:\s*/),v=p[0].trim(),_=p[1].trim();v==="stop-color"?i=_:v==="stop-opacity"&&(u=_)}}return i||(i=r.getAttribute("stop-color")||"rgb(0,0,0)"),u||(u=r.getAttribute("stop-opacity")),i=new f.Color(i),l=i.getAlpha(),u=isNaN(parseFloat(u))?1:parseFloat(u),u*=l*t,{offset:a,color:i.toRgb(),opacity:u}}function s(r){return{x1:r.getAttribute("x1")||0,y1:r.getAttribute("y1")||0,x2:r.getAttribute("x2")||"100%",y2:r.getAttribute("y2")||0}}function h(r){return{x1:r.getAttribute("fx")||r.getAttribute("cx")||"50%",y1:r.getAttribute("fy")||r.getAttribute("cy")||"50%",r1:0,x2:r.getAttribute("cx")||"50%",y2:r.getAttribute("cy")||"50%",r2:r.getAttribute("r")||"50%"}}var o=f.util.object.clone;f.Gradient=f.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(r){r||(r={}),r.coords||(r.coords={});var t,n=this;Object.keys(r).forEach(function(a){n[a]=r[a]}),this.id?this.id+="_"+f.Object.__uid++:this.id=f.Object.__uid++,t={x1:r.coords.x1||0,y1:r.coords.y1||0,x2:r.coords.x2||0,y2:r.coords.y2||0},this.type==="radial"&&(t.r1=r.coords.r1||0,t.r2=r.coords.r2||0),this.coords=t,this.colorStops=r.colorStops.slice()},addColorStop:function(r){for(var t in r){var n=new f.Color(r[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(r){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return f.util.populateWithProperties(this,t,r),t},toSVG:function(r,l){var n=o(this.coords,!0),a,i,l=l||{},u,d,g=o(this.colorStops,!0),p=n.r1>n.r2,v=this.gradientTransform?this.gradientTransform.concat():f.iMatrix.concat(),_=-this.offsetX,T=-this.offsetY,A=!!l.additionalTransform,X=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(g.sort(function(G,q){return G.offset-q.offset}),X==="objectBoundingBox"?(_/=r.width,T/=r.height):(_+=r.width/2,T+=r.height/2),r.type==="path"&&this.gradientUnits!=="percentage"&&(_-=r.pathOffset.x,T-=r.pathOffset.y),v[4]-=_,v[5]-=T,d='id="SVGID_'+this.id+'" gradientUnits="'+X+'"',d+=' gradientTransform="'+(A?l.additionalTransform+" ":"")+f.util.matrixToSVG(v)+'" ',this.type==="linear"?u=[" -`]:this.type==="radial"&&(u=[" -`]),this.type==="radial"){if(p)for(g=g.concat(),g.reverse(),a=0,i=g.length;a0){var N=Math.max(n.r1,n.r2),V=W/N;for(a=0,i=g.length;a -`)}return u.push(this.type==="linear"?` -`:` -`),u.join("")},toLive:function(r){var t,n=f.util.object.clone(this.coords),a,i;if(this.type){for(this.type==="linear"?t=r.createLinearGradient(n.x1,n.y1,n.x2,n.y2):this.type==="radial"&&(t=r.createRadialGradient(n.x1,n.y1,n.r1,n.x2,n.y2,n.r2)),a=0,i=this.colorStops.length;a1?1:i,isNaN(i)&&(i=1);var l=r.getElementsByTagName("stop"),u,d=r.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",g=r.getAttribute("gradientTransform")||"",p=[],v,_,T=0,A=0,X;for(r.nodeName==="linearGradient"||r.nodeName==="LINEARGRADIENT"?(u="linear",v=s(r)):(u="radial",v=h(r)),_=l.length;_--;)p.push(c(l[_],i));X=f.parseTransformAttribute(g),e(t,v,a,d),d==="pixels"&&(T=-t.left,A=-t.top);var W=new f.Gradient({id:r.getAttribute("id"),type:u,coords:v,colorStops:p,gradientUnits:d,gradientTransform:X,offsetX:T,offsetY:A});return W}});function e(r,t,n,a){var i,l;Object.keys(t).forEach(function(u){i=t[u],i==="Infinity"?l=1:i==="-Infinity"?l=0:(l=parseFloat(t[u],10),typeof i=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(l*=.01,a==="pixels"&&((u==="x1"||u==="x2"||u==="r2")&&(l*=n.viewBoxWidth||n.width),(u==="y1"||u==="y2")&&(l*=n.viewBoxHeight||n.height)))),t[u]=l})}}(),function(){var c=f.util.toFixed;f.Pattern=f.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(s,h){if(s||(s={}),this.id=f.Object.__uid++,this.setOptions(s),!s.source||s.source&&typeof s.source!="string"){h&&h(this);return}else{var o=this;this.source=f.util.createImage(),f.util.loadImage(s.source,function(e,r){o.source=e,h&&h(o,r)},null,this.crossOrigin)}},toObject:function(s){var h=f.Object.NUM_FRACTION_DIGITS,o,e;return typeof this.source.src=="string"?o=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(o=this.source.toDataURL()),e={type:"pattern",source:o,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:c(this.offsetX,h),offsetY:c(this.offsetY,h),patternTransform:this.patternTransform?this.patternTransform.concat():null},f.util.populateWithProperties(this,e,s),e},toSVG:function(s){var h=typeof this.source=="function"?this.source():this.source,o=h.width/s.width,e=h.height/s.height,r=this.offsetX/s.width,t=this.offsetY/s.height,n="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(e=1,t&&(e+=Math.abs(t))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(o=1,r&&(o+=Math.abs(r))),h.src?n=h.src:h.toDataURL&&(n=h.toDataURL()),' - - -`},setOptions:function(s){for(var h in s)this[h]=s[h]},toLive:function(s){var h=this.source;return!h||typeof h.src<"u"&&(!h.complete||h.naturalWidth===0||h.naturalHeight===0)?"":s.createPattern(h,this.repeat)}})}(),function(c){var s=c.fabric||(c.fabric={}),h=s.util.toFixed;if(s.Shadow){s.warn("fabric.Shadow is already defined.");return}s.Shadow=s.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(o){typeof o=="string"&&(o=this._parseShadow(o));for(var e in o)this[e]=o[e];this.id=s.Object.__uid++},_parseShadow:function(o){var e=o.trim(),r=s.Shadow.reOffsetsAndBlur.exec(e)||[],t=e.replace(s.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:t.trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(o){var e=40,r=40,t=s.Object.NUM_FRACTION_DIGITS,n=s.util.rotateVector({x:this.offsetX,y:this.offsetY},s.util.degreesToRadians(-o.angle)),a=20,i=new s.Color(this.color);return o.width&&o.height&&(e=h((Math.abs(n.x)+this.blur)/o.width,t)*100+a,r=h((Math.abs(n.y)+this.blur)/o.height,t)*100+a),o.flipX&&(n.x*=-1),o.flipY&&(n.y*=-1),' - - - - - - - - - -`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var o={},e=s.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(r){this[r]!==e[r]&&(o[r]=this[r])},this),o}}),s.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(Z),function(){if(f.StaticCanvas){f.warn("fabric.StaticCanvas is already defined.");return}var c=f.util.object.extend,s=f.util.getElementOffset,h=f.util.removeFromArray,o=f.util.toFixed,e=f.util.transformPoint,r=f.util.invertTransform,t=f.util.getNodeCanvas,n=f.util.createCanvasElement,a=new Error("Could not initialize `canvas` element");f.StaticCanvas=f.util.createClass(f.CommonMethods,{initialize:function(i,l){l||(l={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(i,l)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:f.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(i,l){var u=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(i),this._initOptions(l),this.interactive||this._initRetinaScaling(),l.overlayImage&&this.setOverlayImage(l.overlayImage,u),l.backgroundImage&&this.setBackgroundImage(l.backgroundImage,u),l.backgroundColor&&this.setBackgroundColor(l.backgroundColor,u),l.overlayColor&&this.setOverlayColor(l.overlayColor,u),this.calcOffset()},_isRetinaScaling:function(){return f.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,f.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var i=f.devicePixelRatio;this.__initRetinaScaling(i,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(i,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(i,l,u){l.setAttribute("width",this.width*i),l.setAttribute("height",this.height*i),u.scale(i,i)},calcOffset:function(){return this._offset=s(this.lowerCanvasEl),this},setOverlayImage:function(i,l,u){return this.__setBgOverlayImage("overlayImage",i,l,u)},setBackgroundImage:function(i,l,u){return this.__setBgOverlayImage("backgroundImage",i,l,u)},setOverlayColor:function(i,l){return this.__setBgOverlayColor("overlayColor",i,l)},setBackgroundColor:function(i,l){return this.__setBgOverlayColor("backgroundColor",i,l)},__setBgOverlayImage:function(i,l,u,d){return typeof l=="string"?f.util.loadImage(l,function(g,p){if(g){var v=new f.Image(g,d);this[i]=v,v.canvas=this}u&&u(g,p)},this,d&&d.crossOrigin):(d&&l.setOptions(d),this[i]=l,l&&(l.canvas=this),u&&u(l,!1)),this},__setBgOverlayColor:function(i,l,u){return this[i]=l,this._initGradient(l,i),this._initPattern(l,i,u),this},_createCanvasElement:function(){var i=n();if(!i||(i.style||(i.style={}),typeof i.getContext>"u"))throw a;return i},_initOptions:function(i){var l=this.lowerCanvasEl;this._setOptions(i),this.width=this.width||parseInt(l.width,10)||0,this.height=this.height||parseInt(l.height,10)||0,this.lowerCanvasEl.style&&(l.width=this.width,l.height=this.height,l.style.width=this.width+"px",l.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(i){i&&i.getContext?this.lowerCanvasEl=i:this.lowerCanvasEl=f.util.getById(i)||this._createCanvasElement(),f.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(i,l){return this.setDimensions({width:i},l)},setHeight:function(i,l){return this.setDimensions({height:i},l)},setDimensions:function(i,l){var u;l=l||{};for(var d in i)u=i[d],l.cssOnly||(this._setBackstoreDimension(d,i[d]),u+="px",this.hasLostContext=!0),l.backstoreOnly||this._setCssDimension(d,u);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),l.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(i,l){return this.lowerCanvasEl[i]=l,this.upperCanvasEl&&(this.upperCanvasEl[i]=l),this.cacheCanvasEl&&(this.cacheCanvasEl[i]=l),this[i]=l,this},_setCssDimension:function(i,l){return this.lowerCanvasEl.style[i]=l,this.upperCanvasEl&&(this.upperCanvasEl.style[i]=l),this.wrapperEl&&(this.wrapperEl.style[i]=l),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(i){var l=this._activeObject,u=this.backgroundImage,d=this.overlayImage,g,p,v;for(this.viewportTransform=i,p=0,v=this._objects.length;p -`),this._setSVGBgOverlayColor(u,"background"),this._setSVGBgOverlayImage(u,"backgroundImage",l),this._setSVGObjects(u,l),this.clipPath&&u.push(` -`),this._setSVGBgOverlayColor(u,"overlay"),this._setSVGBgOverlayImage(u,"overlayImage",l),u.push(""),u.join("")},_setSVGPreamble:function(i,l){l.suppressPreamble||i.push(' -`,' -`)},_setSVGHeader:function(i,l){var u=l.width||this.width,d=l.height||this.height,g,p='viewBox="0 0 '+this.width+" "+this.height+'" ',v=f.Object.NUM_FRACTION_DIGITS;l.viewBox?p='viewBox="'+l.viewBox.x+" "+l.viewBox.y+" "+l.viewBox.width+" "+l.viewBox.height+'" ':this.svgViewportTransformation&&(g=this.viewportTransform,p='viewBox="'+o(-g[4]/g[0],v)+" "+o(-g[5]/g[3],v)+" "+o(this.width/g[0],v)+" "+o(this.height/g[3],v)+'" '),i.push(" -`,"Created with Fabric.js ",f.version,` -`,` -`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(l),` -`)},createSVGClipPathMarkup:function(i){var l=this.clipPath;return l?(l.clipPathId="CLIPPATH_"+f.Object.__uid++,' -`+this.clipPath.toClipPathSVG(i.reviver)+` -`):""},createSVGRefElementsMarkup:function(){var i=this,l=["background","overlay"].map(function(u){var d=i[u+"Color"];if(d&&d.toLive){var g=i[u+"Vpt"],p=i.viewportTransform,v={width:i.width/(g?p[0]:1),height:i.height/(g?p[3]:1)};return d.toSVG(v,{additionalTransform:g?f.util.matrixToSVG(p):""})}});return l.join("")},createSVGFontFacesMarkup:function(){var i="",l={},u,d,g,p,v,_,T,A,X,W=f.fontPaths,N=[];for(this._objects.forEach(function U(G){N.push(G),G._objects&&G._objects.forEach(U)}),A=0,X=N.length;A',` -`,i,"",` -`].join("")),i},_setSVGObjects:function(i,l){var u,d,g,p=this._objects;for(d=0,g=p.length;d -`)}else i.push(' -`)},sendToBack:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=g.length;u--;)d=g[u],h(this._objects,d),this._objects.unshift(d);else h(this._objects,i),this._objects.unshift(i);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(i){if(!i)return this;var l=this._activeObject,u,d,g;if(i===l&&i.type==="activeSelection")for(g=l._objects,u=0;u0+T&&(v=p-1,h(this._objects,g),this._objects.splice(v,0,g)),T++;else p=this._objects.indexOf(i),p!==0&&(v=this._findNewLowerIndex(i,p,l),h(this._objects,i),this._objects.splice(v,0,i));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(i,l,u){var d,g;if(u)for(d=l,g=l-1;g>=0;--g){var p=i.intersectsWithObject(this._objects[g])||i.isContainedWithinObject(this._objects[g])||this._objects[g].isContainedWithinObject(i);if(p){d=g;break}}else d=l-1;return d},bringForward:function(i,l){if(!i)return this;var u=this._activeObject,d,g,p,v,_,T=0;if(i===u&&i.type==="activeSelection")for(_=u._objects,d=_.length;d--;)g=_[d],p=this._objects.indexOf(g),p"}}),c(f.StaticCanvas.prototype,f.Observable),c(f.StaticCanvas.prototype,f.Collection),c(f.StaticCanvas.prototype,f.DataURLExporter),c(f.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(i){var l=n();if(!l||!l.getContext)return null;var u=l.getContext("2d");if(!u)return null;switch(i){case"setLineDash":return typeof u.setLineDash<"u";default:return null}}}),f.StaticCanvas.prototype.toJSON=f.StaticCanvas.prototype.toObject,f.isLikelyNode&&(f.StaticCanvas.prototype.createPNGStream=function(){var i=t(this.lowerCanvasEl);return i&&i.createPNGStream()},f.StaticCanvas.prototype.createJPEGStream=function(i){var l=t(this.lowerCanvasEl);return l&&l.createJPEGStream(i)})}(),f.BaseBrush=f.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(c){c.strokeStyle=this.color,c.lineWidth=this.width,c.lineCap=this.strokeLineCap,c.miterLimit=this.strokeMiterLimit,c.lineJoin=this.strokeLineJoin,c.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(c){var s=this.canvas.viewportTransform;c.save(),c.transform(s[0],s[1],s[2],s[3],s[4],s[5])},_setShadow:function(){if(this.shadow){var c=this.canvas,s=this.shadow,h=c.contextTop,o=c.getZoom();c&&c._isRetinaScaling()&&(o*=f.devicePixelRatio),h.shadowColor=s.color,h.shadowBlur=s.blur*o,h.shadowOffsetX=s.offsetX*o,h.shadowOffsetY=s.offsetY*o}},needsFullRender:function(){var c=new f.Color(this.color);return c.getAlpha()<1||!!this.shadow},_resetShadow:function(){var c=this.canvas.contextTop;c.shadowColor="",c.shadowBlur=c.shadowOffsetX=c.shadowOffsetY=0},_isOutSideCanvas:function(c){return c.x<0||c.x>this.canvas.getWidth()||c.y<0||c.y>this.canvas.getHeight()}}),function(){f.PencilBrush=f.util.createClass(f.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(c){this.canvas=c,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(c,s,h){var o=s.midPointFrom(h);return c.quadraticCurveTo(s.x,s.y,o.x,o.y),o},onMouseDown:function(c,s){this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],this._prepareForDrawing(c),this._captureDrawingPath(c),this._render())},onMouseMove:function(c,s){if(this.canvas._isMainEvent(s.e)&&(this.drawStraightLine=s.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(c))&&this._captureDrawingPath(c)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var h=this._points,o=h.length,e=this.canvas.contextTop;this._saveAndTransform(e),this.oldEnd&&(e.beginPath(),e.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(e,h[o-2],h[o-1],!0),e.stroke(),e.restore()}},onMouseUp:function(c){return this.canvas._isMainEvent(c.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(c){var s=new f.Point(c.x,c.y);this._reset(),this._addPoint(s),this.canvas.contextTop.moveTo(s.x,s.y)},_addPoint:function(c){return this._points.length>1&&c.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(c),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(c){var s=new f.Point(c.x,c.y);return this._addPoint(s)},_render:function(c){var s,h,o=this._points[0],e=this._points[1];if(c=c||this.canvas.contextTop,this._saveAndTransform(c),c.beginPath(),this._points.length===2&&o.x===e.x&&o.y===e.y){var r=this.width/1e3;o=new f.Point(o.x,o.y),e=new f.Point(e.x,e.y),o.x-=r,e.x+=r}for(c.moveTo(o.x,o.y),s=1,h=this._points.length;s=o&&(t=c[e],n.push(t));return n.push(c[r]),n},_finalizeAndAddPath:function(){var c=this.canvas.contextTop;c.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var s=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(s)){this.canvas.requestRenderAll();return}var h=this.createPath(s);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:h}),this.canvas.add(h),this.canvas.requestRenderAll(),h.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:h})}})}(),f.CircleBrush=f.util.createClass(f.BaseBrush,{width:10,initialize:function(c){this.canvas=c,this.points=[]},drawDot:function(c){var s=this.addPoint(c),h=this.canvas.contextTop;this._saveAndTransform(h),this.dot(h,s),h.restore()},dot:function(c,s){c.fillStyle=s.fill,c.beginPath(),c.arc(s.x,s.y,s.radius,0,Math.PI*2,!1),c.closePath(),c.fill()},onMouseDown:function(c){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(c)},_render:function(){var c=this.canvas.contextTop,s,h,o=this.points;for(this._saveAndTransform(c),s=0,h=o.length;s0&&!this.preserveObjectStacking){t=[],n=[];for(var a=0,i=this._objects.length;a1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var t=e.calcTransformMatrix(),n=f.util.invertTransform(t),a=this.restorePointerVpt(r);return f.util.transformPoint(a,n)},isTargetTransparent:function(e,r,t){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:r,y:t}),a=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),i=Math.max(e.cacheTranslationY+n.y*e.zoomY,0),g=f.util.isTransparent(e._cacheContext,Math.round(a),Math.round(i),this.targetFindTolerance);return g}var l=this.contextCache,u=e.selectionBackgroundColor,d=this.viewportTransform;e.selectionBackgroundColor="",this.clearContext(l),l.save(),l.transform(d[0],d[1],d[2],d[3],d[4],d[5]),e.render(l),l.restore(),e.selectionBackgroundColor=u;var g=f.util.isTransparent(l,r,t,this.targetFindTolerance);return g},_isSelectionKeyPressed:function(e){var r=!1;return Array.isArray(this.selectionKey)?r=!!this.selectionKey.find(function(t){return e[t]===!0}):r=e[this.selectionKey],r},_shouldClearSelection:function(e,r){var t=this.getActiveObjects(),n=this._activeObject;return!r||r&&n&&t.length>1&&t.indexOf(r)===-1&&n!==r&&!this._isSelectionKeyPressed(e)||r&&!r.evented||r&&!r.selectable&&n&&n!==r},_shouldCenterTransform:function(e,r,t){if(e){var n;return r==="scale"||r==="scaleX"||r==="scaleY"||r==="resizing"?n=this.centeredScaling||e.centeredScaling:r==="rotate"&&(n=this.centeredRotation||e.centeredRotation),n?!t:t}},_getOriginFromCorner:function(e,r){var t={x:e.originX,y:e.originY};return r==="ml"||r==="tl"||r==="bl"?t.x="right":(r==="mr"||r==="tr"||r==="br")&&(t.x="left"),r==="tl"||r==="mt"||r==="tr"?t.y="bottom":(r==="bl"||r==="mb"||r==="br")&&(t.y="top"),t},_getActionFromCorner:function(e,r,t,n){if(!r||!e)return"drag";var a=n.controls[r];return a.getActionName(t,a,n)},_setupCurrentTransform:function(e,r,t){if(r){var n=this.getPointer(e),a=r.__corner,i=r.controls[a],l=t&&a?i.getActionHandler(e,r,i):f.controlsUtils.dragHandler,u=this._getActionFromCorner(t,a,e,r),d=this._getOriginFromCorner(r,a),g=e[this.centeredKey],p={target:r,action:u,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:n.x-r.left,offsetY:n.y-r.top,originX:d.x,originY:d.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:s(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:g,original:f.util.saveObjectTransform(r)};this._shouldCenterTransform(r,u,g)&&(p.originX="center",p.originY="center"),p.original.originX=d.x,p.original.originY=d.y,this._currentTransform=p,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,t=new f.Point(r.ex,r.ey),n=f.util.transformPoint(t,this.viewportTransform),a=new f.Point(r.ex+r.left,r.ey+r.top),i=f.util.transformPoint(a,this.viewportTransform),l=Math.min(n.x,i.x),u=Math.min(n.y,i.y),d=Math.max(n.x,i.x),g=Math.max(n.y,i.y),p=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(l,u,d-l,g-u)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,l+=p,u+=p,d-=p,g-=p,f.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(l,u,d-l,g-u))},findTarget:function(e,r){if(!this.skipTargetFind){var t=!0,n=this.getPointer(e,t),a=this._activeObject,i=this.getActiveObjects(),l,u,d=h(e),g=i.length>1&&!r||i.length===1;if(this.targets=[],g&&a._findTargetCorner(n,d)||i.length>1&&!r&&a===this._searchPossibleTargets([a],n))return a;if(i.length===1&&a===this._searchPossibleTargets([a],n))if(this.preserveObjectStacking)l=a,u=this.targets,this.targets=[];else return a;var p=this._searchPossibleTargets(this._objects,n);return e[this.altSelectionKey]&&p&&l&&p!==l&&(p=l,this.targets=u),p}},_checkTarget:function(e,r,t){if(r&&r.visible&&r.evented&&r.containsPoint(e))if((this.perPixelTargetFind||r.perPixelTargetFind)&&!r.isEditing){var n=this.isTargetTransparent(r,t.x,t.y);if(!n)return!0}else return!0},_searchPossibleTargets:function(e,r){for(var t,n=e.length,a;n--;){var i=e[n],l=i.group?this._normalizePointer(i.group,r):r;if(this._checkTarget(l,i,r)){t=e[n],t.subTargetCheck&&t instanceof f.Group&&(a=this._searchPossibleTargets(t._objects,r),a&&this.targets.push(a));break}}return t},restorePointerVpt:function(e){return f.util.transformPoint(e,f.util.invertTransform(this.viewportTransform))},getPointer:function(e,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var t=c(e),n=this.upperCanvasEl,a=n.getBoundingClientRect(),i=a.width||0,l=a.height||0,u;(!i||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(i=Math.abs(a.right-a.left))),this.calcOffset(),t.x=t.x-this._offset.left,t.y=t.y-this._offset.top,r||(t=this.restorePointerVpt(t));var d=this.getRetinaScaling();return d!==1&&(t.x/=d,t.y/=d),i===0||l===0?u={width:1,height:1}:u={width:n.width/i,height:n.height/l},{x:t.x*u.width,y:t.y*u.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,t=this.upperCanvasEl;t?t.className="":(t=this._createCanvasElement(),this.upperCanvasEl=t),f.util.addClass(t,"upper-canvas "+e),this.wrapperEl.appendChild(t),this._copyCanvasStyle(r,t),this._applyCanvasStyle(t),this.contextTop=t.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=f.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),f.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),f.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,t=this.height||e.height;f.util.setStyle(e,{position:"absolute",width:r+"px",height:t+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=t,f.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,r){r.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type==="activeSelection"&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,r){var t=!1,n=this.getActiveObjects(),a=[],i=[];e.forEach(function(l){n.indexOf(l)===-1&&(t=!0,l.fire("deselected",{e:r,target:l}),i.push(l))}),n.forEach(function(l){e.indexOf(l)===-1&&(t=!0,l.fire("selected",{e:r,target:l}),a.push(l))}),e.length>0&&n.length>0?t&&this.fire("selection:updated",{e:r,selected:a,deselected:i}):n.length>0?this.fire("selection:created",{e:r,selected:a}):e.length>0&&this.fire("selection:cleared",{e:r,deselected:i})},setActiveObject:function(e,r){var t=this.getActiveObjects();return this._setActiveObject(e,r),this._fireSelectionEvents(t,r),this},_setActiveObject:function(e,r){return this._activeObject===e||!this._discardActiveObject(r,e)||e.onSelect({e:r})?!1:(this._activeObject=e,!0)},_discardActiveObject:function(e,r){var t=this._activeObject;if(t){if(t.onDeselect({e,object:r}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var r=this.getActiveObjects(),t=this.getActiveObject();return r.length&&this.fire("before:selection:cleared",{target:t,e}),this._discardActiveObject(e),this._fireSelectionEvents(r,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(r){f.util.cleanUpJsdomNode(this[r]),this[r]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,f.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var r=this._activeObject;r&&r._renderControls(e)},_toObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(e),a=this.callSuper("_toObject",e,r,t);return this._unwindGroupTransformOnObject(e,n),a},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type==="activeSelection"&&this._activeObject===e.group){var r=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],t={};return r.forEach(function(n){t[n]=e[n]}),f.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}else return null},_unwindGroupTransformOnObject:function(e,r){r&&e.set(r)},_setSVGObject:function(e,r,t){var n=this._realizeGroupTransformOnObject(r);this.callSuper("_setSVGObject",e,r,t),this._unwindGroupTransformOnObject(r,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),f.StaticCanvas.prototype.setViewportTransform.call(this,e)}});for(var o in f.StaticCanvas)o!=="prototype"&&(f.Canvas[o]=f.StaticCanvas[o])}(),function(){var c=f.util.addListener,s=f.util.removeListener,h=3,o=2,e=1,r={passive:!1};function t(n,a){return n.button&&n.button===a-1}f.util.object.extend(f.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(c,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(n,a){var i=this.upperCanvasEl,l=this._getEventPrefix();n(f.window,"resize",this._onResize),n(i,l+"down",this._onMouseDown),n(i,l+"move",this._onMouseMove,r),n(i,l+"out",this._onMouseOut),n(i,l+"enter",this._onMouseEnter),n(i,"wheel",this._onMouseWheel),n(i,"contextmenu",this._onContextMenu),n(i,"dblclick",this._onDoubleClick),n(i,"dragover",this._onDragOver),n(i,"dragenter",this._onDragEnter),n(i,"dragleave",this._onDragLeave),n(i,"drop",this._onDrop),this.enablePointerEvents||n(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&a in eventjs&&(eventjs[a](i,"gesture",this._onGesture),eventjs[a](i,"drag",this._onDrag),eventjs[a](i,"orientation",this._onOrientationChange),eventjs[a](i,"shake",this._onShake),eventjs[a](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(s,"remove");var n=this._getEventPrefix();s(f.document,n+"up",this._onMouseUp),s(f.document,"touchend",this._onTouchEnd,r),s(f.document,n+"move",this._onMouseMove,r),s(f.document,"touchmove",this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(n,a){this.__onTransformGesture&&this.__onTransformGesture(n,a)},_onDrag:function(n,a){this.__onDrag&&this.__onDrag(n,a)},_onMouseWheel:function(n){this.__onMouseWheel(n)},_onMouseOut:function(n){var a=this._hoveredTarget;this.fire("mouse:out",{target:a,e:n}),this._hoveredTarget=null,a&&a.fire("mouseout",{e:n});var i=this;this._hoveredTargets.forEach(function(l){i.fire("mouse:out",{target:a,e:n}),l&&a.fire("mouseout",{e:n})}),this._hoveredTargets=[]},_onMouseEnter:function(n){!this._currentTransform&&!this.findTarget(n)&&(this.fire("mouse:over",{target:null,e:n}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(n,a){this.__onOrientationChange&&this.__onOrientationChange(n,a)},_onShake:function(n,a){this.__onShake&&this.__onShake(n,a)},_onLongPress:function(n,a){this.__onLongPress&&this.__onLongPress(n,a)},_onDragOver:function(n){n.preventDefault();var a=this._simpleEventHandler("dragover",n);this._fireEnterLeaveEvents(a,n)},_onDrop:function(n){return this._simpleEventHandler("drop:before",n),this._simpleEventHandler("drop",n)},_onContextMenu:function(n){return this.stopContextMenu&&(n.stopPropagation(),n.preventDefault()),!1},_onDoubleClick:function(n){this._cacheTransformEventData(n),this._handleEvent(n,"dblclick"),this._resetTransformEventData(n)},getPointerId:function(n){var a=n.changedTouches;return a?a[0]&&a[0].identifier:this.enablePointerEvents?n.pointerId:-1},_isMainEvent:function(n){return n.isPrimary===!0?!0:n.isPrimary===!1?!1:n.type==="touchend"&&n.touches.length===0?!0:n.changedTouches?n.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(n){n.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();c(f.document,"touchend",this._onTouchEnd,r),c(f.document,"touchmove",this._onMouseMove,r),s(a,i+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();s(a,i+"move",this._onMouseMove,r),c(f.document,i+"up",this._onMouseUp),c(f.document,i+"move",this._onMouseMove,r)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var a=this._getEventPrefix();s(f.document,"touchend",this._onTouchEnd,r),s(f.document,"touchmove",this._onMouseMove,r);var i=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){c(i.upperCanvasEl,a+"down",i._onMouseDown),i._willAddMouseDown=0},400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var a=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(n)&&(s(f.document,i+"up",this._onMouseUp),s(f.document,i+"move",this._onMouseMove,r),c(a,i+"move",this._onMouseMove,r))},_onMouseMove:function(n){!this.allowTouchScrolling&&n.preventDefault&&n.preventDefault(),this.__onMouseMove(n)},_onResize:function(){this.calcOffset()},_shouldRender:function(n){var a=this._activeObject;return!!a!=!!n||a&&n&&a!==n?!0:(a&&a.isEditing,!1)},__onMouseUp:function(n){var a,i=this._currentTransform,l=this._groupSelector,u=!1,d=!l||l.left===0&&l.top===0;if(this._cacheTransformEventData(n),a=this._target,this._handleEvent(n,"up:before"),t(n,h)){this.fireRightClick&&this._handleEvent(n,"up",h,d);return}if(t(n,o)){this.fireMiddleClick&&this._handleEvent(n,"up",o,d),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(n);return}if(this._isMainEvent(n)){if(i&&(this._finalizeCurrentTransform(n),u=i.actionPerformed),!d){var g=a===this._activeObject;this._maybeGroupObjects(n),u||(u=this._shouldRender(a)||!g&&a===this._activeObject)}var p,v;if(a){if(p=a._findTargetCorner(this.getPointer(n,!0),f.util.isTouchEvent(n)),a.selectable&&a!==this._activeObject&&a.activeOn==="up")this.setActiveObject(a,n),u=!0;else{var _=a.controls[p],T=_&&_.getMouseUpHandler(n,a,_);T&&(v=this.getPointer(n),T(n,i,v.x,v.y))}a.isMoving=!1}if(i&&(i.target!==a||i.corner!==p)){var A=i.target&&i.target.controls[i.corner],X=A&&A.getMouseUpHandler(n,a,_);v=v||this.getPointer(n),X&&X(n,i,v.x,v.y)}this._setCursorFromEvent(n,a),this._handleEvent(n,"up",e,d),this._groupSelector=null,this._currentTransform=null,a&&(a.__corner=0),u?this.requestRenderAll():d||this.renderTop()}},_simpleEventHandler:function(n,a){var i=this.findTarget(a),l=this.targets,u={e:a,target:i,subTargets:l};if(this.fire(n,u),i&&i.fire(n,u),!l)return i;for(var d=0;d1&&(e=new f.ActiveSelection(o.reverse(),{canvas:this}),this.setActiveObject(e,h))},_collectObjects:function(h){for(var o=[],e,r=this._groupSelector.ex,t=this._groupSelector.ey,n=r+this._groupSelector.left,a=t+this._groupSelector.top,i=new f.Point(c(r,n),c(t,a)),l=new f.Point(s(r,n),s(t,a)),u=!this.selectionFullyContained,d=r===n&&t===a,g=this._objects.length;g--&&(e=this._objects[g],!(!(!e||!e.selectable||!e.visible)&&(u&&e.intersectsWithRect(i,l,!0)||e.isContainedWithinRect(i,l,!0)||u&&e.containsPoint(i,null,!0)||u&&e.containsPoint(l,null,!0))&&(o.push(e),d))););return o.length>1&&(o=o.filter(function(p){return!p.onSelect({e:h})})),o},_maybeGroupObjects:function(h){this.selection&&this._groupSelector&&this._groupSelectedObjects(h),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){f.util.object.extend(f.StaticCanvas.prototype,{toDataURL:function(c){c||(c={});var s=c.format||"png",h=c.quality||1,o=(c.multiplier||1)*(c.enableRetinaScaling?this.getRetinaScaling():1),e=this.toCanvasElement(o,c);return f.util.toDataURL(e,s,h)},toCanvasElement:function(c,s){c=c||1,s=s||{};var h=(s.width||this.width)*c,o=(s.height||this.height)*c,e=this.getZoom(),r=this.width,t=this.height,n=e*c,a=this.viewportTransform,i=(a[4]-(s.left||0))*c,l=(a[5]-(s.top||0))*c,u=this.interactive,d=[n,0,0,n,i,l],g=this.enableRetinaScaling,p=f.util.createCanvasElement(),v=this.contextTop;return p.width=h,p.height=o,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=d,this.width=h,this.height=o,this.calcViewportBoundaries(),this.renderCanvas(p.getContext("2d"),this._objects),this.viewportTransform=a,this.width=r,this.height=t,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=g,this.contextTop=v,p}})}(),f.util.object.extend(f.StaticCanvas.prototype,{loadFromJSON:function(c,s,h){if(c){var o=typeof c=="string"?JSON.parse(c):f.util.object.clone(c),e=this,r=o.clipPath,t=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete o.clipPath,this._enlivenObjects(o.objects,function(n){e.clear(),e._setBgOverlay(o,function(){r?e._enlivenObjects([r],function(a){e.clipPath=a[0],e.__setupCanvas.call(e,o,n,t,s)}):e.__setupCanvas.call(e,o,n,t,s)})},h),this}},__setupCanvas:function(c,s,h,o){var e=this;s.forEach(function(r,t){e.insertAt(r,t)}),this.renderOnAddRemove=h,delete c.objects,delete c.backgroundImage,delete c.overlayImage,delete c.background,delete c.overlay,this._setOptions(c),this.renderAll(),o&&o()},_setBgOverlay:function(c,s){var h={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!c.backgroundImage&&!c.overlayImage&&!c.background&&!c.overlay){s&&s();return}var o=function(){h.backgroundImage&&h.overlayImage&&h.backgroundColor&&h.overlayColor&&s&&s()};this.__setBgOverlay("backgroundImage",c.backgroundImage,h,o),this.__setBgOverlay("overlayImage",c.overlayImage,h,o),this.__setBgOverlay("backgroundColor",c.background,h,o),this.__setBgOverlay("overlayColor",c.overlay,h,o)},__setBgOverlay:function(c,s,h,o){var e=this;if(!s){h[c]=!0,o&&o();return}c==="backgroundImage"||c==="overlayImage"?f.util.enlivenObjects([s],function(r){e[c]=r[0],h[c]=!0,o&&o()}):this["set"+f.util.string.capitalize(c,!0)](s,function(){h[c]=!0,o&&o()})},_enlivenObjects:function(c,s,h){if(!c||c.length===0){s&&s([]);return}f.util.enlivenObjects(c,function(o){s&&s(o)},null,h)},_toDataURL:function(c,s){this.clone(function(h){s(h.toDataURL(c))})},_toDataURLWithMultiplier:function(c,s,h){this.clone(function(o){h(o.toDataURLWithMultiplier(c,s))})},clone:function(c,s){var h=JSON.stringify(this.toJSON(s));this.cloneWithoutData(function(o){o.loadFromJSON(h,function(){c&&c(o)})})},cloneWithoutData:function(c){var s=f.util.createCanvasElement();s.width=this.width,s.height=this.height;var h=new f.Canvas(s);this.backgroundImage?(h.setBackgroundImage(this.backgroundImage.src,function(){h.renderAll(),c&&c(h)}),h.backgroundImageOpacity=this.backgroundImageOpacity,h.backgroundImageStretch=this.backgroundImageStretch):c&&c(h)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e=s.util.toFixed,r=s.util.string.capitalize,t=s.util.degreesToRadians,n=!s.isLikelyNode,a=2;s.Object||(s.Object=s.util.createClass(s.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(i){i&&this.setOptions(i)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=s.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(i){var l=s.perfLimitSizeTotal,u=i.width,d=i.height,g=s.maxCacheSideLimit,p=s.minCacheSideLimit;if(u<=g&&d<=g&&u*d<=l)return uA&&(i.zoomX/=u/A,i.width=A,i.capped=!0),d>X&&(i.zoomY/=d/X,i.height=X,i.capped=!0),i},_getCacheCanvasDimensions:function(){var i=this.getTotalObjectScaling(),l=this._getTransformedDimensions(0,0),u=l.x*i.scaleX/this.scaleX,d=l.y*i.scaleY/this.scaleY;return{width:u+a,height:d+a,zoomX:i.scaleX,zoomY:i.scaleY,x:u,y:d}},_updateCacheCanvas:function(){var i=this.canvas;if(this.noScaleCache&&i&&i._currentTransform){var l=i._currentTransform.target,u=i._currentTransform.action;if(this===l&&u.slice&&u.slice(0,5)==="scale")return!1}var d=this._cacheCanvas,g=this._limitCacheSize(this._getCacheCanvasDimensions()),p=s.minCacheSideLimit,v=g.width,_=g.height,T,A,X=g.zoomX,W=g.zoomY,N=v!==this.cacheWidth||_!==this.cacheHeight,V=this.zoomX!==X||this.zoomY!==W,U=N||V,G=0,q=0,J=!1;if(N){var K=this._cacheCanvas.width,m=this._cacheCanvas.height,C=v>K||_>m,S=(vp&&m>p;J=C||S,C&&!g.capped&&(v>p||_>p)&&(G=v*.1,q=_*.1)}return this instanceof s.Text&&this.path&&(U=!0,J=!0,G+=this.getHeightOfLine(0)*this.zoomX,q+=this.getHeightOfLine(0)*this.zoomY),U?(J?(d.width=Math.ceil(v+G),d.height=Math.ceil(_+q)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,d.width,d.height)),T=g.x/2,A=g.y/2,this.cacheTranslationX=Math.round(d.width/2-T)+T,this.cacheTranslationY=Math.round(d.height/2-A)+A,this.cacheWidth=v,this.cacheHeight=_,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(X,W),this.zoomX=X,this.zoomY=W,!0):!1},setOptions:function(i){this._setOptions(i),this._initGradient(i.fill,"fill"),this._initGradient(i.stroke,"stroke"),this._initPattern(i.fill,"fill"),this._initPattern(i.stroke,"stroke")},transform:function(i){var l=this.group&&!this.group._transformDone||this.group&&this.canvas&&i===this.canvas.contextTop,u=this.calcTransformMatrix(!l);i.transform(u[0],u[1],u[2],u[3],u[4],u[5])},toObject:function(i){var l=s.Object.NUM_FRACTION_DIGITS,u={type:this.type,version:s.version,originX:this.originX,originY:this.originY,left:e(this.left,l),top:e(this.top,l),width:e(this.width,l),height:e(this.height,l),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:e(this.strokeWidth,l),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:e(this.strokeMiterLimit,l),scaleX:e(this.scaleX,l),scaleY:e(this.scaleY,l),angle:e(this.angle,l),flipX:this.flipX,flipY:this.flipY,opacity:e(this.opacity,l),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:e(this.skewX,l),skewY:e(this.skewY,l)};return this.clipPath&&!this.clipPath.excludeFromExport&&(u.clipPath=this.clipPath.toObject(i),u.clipPath.inverted=this.clipPath.inverted,u.clipPath.absolutePositioned=this.clipPath.absolutePositioned),s.util.populateWithProperties(this,u,i),this.includeDefaultValues||(u=this._removeDefaultValues(u)),u},toDatalessObject:function(i){return this.toObject(i)},_removeDefaultValues:function(i){var l=s.util.getKlass(i.type).prototype,u=l.stateProperties;return u.forEach(function(d){d==="left"||d==="top"||(i[d]===l[d]&&delete i[d],Array.isArray(i[d])&&Array.isArray(l[d])&&i[d].length===0&&l[d].length===0&&delete i[d])}),i},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var i=s.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(i.scaleX),scaleY:Math.abs(i.scaleY)}},getTotalObjectScaling:function(){var i=this.getObjectScaling(),l=i.scaleX,u=i.scaleY;if(this.canvas){var d=this.canvas.getZoom(),g=this.canvas.getRetinaScaling();l*=d*g,u*=d*g}return{scaleX:l,scaleY:u}},getObjectOpacity:function(){var i=this.opacity;return this.group&&(i*=this.group.getObjectOpacity()),i},_set:function(i,l){var u=i==="scaleX"||i==="scaleY",d=this[i]!==l,g=!1;return u&&(l=this._constrainScale(l)),i==="scaleX"&&l<0?(this.flipX=!this.flipX,l*=-1):i==="scaleY"&&l<0?(this.flipY=!this.flipY,l*=-1):i==="shadow"&&l&&!(l instanceof s.Shadow)?l=new s.Shadow(l):i==="dirty"&&this.group&&this.group.set("dirty",l),this[i]=l,d&&(g=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(i)>-1?(this.dirty=!0,g&&this.group.set("dirty",!0)):g&&this.stateProperties.indexOf(i)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:s.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(i){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(i.save(),this._setupCompositeOperation(i),this.drawSelectionBackground(i),this.transform(i),this._setOpacity(i),this._setShadow(i,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(i)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(i),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),i.restore())},renderCache:function(i){i=i||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,i.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(i,l){if(i.save(),l.inverted?i.globalCompositeOperation="destination-out":i.globalCompositeOperation="destination-in",l.absolutePositioned){var u=s.util.invertTransform(this.calcTransformMatrix());i.transform(u[0],u[1],u[2],u[3],u[4],u[5])}l.transform(i),i.scale(1/l.zoomX,1/l.zoomY),i.drawImage(l._cacheCanvas,-l.cacheTranslationX,-l.cacheTranslationY),i.restore()},drawObject:function(i,l){var u=this.fill,d=this.stroke;l?(this.fill="black",this.stroke="",this._setClippingProperties(i)):this._renderBackground(i),this._render(i),this._drawClipPath(i,this.clipPath),this.fill=u,this.stroke=d},_drawClipPath:function(i,l){l&&(l.canvas=this.canvas,l.shouldCache(),l._transformDone=!0,l.renderCache({forClipping:!0}),this.drawClipPathOnCache(i,l))},drawCacheOnCanvas:function(i){i.scale(1/this.zoomX,1/this.zoomY),i.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(i){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!i&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!i){var l=this.cacheWidth/this.zoomX,u=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-l/2,-u/2,l,u)}return!0}return!1},_renderBackground:function(i){if(this.backgroundColor){var l=this._getNonTransformedDimensions();i.fillStyle=this.backgroundColor,i.fillRect(-l.x/2,-l.y/2,l.x,l.y),this._removeShadow(i)}},_setOpacity:function(i){this.group&&!this.group._transformDone?i.globalAlpha=this.getObjectOpacity():i.globalAlpha*=this.opacity},_setStrokeStyles:function(i,l){var u=l.stroke;u&&(i.lineWidth=l.strokeWidth,i.lineCap=l.strokeLineCap,i.lineDashOffset=l.strokeDashOffset,i.lineJoin=l.strokeLineJoin,i.miterLimit=l.strokeMiterLimit,u.toLive?u.gradientUnits==="percentage"||u.gradientTransform||u.patternTransform?this._applyPatternForTransformedGradient(i,u):(i.strokeStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,u)):i.strokeStyle=l.stroke)},_setFillStyles:function(i,l){var u=l.fill;u&&(u.toLive?(i.fillStyle=u.toLive(i,this),this._applyPatternGradientTransform(i,l.fill)):i.fillStyle=u)},_setClippingProperties:function(i){i.globalAlpha=1,i.strokeStyle="transparent",i.fillStyle="#000000"},_setLineDash:function(i,l){!l||l.length===0||(1&l.length&&l.push.apply(l,l),i.setLineDash(l))},_renderControls:function(i,l){var u=this.getViewportTransform(),d=this.calcTransformMatrix(),g,p,v;l=l||{},p=typeof l.hasBorders<"u"?l.hasBorders:this.hasBorders,v=typeof l.hasControls<"u"?l.hasControls:this.hasControls,d=s.util.multiplyTransformMatrices(u,d),g=s.util.qrDecompose(d),i.save(),i.translate(g.translateX,g.translateY),i.lineWidth=1*this.borderScaleFactor,this.group||(i.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(g.angle-=180),i.rotate(t(this.group?g.angle:this.angle)),l.forActiveSelection||this.group?p&&this.drawBordersInGroup(i,g,l):p&&this.drawBorders(i,l),v&&this.drawControls(i,l),i.restore()},_setShadow:function(i){if(this.shadow){var l=this.shadow,u=this.canvas,d,g=u&&u.viewportTransform[0]||1,p=u&&u.viewportTransform[3]||1;l.nonScaling?d={scaleX:1,scaleY:1}:d=this.getObjectScaling(),u&&u._isRetinaScaling()&&(g*=s.devicePixelRatio,p*=s.devicePixelRatio),i.shadowColor=l.color,i.shadowBlur=l.blur*s.browserShadowBlurConstant*(g+p)*(d.scaleX+d.scaleY)/4,i.shadowOffsetX=l.offsetX*g*d.scaleX,i.shadowOffsetY=l.offsetY*p*d.scaleY}},_removeShadow:function(i){this.shadow&&(i.shadowColor="",i.shadowBlur=i.shadowOffsetX=i.shadowOffsetY=0)},_applyPatternGradientTransform:function(i,l){if(!l||!l.toLive)return{offsetX:0,offsetY:0};var u=l.gradientTransform||l.patternTransform,d=-this.width/2+l.offsetX||0,g=-this.height/2+l.offsetY||0;return l.gradientUnits==="percentage"?i.transform(this.width,0,0,this.height,d,g):i.transform(1,0,0,1,d,g),u&&i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),{offsetX:d,offsetY:g}},_renderPaintInOrder:function(i){this.paintFirst==="stroke"?(this._renderStroke(i),this._renderFill(i)):(this._renderFill(i),this._renderStroke(i))},_render:function(){},_renderFill:function(i){this.fill&&(i.save(),this._setFillStyles(i,this),this.fillRule==="evenodd"?i.fill("evenodd"):i.fill(),i.restore())},_renderStroke:function(i){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(i),i.save(),this.strokeUniform&&this.group){var l=this.getObjectScaling();i.scale(1/l.scaleX,1/l.scaleY)}else this.strokeUniform&&i.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(i,this.strokeDashArray),this._setStrokeStyles(i,this),i.stroke(),i.restore()}},_applyPatternForTransformedGradient:function(i,l){var u=this._limitCacheSize(this._getCacheCanvasDimensions()),d=s.util.createCanvasElement(),g,p=this.canvas.getRetinaScaling(),v=u.x/this.scaleX/p,_=u.y/this.scaleY/p;d.width=v,d.height=_,g=d.getContext("2d"),g.beginPath(),g.moveTo(0,0),g.lineTo(v,0),g.lineTo(v,_),g.lineTo(0,_),g.closePath(),g.translate(v/2,_/2),g.scale(u.zoomX/this.scaleX/p,u.zoomY/this.scaleY/p),this._applyPatternGradientTransform(g,l),g.fillStyle=l.toLive(i),g.fill(),i.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),i.scale(p*this.scaleX/u.zoomX,p*this.scaleY/u.zoomY),i.strokeStyle=g.createPattern(d,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var i=s.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",i.scaleX),this.set("scaleY",i.scaleY),this.angle=i.angle,this.skewX=i.skewX,this.skewY=0}},_removeTransformMatrix:function(i){var l=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),l=s.util.transformPoint(l,this.transformMatrix)),this.transformMatrix=null,i&&(this.scaleX*=i.scaleX,this.scaleY*=i.scaleY,this.cropX=i.cropX,this.cropY=i.cropY,l.x+=i.offsetLeft,l.y+=i.offsetTop,this.width=i.width,this.height=i.height),this.setPositionByOrigin(l,"center","center")},clone:function(i,l){var u=this.toObject(l);this.constructor.fromObject?this.constructor.fromObject(u,i):s.Object._fromObject("Object",u,i)},cloneAsImage:function(i,l){var u=this.toCanvasElement(l);return i&&i(new s.Image(u)),this},toCanvasElement:function(i){i||(i={});var l=s.util,u=l.saveObjectTransform(this),d=this.group,g=this.shadow,p=Math.abs,v=(i.multiplier||1)*(i.enableRetinaScaling?s.devicePixelRatio:1);delete this.group,i.withoutTransform&&l.resetObjectTransform(this),i.withoutShadow&&(this.shadow=null);var _=s.util.createCanvasElement(),T=this.getBoundingRect(!0,!0),A=this.shadow,X,W={x:0,y:0},N,V,U;A&&(N=A.blur,A.nonScaling?X={scaleX:1,scaleY:1}:X=this.getObjectScaling(),W.x=2*Math.round(p(A.offsetX)+N)*p(X.scaleX),W.y=2*Math.round(p(A.offsetY)+N)*p(X.scaleY)),V=T.width+W.x,U=T.height+W.y,_.width=Math.ceil(V),_.height=Math.ceil(U);var G=new s.StaticCanvas(_,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});i.format==="jpeg"&&(G.backgroundColor="#fff"),this.setPositionByOrigin(new s.Point(G.width/2,G.height/2),"center","center");var q=this.canvas;G.add(this);var J=G.toCanvasElement(v||1,i);return this.shadow=g,this.set("canvas",q),d&&(this.group=d),this.set(u).setCoords(),G._objects=[],G.dispose(),G=null,J},toDataURL:function(i){return i||(i={}),s.util.toDataURL(this.toCanvasElement(i),i.format||"png",i.quality||1)},isType:function(i){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===i},complexity:function(){return 1},toJSON:function(i){return this.toObject(i)},rotate:function(i){var l=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return l&&this._setOriginToCenter(),this.set("angle",i),l&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(i,l){l=l||this.canvas.getPointer(i);var u=new s.Point(l.x,l.y),d=this._getLeftTopCoords();return this.angle&&(u=s.util.rotatePoint(u,d,t(-this.angle))),{x:u.x-d.x,y:u.y-d.y}},_setupCompositeOperation:function(i){this.globalCompositeOperation&&(i.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){s.runningAnimations&&s.runningAnimations.cancelByTarget(this)}}),s.util.createAccessors&&s.util.createAccessors(s.Object),h(s.Object.prototype,s.Observable),s.Object.NUM_FRACTION_DIGITS=2,s.Object.ENLIVEN_PROPS=["clipPath"],s.Object._fromObject=function(i,l,u,d){var g=s[i];l=o(l,!0),s.util.enlivenPatterns([l.fill,l.stroke],function(p){typeof p[0]<"u"&&(l.fill=p[0]),typeof p[1]<"u"&&(l.stroke=p[1]),s.util.enlivenObjectEnlivables(l,l,function(){var v=d?new g(l[d],l):new g(l);u&&u(v)})})},s.Object.__uid=0)}(Z),function(){var c=f.util.degreesToRadians,s={left:-.5,center:0,right:.5},h={top:-.5,center:0,bottom:.5};f.util.object.extend(f.Object.prototype,{translateToGivenOrigin:function(o,e,r,t,n){var a=o.x,i=o.y,l,u,d;return typeof e=="string"?e=s[e]:e-=.5,typeof t=="string"?t=s[t]:t-=.5,l=t-e,typeof r=="string"?r=h[r]:r-=.5,typeof n=="string"?n=h[n]:n-=.5,u=n-r,(l||u)&&(d=this._getTransformedDimensions(),a=o.x+l*d.x,i=o.y+u*d.y),new f.Point(a,i)},translateToCenterPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,e,r,"center","center");return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},translateToOriginPoint:function(o,e,r){var t=this.translateToGivenOrigin(o,"center","center",e,r);return this.angle?f.util.rotatePoint(t,o,c(this.angle)):t},getCenterPoint:function(){var o=new f.Point(this.left,this.top);return this.translateToCenterPoint(o,this.originX,this.originY)},getPointByOrigin:function(o,e){var r=this.getCenterPoint();return this.translateToOriginPoint(r,o,e)},toLocalPoint:function(o,e,r){var t=this.getCenterPoint(),n,a;return typeof e<"u"&&typeof r<"u"?n=this.translateToGivenOrigin(t,"center","center",e,r):n=new f.Point(this.left,this.top),a=new f.Point(o.x,o.y),this.angle&&(a=f.util.rotatePoint(a,t,-c(this.angle))),a.subtractEquals(n)},setPositionByOrigin:function(o,e,r){var t=this.translateToCenterPoint(o,e,r),n=this.translateToOriginPoint(t,this.originX,this.originY);this.set("left",n.x),this.set("top",n.y)},adjustPosition:function(o){var e=c(this.angle),r=this.getScaledWidth(),t=f.util.cos(e)*r,n=f.util.sin(e)*r,a,i;typeof this.originX=="string"?a=s[this.originX]:a=this.originX-.5,typeof o=="string"?i=s[o]:i=o-.5,this.left+=t*(i-a),this.top+=n*(i-a),this.setCoords(),this.originX=o},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var o=this.getCenterPoint();this.originX="center",this.originY="center",this.left=o.x,this.top=o.y},_resetOrigin:function(){var o=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=o.x,this.top=o.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function c(r){return[new f.Point(r.tl.x,r.tl.y),new f.Point(r.tr.x,r.tr.y),new f.Point(r.br.x,r.br.y),new f.Point(r.bl.x,r.bl.y)]}var s=f.util,h=s.degreesToRadians,o=s.multiplyTransformMatrices,e=s.transformPoint;s.object.extend(f.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(r,t){return t?r?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),r?this.aCoords:this.lineCoords)},getCoords:function(r,t){return c(this._getCoords(r,t))},intersectsWithRect:function(r,t,n,a){var i=this.getCoords(n,a),l=f.Intersection.intersectPolygonRectangle(i,r,t);return l.status==="Intersection"},intersectsWithObject:function(r,t,n){var a=f.Intersection.intersectPolygonPolygon(this.getCoords(t,n),r.getCoords(t,n));return a.status==="Intersection"||r.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(r,t,n)},isContainedWithinObject:function(r,t,n){for(var a=this.getCoords(t,n),i=t?r.aCoords:r.lineCoords,l=0,u=r._getImageLines(i);l<4;l++)if(!r.containsPoint(a[l],u))return!1;return!0},isContainedWithinRect:function(r,t,n,a){var i=this.getBoundingRect(n,a);return i.left>=r.x&&i.left+i.width<=t.x&&i.top>=r.y&&i.top+i.height<=t.y},containsPoint:function(r,l,n,a){var i=this._getCoords(n,a),l=l||this._getImageLines(i),u=this._findCrossPoints(r,l);return u!==0&&u%2===1},isOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br,a=this.getCoords(!0,r);return a.some(function(i){return i.x<=n.x&&i.x>=t.x&&i.y<=n.y&&i.y>=t.y})||this.intersectsWithRect(t,n,!0,r)?!0:this._containsCenterOfCanvas(t,n,r)},_containsCenterOfCanvas:function(r,t,n){var a={x:(r.x+t.x)/2,y:(r.y+t.y)/2};return!!this.containsPoint(a,null,!0,n)},isPartiallyOnScreen:function(r){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;if(this.intersectsWithRect(t,n,!0,r))return!0;var a=this.getCoords(!0,r).every(function(i){return(i.x>=n.x||i.x<=t.x)&&(i.y>=n.y||i.y<=t.y)});return a&&this._containsCenterOfCanvas(t,n,r)},_getImageLines:function(r){var t={topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}};return t},_findCrossPoints:function(r,t){var n,a,i,l,u,d=0,g;for(var p in t)if(g=t[p],!(g.o.y=r.y&&g.d.y>=r.y)&&(g.o.x===g.d.x&&g.o.x>=r.x?u=g.o.x:(n=0,a=(g.d.y-g.o.y)/(g.d.x-g.o.x),i=r.y-n*r.x,l=g.o.y-a*g.o.x,u=-(i-l)/(n-a)),u>=r.x&&(d+=1),d===2))break;return d},getBoundingRect:function(r,t){var n=this.getCoords(r,t);return s.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(r){return Math.abs(r)"u"&&(r=this.skewX),typeof t>"u"&&(t=this.skewY);var n,a,i,l=r===0&&t===0;if(this.strokeUniform?(a=this.width,i=this.height):(n=this._getNonTransformedDimensions(),a=n.x,i=n.y),l)return this._finalizeDimensions(a*this.scaleX,i*this.scaleY);var u=s.sizeAfterTransform(a,i,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:r,skewY:t});return this._finalizeDimensions(u.x,u.y)},_finalizeDimensions:function(r,t){return this.strokeUniform?{x:r+this.strokeWidth,y:t+this.strokeWidth}:{x:r,y:t}},_calculateCurrentDimensions:function(){var r=this.getViewportTransform(),t=this._getTransformedDimensions(),n=e(t,r,!0);return n.scalarAdd(2*this.padding)}})}(),f.util.object.extend(f.Object.prototype,{sendToBack:function(){return this.group?f.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?f.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(c){return this.group?f.StaticCanvas.prototype.sendBackwards.call(this.group,this,c):this.canvas&&this.canvas.sendBackwards(this,c),this},bringForward:function(c){return this.group?f.StaticCanvas.prototype.bringForward.call(this.group,this,c):this.canvas&&this.canvas.bringForward(this,c),this},moveTo:function(c){return this.group&&this.group.type!=="activeSelection"?f.StaticCanvas.prototype.moveTo.call(this.group,this,c):this.canvas&&this.canvas.moveTo(this,c),this}}),function(){function c(h,o){if(o){if(o.toLive)return h+": url(#SVGID_"+o.id+"); ";var e=new f.Color(o),r=h+": "+e.toRgb()+"; ",t=e.getAlpha();return t!==1&&(r+=h+"-opacity: "+t.toString()+"; "),r}else return h+": none; "}var s=f.util.toFixed;f.util.object.extend(f.Object.prototype,{getSvgStyles:function(h){var o=this.fillRule?this.fillRule:"nonzero",e=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",t=this.strokeDashOffset?this.strokeDashOffset:"0",n=this.strokeLineCap?this.strokeLineCap:"butt",a=this.strokeLineJoin?this.strokeLineJoin:"miter",i=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=h?"":this.getSvgFilter(),g=c("fill",this.fill),p=c("stroke",this.stroke);return[p,"stroke-width: ",e,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",n,"; ","stroke-dashoffset: ",t,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",i,"; ",g,"fill-rule: ",o,"; ","opacity: ",l,";",d,u].join("")},getSvgSpanStyles:function(h,o){var e="; ",t=h.fontFamily?"font-family: "+(h.fontFamily.indexOf("'")===-1&&h.fontFamily.indexOf('"')===-1?"'"+h.fontFamily+"'":h.fontFamily)+e:"",r=h.strokeWidth?"stroke-width: "+h.strokeWidth+e:"",t=t,n=h.fontSize?"font-size: "+h.fontSize+"px"+e:"",a=h.fontStyle?"font-style: "+h.fontStyle+e:"",i=h.fontWeight?"font-weight: "+h.fontWeight+e:"",l=h.fill?c("fill",h.fill):"",u=h.stroke?c("stroke",h.stroke):"",d=this.getSvgTextDecoration(h),g=h.deltaY?"baseline-shift: "+-h.deltaY+"; ":"";return d&&(d="text-decoration: "+d+e),[u,r,t,n,a,i,d,l,g,o?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(h){return["overline","underline","line-through"].filter(function(o){return h[o.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(h,o){var e=h?this.calcTransformMatrix():this.calcOwnMatrix(),r='transform="'+f.util.matrixToSVG(e);return r+(o||"")+'" '},_setSVGBg:function(h){if(this.backgroundColor){var o=f.Object.NUM_FRACTION_DIGITS;h.push(" -`)}},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(h),{reviver:h})},toClipPathSVG:function(h){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(h),{reviver:h})},_createBaseClipPathSVGMarkup:function(h,o){o=o||{};var e=o.reviver,r=o.additionalTransform||"",t=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),n=h.indexOf("COMMON_PARTS");return h[n]=t,e?e(h.join("")):h.join("")},_createBaseSVGMarkup:function(h,o){o=o||{};var e=o.noStyle,r=o.reviver,t=e?"":'style="'+this.getSvgStyles()+'" ',n=o.withShadow?'style="'+this.getSvgFilter()+'" ':"",a=this.clipPath,i=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",l=a&&a.absolutePositioned,u=this.stroke,d=this.fill,g=this.shadow,p,v=[],_,T=h.indexOf("COMMON_PARTS"),A=o.additionalTransform;return a&&(a.clipPathId="CLIPPATH_"+f.Object.__uid++,_=' -`+a.toClipPathSVG(r)+` -`),l&&v.push(" -`),v.push(" -`),p=[t,i,e?"":this.addPaintOrder()," ",A?'transform="'+A+'" ':""].join(""),h[T]=p,d&&d.toLive&&v.push(d.toSVG(this)),u&&u.toLive&&v.push(u.toSVG(this)),g&&v.push(g.toSVG(this)),a&&v.push(_),v.push(h.join("")),v.push(` -`),l&&v.push(` -`),r?r(v.join("")):v.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var c=f.util.object.extend,s="stateProperties";function h(e,r,t){var n={},a=!0;t.forEach(function(i){n[i]=e[i]}),c(e[r],n,a)}function o(e,r,t){if(e===r)return!0;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0,a=e.length;n=0;a--)if(i=n[a],!!this.isControlVisible(i)&&(t=this._getImageLines(h?this.oCoords[i].touchCorner:this.oCoords[i].corner),r=this._findCrossPoints({x:o,y:e},t),r!==0&&r%2===1))return this.__corner=i,i;return!1},forEachControl:function(s){for(var h in this.controls)s(this.controls[h],h,this)},_setCornerCoords:function(){var s=this.oCoords;for(var h in s){var o=this.controls[h];s[h].corner=o.calcCornerCoords(this.angle,this.cornerSize,s[h].x,s[h].y,!1),s[h].touchCorner=o.calcCornerCoords(this.angle,this.touchCornerSize,s[h].x,s[h].y,!0)}},drawSelectionBackground:function(s){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;s.save();var h=this.getCenterPoint(),o=this._calculateCurrentDimensions(),e=this.canvas.viewportTransform;return s.translate(h.x,h.y),s.scale(1/e[0],1/e[3]),s.rotate(c(this.angle)),s.fillStyle=this.selectionBackgroundColor,s.fillRect(-o.x/2,-o.y/2,o.x,o.y),s.restore(),this},drawBorders:function(s,h){h=h||{};var o=this._calculateCurrentDimensions(),e=this.borderScaleFactor,r=o.x+e,t=o.y+e,n=typeof h.hasControls<"u"?h.hasControls:this.hasControls,a=!1;return s.save(),s.strokeStyle=h.borderColor||this.borderColor,this._setLineDash(s,h.borderDashArray||this.borderDashArray),s.strokeRect(-r/2,-t/2,r,t),n&&(s.beginPath(),this.forEachControl(function(i,l,u){i.withConnection&&i.getVisibility(u,l)&&(a=!0,s.moveTo(i.x*r,i.y*t),s.lineTo(i.x*r+i.offsetX,i.y*t+i.offsetY))}),a&&s.stroke()),s.restore(),this},drawBordersInGroup:function(s,h,o){o=o||{};var e=f.util.sizeAfterTransform(this.width,this.height,h),r=this.strokeWidth,t=this.strokeUniform,n=this.borderScaleFactor,a=e.x+r*(t?this.canvas.getZoom():h.scaleX)+n,i=e.y+r*(t?this.canvas.getZoom():h.scaleY)+n;return s.save(),this._setLineDash(s,o.borderDashArray||this.borderDashArray),s.strokeStyle=o.borderColor||this.borderColor,s.strokeRect(-a/2,-i/2,a,i),s.restore(),this},drawControls:function(s,h){h=h||{},s.save();var o=this.canvas.getRetinaScaling(),e,r;return s.setTransform(o,0,0,o,0,0),s.strokeStyle=s.fillStyle=h.cornerColor||this.cornerColor,this.transparentCorners||(s.strokeStyle=h.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(s,h.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(e=this.group.calcTransformMatrix()),this.forEachControl(function(t,n,a){r=a.oCoords[n],t.getVisibility(a,n)&&(e&&(r=f.util.transformPoint(r,e)),t.render(s,r.x,r.y,h,a))}),s.restore(),this},isControlVisible:function(s){return this.controls[s]&&this.controls[s].getVisibility(this,s)},setControlVisible:function(s,h){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[s]=h,this},setControlsVisibility:function(s){s||(s={});for(var h in s)this.setControlVisible(h,s[h]);return this},onDeselect:function(){},onSelect:function(){}})}(),f.util.object.extend(f.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){c.set("left",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxCenterObjectV:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){c.set("top",t),r.requestRenderAll(),e()},onComplete:function(){c.setCoords(),o()}})},fxRemove:function(c,s){s=s||{};var h=function(){},o=s.onComplete||h,e=s.onChange||h,r=this;return f.util.animate({target:this,startValue:c.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){c.set("opacity",t),r.requestRenderAll(),e()},onComplete:function(){r.remove(c),o()}})}}),f.util.object.extend(f.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var c=[],s,h,o=[];for(s in arguments[0])c.push(s);for(var e=0,r=c.length;e-1||r&&e.colorProperties.indexOf(r[1])>-1,n=r?this.get(r[0])[r[1]]:this.get(c);"from"in h||(h.from=n),t||(~s.indexOf("=")?s=n+parseFloat(s.replace("=","")):s=parseFloat(s));var a={target:this,startValue:h.from,endValue:s,byValue:h.by,easing:h.easing,duration:h.duration,abort:h.abort&&function(i,l,u){return h.abort.call(e,i,l,u)},onChange:function(i,l,u){r?e[r[0]][r[1]]=i:e.set(c,i),!o&&h.onChange&&h.onChange(i,l,u)},onComplete:function(i,l,u){o||(e.setCoords(),h.onComplete&&h.onComplete(i,l,u))}};return t?f.util.animateColor(a.startValue,a.endValue,a.duration,a):f.util.animate(a)}}),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.object.clone,e={x1:1,x2:1,y1:1,y2:1};if(s.Line){s.warn("fabric.Line is already defined");return}s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,n){t||(t=[0,0,0,0]),this.callSuper("initialize",n),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(n)},_setWidthHeight:function(t){t||(t={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,n){return this.callSuper("_set",t,n),typeof e[t]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:r({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:r({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var n=this.calcLinePoints();t.moveTo(n.x1,n.y1),t.lineTo(n.x2,n.y2),t.lineWidth=this.strokeWidth;var a=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=a},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return h(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(t.y-=this.strokeWidth),this.height===0&&(t.x-=this.strokeWidth)),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,n=this.y1<=this.y2?-1:1,a=t*this.width*.5,i=n*this.height*.5,l=t*this.width*-.5,u=n*this.height*-.5;return{x1:a,x2:l,y1:i,y2:u}},_toSVG:function(){var t=this.calcLinePoints();return[" -`]}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,n,a){a=a||{};var i=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),l=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];n(new s.Line(l,h(i,a)))},s.Line.fromObject=function(t,n){function a(l){delete l.points,n&&n(l)}var i=o(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,a,"points")};function r(t,n){var a=t.origin,i=t.axis1,l=t.axis2,u=t.dimension,d=n.nearest,g=n.center,p=n.farthest;return function(){switch(this.get(a)){case d:return Math.min(this.get(i),this.get(l));case g:return Math.min(this.get(i),this.get(l))+.5*this.get(u);case p:return Math.max(this.get(i),this.get(l))}}}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.degreesToRadians;if(s.Circle){s.warn("fabric.Circle is already defined.");return}s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,r){return this.callSuper("_set",e,r),e==="radius"&&this.setRadius(r),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=0,t=0,n=(this.endAngle-this.startAngle)%360;if(n===0)e=[" -`];else{var a=h(this.startAngle),i=h(this.endAngle),l=this.radius,u=s.util.cos(a)*l,d=s.util.sin(a)*l,g=s.util.cos(i)*l,p=s.util.sin(i)*l,v=n>180?"1":"0";e=[' -`]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,h(this.startAngle),h(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",e*2).set("height",e*2)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(e,r){var t=s.parseAttributes(e,s.Circle.ATTRIBUTE_NAMES);if(!o(t))throw new Error("value of `r` attribute is required and can not be negative");t.left=(t.left||0)-t.radius,t.top=(t.top||0)-t.radius,r(new s.Circle(t))};function o(e){return"radius"in e&&e.radius>=0}s.Circle.fromObject=function(e,r){s.Object._fromObject("Circle",e,r)}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Triangle){s.warn("fabric.Triangle is already defined");return}s.Triangle=s.util.createClass(s.Object,{type:"triangle",width:100,height:100,_render:function(h){var o=this.width/2,e=this.height/2;h.beginPath(),h.moveTo(-o,e),h.lineTo(0,-e),h.lineTo(o,e),h.closePath(),this._renderPaintInOrder(h)},_toSVG:function(){var h=this.width/2,o=this.height/2,e=[-h+" "+o,"0 "+-o,h+" "+o].join(",");return["']}}),s.Triangle.fromObject=function(h,o){return s.Object._fromObject("Triangle",h,o)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=Math.PI*2;if(s.Ellipse){s.warn("fabric.Ellipse is already defined.");return}s.Ellipse=s.util.createClass(s.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this.set("rx",o&&o.rx||0),this.set("ry",o&&o.ry||0)},_set:function(o,e){switch(this.callSuper("_set",o,e),o){case"rx":this.rx=e,this.set("width",e*2);break;case"ry":this.ry=e,this.set("height",e*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){return[" -`]},_render:function(o){o.beginPath(),o.save(),o.transform(1,0,0,this.ry/this.rx,0,0),o.arc(0,0,this.rx,0,h,!1),o.restore(),this._renderPaintInOrder(o)}}),s.Ellipse.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),s.Ellipse.fromElement=function(o,e){var r=s.parseAttributes(o,s.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,e(new s.Ellipse(r))},s.Ellipse.fromObject=function(o,e){s.Object._fromObject("Ellipse",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend;if(s.Rect){s.warn("fabric.Rect is already defined");return}s.Rect=s.util.createClass(s.Object,{stateProperties:s.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:s.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(o){this.callSuper("initialize",o),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(o){var e=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,t=this.width,n=this.height,a=-this.width/2,i=-this.height/2,l=e!==0||r!==0,u=1-.5522847498;o.beginPath(),o.moveTo(a+e,i),o.lineTo(a+t-e,i),l&&o.bezierCurveTo(a+t-u*e,i,a+t,i+u*r,a+t,i+r),o.lineTo(a+t,i+n-r),l&&o.bezierCurveTo(a+t,i+n-u*r,a+t-u*e,i+n,a+t-e,i+n),o.lineTo(a+e,i+n),l&&o.bezierCurveTo(a+u*e,i+n,a,i+n-u*r,a,i+n-r),o.lineTo(a,i+r),l&&o.bezierCurveTo(a,i+u*r,a+u*e,i,a+e,i),o.closePath(),this._renderPaintInOrder(o)},toObject:function(o){return this.callSuper("toObject",["rx","ry"].concat(o))},_toSVG:function(){var o=-this.width/2,e=-this.height/2;return[" -`]}}),s.Rect.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),s.Rect.fromElement=function(o,e,r){if(!o)return e(null);r=r||{};var t=s.parseAttributes(o,s.Rect.ATTRIBUTE_NAMES);t.left=t.left||0,t.top=t.top||0,t.height=t.height||0,t.width=t.width||0;var n=new s.Rect(h(r?s.util.object.clone(r):{},t));n.visible=n.visible&&n.width>0&&n.height>0,e(n)},s.Rect.fromObject=function(o,e){return s.Object._fromObject("Rect",o,e)}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.object.extend,o=s.util.array.min,e=s.util.array.max,r=s.util.toFixed,t=s.util.projectStrokeOnPoints;if(s.Polyline){s.warn("fabric.Polyline is already defined");return}s.Polyline=s.util.createClass(s.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:s.Object.prototype.cacheProperties.concat("points"),initialize:function(n,a){a=a||{},this.points=n||[],this.callSuper("initialize",a),this._setPositionDimensions(a)},_projectStrokeOnPoints:function(){return t(this.points,this,!0)},_setPositionDimensions:function(n){var a=this._calcDimensions(n),i,l=this.exactBoundingBox?this.strokeWidth:0;this.width=a.width-l,this.height=a.height-l,n.fromSVG||(i=this.translateToGivenOrigin({x:a.left-this.strokeWidth/2+l/2,y:a.top-this.strokeWidth/2+l/2},"left","top",this.originX,this.originY)),typeof n.left>"u"&&(this.left=n.fromSVG?a.left:i.x),typeof n.top>"u"&&(this.top=n.fromSVG?a.top:i.y),this.pathOffset={x:a.left+this.width/2+l/2,y:a.top+this.height/2+l/2}},_calcDimensions:function(){var n=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,a=o(n,"x")||0,i=o(n,"y")||0,l=e(n,"x")||0,u=e(n,"y")||0,d=l-a,g=u-i;return{left:a,top:i,width:d,height:g}},toObject:function(n){return h(this.callSuper("toObject",n),{points:this.points.concat()})},_toSVG:function(){for(var n=[],a=this.pathOffset.x,i=this.pathOffset.y,l=s.Object.NUM_FRACTION_DIGITS,u=0,d=this.points.length;u -`]},commonRender:function(n){var a,i=this.points.length,l=this.pathOffset.x,u=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;n.beginPath(),n.moveTo(this.points[0].x-l,this.points[0].y-u);for(var d=0;d"},toObject:function(n){return e(this.callSuper("toObject",n),{path:this.path.map(function(a){return a.slice()})})},toDatalessObject:function(n){var a=this.toObject(["sourcePath"].concat(n));return a.sourcePath&&delete a.path,a},_toSVG:function(){var n=s.util.joinPath(this.path);return[" -`]},_getOffsetTransform:function(){var n=s.Object.NUM_FRACTION_DIGITS;return" translate("+t(-this.pathOffset.x,n)+", "+t(-this.pathOffset.y,n)+")"},toClipPathSVG:function(n){var a=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},toSVG:function(n){var a=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:n,additionalTransform:a})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var n=[],a=[],i,l=0,u=0,d=0,g=0,p,v=0,_=this.path.length;v<_;++v){switch(i=this.path[v],i[0]){case"L":d=i[1],g=i[2],p=[];break;case"M":d=i[1],g=i[2],l=d,u=g,p=[];break;case"C":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[3],i[4],i[5],i[6]),d=i[5],g=i[6];break;case"Q":p=s.util.getBoundsOfCurve(d,g,i[1],i[2],i[1],i[2],i[3],i[4]),d=i[3],g=i[4];break;case"z":case"Z":d=l,g=u;break}p.forEach(function(U){n.push(U.x),a.push(U.y)}),n.push(d),a.push(g)}var T=h(n)||0,A=h(a)||0,X=o(n)||0,W=o(a)||0,N=X-T,V=W-A;return{left:T,top:A,width:N,height:V}}}),s.Path.fromObject=function(n,a){if(typeof n.sourcePath=="string"){var i=n.sourcePath;s.loadSVGFromURL(i,function(l){var u=l[0];u.setOptions(n),n.clipPath?s.util.enlivenObjects([n.clipPath],function(d){u.clipPath=d[0],a&&a(u)}):a&&a(u)})}else s.Object._fromObject("Path",n,a,"path")},s.Path.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat(["d"]),s.Path.fromElement=function(n,a,i){var l=s.parseAttributes(n,s.Path.ATTRIBUTE_NAMES);l.fromSVG=!0,a(new s.Path(l.d,e(l,i)))}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.util.array.min,o=s.util.array.max;s.Group||(s.Group=s.util.createClass(s.Object,s.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,r,t){r=r||{},this._objects=[],t&&this.callSuper("initialize",r),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(t)this._updateObjectsACoords();else{var a=r&&r.centerPoint;r.originX!==void 0&&(this.originX=r.originX),r.originY!==void 0&&(this.originY=r.originY),a||this._calcBounds(),this._updateObjectsCoords(a),delete r.centerPoint,this.callSuper("initialize",r)}this.setCoords()},_updateObjectsACoords:function(){for(var e=!0,r=this._objects.length;r--;)this._objects[r].setCoords(e)},_updateObjectsCoords:function(e){for(var e=e||this.getCenterPoint(),r=this._objects.length;r--;)this._updateObjectCoords(this._objects[r],e)},_updateObjectCoords:function(e,r){var t=e.left,n=e.top,a=!0;e.set({left:t-r.x,top:n-r.y}),e.group=this,e.setCoords(a)},toString:function(){return"#"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),s.util.resetObjectTransform(this),e&&(r&&s.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),s.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var t=this._objects.length;if(this.useSetOnGroup)for(;t--;)this._objects[t].setOnGroup(e,r);if(e==="canvas")for(;t--;)this._objects[t]._set(e,r);s.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,t=this._objects.filter(function(a){return!a.excludeFromExport}).map(function(a){var i=a.includeDefaultValues;a.includeDefaultValues=r;var l=a.toObject(e);return a.includeDefaultValues=i,l}),n=s.Object.prototype.toObject.call(this,e);return n.objects=t,n},toDatalessObject:function(e){var r,t=this.sourcePath;if(t)r=t;else{var n=this.includeDefaultValues;r=this._objects.map(function(i){var l=i.includeDefaultValues;i.includeDefaultValues=n;var u=i.toDatalessObject(e);return i.includeDefaultValues=l,u})}var a=s.Object.prototype.toDatalessObject.call(this,e);return a.objects=r,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=s.Object.prototype.shouldCache.call(this);if(e){for(var r=0,t=this._objects.length;r -`],t=0,n=this._objects.length;t -`),r},getSvgStyles:function(){var e=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",r=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),r].join("")},toClipPathSVG:function(e){for(var r=[],t=0,n=this._objects.length;t"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(h,o,e){h.save(),h.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",h,o),e=e||{},typeof e.hasControls>"u"&&(e.hasControls=!1),e.forActiveSelection=!0;for(var r=0,t=this._objects.length;r -`,' -`,` -`),a=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(i='" image-rendering="optimizeSpeed'),o.push(" -`),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=[" -`],this.fill=u}return this.paintFirst!=="fill"?h=h.concat(e,o):h=h.concat(o,e),h},getSrc:function(h){var o=h?this._element:this._originalElement;return o?o.toDataURL?o.toDataURL():this.srcFromAttribute?o.getAttribute("src"):o.src:this.src||""},setSrc:function(h,o,e){return f.util.loadImage(h,function(r,t){this.setElement(r,e),this._setWidthHeight(),o&&o(this,t)},this,e&&e.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var h=this.resizeFilter,o=this.minimumScaleTrigger,e=this.getTotalObjectScaling(),r=e.scaleX,t=e.scaleY,n=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!h||r>o&&t>o){this._element=n,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,this._lastScaleY=t;return}f.filterBackend||(f.filterBackend=f.initFilterBackend());var a=f.util.createCanvasElement(),i=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=n.width,u=n.height;a.width=l,a.height=u,this._element=a,this._lastScaleX=h.scaleX=r,this._lastScaleY=h.scaleY=t,f.filterBackend.applyFilters([h],n,l,u,this._element,i),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(h){if(h=h||this.filters||[],h=h.filter(function(n){return n&&!n.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),h.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var o=this._originalElement,e=o.naturalWidth||o.width,r=o.naturalHeight||o.height;if(this._element===this._originalElement){var t=f.util.createCanvasElement();t.width=e,t.height=r,this._element=t,this._filteredEl=t}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,e,r),this._lastScaleX=1,this._lastScaleY=1;return f.filterBackend||(f.filterBackend=f.initFilterBackend()),f.filterBackend.applyFilters(h,this._originalElement,e,r,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(h),this._renderPaintInOrder(h)},drawCacheOnCanvas:function(h){f.util.setImageSmoothing(h,this.imageSmoothing),f.Object.prototype.drawCacheOnCanvas.call(this,h)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(h){var o=this._element;if(o){var e=this._filterScalingX,r=this._filterScalingY,t=this.width,n=this.height,a=Math.min,i=Math.max,l=i(this.cropX,0),u=i(this.cropY,0),d=o.naturalWidth||o.width,g=o.naturalHeight||o.height,p=l*e,v=u*r,_=a(t*e,d-p),T=a(n*r,g-v),A=-t/2,X=-n/2,W=a(t,d/e-l),N=a(n,g/r-u);o&&h.drawImage(o,p,v,_,T,A,X,W,N)}},_needsResize:function(){var h=this.getTotalObjectScaling();return h.scaleX!==this._lastScaleX||h.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(h,o){this.setElement(f.util.getById(h),o),f.util.addClass(this.getElement(),f.Image.CSS_CANVAS)},_initConfig:function(h){h||(h={}),this.setOptions(h),this._setWidthHeight(h)},_initFilters:function(h,o){h&&h.length?f.util.enlivenObjects(h,function(e){o&&o(e)},"fabric.Image.filters"):o&&o()},_setWidthHeight:function(h){h||(h={});var o=this.getElement();this.width=h.width||o.naturalWidth||o.width||0,this.height=h.height||o.naturalHeight||o.height||0},parsePreserveAspectRatioAttribute:function(){var h=f.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),o=this._element.width,e=this._element.height,r=1,t=1,n=0,a=0,i=0,l=0,u,d=this.width,g=this.height,p={width:d,height:g};return h&&(h.alignX!=="none"||h.alignY!=="none")?(h.meetOrSlice==="meet"&&(r=t=f.util.findScaleToFit(this._element,p),u=(d-o*r)/2,h.alignX==="Min"&&(n=-u),h.alignX==="Max"&&(n=u),u=(g-e*t)/2,h.alignY==="Min"&&(a=-u),h.alignY==="Max"&&(a=u)),h.meetOrSlice==="slice"&&(r=t=f.util.findScaleToCover(this._element,p),u=o-d/r,h.alignX==="Mid"&&(i=u/2),h.alignX==="Max"&&(i=u),u=e-g/t,h.alignY==="Mid"&&(l=u/2),h.alignY==="Max"&&(l=u),o=d/r,e=g/t)):(r=d/o,t=g/e),{width:o,height:e,scaleX:r,scaleY:t,offsetLeft:n,offsetTop:a,cropX:i,cropY:l}}}),f.Image.CSS_CANVAS="canvas-img",f.Image.prototype.getSvgSrc=f.Image.prototype.getSrc,f.Image.fromObject=function(h,o){var e=f.util.object.clone(h);f.util.loadImage(e.src,function(r,t){if(t){o&&o(null,!0);return}f.Image.prototype._initFilters.call(e,e.filters,function(n){e.filters=n||[],f.Image.prototype._initFilters.call(e,[e.resizeFilter],function(a){e.resizeFilter=a[0],f.util.enlivenObjectEnlivables(e,e,function(){var i=new f.Image(r,e);o(i,!1)})})})},null,e.crossOrigin)},f.Image.fromURL=function(h,o,e){f.util.loadImage(h,function(r,t){o&&o(new f.Image(r,e),t)},null,e&&e.crossOrigin)},f.Image.ATTRIBUTE_NAMES=f.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),f.Image.fromElement=function(h,o,e){var r=f.parseAttributes(h,f.Image.ATTRIBUTE_NAMES);f.Image.fromURL(r["xlink:href"],o,s(e?f.util.object.clone(e):{},r))}}(Z),f.util.object.extend(f.Object.prototype,{_getAngleValueForStraighten:function(){var c=this.angle%360;return c>0?Math.round((c-1)/90)*90:Math.round(c/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(c){c=c||{};var s=function(){},h=c.onComplete||s,o=c.onChange||s,e=this;return f.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(r){e.rotate(r),o()},onComplete:function(){e.setCoords(),h()}})}}),f.util.object.extend(f.StaticCanvas.prototype,{straightenObject:function(c){return c.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(c){return c.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function c(h,o){var e="precision "+o+` float; -void main(){}`,r=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(r,e),h.compileShader(r),!!h.getShaderParameter(r,h.COMPILE_STATUS)}f.isWebglSupported=function(h){if(f.isLikelyNode)return!1;h=h||f.WebglFilterBackend.prototype.tileSize;var o=document.createElement("canvas"),e=o.getContext("webgl")||o.getContext("experimental-webgl"),r=!1;if(e){f.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),r=f.maxTextureSize>=h;for(var t=["highp","mediump","lowp"],n=0;n<3;n++)if(c(e,t[n])){f.webGlPrecision=t[n];break}}return this.isSupported=r,r},f.WebglFilterBackend=s;function s(h){h&&h.tileSize&&(this.tileSize=h.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}s.prototype={tileSize:2048,resources:{},setupGLContext:function(h,o){this.dispose(),this.createWebGLCanvas(h,o),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(h,o)},chooseFastestCopyGLTo2DMethod:function(h,o){var e=typeof window.performance<"u",r;try{new ImageData(1,1),r=!0}catch{r=!1}var t=typeof ArrayBuffer<"u",n=typeof Uint8ClampedArray<"u";if(e&&r&&t&&n){var a=f.util.createCanvasElement(),i=new ArrayBuffer(h*o*4);if(f.forceGLPutImageData){this.imageBuffer=i,this.copyGLTo2D=gt;return}var l={imageBuffer:i,destinationWidth:h,destinationHeight:o,targetCanvas:a},u,d,g;a.width=h,a.height=o,u=window.performance.now(),ct.call(l,this.gl,l),d=window.performance.now()-u,u=window.performance.now(),gt.call(l,this.gl,l),g=window.performance.now()-u,d>g?(this.imageBuffer=i,this.copyGLTo2D=gt):this.copyGLTo2D=ct}},createWebGLCanvas:function(h,o){var e=f.util.createCanvasElement();e.width=h,e.height=o;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},t=e.getContext("webgl",r);t||(t=e.getContext("experimental-webgl",r)),t&&(t.clearColor(0,0,0,0),this.canvas=e,this.gl=t)},applyFilters:function(h,o,e,r,t,n){var a=this.gl,i;n&&(i=this.getCachedTexture(n,o));var l={originalWidth:o.width||o.originalWidth,originalHeight:o.height||o.originalHeight,sourceWidth:e,sourceHeight:r,destinationWidth:e,destinationHeight:r,context:a,sourceTexture:this.createTexture(a,e,r,!i&&o),targetTexture:this.createTexture(a,e,r),originalTexture:i||this.createTexture(a,e,r,!i&&o),passes:h.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:t},u=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,u),h.forEach(function(d){d&&d.applyTo(l)}),lt(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(u),t.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(h,o,e,r,t){var n=h.createTexture();return h.bindTexture(h.TEXTURE_2D,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,t||h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),r?h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,r):h.texImage2D(h.TEXTURE_2D,0,h.RGBA,o,e,0,h.RGBA,h.UNSIGNED_BYTE,null),n},getCachedTexture:function(h,o){if(this.textureCache[h])return this.textureCache[h];var e=this.createTexture(this.gl,o.width,o.height,o);return this.textureCache[h]=e,e},evictCachesForKey:function(h){this.textureCache[h]&&(this.gl.deleteTexture(this.textureCache[h]),delete this.textureCache[h])},copyGLTo2D:ct,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var h=this.gl,o={renderer:"",vendor:""};if(!h)return o;var e=h.getExtension("WEBGL_debug_renderer_info");if(e){var r=h.getParameter(e.UNMASKED_RENDERER_WEBGL),t=h.getParameter(e.UNMASKED_VENDOR_WEBGL);r&&(o.renderer=r.toLowerCase()),t&&(o.vendor=t.toLowerCase())}return this.gpuInfo=o,o}}}();function lt(c){var s=c.targetCanvas,h=s.width,o=s.height,e=c.destinationWidth,r=c.destinationHeight;(h!==e||o!==r)&&(s.width=e,s.height=r)}function ct(c,s){var h=c.canvas,o=s.targetCanvas,e=o.getContext("2d");e.translate(0,o.height),e.scale(1,-1);var r=h.height-o.height;e.drawImage(h,0,r,o.width,o.height,0,0,o.width,o.height)}function gt(c,s){var h=s.targetCanvas,o=h.getContext("2d"),e=s.destinationWidth,r=s.destinationHeight,t=e*r*4,n=new Uint8Array(this.imageBuffer,0,t),a=new Uint8ClampedArray(this.imageBuffer,0,t);c.readPixels(0,0,e,r,c.RGBA,c.UNSIGNED_BYTE,n);var i=new ImageData(a,e,r);o.putImageData(i,0,0)}(function(){var c=function(){};f.Canvas2dFilterBackend=s;function s(){}s.prototype={evictCachesForKey:c,dispose:c,clearWebGLCaches:c,resources:{},applyFilters:function(h,o,e,r,t){var n=t.getContext("2d");n.drawImage(o,0,0,e,r);var a=n.getImageData(0,0,e,r),i=n.getImageData(0,0,e,r),l={sourceWidth:e,sourceHeight:r,imageData:a,originalEl:o,originalImageData:i,canvasEl:t,ctx:n,filterBackend:this};return h.forEach(function(u){u.applyTo(l)}),(l.imageData.width!==e||l.imageData.height!==r)&&(t.width=l.imageData.width,t.height=l.imageData.height),n.putImageData(l.imageData,0,0),l}}})(),f.Image=f.Image||{},f.Image.filters=f.Image.filters||{},f.Image.filters.BaseFilter=f.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; -varying vec2 vTexCoord; -void main() { -vTexCoord = aPosition; -gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); -}`,fragmentSource:`precision highp float; -varying vec2 vTexCoord; -uniform sampler2D uTexture; -void main() { -gl_FragColor = texture2D(uTexture, vTexCoord); -}`,initialize:function(c){c&&this.setOptions(c)},setOptions:function(c){for(var s in c)this[s]=c[s]},createProgram:function(c,s,h){s=s||this.fragmentSource,h=h||this.vertexSource,f.webGlPrecision!=="highp"&&(s=s.replace(/precision highp float/g,"precision "+f.webGlPrecision+" float"));var o=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(o,h),c.compileShader(o),!c.getShaderParameter(o,c.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+c.getShaderInfoLog(o));var e=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(e,s),c.compileShader(e),!c.getShaderParameter(e,c.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+c.getShaderInfoLog(e));var r=c.createProgram();if(c.attachShader(r,o),c.attachShader(r,e),c.linkProgram(r),!c.getProgramParameter(r,c.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+c.getProgramInfoLog(r));var t=this.getAttributeLocations(c,r),n=this.getUniformLocations(c,r)||{};return n.uStepW=c.getUniformLocation(r,"uStepW"),n.uStepH=c.getUniformLocation(r,"uStepH"),{program:r,attributeLocations:t,uniformLocations:n}},getAttributeLocations:function(c,s){return{aPosition:c.getAttribLocation(s,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(c,s,h){var o=s.aPosition,e=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o),c.vertexAttribPointer(o,2,c.FLOAT,!1,0,0),c.bufferData(c.ARRAY_BUFFER,h,c.STATIC_DRAW)},_setupFrameBuffer:function(c){var s=c.context,h,o;c.passes>1?(h=c.destinationWidth,o=c.destinationHeight,(c.sourceWidth!==h||c.sourceHeight!==o)&&(s.deleteTexture(c.targetTexture),c.targetTexture=c.filterBackend.createTexture(s,h,o)),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,c.targetTexture,0)):(s.bindFramebuffer(s.FRAMEBUFFER,null),s.finish())},_swapTextures:function(c){c.passes--,c.pass++;var s=c.targetTexture;c.targetTexture=c.sourceTexture,c.sourceTexture=s},isNeutralState:function(){var c=this.mainParameter,s=f.Image.filters[this.type].prototype;if(c)if(Array.isArray(s[c])){for(var h=s[c].length;h--;)if(this[c][h]!==s[c][h])return!1;return!0}else return s[c]===this[c];else return!1},applyTo:function(c){c.webgl?(this._setupFrameBuffer(c),this.applyToWebGL(c),this._swapTextures(c)):this.applyTo2d(c)},retrieveShader:function(c){return c.programCache.hasOwnProperty(this.type)||(c.programCache[this.type]=this.createProgram(c.context)),c.programCache[this.type]},applyToWebGL:function(c){var s=c.context,h=this.retrieveShader(c);c.pass===0&&c.originalTexture?s.bindTexture(s.TEXTURE_2D,c.originalTexture):s.bindTexture(s.TEXTURE_2D,c.sourceTexture),s.useProgram(h.program),this.sendAttributeData(s,h.attributeLocations,c.aPosition),s.uniform1f(h.uniformLocations.uStepW,1/c.sourceWidth),s.uniform1f(h.uniformLocations.uStepH,1/c.sourceHeight),this.sendUniformData(s,h.uniformLocations),s.viewport(0,0,c.destinationWidth,c.destinationHeight),s.drawArrays(s.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(c,s,h){c.activeTexture(h),c.bindTexture(c.TEXTURE_2D,s),c.activeTexture(c.TEXTURE0)},unbindAdditionalTexture:function(c,s){c.activeTexture(s),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(c){this[this.mainParameter]=c},sendUniformData:function(){},createHelpLayer:function(c){if(!c.helpLayer){var s=document.createElement("canvas");s.width=c.sourceWidth,s.height=c.sourceHeight,c.helpLayer=s}},toObject:function(){var c={type:this.type},s=this.mainParameter;return s&&(c[s]=this[s]),c},toJSON:function(){return this.toObject()}}),f.Image.filters.BaseFilter.fromObject=function(c,s){var h=new f.Image.filters[c.type](c);return s&&s(h),h},function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.ColorMatrix=o(h.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -varying vec2 vTexCoord; -uniform mat4 uColorMatrix; -uniform vec4 uConstants; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -color *= uColorMatrix; -color += uConstants; -gl_FragColor = color; -}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a=this.matrix,i,l,u,d,g,p=this.colorsOnly;for(g=0;g=d||N<0||N>=u)&&(U=(V*u+N)*4,G=a[m*i+K],_+=n[U]*G,T+=n[U+1]*G,A+=n[U+2]*G,v||(X+=n[U+3]*G));p[W]=_,p[W+1]=T,p[W+2]=A,v?p[W+3]=n[W+3]:p[W+3]=X}r.imageData=g},getUniformLocations:function(r,t){return{uMatrix:r.getUniformLocation(t,"uMatrix"),uOpaque:r.getUniformLocation(t,"uOpaque"),uHalfSize:r.getUniformLocation(t,"uHalfSize"),uSize:r.getUniformLocation(t,"uSize")}},sendUniformData:function(r,t){r.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return h(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),s.Image.filters.Convolute.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Grayscale=o(h.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; -uniform sampler2D uTexture; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -float average = (color.r + color.b + color.g) / 3.0; -gl_FragColor = vec4(average, average, average, color.a); -}`,lightness:`precision highp float; -uniform sampler2D uTexture; -uniform int uMode; -varying vec2 vTexCoord; -void main() { -vec4 col = texture2D(uTexture, vTexCoord); -float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0; -gl_FragColor = vec4(average, average, average, col.a); -}`,luminosity:`precision highp float; -uniform sampler2D uTexture; -uniform int uMode; -varying vec2 vTexCoord; -void main() { -vec4 col = texture2D(uTexture, vTexCoord); -float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; -gl_FragColor = vec4(average, average, average, col.a); -}`},mode:"average",mainParameter:"mode",applyTo2d:function(e){var r=e.imageData,t=r.data,n,a=t.length,i,l=this.mode;for(n=0;np[0]&&u>p[1]&&d>p[2]&&l 0.0) { -`+this.fragmentSource[e]+`} -}`},retrieveShader:function(e){var r=this.type+"_"+this.mode,t;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r=e.imageData,t=r.data,n=t.length,a,i,l,u,d,g,p,v=1-this.alpha;p=new s.Color(this.color).getSource(),a=p[0]*this.alpha,i=p[1]*this.alpha,l=p[2]*this.alpha;for(var _=0;_=u||d<=-u)return 0;if(d<11920929e-14&&d>-11920929e-14)return 1;d*=Math.PI;var g=d/u;return n(d)/d*n(g)/g}},applyTo2d:function(u){var d=u.imageData,g=this.scaleX,p=this.scaleY;this.rcpScaleX=1/g,this.rcpScaleY=1/p;var v=d.width,_=d.height,T=t(v*g),A=t(_*p),X;this.resizeType==="sliceHack"?X=this.sliceByTwo(u,v,_,T,A):this.resizeType==="hermite"?X=this.hermiteFastResize(u,v,_,T,A):this.resizeType==="bilinear"?X=this.bilinearFiltering(u,v,_,T,A):this.resizeType==="lanczos"&&(X=this.lanczosResize(u,v,_,T,A)),u.imageData=X},sliceByTwo:function(u,d,g,p,v){var _=u.imageData,T=.5,A=!1,X=!1,W=d*T,N=g*T,V=s.filterBackend.resources,U,G,q=0,J=0,K=d,m=0;for(V.sliceByTwo||(V.sliceByTwo=document.createElement("canvas")),U=V.sliceByTwo,(U.width=d)){Y=o(1e3*r(P-m.x)),K[Y]||(K[Y]={});for(var j=C.y-J;j<=C.y+J;j++)j<0||j>=g||(z=o(1e3*r(j-m.y)),K[Y][z]||(K[Y][z]=W(e(h(Y*U,2)+h(z*G,2))/1e3)),x=K[Y][z],x>0&&(y=(j*d+P)*4,w+=x,k+=x*T[y],M+=x*T[y+1],E+=x*T[y+2],R+=x*T[y+3]))}y=(b*p+S)*4,X[y]=k/w,X[y+1]=M/w,X[y+2]=E/w,X[y+3]=R/w}return++S1&&z<-1||(K=2*z*z*z-3*z*z+1,K>0&&(Y=4*(R+w*d),x+=K*N[Y+3],C+=K,N[Y+3]<255&&(K=K*N[Y+3]/250),S+=K*N[Y],b+=K*N[Y+1],P+=K*N[Y+2],m+=K))}U[J]=S/m,U[J+1]=b/m,U[J+2]=P/m,U[J+3]=x/C}return V},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),s.Image.filters.Resize.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Contrast=o(h.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -uniform float uContrast; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); -color.rgb = contrastF * (color.rgb - 0.5) + 0.5; -gl_FragColor = color; -}`,contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(this.contrast!==0){var r=e.imageData,t,a,n=r.data,a=n.length,i=Math.floor(this.contrast*255),l=259*(i+255)/(255*(259-i));for(t=0;t1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?r[0]=t:r[1]=t,r}}),h.Blur.fromObject=s.Image.filters.BaseFilter.fromObject}(Z),function(c){var s=c.fabric||(c.fabric={}),h=s.Image.filters,o=s.util.createClass;h.Gamma=o(h.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; -uniform sampler2D uTexture; -uniform vec3 uGamma; -varying vec2 vTexCoord; -void main() { -vec4 color = texture2D(uTexture, vTexCoord); -vec3 correction = (1.0 / uGamma); -color.r = pow(color.r, correction.r); -color.g = pow(color.g, correction.g); -color.b = pow(color.b, correction.b); -gl_FragColor = color; -gl_FragColor.rgb *= color.a; -}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],h.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var r=e.imageData,t=r.data,n=this.gamma,a=t.length,i=1/n[0],l=1/n[1],u=1/n[2],d;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),d=0,a=256;d'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),r=this.fontSize;return e.width+=r*e.zoomX,e.height+=r*e.zoomY,e},_render:function(e){var r=this.path;r&&!r.isNotVisible()&&r._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){this.paintFirst==="stroke"?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,r,t){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom";break}e.font=this._getFontDeclaration(r,t)},calcTextWidth:function(){for(var e=this.getLineWidth(0),r=1,t=this._textLines.length;re&&(e=n)}return e},_renderTextLine:function(e,r,t,n,a,i){this._renderChars(e,r,t,n,a,i)},_renderTextLinesBackground:function(e){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var r,t,n=e.fillStyle,a,i,l=this._getLeftOffset(),u=this._getTopOffset(),d=0,g=0,p,v,_=this.path,T,A=0,X=this._textLines.length;A=0:tv?g%=v:g<0&&(g+=v),this._setGraphemeOnPath(g,l,p),g+=l.kernedWidth}return{width:r,numOfSpaces:u}},_setGraphemeOnPath:function(e,r,t){var n=e+r.kernedWidth/2,a=this.path,i=s.util.getPointOnPath(a.path,n,a.segmentsInfo);r.renderLeft=i.x-t.x,r.renderTop=i.y-t.y,r.angle=i.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(e,r,t,n,a){var i=this.getCompleteStyleDeclaration(r,t),l=n?this.getCompleteStyleDeclaration(r,t-1):{},u=this._measureChar(e,i,n,l),d=u.kernedWidth,g=u.width,p;this.charSpacing!==0&&(p=this._getWidthOfCharSpacing(),g+=p,d+=p);var v={width:g,left:0,height:i.fontSize,kernedWidth:d,deltaY:i.deltaY};if(t>0&&!a){var _=this.__charBounds[r][t-1];v.left=_.left+_.width+u.kernedWidth-u.width}return v},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var r=this._textLines[e],t=this.getHeightOfChar(e,0),n=1,a=r.length;n0){var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),g&&U&&(e.fillStyle=U,e.fillRect(b,_+J*n+l,A,this.fontSize/15)),T=X.left,A=X.width,g=W,U=V,n=a,l=u}else A+=X.kernedWidth;var b=p+i+T;this.direction==="rtl"&&(b=this.width-b-A),e.fillStyle=V,W&&V&&e.fillRect(b,_+J*n+l,A-q,this.fontSize/15),v+=t}this._removeShadow(e)}},_getFontDeclaration:function(e,r){var t=e||this,n=this.fontFamily,a=s.Text.genericFonts.indexOf(n.toLowerCase())>-1,i=n===void 0||n.indexOf("'")>-1||n.indexOf(",")>-1||n.indexOf('"')>-1||a?t.fontFamily:'"'+t.fontFamily+'"';return[s.isLikelyNode?t.fontWeight:t.fontStyle,s.isLikelyNode?t.fontStyle:t.fontWeight,r?this.CACHE_FONT_SIZE+"px":t.fontSize+"px",i].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),t=new Array(r.length),n=[` -`],a=[],i=0;i"u"?this.styles:{line:this.styles[c]};for(var h in s)for(var o in s[h])for(var e in s[h][o])return!1;return!0},styleHas:function(c,s){if(!this.styles||!c||c===""||typeof s<"u"&&!this.styles[s])return!1;var h=typeof s>"u"?this.styles:{0:this.styles[s]};for(var o in h)for(var e in h[o])if(typeof h[o][e][c]<"u")return!0;return!1},cleanStyle:function(c){if(!this.styles||!c||c==="")return!1;var s=this.styles,h=0,o,e,r=!0,t=0,n;for(var a in s){o=0;for(var i in s[a]){var n=s[a][i],l=n.hasOwnProperty(c);h++,l?(e?n[c]!==e&&(r=!1):e=n[c],n[c]===this[c]&&delete n[c]):r=!1,Object.keys(n).length!==0?o++:delete s[a][i]}o===0&&delete s[a]}for(var u=0;u"u"&&(c=this.selectionStart);for(var h=s?this._unwrappedTextLines:this._textLines,o=h.length,e=0;e"u"&&(c=this.selectionStart||0),typeof s>"u"&&(s=this.selectionEnd||c);for(var o=[],e=c;e"u"&&(s=this.selectionStart||0),typeof h>"u"&&(h=this.selectionEnd||s);for(var o=s;o"u"?this[e]:h[e];return o},_setStyleDeclaration:function(c,s,h){this.styles[c][s]=h},_deleteStyleDeclaration:function(c,s){delete this.styles[c][s]},_getLineStyle:function(c){return!!this.styles[c]},_setLineStyle:function(c){this.styles[c]={}},_deleteLineStyle:function(c){delete this.styles[c]}})}(),function(){function c(s){s.textDecoration&&(s.textDecoration.indexOf("underline")>-1&&(s.underline=!0),s.textDecoration.indexOf("line-through")>-1&&(s.linethrough=!0),s.textDecoration.indexOf("overline")>-1&&(s.overline=!0),delete s.textDecoration)}f.IText=f.util.createClass(f.Text,f.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(s,h){this.callSuper("initialize",s,h),this.initBehavior()},setSelectionStart:function(s){s=Math.max(s,0),this._updateAndFire("selectionStart",s)},setSelectionEnd:function(s){s=Math.min(s,this.text.length),this._updateAndFire("selectionEnd",s)},_updateAndFire:function(s,h){this[s]!==h&&(this._fireSelectionChanged(),this[s]=h),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(s){this.clearContextTop(),this.callSuper("render",s),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(s){this.callSuper("_render",s)},clearContextTop:function(s){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var h=this.canvas.contextTop,o=this.canvas.viewportTransform;h.save(),h.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this.transform(h),this._clearTextArea(h),s||h.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var s=this._getCursorBoundaries(),h=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(s,h):this.renderSelection(s,h),h.restore()}},_clearTextArea:function(s){var h=this.width+4,o=this.height+4;s.clearRect(-h/2,-o/2,h,o)},_getCursorBoundaries:function(s){typeof s>"u"&&(s=this.selectionStart);var h=this._getLeftOffset(),o=this._getTopOffset(),e=this._getCursorBoundariesOffsets(s);return{left:h,top:o,leftOffset:e.left,topOffset:e.top}},_getCursorBoundariesOffsets:function(s){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var h,o,e,r=0,t=0,n,a=this.get2DCursorLocation(s);e=a.charIndex,o=a.lineIndex;for(var i=0;i0?t:0)},this.direction==="rtl"&&(n.left*=-1),this.cursorOffsetCache=n,this.cursorOffsetCache},renderCursor:function(s,h){var o=this.get2DCursorLocation(),e=o.lineIndex,r=o.charIndex>0?o.charIndex-1:0,t=this.getValueOfPropertyAt(e,r,"fontSize"),n=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/n,i=s.topOffset,l=this.getValueOfPropertyAt(e,r,"deltaY");i+=(1-this._fontSizeFraction)*this.getHeightOfLine(e)/this.lineHeight-t*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(s,h),h.fillStyle=this.cursorColor||this.getValueOfPropertyAt(e,r,"fill"),h.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,h.fillRect(s.left+s.leftOffset-a/2,i+s.top+l,a,t)},renderSelection:function(s,h){for(var o=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,e=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=this.textAlign.indexOf("justify")!==-1,t=this.get2DCursorLocation(o),n=this.get2DCursorLocation(e),a=t.lineIndex,i=n.lineIndex,l=t.charIndex<0?0:t.charIndex,u=n.charIndex<0?0:n.charIndex,d=a;d<=i;d++){var g=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),v=0,_=0,T=0;if(d===a&&(_=this.__charBounds[a][l].left),d>=a&&d1)&&(p/=this.lineHeight);var X=s.left+g+_,W=T-_,N=p,V=0;this.inCompositionMode?(h.fillStyle=this.compositionColor||"black",N=1,V=p):h.fillStyle=this.selectionColor,this.direction==="rtl"&&(X=this.width-X-W),h.fillRect(X,s.top+s.topOffset+V,W,N),s.topOffset+=v}},getCurrentCharFontSize:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fontSize")},getCurrentCharColor:function(){var s=this._getCurrentCharIndex();return this.getValueOfPropertyAt(s.l,s.c,"fill")},_getCurrentCharIndex:function(){var s=this.get2DCursorLocation(this.selectionStart,!0),h=s.charIndex>0?s.charIndex-1:0;return{l:s.lineIndex,c:h}}}),f.IText.fromObject=function(s,h){var o=f.util.stylesFromArray(s.styles,s.text),e=Object.assign({},s,{styles:o});if(c(e),e.styles)for(var r in e.styles)for(var t in e.styles[r])c(e.styles[r][t]);f.Object._fromObject("IText",e,h,"text")}}(),function(){var c=f.util.object.clone;f.util.object.extend(f.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var s=this;this.on("added",function(){var h=s.canvas;h&&(h._hasITextHandlers||(h._hasITextHandlers=!0,s._initCanvasHandlers(h)),h._iTextInstances=h._iTextInstances||[],h._iTextInstances.push(s))})},initRemovedHandler:function(){var s=this;this.on("removed",function(){var h=s.canvas;h&&(h._iTextInstances=h._iTextInstances||[],f.util.removeFromArray(h._iTextInstances,s),h._iTextInstances.length===0&&(h._hasITextHandlers=!1,s._removeCanvasHandlers(h)))})},_initCanvasHandlers:function(s){s._mouseUpITextHandler=function(){s._iTextInstances&&s._iTextInstances.forEach(function(h){h.__isMousedown=!1})},s.on("mouse:up",s._mouseUpITextHandler)},_removeCanvasHandlers:function(s){s.off("mouse:up",s._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(s,h,o,e){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},s.animate("_currentCursorOpacity",h,{duration:o,onComplete:function(){r.isAborted||s[e]()},onChange:function(){s.canvas&&s.selectionStart===s.selectionEnd&&s.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var s=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){s._currentTickCompleteState=s._animateCursor(s,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(s){var h=this,o=s?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){h._tick()},o)},abortCursorAnimation:function(){var s=this._currentTickState||this._currentTickCompleteState,h=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,s&&h&&h.clearContext(h.contextTop||h.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(s){var h=0,o=s-1;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o--;for(;/\S/.test(this._text[o])&&o>-1;)h++,o--;return s-h},findWordBoundaryRight:function(s){var h=0,o=s;if(this._reSpace.test(this._text[o]))for(;this._reSpace.test(this._text[o]);)h++,o++;for(;/\S/.test(this._text[o])&&o-1;)h++,o--;return s-h},findLineBoundaryRight:function(s){for(var h=0,o=s;!/\n/.test(this._text[o])&&o0&&ethis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=h):(this.selectionStart=h,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==o||this.selectionEnd!==e)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(s,h,o){var e=o.slice(0,s),r=f.util.string.graphemeSplit(e).length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=f.util.string.graphemeSplit(t).length;return{selectionStart:r,selectionEnd:r+n}},fromGraphemeToStringSelection:function(s,h,o){var e=o.slice(0,s),r=e.join("").length;if(s===h)return{selectionStart:r,selectionEnd:r};var t=o.slice(s,h),n=t.join("").length;return{selectionStart:r,selectionEnd:r+n}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var s=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=s.selectionStart,this.hiddenTextarea.selectionEnd=s.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var s=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=s.selectionEnd,this.inCompositionMode||(this.selectionStart=s.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var s=this._calcTextareaPosition();this.hiddenTextarea.style.left=s.left,this.hiddenTextarea.style.top=s.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var s=this.inCompositionMode?this.compositionStart:this.selectionStart,h=this._getCursorBoundaries(s),o=this.get2DCursorLocation(s),e=o.lineIndex,r=o.charIndex,t=this.getValueOfPropertyAt(e,r,"fontSize")*this.lineHeight,n=h.leftOffset,a=this.calcTransformMatrix(),i={x:h.left+n,y:h.top+h.topOffset+t},l=this.canvas.getRetinaScaling(),u=this.canvas.upperCanvasEl,d=u.width/l,g=u.height/l,p=d-t,v=g-t,_=u.clientWidth/d,T=u.clientHeight/g;return i=f.util.transformPoint(i,a),i=f.util.transformPoint(i,this.canvas.viewportTransform),i.x*=_,i.y*=T,i.x<0&&(i.x=0),i.x>p&&(i.x=p),i.y<0&&(i.y=0),i.y>v&&(i.y=v),i.x+=this.canvas._offset.left,i.y+=this.canvas._offset.top,{left:i.x+"px",top:i.y+"px",fontSize:t+"px",charHeight:t}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var s=this._textBeforeEdit!==this.text,h=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,h&&(h.blur&&h.blur(),h.parentNode&&h.parentNode.removeChild(h)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),s&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),s&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var s in this.styles)this._textLines[s]||delete this.styles[s]},removeStyleFromTo:function(s,h){var o=this.get2DCursorLocation(s,!0),e=this.get2DCursorLocation(h,!0),r=o.lineIndex,t=o.charIndex,n=e.lineIndex,a=e.charIndex,i,l;if(r!==n){if(this.styles[r])for(i=t;i=a&&(l[d-u]=l[g],delete l[g])}},shiftLineStyles:function(s,h){var o=c(this.styles);for(var e in this.styles){var r=parseInt(e,10);r>s&&(this.styles[r+h]=o[r],o[r-h]||delete this.styles[r])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(s,h,o,e){var r,t={},n=!1,a=this._unwrappedTextLines[s].length===h;o||(o=1),this.shiftLineStyles(s,o),this.styles[s]&&(r=this.styles[s][h===0?h:h-1]);for(var i in this.styles[s]){var l=parseInt(i,10);l>=h&&(n=!0,t[l-h]=this.styles[s][i],a&&h===0||delete this.styles[s][i])}var u=!1;for(n&&!a&&(this.styles[s+o]=t,u=!0),u&&o--;o>0;)e&&e[o-1]?this.styles[s+o]={0:c(e[o-1])}:r?this.styles[s+o]={0:c(r)}:delete this.styles[s+o],o--;this._forceClearCache=!0},insertCharStyleObject:function(s,h,o,e){this.styles||(this.styles={});var r=this.styles[s],t=r?c(r):{};o||(o=1);for(var n in t){var a=parseInt(n,10);a>=h&&(r[a+o]=t[a],t[a-o]||delete r[a])}if(this._forceClearCache=!0,e){for(;o--;)Object.keys(e[o]).length&&(this.styles[s]||(this.styles[s]={}),this.styles[s][h+o]=c(e[o]));return}if(r)for(var i=r[h?h-1:1];i&&o--;)this.styles[s][h+o]=c(i)},insertNewStyleBlock:function(s,h,o){for(var e=this.get2DCursorLocation(h,!0),r=[0],t=0,n=0;n0&&(this.insertCharStyleObject(e.lineIndex,e.charIndex,r[0],o),o=o&&o.slice(r[0]+1)),t&&this.insertNewlineStyleObject(e.lineIndex,e.charIndex+r[0],t);for(var n=1;n0?this.insertCharStyleObject(e.lineIndex+n,0,r[n],o):o&&this.styles[e.lineIndex+n]&&o[0]&&(this.styles[e.lineIndex+n][0]=o[0]),o=o&&o.slice(r[n]+1);r[n]>0&&this.insertCharStyleObject(e.lineIndex+n,0,r[n],o)},setSelectionStartEndWithShift:function(s,h,o){o<=s?(h===s?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=s),this.selectionStart=o):o>s&&os?this.selectionStart=s:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>s?this.selectionEnd=s:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),f.util.object.extend(f.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(c){if(this.canvas){this.__newClickTime=+new Date;var s=c.pointer;this.isTripleClick(s)&&(this.fire("tripleclick",c),this._stopEvent(c.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=s,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(c){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===c.x&&this.__lastPointer.y===c.y},_stopEvent:function(c){c.preventDefault&&c.preventDefault(),c.stopPropagation&&c.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(c){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(c.e))},tripleClickHandler:function(c){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(c.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(c.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(c){!this.canvas||!this.editable||c.e.button&&c.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(c){if(this.__isMousedown=!1,!(!this.editable||this.group||c.transform&&c.transform.actionPerformed||c.e.button&&c.e.button!==1)){if(this.canvas){var s=this.canvas._activeObject;if(s&&s!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(c.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(c){var s=this.getSelectionStartFromPointer(c),h=this.selectionStart,o=this.selectionEnd;c.shiftKey?this.setSelectionStartEndWithShift(h,o,s):(this.selectionStart=s,this.selectionEnd=s),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(c){for(var s=this.getLocalPointer(c),h=0,o=0,e=0,r=0,t=0,n,a,i=0,l=this._textLines.length;i0&&(r+=this._textLines[i-1].length+this.missingNewlineOffset(i-1));n=this._getLineLeftOffset(t),o=n*this.scaleX,a=this._textLines[t],this.direction==="rtl"&&(s.x=this.width*this.scaleX-s.x+o);for(var u=0,d=a.length;ur||t<0?0:1,a=o+n;return this.flipX&&(a=e-a),a>this._text.length&&(a=this._text.length),a}}),f.util.object.extend(f.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=f.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var c=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+c.top+"; left: "+c.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+c.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):f.document.body.appendChild(this.hiddenTextarea),f.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),f.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),f.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),f.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),f.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),f.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(f.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(c){if(this.isEditing){var s=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(c.keyCode in s)this[s[c.keyCode]](c);else if(c.keyCode in this.ctrlKeysMapDown&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapDown[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),c.keyCode>=33&&c.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(c){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(c.keyCode in this.ctrlKeysMapUp&&(c.ctrlKey||c.metaKey))this[this.ctrlKeysMapUp[c.keyCode]](c);else return;c.stopImmediatePropagation(),c.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(c){var s=this.fromPaste;if(this.fromPaste=!1,c&&c.stopPropagation(),!!this.isEditing){var h=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,o=this._text.length,e=h.length,r,t,n=e-o,a=this.selectionStart,i=this.selectionEnd,l=a!==i,u,d,g;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var p=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=a>p.selectionStart;l?(r=this._text.slice(a,i),n+=i-a):e0&&(o=this.__charBounds[c][s-1],h+=o.left+o.width),h},getDownCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===this._textLines.length-1||c.metaKey||c.keyCode===34)return this._text.length-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e+1,t),a=this._textLines[e].slice(r);return a.length+n+1+this.missingNewlineOffset(e)},_getSelectionForOffset:function(c,s){return c.shiftKey&&this.selectionStart!==this.selectionEnd&&s?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(c,s){var h=this._getSelectionForOffset(c,s),o=this.get2DCursorLocation(h),e=o.lineIndex;if(e===0||c.metaKey||c.keyCode===33)return-h;var r=o.charIndex,t=this._getWidthBeforeCursor(e,r),n=this._getIndexOnLine(e-1,t),a=this._textLines[e].slice(0,r),i=this.missingNewlineOffset(e-1);return-this._textLines[e-1].length+n-a.length+(1-i)},_getIndexOnLine:function(c,s){for(var h=this._textLines[c],o=this._getLineLeftOffset(c),e=o,r=0,t,n,a=0,i=h.length;as){n=!0;var l=e-t,u=e,d=Math.abs(l-s),g=Math.abs(u-s);r=g=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",c)},moveCursorUp:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",c)},_moveCursorUpOrDown:function(c,s){var h="get"+c+"CursorOffset",o=this[h](s,this._selectionDirection==="right");s.shiftKey?this.moveCursorWithShift(o):this.moveCursorWithoutShift(o),o!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(c){var s=this._selectionDirection==="left"?this.selectionStart+c:this.selectionEnd+c;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,s),c!==0},moveCursorWithoutShift:function(c){return c<0?(this.selectionStart+=c,this.selectionEnd=this.selectionStart):(this.selectionEnd+=c,this.selectionStart=this.selectionEnd),c!==0},moveCursorLeft:function(c){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",c)},_move:function(c,s,h){var o;if(c.altKey)o=this["findWordBoundary"+h](this[s]);else if(c.metaKey||c.keyCode===35||c.keyCode===36)o=this["findLineBoundary"+h](this[s]);else return this[s]+=h==="Left"?-1:1,!0;if(typeof o<"u"&&this[s]!==o)return this[s]=o,!0},_moveLeft:function(c,s){return this._move(c,s,"Left")},_moveRight:function(c,s){return this._move(c,s,"Right")},moveCursorLeftWithoutShift:function(c){var s=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(s=this._moveLeft(c,"selectionStart")),this.selectionEnd=this.selectionStart,s},moveCursorLeftWithShift:function(c){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(c,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(c,"selectionStart")},moveCursorRight:function(c){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",c)},_moveCursorLeftOrRight:function(c,s){var h="moveCursor"+c+"With";this._currentCursorOpacity=1,s.shiftKey?h+="Shift":h+="outShift",this[h](s)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(c){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(c,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(c,"selectionEnd")},moveCursorRightWithoutShift:function(c){var s=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(s=this._moveRight(c,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,s},removeChars:function(c,s){typeof s>"u"&&(s=c+1),this.removeStyleFromTo(c,s),this._text.splice(c,s-c),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(c,s,h,o){typeof o>"u"&&(o=h),o>h&&this.removeStyleFromTo(h,o);var e=f.util.string.graphemeSplit(c);this.insertNewStyleBlock(e,h,s),this._text=[].concat(this._text.slice(0,h),e,this._text.slice(o)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var c=f.util.toFixed,s=/ +/g;f.util.object.extend(f.Text.prototype,{_toSVG:function(){var h=this._getSVGLeftTopOffsets(),o=this._getSVGTextAndBg(h.textTop,h.textLeft);return this._wrapSVGTextAndBg(o)},toSVG:function(h){return this._createBaseSVGMarkup(this._toSVG(),{reviver:h,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(h){var o=!0,e=this.getSvgTextDecoration(this);return[h.textBgRects.join(""),' ",h.textSpans.join(""),` -`]},_getSVGTextAndBg:function(h,o){var e=[],r=[],t=h,n;this._setSVGBg(r);for(var a=0,i=this._textLines.length;a",f.util.string.escapeXml(h),""].join("")},_setSVGTextLineText:function(h,o,e,r){var t=this.getHeightOfLine(o),n=this.textAlign.indexOf("justify")!==-1,a,i,l="",u,d,g=0,p=this._textLines[o],v;r+=t*(1-this._fontSizeFraction)/this.lineHeight;for(var _=0,T=p.length-1;_<=T;_++)v=_===T||this.charSpacing,l+=p[_],u=this.__charBounds[o][_],g===0?(e+=u.kernedWidth-u.width,g+=u.width):g+=u.kernedWidth,n&&!v&&this._reSpaceAndTab.test(p[_])&&(v=!0),v||(a=a||this.getCompleteStyleDeclaration(o,_),i=this.getCompleteStyleDeclaration(o,_+1),v=f.util.hasStyleChanged(a,i,!0)),v&&(d=this._getStyleDeclaration(o,_)||{},h.push(this._createTextCharSpan(l,d,e,r)),l="",a=i,e+=g,g=0)},_pushTextBgRect:function(h,o,e,r,t,n){var a=f.Object.NUM_FRACTION_DIGITS;h.push(" -`)},_setSVGTextLineBg:function(h,o,e,r){for(var t=this._textLines[o],n=this.getHeightOfLine(o)/this.lineHeight,a=0,i=0,l,u,d=this.getValueOfPropertyAt(o,0,"textBackgroundColor"),g=0,p=t.length;gthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(h){for(var o=0,e=0,r=0,t={},n=0;n0?(e=0,r++,o++):!this.splitByGrapheme&&this._reSpaceAndTab.test(h.graphemeText[r])&&n>0&&(e++,r++),t[n]={line:o,offset:e},r+=h.graphemeLines[n].length,e+=h.graphemeLines[n].length;return t},styleHas:function(h,o){if(this._styleMap&&!this.isWrapping){var e=this._styleMap[o];e&&(o=e.line)}return s.Text.prototype.styleHas.call(this,h,o)},isEmptyStyles:function(h){if(!this.styles)return!0;var o=0,e=h+1,r,t,n=!1,a=this._styleMap[h],i=this._styleMap[h+1];a&&(h=a.line,o=a.offset),i&&(e=i.line,n=e===h,r=i.offset),t=typeof h>"u"?this.styles:{line:this.styles[h]};for(var l in t)for(var u in t[l])if(u>=o&&(!n||ue&&!T?(a.push(i),i=[],t=p,T=!0):t+=A,!T&&!n&&i.push(g),i=i.concat(u),v=n?0:this._measureWord([g],o,d),d++,T=!1,p>_&&(_=p);return W&&a.push(i),_+X>this.dynamicMinWidth&&(this.dynamicMinWidth=_-A+X),a},isEndOfWrapping:function(h){return!this._styleMap[h+1]||this._styleMap[h+1].line!==this._styleMap[h].line},missingNewlineOffset:function(h){return this.splitByGrapheme?this.isEndOfWrapping(h)?1:0:1},_splitTextIntoLines:function(h){for(var o=s.Text.prototype._splitTextIntoLines.call(this,h),e=this._wrapText(o.lines,this.width),r=new Array(e.length),t=0;tun.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?Y(n):E(n):e?U(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function W(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function Y(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=Y:e?s=E:o&&(s=U);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function R(n,r){return n&&r?bn:n?yn:r?pn:W}function Mn(n,r,e,o,s){const t=R(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new T,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=R(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?X(s,e,o):null});return n}function X(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;aun.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?Y(n):E(n):e?U(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function W(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function Y(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=Y:e?s=E:o&&(s=U);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function R(n,r){return n&&r?bn:n?yn:r?pn:W}function Mn(n,r,e,o,s){const t=R(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new T,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=R(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?X(s,e,o):null});return n}function X(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;an.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:s}of t){const{isTable:o,layerId:n}=s;o?r.push(n):a.push(n)}d(e.layers,a),d(e.tables,r)}function d(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,s)=>{const o=t.indexOf(r.id),n=t.indexOf(s.id);return on?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:s,apiKey:o}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:s,apiKey:o}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(o,n)=>o.id===n.id);e=e.filter(o=>!r.removed.some(n=>n.id===o.id));const s=r.added;return s.forEach(({id:o})=>{e.push({id:o})}),{itemResources:e,added:s.filter(({id:o})=>!a.includes(o))}}async function U(e,t,a,r){const s=await V(t),o=t.map(({id:n,type:i})=>new(s.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(o.map(n=>n.load())),o.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:s})=>{const o=g(s),n=D[o];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:s},o)=>{r.set(s,a[o])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:s,fullExtent:o,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=s,t.extent=null,n||o==null||(t.extent=await J(o)),m(t,l.METADATA),m(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function ue(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ye(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,s)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{ue as save,ye as saveAs}; diff --git a/custom-toc-separator/assets/featureLayerUtils-BlPdhYbm-DxeKRxzI.js b/custom-toc-separator/assets/featureLayerUtils-BlPdhYbm-DxeKRxzI.js deleted file mode 100644 index 5724a798..00000000 --- a/custom-toc-separator/assets/featureLayerUtils-BlPdhYbm-DxeKRxzI.js +++ /dev/null @@ -1 +0,0 @@ -import{jc as P,hq as w,ao as $}from"./story-OUarUCIt.js";import{C as N,D as O}from"./utils-BVWK2jiA-Bnz0n_UG.js";import{i as R}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{d as x,p as D,g}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import{S as J,l as m,u as M,L as f,E as l}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./main-lj2zzr_L.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";const T="Feature Service",A="feature-layer-utils",Y=`${A}-save`,_=`${A}-save-as`;function h(e){return{isValid:P(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function b(e){const t=[],a=[];for(const{layer:r,layerJSON:s}of e)r.isTable?a.push(s):t.push(s);return{layers:t,tables:a}}function L(e){return b([e])}async function F(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):G(t,e)}async function G(e,t){if(e.reverse(),!t)return b(e);const a=await K(t,e);for(const r of e)v(r.layer,r.layerJSON,a);return q(a,e),a}async function K(e,t){let a=await e.fetchData("json");if(j(a))return a;a||={},C(a);const{layer:{url:r,customParameters:s,apiKey:o}}=t[0];return await B(a,{url:r??"",customParameters:s,apiKey:o},t.map(n=>n.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:s}of t){const{isTable:o,layerId:n}=s;o?r.push(n):a.push(n)}d(e.layers,a),d(e.tables,r)}function d(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,s)=>{const o=t.indexOf(r.id),n=t.indexOf(s.id);return on?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:s,apiKey:o}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:s,apiKey:o}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(o,n)=>o.id===n.id);e=e.filter(o=>!r.removed.some(n=>n.id===o.id));const s=r.added;return s.forEach(({id:o})=>{e.push({id:o})}),{itemResources:e,added:s.filter(({id:o})=>!a.includes(o))}}async function U(e,t,a,r){const s=await V(t),o=t.map(({id:n,type:i})=>new(s.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(o.map(n=>n.load())),o.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:s})=>{const o=g(s),n=D[o];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:s},o)=>{r.set(s,a[o])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:s,fullExtent:o,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=s,t.extent=null,n||o==null||(t.extent=await J(o)),m(t,l.METADATA),m(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function ue(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ye(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,s)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{ue as save,ye as saveAs}; diff --git a/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-CkN8Mclp.js b/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-CkN8Mclp.js new file mode 100644 index 00000000..dd9ec4d0 --- /dev/null +++ b/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-CkN8Mclp.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as g}from"./main-BTdHgocv.js";import{aK as A,o as s,e9 as v,ea as P,eb as j,ct as L,dO as E,ec as R,V as m,cP as C}from"./story-DT1Ep1ux.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-aKnzhZ32.js";import{b as f}from"./Query-BrwMGK8U-FWeI_AU8.js";import{p as _}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*G(t)}function G(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const W=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function Y(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function tt(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function et(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-C1Nc4Ce5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function nt(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-C1Nc4Ce5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function rt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function at(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function ot(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function st(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function lt(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function pt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function dt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function ft(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function yt(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function mt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function ht(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function wt(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function bt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function N(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function gt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await N(n,r)}function It(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function Ft(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function xt(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function qt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function Ot(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{tt as $,$ as A,ot as B,st as H,it as K,Q as O,Y as Q,et as U,ct as W,ut as X,lt as Y,nt as Z,rt as _,mt as a,gt as c,xt as d,pt as e,qt as f,bt as i,W as k,It as l,Ot as m,ft as n,ht as o,Ft as p,yt as r,wt as s,dt as t,at as z}; diff --git a/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-qNRhGrP3.js b/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-qNRhGrP3.js deleted file mode 100644 index 1ebcb0ea..00000000 --- a/custom-toc-separator/assets/featureLayerUtils-DgfQQyK4-qNRhGrP3.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BlkhMH5A.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as g}from"./main-lj2zzr_L.js";import{aK as A,o as s,e9 as v,ea as P,eb as j,ct as L,dO as E,ec as R,V as m,cP as C}from"./story-OUarUCIt.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-DY7R6puO.js";import{b as f}from"./Query-BrwMGK8U-gUIs0TS1.js";import{p as _}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*G(t)}function G(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const W=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function Y(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function tt(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function et(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-BlkhMH5A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function nt(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-BlkhMH5A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function rt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function at(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function ot(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function st(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function lt(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function pt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function dt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function ft(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function yt(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function mt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function ht(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function wt(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function bt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function N(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function gt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await N(n,r)}function It(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function Ft(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function xt(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function qt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function Ot(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{tt as $,$ as A,ot as B,st as H,it as K,Q as O,Y as Q,et as U,ct as W,ut as X,lt as Y,nt as Z,rt as _,mt as a,gt as c,xt as d,pt as e,qt as f,bt as i,W as k,It as l,Ot as m,ft as n,ht as o,Ft as p,yt as r,wt as s,dt as t,at as z}; diff --git a/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js b/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js deleted file mode 100644 index 6dcd3feb..00000000 --- a/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js +++ /dev/null @@ -1 +0,0 @@ -import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./story-OUarUCIt.js";import{d as n}from"./sphere-BenPORjV-CkV41Bdd.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./boundedPlane-DlvE0eNx-DGqkTDRl.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; diff --git a/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-ChL-ugTO.js b/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-ChL-ugTO.js new file mode 100644 index 00000000..03b3dd8f --- /dev/null +++ b/custom-toc-separator/assets/featureReferenceUtils-Ct4KY5u7-ChL-ugTO.js @@ -0,0 +1 @@ +import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./story-DT1Ep1ux.js";import{d as n}from"./sphere-BenPORjV-B4r28WKg.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./boundedPlane-DlvE0eNx-D5uXMAZI.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; diff --git a/custom-toc-separator/assets/featureSetUtils-wd4FcF3A-BowkCysI.js b/custom-toc-separator/assets/featureSetUtils-wd4FcF3A-BowkCysI.js deleted file mode 100644 index b2ddf99c..00000000 --- a/custom-toc-separator/assets/featureSetUtils-wd4FcF3A-BowkCysI.js +++ /dev/null @@ -1 +0,0 @@ -import{J as te,t as Ne,O as Le,bi as E,bV as P,d as Ae,bM as Pe,f as j,g as Oe,V as le,aB as oe}from"./story-OUarUCIt.js";import{ae as U,r as Ee,af as je}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{p as x,b as y,v as O,y as I,f as b,D as M,U as T,W as Ge,J as qe,z as Be,G as J,M as ue,R as de,O as he,t as Ue,a as Ie,I as Me,A as g,e as W,V as We,x as Qe,c as Ve}from"./SpatialFilter-BlQBFhwz-ZEGVFVLp.js";import{L as ie,y as S,I as Ze,a as R,D as ce,N as pe,w as fe,P as ye,x as _e,B as re,d as $e,R as be,U as Je,j as ge}from"./shared-D1w-26bA-BhDdbtTQ.js";import{Z as C,n as v,a as k,r as Ke,u as ze}from"./WhereClause-DxwoyBMS-D_DBEuLt.js";import{I as He,O as Xe,m as Ye}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{k as Ce,g as Te}from"./MD5-CHHr-oed-SuyrCYQ0.js";import{y as G}from"./Field-C6hA1tZj-DY7R6puO.js";import{o as et}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{N as tt,h as it}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import N from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{c as rt,d as me}from"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import{b as z,m as we}from"./Query-BrwMGK8U-gUIs0TS1.js";import{y as st}from"./FeatureType-C9hJmS6_-BoBeHHAU.js";import{D as H}from"./Layer-ChoECxvZ-DxWUU3pP.js";import at from"./PortalItem-CctGdnxF-DgukgleB.js";import"./main-lj2zzr_L.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let Re=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(u,e,t){this._layerById[e]=t,this._layerByName[u]=t}async featureSetByName(u,e=!0,t=["*"]){return this._layerByName[u]===void 0?null:this._layerByName[u]}async featureSetById(u,e=!0,t=["*"]){return this._layerById[u]===void 0?null:this._layerById[u]}castToText(u=!1){return"object, FeatureSetCollection"}};class q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof C?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new te({wkid:4326}),this.geometryType=ie.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new y(t._candidates.slice().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new y(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===S.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?S.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return Ne(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new y([],e,!1,null),s=Math.min(t,e.length);if(await this._parent?._getFeatures(r,-1,s,i),this._checkCancelled(i),this._whereClauseFunction==null){for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function dt(u){if(!u)return"COUNT";switch(u.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let ht=class ve extends x{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new X(a));for(let a=0;a0&&(l=new ot({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,r,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.Standardised)),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,t.queryelem?.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function dt(u){if(!u)return"COUNT";switch(u.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let ht=class ve extends x{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new X(a));for(let a=0;a0&&(l=new ot({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,r,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.Standardised)),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,t.queryelem?.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let n=0;n0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Rt as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetbase-BDDCCC0O-Y9F7JkCA.js b/custom-toc-separator/assets/featuresetbase-BDDCCC0O-Y9F7JkCA.js deleted file mode 100644 index d49643fe..00000000 --- a/custom-toc-separator/assets/featuresetbase-BDDCCC0O-Y9F7JkCA.js +++ /dev/null @@ -1 +0,0 @@ -import{r as Fe}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{N as Z,t as De,D as Te,l as J}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import{w as x,h as $e,c as Y,r as N,T as c,n as m,y as C,M as E,P as xe,e as de,d as ue,D as ce,g as L,L as k,C as b,t as G,Z as M,U as Ee,f as O,ag as be,q,O as Ne}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{M as Ae,q as me,f as Le,c as _,e as Se,a as Ze,b as Ce,T as X,E as ve,N as Pe,O as Re,L as U,B as Ue,d as V,R as S,k as ee}from"./featureSetUtils-wd4FcF3A-BowkCysI.js";import{n as Me}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ke}from"./portalUtils-CKN9iXwH-BVEO1U-S.js";import{E as Oe,e as pe}from"./SpatialFilter-BlQBFhwz-ZEGVFVLp.js";import{I as ne}from"./shared-D1w-26bA-BhDdbtTQ.js";import{r as ye,t as ze}from"./story-OUarUCIt.js";import{Z as $}from"./WhereClause-DxwoyBMS-D_DBEuLt.js";import te from"./FeatureLayer-BrRKw5Si-_MOPDF8o.js";import{y as W}from"./Field-C6hA1tZj-DY7R6puO.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./main-lj2zzr_L.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import"./FeatureType-C9hJmS6_-BoBeHHAU.js";import"./FeatureTemplate-SPHPD45f-B2RPXrwU.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./jsonUtils-C64Zfu7c-COIuPQy9.js";import"./LRUCache-C3erQTWv-6ABNHME-.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-BNEY6jgo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import"./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js";import"./commonProperties-BtIqvFU_-CGeXCscf.js";import"./ElevationInfo-yv2-9tj6-CvgTP051.js";import"./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./featureLayerUtils-DgfQQyK4-qNRhGrP3.js";import"./LayerFloorInfo-DRJ8wfwx-InRheW3z.js";import"./Relationship-PyhUibYK-Jg399ifo.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js";import"./editsZScale-BDsX6vv--D74kwHO-.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./APIKeyMixin-BUMSx9ny-CLspp1LR.js";import"./ArcGISService-BYA-y6X6-6EgTwM9y.js";import"./BlendLayer-D1WkSmwP-Ci8H7GFA.js";import"./jsonUtils-wIllKWI4-DQMnFF3M.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./CustomParametersMixin-vdKsTHer-DdP_vchN.js";import"./EditBusLayer-Df29OyJh-DvFQsl1d.js";import"./FeatureEffectLayer-Cro89IEC-4oF6iinH.js";import"./FeatureEffect-CDEk9Es7-ChIqC_0q.js";import"./FeatureFilter-BCFHgLVU-Dii6VkUI.js";import"./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js";import"./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js";import"./labelingInfo-DGVNul26-ZDnYoHJW.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js";import"./OrderedLayer-6Qsmrd_l-DORD-Yg0.js";import"./OrderByInfo-GD2XnU8e-Qxq3kQ53.js";import"./PortalLayer-CElnYuSQ-B2e-CURI.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js";import"./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js";import"./TemporalLayer-CpOrN_w9-DgT3hhJl.js";import"./TimeInfo-w_HB2CsF-DPmXTSB9.js";import"./fieldProperties-Bq26w7gt-CNDu5Kzx.js";import"./versionUtils-LZYZz-38-CcEiEhYk.js";import"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./popupUtils-B0uZcXX0-EZv1BfXi.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function He(r){if(r.length===1){if(b(r[0]))return J("distinct",r[0],-1);if(M(r[0]))return J("distinct",r[0].toArray(),-1)}return J("distinct",r,-1)}async function ie(r,n,i){const y=r.getVariables();if(y.length>0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Rt as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetgeom-BftbGgg3-CaOd3Bh1.js b/custom-toc-separator/assets/featuresetgeom-BftbGgg3-CaOd3Bh1.js deleted file mode 100644 index 5cb186fc..00000000 --- a/custom-toc-separator/assets/featuresetgeom-BftbGgg3-CaOd3Bh1.js +++ /dev/null @@ -1 +0,0 @@ -import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{Y as d}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-ZEGVFVLp.js";import{d as o}from"./story-OUarUCIt.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./main-lj2zzr_L.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./workers-PiCjreoO-mU03Z-E4.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function Q(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{Q as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetgeom-BftbGgg3-DXn5ZSC9.js b/custom-toc-separator/assets/featuresetgeom-BftbGgg3-DXn5ZSC9.js new file mode 100644 index 00000000..a07509fa --- /dev/null +++ b/custom-toc-separator/assets/featuresetgeom-BftbGgg3-DXn5ZSC9.js @@ -0,0 +1 @@ +import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{Y as d}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-B_zCY5td.js";import{d as o}from"./story-DT1Ep1ux.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./main-BTdHgocv.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./workers-PiCjreoO-DrDY4oeh.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function Q(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{Q as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CcErodTx.js b/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CcErodTx.js new file mode 100644 index 00000000..3eab4b40 --- /dev/null +++ b/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CcErodTx.js @@ -0,0 +1 @@ +import{r as l}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{l as u}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-Daxq3yaK.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{G as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CrDUFmTe.js b/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CrDUFmTe.js deleted file mode 100644 index d759bfbc..00000000 --- a/custom-toc-separator/assets/featuresetstats-CY6YJ8Jt-CrDUFmTe.js +++ /dev/null @@ -1 +0,0 @@ -import{r as l}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{l as u}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-D_DBEuLt.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{G as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetstring-DFELZWNA-BueHZdJS.js b/custom-toc-separator/assets/featuresetstring-DFELZWNA-BueHZdJS.js new file mode 100644 index 00000000..8c708e5d --- /dev/null +++ b/custom-toc-separator/assets/featuresetstring-DFELZWNA-BueHZdJS.js @@ -0,0 +1 @@ +import{N as l}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{M as v}from"./shared-D1w-26bA-BBBcUeQg.js";import"./main-BTdHgocv.js";import"./story-DT1Ep1ux.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function E(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{E as registerFunctions}; diff --git a/custom-toc-separator/assets/featuresetstring-DFELZWNA-C0fmjkkW.js b/custom-toc-separator/assets/featuresetstring-DFELZWNA-C0fmjkkW.js deleted file mode 100644 index cc38c6aa..00000000 --- a/custom-toc-separator/assets/featuresetstring-DFELZWNA-C0fmjkkW.js +++ /dev/null @@ -1 +0,0 @@ -import{N as l}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{M as v}from"./shared-D1w-26bA-BhDdbtTQ.js";import"./main-lj2zzr_L.js";import"./story-OUarUCIt.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function E(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{E as registerFunctions}; diff --git a/custom-toc-separator/assets/fetchService-DbaKmJhP-DL4bBdhv.js b/custom-toc-separator/assets/fetchService-DbaKmJhP-DL4bBdhv.js new file mode 100644 index 00000000..e90f81a0 --- /dev/null +++ b/custom-toc-separator/assets/fetchService-DbaKmJhP-DL4bBdhv.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-c3I3WxvN.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./MultiOriginJSONSupport-DKRh9P6w-DKZNtiMX.js","./Layer-ChoECxvZ-ocw70508.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./BlendLayer-D1WkSmwP-DaCYrII3.js","./jsonUtils-wIllKWI4-ChoaxSoX.js","./parser-DyDJ-rlI-BVBmjSW8.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-_sKw2yv4.js","./commonProperties-BtIqvFU_-BAaMjACd.js","./ElevationInfo-yv2-9tj6-BtRqJcOf.js","./lengthUtils-DKpMe5qR-C4JQidi_.js","./ScaleRangeLayer-Bz0DcnvM-BpotXucP.js","./imageBitmapUtils-DA36kg39-DfVYzy_v.js","./TileInfo-CWIRDhZl-C54e75zw.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-DbKLfNnN.js","./BuildingSceneLayer-IIePcdNz-BzWvrqye.js","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./loadAll-e978YItg-EK1YwFYX.js","./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js","./RendererLegendOptions-K3md58-X-DkzIw6pB.js","./diffUtils-Cz3Fi8Xb-DpL4XxiB.js","./colorRamps-q0bZVhs2-Yy2GlotV.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-DAfTVTEf.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./styleUtils-BtpNqZyT-DM-kTnEs.js","./jsonUtils-C64Zfu7c-D7O5HWOd.js","./LRUCache-C3erQTWv-D3oKynNB.js","./Version-CoKzbupV-CGLbrkRD.js","./FieldsIndex-HmzMbJQG-C6g_2n4m.js","./UnknownTimeZone-C--TOcPG-BFI0PL8S.js","./OverrideHelper-DWRbVlj1-BuRN6WEb.js","./colorUtils-Cthpxcks-DXg8vX2o.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BKynsqQg.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-FGsT2dwo.js","./heatmapUtils-seiMkkkR-D22mGlP8.js","./FeatureLayer-BrRKw5Si-DV01qpqc.js","./FeatureLayerBase-vvYyZTfh-DKfYVQxG.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./featureLayerUtils-DgfQQyK4-CkN8Mclp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-FWeI_AU8.js","./RelationshipQuery-DJsz3K0U-ueD2VMB6.js","./LayerFloorInfo-DRJ8wfwx-DU4GUmeO.js","./Relationship-PyhUibYK-Dl9eU1qo.js","./serviceCapabilitiesUtils-rPjN5QBe-71pZ0ygy.js","./workers-PiCjreoO-DrDY4oeh.js","./editsZScale-BDsX6vv--CJojmgz5.js","./queryZScale-BiYV6Pr6-BSxy2N4g.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./FeatureSet-BkVNthuN-CvGbjjZL.js","./APIKeyMixin-BUMSx9ny-WDHyZfLR.js","./ArcGISService-BYA-y6X6-BWJQc6nI.js","./CustomParametersMixin-vdKsTHer-D2O-ilop.js","./EditBusLayer-Df29OyJh-CAoDB1e-.js","./FeatureEffectLayer-Cro89IEC-wxowDxbO.js","./FeatureEffect-CDEk9Es7-8jhaVJv-.js","./FeatureFilter-BCFHgLVU-DfMwTLEM.js","./FeatureReductionLayer-BTZjL0_Z-DUf0zoZO.js","./FeatureReductionSelection-BjX3h7Sz-CCIYSwkj.js","./labelingInfo-DGVNul26-DxpYAQDw.js","./labelUtils-BW14kBqX-B_97vWvS.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-BekPpQJS.js","./OrderByInfo-GD2XnU8e-BH2q29Gm.js","./PortalLayer-CElnYuSQ-CcA75vOb.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./portalItemUtils-B8bw6SAG-Br9_-LS_.js","./TemporalLayer-CpOrN_w9-B2VZ6x81.js","./TimeInfo-w_HB2CsF-CygrHAJu.js","./FeatureTemplate-SPHPD45f-Dk1o48TK.js","./FeatureType-C9hJmS6_-zoljUYGr.js","./fieldProperties-Bq26w7gt-c4nyNJP6.js","./versionUtils-LZYZz-38-esAtUime.js","./styleUtils-ChrJTYIw-DnWMc-4t.js","./popupUtils-B0uZcXX0-mkpGjfro.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-CobyO2zX.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-Q4gT-eB4.js","./resourceUtils-BmW6QqlX-DJoDGZfh.js","./resourceUtils-rTM6Iemx-DwzNb5YY.js","./saveUtils-CIYk-dsQ-LlVI_Glz.js","./I3SLayerDefinitions-CwLXCKtU-BM__SoJm.js","./I3SUtil-Bq8KpP2j-DOy8KABV.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./projectVectorToVector-sIYLNlex-DFXrlpsW.js","./projectPointToVector-B2UUY9SE-XbfUb3dm.js","./sphere-BenPORjV-B4r28WKg.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-CP4TXD5k.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-Cc5iivi1.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-BOmhq_GU.js","./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-DTZDb9tw.js","./quat-BODLR7mS-Cqne66qw.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-BOsTLw9-.js","./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js","./elevationInfoUtils-mOZsPH2J-Dolgdnjb.js","./CSVLayer-CJQy-BsL-DRo8sxgB.js","./clientSideDefaults-BqqayPct-B1aankCm.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-zoS4CiOe.js","./ReactiveMap-CFk6jPfN-DUyzE86P.js","./signal-CETehA7D-o0XgAOKb.js","./utils-tNxq3jkf-CYo4DtRj.js","./ClassBreaksDefinition-bYRgYgPp-DlGZwPyV.js","./FeatureLayerSource-k4WMYop1-CO3-WMru.js","./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js","./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js","./External-D_wl4XAw-CF3XmPYl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DmlAOJ8b.js","./editingSupport-gUqP9iyf-C1Nc4Ce5.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./QueryTask-CwHwH2rS-LNltUUKG.js","./executeForIds-Z1gkLduF-CKWTLnam.js","./query-DFW9-NG_-SSagAgRu.js","./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js","./pbf-D-y3_eZO-CKuZ8F1K.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-Bi7xykzy.js","./featureConversionUtils-D6hFQ4Af-C534NCdS.js","./executeQueryJSON-CcHnccia-BAMZ5LEx.js","./DimensionLayer-DFh7fPYo-YOc_PB3Q.js","./Analysis-BPgJ-FCw-Y4Lx0iev.js","./Cyclical-C_9rKUUQ-DFuI-YVz.js","./ElevationLayer-G6y-P-jo-BuQp_I33.js","./ArcGISCachedService-C64Ko1TY-BFUuSyiK.js","./TileInfoTilemapCache-D1SExPij-DqTuw8Sy.js","./TilemapCache-CRRxws77-CQyTs6St.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-YQWmUbSd.js","./GeoRSSLayer-DgF8xnYi-DsIKHjQm.js","./GroupLayer-ER-XzoYr-CcG_XUkW.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./writeUtils-D5qlLkwk-BD0oSm_9.js","./ImageryLayer-B-bJb8lU-B4H6ifcq.js","./RasterPresetRendererMixin-D6W9pUY6-C16ICQ6k.js","./multidimensionalUtils-BwTugeu7-DEZ_-aFn.js","./dataUtils-BkPy4R3C-CjC6pTlj.js","./RasterSymbolizer-BVys6HkM-5rDIvGzY.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-QfypPSGF.js","./cimSymbolUtils-CKIzBgMU-BUNQAKUj.js","./ImageryTileLayer-DixyNESc-DOM1Vp8R.js","./RawBlockCache-Cj_tmHDm-DQHJ-Ncv.js","./rasterProjectionHelper-Calp0o_1-C-zaFCqp.js","./QueueProcessor-DbfV9fLy-Cd63xfTl.js","./PolynomialTransform-C3nWCu0l-of3yQAdZ.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-7qGXLlt7.js","./IntegratedMeshLayer-C-XaBbXd-DRMrJm3r.js","./persistable-C6RBwzJi-DSWzGhuz.js","./resourceExtension-CdQvIDKV-iZLDgXmu.js","./KMLLayer-DwQXpcMB-DgN1R0Sa.js","./kmlUtils-C5oIEoOy-CwR9R5MT.js","./KnowledgeGraphLayer-BjNFJGLf-DTl8aTaS.js","./KnowledgeGraphSublayer-DPj4igi1-B-KgKAya.js","./GraphicsLayer-DfeGaYc1-shHP2mZF.js","./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js","./knowledgeGraphService-DOJz0fzA-CKY-uOox.js","./Relationship-Db9GUmYx-D8hB6lBb.js","./FeatureStore-Co2V0sVE-IoB-sC2w.js","./BoundsStore--N6o1xkF-vTEQb1N7.js","./PooledRBush-DbfAmeLn-BhVBo5wc.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-CHDjIIE2.js","./queryUtils-Brxu6254-qwN-s2Og.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js","./QueryEngine-CH5uUhZK-CYBqfWM0.js","./WhereClause-DxwoyBMS-Daxq3yaK.js","./TimeOnly-DSMefxKy-52VbaSQ6.js","./utils-HtkT8Fn3-CoByYob7.js","./utils-DyydRFHu-C4YRMtgK.js","./Basemap-BEqqSTw9-1Mix6R1G.js","./Scheduler-B7UX7Wr5-xYmcMbo2.js","./LineOfSightLayer-D6sUQaEP-B5JHB-gg.js","./featureReferenceUtils-Ct4KY5u7-ChL-ugTO.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-D5uXMAZI.js","./lineSegment-CcqvCARM-CJhaINhC.js","./LinkChartLayer-KcYDvLxD-Cj8gdSBT.js","./MapImageLayer-B_rP0PhA-CtcDOdqG.js","./scaleUtils-DxsfQwK1-BDJMc0pY.js","./SublayersOwner-DfTaMJ5V-BYFVn9A8.js","./sublayerUtils-CyM0QC5B-CIwWTPAs.js","./ExportImageParameters-DxyNGQ57-CAFcOOUq.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-Cx3vRzxv.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-D_Q6ZKgd.js","./perspectiveUtils-Bu88xlbg-3834DwlL.js","./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./OGCFeatureLayer-DPXQjO1S-wTuiwEzX.js","./ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js","./geojson-CNt_qtQf-DS1EMYq7.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-BF0o3_jy.js","./OpenStreetMapLayer-Bx4EhJij-BXPORwQJ.js","./WebTileLayer-CUoicUjK-BgSZQGkL.js","./OrientedImageryLayer-CwG5o4Di-ft75Mdw_.js","./PointCloudLayer-CkxImr5P-D-1Av7eh.js","./PointCloudUniqueValueRenderer-C-5hwEaR-CCd5EswY.js","./RouteLayer-BQQ6WxtH-l4NjCf3m.js","./Stop-he5xSAJJ-Cm3NmLQL.js","./SceneLayer-DOh9PmQy-BBBCEzRV.js","./Mesh-DLzjDUIO-BGFhxEuV.js","./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-BChBDP40.js","./deduplicate-D2d-E5Pw-UtmvndF2.js","./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js","./vec3-BazNroeq-xVxXS26y.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec4-DWDdg1fj-CEZkOwEl.js","./meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js","./StreamLayer-Bqnt-d3H-dCedDpZK.js","./SubtypeGroupLayer-D1vAbwEU-B8cBzyBr.js","./TileLayer-Be5tWeN5-NuBFIOK0.js","./UnknownLayer-DwWK383_-BkjNaYrE.js","./UnsupportedLayer-CCUtmZ2i-BMYpECe1.js","./VectorTileLayer-DruyQukp-DuYwzcLx.js","./TileKey-C5IL-JBr-Do29X9ef.js","./StyleRepository-D3WuVprR-DmkdyZGe.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn-DWgvXyZj.js","./TelemetryDisplay-Bq2PXfI8-C3u5XocC.js","./ViewshedLayer-BYX-h7eL-CmEty2pX.js","./VoxelLayer-KL84GttA-CEFleBBB.js","./WFSLayer-DKnx5V8b-Daej1uTs.js","./wfsUtils-DoLaqXsj-DEeOUKXZ.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-kb-WeC_q.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-DL05uTg1.js","./WMTSLayer-DJY_jjIE-Bq0CKOK2.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-BTdHgocv.js";import{f as s}from"./story-DT1Ep1ux.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const E={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-c3I3WxvN.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-BzWvrqye.js");return{default:t}},__vite__mapDeps([23,1,2,3,4,24,25,5,6,7,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,47,15,16,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-DRo8sxgB.js");return{default:t}},__vite__mapDeps([127,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,128,129,93]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-zoS4CiOe.js");return{default:t}},__vite__mapDeps([130,1,2,3,4,5,6,7,35,131,132,8,9,10,11,12,13,18,15,16,17,79,133,134,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,70,71,72,75,76,90,135,136,137,104,138,139,63,64,140,103,120,109,111,141,142,143,144,145,69,128,129,93,146,147,148,149,150,151,152,62,153,154,65,155,61,66,67,68,22,78,80,81,82,14,83,84,86,85,87,88]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-YOc_PB3Q.js");return{default:t}},__vite__mapDeps([156,1,2,3,4,157,158,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-BuQp_I33.js");return{default:t}},__vite__mapDeps([159,2,3,1,4,5,51,6,7,160,20,21,161,162,163,35,67,52,22,15,16,17,80,81,82,63,64,60]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-DV01qpqc.js");return{default:t}},__vite__mapDeps([47,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-YQWmUbSd.js");return{default:t}},__vite__mapDeps([164,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,65,49,50,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,85,87,90]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-DsIKHjQm.js");return{default:t}},__vite__mapDeps([165,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-CcG_XUkW.js");return{default:t}},__vite__mapDeps([166,2,3,1,4,24,25,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,167,92,100,168]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-B4H6ifcq.js");return{default:t}},__vite__mapDeps([169,2,3,1,4,5,6,7,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,13,42,134,144,65,142,143,145,175,10,11,12,176,43,44,35,15,16,37,38,19,55,147,148,149,150,151,152,62,63,64,155,67,52,8,9,68,22,80,81,82,14,18,83,84,88,90,92]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-DOM1Vp8R.js");return{default:t}},__vite__mapDeps([177,2,3,1,4,5,6,7,67,52,8,9,10,11,12,13,68,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,42,134,144,65,142,143,145,175,176,43,44,35,15,16,20,21,178,179,63,64,180,131,132,181,22,80,81,82,14,18,83,84,162,163,90,92]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-7qGXLlt7.js");return{default:t}},__vite__mapDeps([182,1,2,3,4,5,104,13,64,6,7,66,67,52,68,22,15,16,17,80,81,82,63,18,126]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-DRMrJm3r.js");return{default:t}},__vite__mapDeps([183,1,2,3,4,5,184,77,96,54,185,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,51,97,98,99,100,101,126]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-DgN1R0Sa.js");return{default:t}},__vite__mapDeps([186,1,2,3,4,24,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,187,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,65,49,50]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-DTl8aTaS.js");return{default:t}},__vite__mapDeps([188,1,2,3,4,5,54,6,7,189,63,64,154,151,152,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,56,75,76,77,78,79,14,83,84,65,90,67,52,68,22,80,82]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-B5JHB-gg.js");return{default:t}},__vite__mapDeps([209,1,2,3,4,157,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,184,77,96,54,185,16,17,63,64,126,5,6,7,22,15]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-Cj8gdSBT.js");return{default:t}},__vite__mapDeps([214,1,2,3,4,5,6,7,154,151,152,189,63,64,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,54,56,75,76,77,78,79,14,83,84,65,90,22]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-CtcDOdqG.js");return{default:t}},__vite__mapDeps([215,1,2,3,4,25,5,216,6,7,66,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,83,84,219,220,19,88]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-Cx3vRzxv.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,63,64,142,143,144,145,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,190,191,222]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-D_Q6ZKgd.js");return{default:t}},__vite__mapDeps([223,2,3,1,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,224,225,143,108,109,226,104,112,227,54,185,195,196,197,92]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-wTuiwEzX.js");return{default:t}},__vite__mapDeps([228,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,229,154,151,152,230,231,128,129,93,232,50,65,49,66,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,86,85,87,90]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-BXPORwQJ.js");return{default:t}},__vite__mapDeps([233,1,2,3,4,234,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di-ft75Mdw_.js");return{default:t}},__vite__mapDeps([235,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P-D-1Av7eh.js");return{default:t}},__vite__mapDeps([236,1,2,3,4,5,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,87,37,38,237,27,126,90]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-l4NjCf3m.js");return{default:t}},__vite__mapDeps([238,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,95,96,63,64,6,7,8,9,10,11,12,22,15,16,80,81,82,18,52,144,239,142,143,145,65,49,50]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-BBBCEzRV.js");return{default:t}},__vite__mapDeps([240,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,241,140,12,103,120,109,111,104,227,242,136,137,243,244,110,112,245,106,63,64,246,108,121,122,247,248,226,249,138,139,6,7,250,66,67,52,68,69,54,22,15,16,80,81,82,18,94,95,96,51,97,98,99,100,83,84,125,93,53,49,50,55,56,74,87,101,75,76,57,184,77,185,89,126,90,102,105,107,113,114,115,116,117,118,119,123,124]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-dCedDpZK.js");return{default:t}},__vite__mapDeps([251,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,67,52,8,9,10,11,12,68,70,71,72,55,49,50,73,15,16,74,53,54,56,75,76,77,22,80,81,82,63,64,14,18,83,84,87,89,90,92]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-B8cBzyBr.js");return{default:t}},__vite__mapDeps([252,2,3,1,4,25,5,6,7,66,67,52,8,9,10,11,12,13,68,69,54,48,49,50,15,16,17,51,53,55,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,56,57,58,59,22,80,81,82,63,64,14,18,83,84,87,176,175,85,75,76,90,88,92]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-NuBFIOK0.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,25,5,6,7,66,160,20,21,161,162,163,35,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,19]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-BkjNaYrE.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-BMYpECe1.js");return{default:t}},__vite__mapDeps([255,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-DuYwzcLx.js");return{default:t}},__vite__mapDeps([256,1,2,3,4,5,6,7,66,160,20,21,161,162,163,35,67,52,8,9,10,11,12,13,68,22,15,16,17,80,81,82,63,64,14,18,257,97,258,259,44,260,261,262,263,40,41,42,264,265,266]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn-DWgvXyZj.js");return{default:t}},__vite__mapDeps([267,1,2,3,4,5,6,7,8,9,10,11,12,13,68,18,52,15,16,17,59,268,109,108,104,121,64,174]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-CmEty2pX.js");return{default:t}},__vite__mapDeps([269,1,2,3,4,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,158,157,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-CEFleBBB.js");return{default:t}},__vite__mapDeps([270,1,2,3,4,5,104,13,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,37,38,84,158,184,77,185,120,109,111,41,90]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-Daej1uTs.js");return{default:t}},__vite__mapDeps([271,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,272,63,64,230,231,151,273,52,49,50,65,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,14,18,83,84,87,90]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-kb-WeC_q.js");return{default:t}},__vite__mapDeps([274,1,2,3,4,24,5,216,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,83,84,275,52,276,19]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-Bq0CKOK2.js");return{default:t}},__vite__mapDeps([277,1,2,3,4,5,6,7,234,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21,161,275,273]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-BgSZQGkL.js"),__vite__mapDeps([234,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function O(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function T(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{O as d,T as g,d as o,E as p}; diff --git a/custom-toc-separator/assets/fetchService-DbaKmJhP-DoSq_UWg.js b/custom-toc-separator/assets/fetchService-DbaKmJhP-DoSq_UWg.js deleted file mode 100644 index 5bb33243..00000000 --- a/custom-toc-separator/assets/fetchService-DbaKmJhP-DoSq_UWg.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-BIiqswnB.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./MultiOriginJSONSupport-DKRh9P6w-5uoyVjWd.js","./Layer-ChoECxvZ-DxWUU3pP.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./BlendLayer-D1WkSmwP-Ci8H7GFA.js","./jsonUtils-wIllKWI4-DQMnFF3M.js","./parser-DyDJ-rlI-BZnJ9Tpt.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-BK6RT4lC.js","./commonProperties-BtIqvFU_-CGeXCscf.js","./ElevationInfo-yv2-9tj6-CvgTP051.js","./lengthUtils-DKpMe5qR-BJJJQeiz.js","./ScaleRangeLayer-Bz0DcnvM-Bs4L4KCV.js","./imageBitmapUtils-DA36kg39-zZ47VIK5.js","./TileInfo-CWIRDhZl-561xzxdP.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-Dgb3Hr2c.js","./BuildingSceneLayer-IIePcdNz-Bf9jDBFL.js","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./loadAll-e978YItg-cyBswBq0.js","./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js","./RendererLegendOptions-K3md58-X-CotdYMFm.js","./diffUtils-Cz3Fi8Xb-JVwNDDxH.js","./colorRamps-q0bZVhs2-D0XKNTvx.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-BSOWzUJi.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./styleUtils-BtpNqZyT-BHhk4mUO.js","./jsonUtils-C64Zfu7c-COIuPQy9.js","./LRUCache-C3erQTWv-6ABNHME-.js","./Version-CoKzbupV-5qCYzF4G.js","./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js","./UnknownTimeZone-C--TOcPG-BlA07cjv.js","./OverrideHelper-DWRbVlj1-CsyvnxCE.js","./colorUtils-Cthpxcks-DchH3ayn.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-BNEY6jgo.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-Ds815HQE.js","./heatmapUtils-seiMkkkR-BT5eGA8G.js","./FeatureLayer-BrRKw5Si-_MOPDF8o.js","./FeatureLayerBase-vvYyZTfh-BYmgg8m3.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./featureLayerUtils-DgfQQyK4-qNRhGrP3.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-gUIs0TS1.js","./RelationshipQuery-DJsz3K0U-CjRN9GkI.js","./LayerFloorInfo-DRJ8wfwx-InRheW3z.js","./Relationship-PyhUibYK-Jg399ifo.js","./serviceCapabilitiesUtils-rPjN5QBe-DOT0kSHF.js","./workers-PiCjreoO-mU03Z-E4.js","./editsZScale-BDsX6vv--D74kwHO-.js","./queryZScale-BiYV6Pr6-Dr42wv_P.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./FeatureSet-BkVNthuN-C5Zta7rI.js","./APIKeyMixin-BUMSx9ny-CLspp1LR.js","./ArcGISService-BYA-y6X6-6EgTwM9y.js","./CustomParametersMixin-vdKsTHer-DdP_vchN.js","./EditBusLayer-Df29OyJh-DvFQsl1d.js","./FeatureEffectLayer-Cro89IEC-4oF6iinH.js","./FeatureEffect-CDEk9Es7-ChIqC_0q.js","./FeatureFilter-BCFHgLVU-Dii6VkUI.js","./FeatureReductionLayer-BTZjL0_Z-CXed7WhY.js","./FeatureReductionSelection-BjX3h7Sz-D1YIJgJD.js","./labelingInfo-DGVNul26-ZDnYoHJW.js","./labelUtils-BW14kBqX-DeXQjA1z.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-DORD-Yg0.js","./OrderByInfo-GD2XnU8e-Qxq3kQ53.js","./PortalLayer-CElnYuSQ-B2e-CURI.js","./PortalItem-CctGdnxF-DgukgleB.js","./portalItemUtils-B8bw6SAG-DkJqoRnI.js","./TemporalLayer-CpOrN_w9-DgT3hhJl.js","./TimeInfo-w_HB2CsF-DPmXTSB9.js","./FeatureTemplate-SPHPD45f-B2RPXrwU.js","./FeatureType-C9hJmS6_-BoBeHHAU.js","./fieldProperties-Bq26w7gt-CNDu5Kzx.js","./versionUtils-LZYZz-38-CcEiEhYk.js","./styleUtils-ChrJTYIw-CbI3fdq_.js","./popupUtils-B0uZcXX0-EZv1BfXi.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-Dbvqi9tG.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-CN6VxGdq.js","./resourceUtils-BmW6QqlX-DTC51C_z.js","./resourceUtils-rTM6Iemx-LGtMSbcd.js","./saveUtils-CIYk-dsQ-BafA6Tfo.js","./I3SLayerDefinitions-CwLXCKtU-DyBOBLUl.js","./I3SUtil-Bq8KpP2j-CH-xwlo7.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./projectVectorToVector-sIYLNlex-CdnDHDm4.js","./projectPointToVector-B2UUY9SE-fNIw44OG.js","./sphere-BenPORjV-CkV41Bdd.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-DlxNxa6f.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-_F_RwQYP.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-DCWbfrRi.js","./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-BMbvjED3.js","./quat-BODLR7mS-BrN0ZBC_.js","./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js","./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-911d_F5-.js","./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js","./elevationInfoUtils-mOZsPH2J-CN_TctvZ.js","./CSVLayer-CJQy-BsL-CjuxNbH0.js","./clientSideDefaults-BqqayPct-BCK_HM0i.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-C57OJbI0.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./signal-CETehA7D-TD-k6B-y.js","./utils-tNxq3jkf-CgPuWip3.js","./ClassBreaksDefinition-bYRgYgPp-D74IwI72.js","./FeatureLayerSource-k4WMYop1-Czmqxz6U.js","./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js","./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js","./External-D_wl4XAw-BzQ8-YjD.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-mx7xOTc-.js","./editingSupport-gUqP9iyf-BlkhMH5A.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./QueryTask-CwHwH2rS-Cdg8UCnQ.js","./executeForIds-Z1gkLduF-BLtp2DWt.js","./query-DFW9-NG_-CLOB0soI.js","./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js","./pbf-D-y3_eZO-kB76Yuqq.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-DA2vEqjE.js","./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js","./executeQueryJSON-CcHnccia-C6q0seac.js","./DimensionLayer-DFh7fPYo-CPmgikK_.js","./Analysis-BPgJ-FCw-DzBMoBqT.js","./Cyclical-C_9rKUUQ-BqcUyGYR.js","./ElevationLayer-G6y-P-jo-223z_Bn9.js","./ArcGISCachedService-C64Ko1TY-CD3MqLHR.js","./TileInfoTilemapCache-D1SExPij-NBsOGvA0.js","./TilemapCache-CRRxws77-Buzexpoq.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-B_I_Y0v_.js","./GeoRSSLayer-DgF8xnYi-Bxp1nci4.js","./GroupLayer-ER-XzoYr-Dd5UcbJI.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./ImageryLayer-B-bJb8lU-D8ecHz6d.js","./RasterPresetRendererMixin-D6W9pUY6-Dhi45guF.js","./multidimensionalUtils-BwTugeu7-DCwX6ZId.js","./dataUtils-BkPy4R3C-YDmCFwfE.js","./RasterSymbolizer-BVys6HkM-D0TnSXh8.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-DGbScRZv.js","./cimSymbolUtils-CKIzBgMU-CX4234se.js","./ImageryTileLayer-DixyNESc-BjuvDY5X.js","./RawBlockCache-Cj_tmHDm-TGuQW6oN.js","./rasterProjectionHelper-Calp0o_1-C6XacwGz.js","./QueueProcessor-DbfV9fLy-2ansCCcJ.js","./PolynomialTransform-C3nWCu0l-QGUE0RJ1.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-ZHb6u4tt.js","./IntegratedMeshLayer-C-XaBbXd-CJAaHChR.js","./persistable-C6RBwzJi-BbuVIS8Z.js","./resourceExtension-CdQvIDKV-CYtArgCw.js","./KMLLayer-DwQXpcMB-iNCyMt5e.js","./kmlUtils-C5oIEoOy-DWwDrVZj.js","./KnowledgeGraphLayer-BjNFJGLf-DaZh0NKT.js","./KnowledgeGraphSublayer-DPj4igi1-BnjmG91b.js","./GraphicsLayer-DfeGaYc1-CVunY75r.js","./GraphicsCollection-CWTXNZOX-EGgNeYwI.js","./knowledgeGraphService-DOJz0fzA-BspkM59i.js","./Relationship-Db9GUmYx-D5mx9kys.js","./FeatureStore-Co2V0sVE-BIksXSjO.js","./BoundsStore--N6o1xkF-OMiRxUp-.js","./PooledRBush-DbfAmeLn-D1-Igyfv.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-BLBOCVnL.js","./queryUtils-Brxu6254-BZ9oWgik.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js","./QueryEngine-CH5uUhZK-B7KHLDgB.js","./WhereClause-DxwoyBMS-D_DBEuLt.js","./TimeOnly-DSMefxKy-C9JclgbM.js","./utils-HtkT8Fn3-CjrLkz9Y.js","./utils-DyydRFHu-uR3F5VAW.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./LineOfSightLayer-D6sUQaEP-DEHxgqol.js","./featureReferenceUtils-Ct4KY5u7-B1b0SCf3.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-DGqkTDRl.js","./lineSegment-CcqvCARM-CznIGfdF.js","./LinkChartLayer-KcYDvLxD-CEFjNwIG.js","./MapImageLayer-B_rP0PhA-BLOVllPr.js","./scaleUtils-DxsfQwK1-rzzukPSH.js","./SublayersOwner-DfTaMJ5V-DEkAA9m8.js","./sublayerUtils-CyM0QC5B-CJNrSXfS.js","./ExportImageParameters-DxyNGQ57-ClKzvvsE.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-BR58wdZ7.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-DULxKfbY.js","./perspectiveUtils-Bu88xlbg-DDSQwPJw.js","./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./OGCFeatureLayer-DPXQjO1S-Ctex3rAt.js","./ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js","./geojson-CNt_qtQf-DAI1_86C.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-DGf5w49d.js","./OpenStreetMapLayer-Bx4EhJij-DQy5tSBL.js","./WebTileLayer-CUoicUjK-DzBqU6HL.js","./OrientedImageryLayer-CwG5o4Di-DbfQeoad.js","./PointCloudLayer-CkxImr5P-BPrbn2Rt.js","./PointCloudUniqueValueRenderer-C-5hwEaR-C21BHqCP.js","./RouteLayer-BQQ6WxtH-DU8QGd53.js","./Stop-he5xSAJJ-Bv9OY5sh.js","./SceneLayer-DOh9PmQy-DjFmWa6Y.js","./Mesh-DLzjDUIO-BlTrUdFo.js","./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-Bin5_zrY.js","./deduplicate-D2d-E5Pw-DsVnH-8X.js","./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js","./vec3-BazNroeq-C58EAHFm.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./vec4-DWDdg1fj-CF_vNE3j.js","./meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js","./StreamLayer-Bqnt-d3H-BIucz7KM.js","./SubtypeGroupLayer-D1vAbwEU-BCv27zTO.js","./TileLayer-Be5tWeN5-B-Oi14XY.js","./UnknownLayer-DwWK383_-CSQMJeuE.js","./UnsupportedLayer-CCUtmZ2i-CmEV-4Pa.js","./VectorTileLayer-DruyQukp-DqAW9Qpj.js","./TileKey-C5IL-JBr-Cy7bNm0k.js","./StyleRepository-D3WuVprR-D1hVbbHk.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn-iHSXGJEF.js","./TelemetryDisplay-Bq2PXfI8-gJKD9cAf.js","./ViewshedLayer-BYX-h7eL-8AAkij1t.js","./VoxelLayer-KL84GttA-BEmbBHI5.js","./WFSLayer-DKnx5V8b-BX03R8vP.js","./wfsUtils-DoLaqXsj-CK9z1afv.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-CjTxerqU.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-C1TU4Ziq.js","./WMTSLayer-DJY_jjIE-DBDKBXYD.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-lj2zzr_L.js";import{f as s}from"./story-OUarUCIt.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const E={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-BIiqswnB.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-Bf9jDBFL.js");return{default:t}},__vite__mapDeps([23,1,2,3,4,24,25,5,6,7,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,47,15,16,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-CjuxNbH0.js");return{default:t}},__vite__mapDeps([127,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,128,129,93]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-C57OJbI0.js");return{default:t}},__vite__mapDeps([130,1,2,3,4,5,6,7,35,131,132,8,9,10,11,12,13,18,15,16,17,79,133,134,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,70,71,72,75,76,90,135,136,137,104,138,139,63,64,140,103,120,109,111,141,142,143,144,145,69,128,129,93,146,147,148,149,150,151,152,62,153,154,65,155,61,66,67,68,22,78,80,81,82,14,83,84,86,85,87,88]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-CPmgikK_.js");return{default:t}},__vite__mapDeps([156,1,2,3,4,157,158,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-223z_Bn9.js");return{default:t}},__vite__mapDeps([159,2,3,1,4,5,51,6,7,160,20,21,161,162,163,35,67,52,22,15,16,17,80,81,82,63,64,60]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-_MOPDF8o.js");return{default:t}},__vite__mapDeps([47,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-B_I_Y0v_.js");return{default:t}},__vite__mapDeps([164,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,65,49,50,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,85,87,90]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-Bxp1nci4.js");return{default:t}},__vite__mapDeps([165,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-Dd5UcbJI.js");return{default:t}},__vite__mapDeps([166,2,3,1,4,24,25,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,167,92,100,168]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-D8ecHz6d.js");return{default:t}},__vite__mapDeps([169,2,3,1,4,5,6,7,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,13,42,134,144,65,142,143,145,175,10,11,12,176,43,44,35,15,16,37,38,19,55,147,148,149,150,151,152,62,63,64,155,67,52,8,9,68,22,80,81,82,14,18,83,84,88,90,92]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-BjuvDY5X.js");return{default:t}},__vite__mapDeps([177,2,3,1,4,5,6,7,67,52,8,9,10,11,12,13,68,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,42,134,144,65,142,143,145,175,176,43,44,35,15,16,20,21,178,179,63,64,180,131,132,181,22,80,81,82,14,18,83,84,162,163,90,92]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-ZHb6u4tt.js");return{default:t}},__vite__mapDeps([182,1,2,3,4,5,104,13,64,6,7,66,67,52,68,22,15,16,17,80,81,82,63,18,126]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-CJAaHChR.js");return{default:t}},__vite__mapDeps([183,1,2,3,4,5,184,77,96,54,185,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,51,97,98,99,100,101,126]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-iNCyMt5e.js");return{default:t}},__vite__mapDeps([186,1,2,3,4,24,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,187,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,65,49,50]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-DaZh0NKT.js");return{default:t}},__vite__mapDeps([188,1,2,3,4,5,54,6,7,189,63,64,154,151,152,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,56,75,76,77,78,79,14,83,84,65,90,67,52,68,22,80,82]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-DEHxgqol.js");return{default:t}},__vite__mapDeps([209,1,2,3,4,157,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,184,77,96,54,185,16,17,63,64,126,5,6,7,22,15]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-CEFjNwIG.js");return{default:t}},__vite__mapDeps([214,1,2,3,4,5,6,7,154,151,152,189,63,64,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,54,56,75,76,77,78,79,14,83,84,65,90,22]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-BLOVllPr.js");return{default:t}},__vite__mapDeps([215,1,2,3,4,25,5,216,6,7,66,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,83,84,219,220,19,88]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-BR58wdZ7.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,63,64,142,143,144,145,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,190,191,222]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-DULxKfbY.js");return{default:t}},__vite__mapDeps([223,2,3,1,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,224,225,143,108,109,226,104,112,227,54,185,195,196,197,92]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-Ctex3rAt.js");return{default:t}},__vite__mapDeps([228,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,229,154,151,152,230,231,128,129,93,232,50,65,49,66,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,86,85,87,90]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-DQy5tSBL.js");return{default:t}},__vite__mapDeps([233,1,2,3,4,234,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di-DbfQeoad.js");return{default:t}},__vite__mapDeps([235,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P-BPrbn2Rt.js");return{default:t}},__vite__mapDeps([236,1,2,3,4,5,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,87,37,38,237,27,126,90]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-DU8QGd53.js");return{default:t}},__vite__mapDeps([238,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,95,96,63,64,6,7,8,9,10,11,12,22,15,16,80,81,82,18,52,144,239,142,143,145,65,49,50]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-DjFmWa6Y.js");return{default:t}},__vite__mapDeps([240,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,241,140,12,103,120,109,111,104,227,242,136,137,243,244,110,112,245,106,63,64,246,108,121,122,247,248,226,249,138,139,6,7,250,66,67,52,68,69,54,22,15,16,80,81,82,18,94,95,96,51,97,98,99,100,83,84,125,93,53,49,50,55,56,74,87,101,75,76,57,184,77,185,89,126,90,102,105,107,113,114,115,116,117,118,119,123,124]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-BIucz7KM.js");return{default:t}},__vite__mapDeps([251,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,67,52,8,9,10,11,12,68,70,71,72,55,49,50,73,15,16,74,53,54,56,75,76,77,22,80,81,82,63,64,14,18,83,84,87,89,90,92]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-BCv27zTO.js");return{default:t}},__vite__mapDeps([252,2,3,1,4,25,5,6,7,66,67,52,8,9,10,11,12,13,68,69,54,48,49,50,15,16,17,51,53,55,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,56,57,58,59,22,80,81,82,63,64,14,18,83,84,87,176,175,85,75,76,90,88,92]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-B-Oi14XY.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,25,5,6,7,66,160,20,21,161,162,163,35,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,19]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-CSQMJeuE.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-CmEV-4Pa.js");return{default:t}},__vite__mapDeps([255,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-DqAW9Qpj.js");return{default:t}},__vite__mapDeps([256,1,2,3,4,5,6,7,66,160,20,21,161,162,163,35,67,52,8,9,10,11,12,13,68,22,15,16,17,80,81,82,63,64,14,18,257,97,258,259,44,260,261,262,263,40,41,42,264,265,266]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn-iHSXGJEF.js");return{default:t}},__vite__mapDeps([267,1,2,3,4,5,6,7,8,9,10,11,12,13,68,18,52,15,16,17,59,268,109,108,104,121,64,174]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-8AAkij1t.js");return{default:t}},__vite__mapDeps([269,1,2,3,4,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,158,157,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-BEmbBHI5.js");return{default:t}},__vite__mapDeps([270,1,2,3,4,5,104,13,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,37,38,84,158,184,77,185,120,109,111,41,90]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-BX03R8vP.js");return{default:t}},__vite__mapDeps([271,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,272,63,64,230,231,151,273,52,49,50,65,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,14,18,83,84,87,90]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-CjTxerqU.js");return{default:t}},__vite__mapDeps([274,1,2,3,4,24,5,216,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,83,84,275,52,276,19]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-DBDKBXYD.js");return{default:t}},__vite__mapDeps([277,1,2,3,4,5,6,7,234,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21,161,275,273]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-DzBqU6HL.js"),__vite__mapDeps([234,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function O(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function T(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{O as d,T as g,d as o,E as p}; diff --git a/custom-toc-separator/assets/fieldProperties-Bq26w7gt-CNDu5Kzx.js b/custom-toc-separator/assets/fieldProperties-Bq26w7gt-CNDu5Kzx.js deleted file mode 100644 index c3b50c3a..00000000 --- a/custom-toc-separator/assets/fieldProperties-Bq26w7gt-CNDu5Kzx.js +++ /dev/null @@ -1 +0,0 @@ -import{K as n,a1 as r,ed as l}from"./story-OUarUCIt.js";import{y as o}from"./Field-C6hA1tZj-DY7R6puO.js";import{o as d}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; diff --git a/custom-toc-separator/assets/fieldProperties-Bq26w7gt-c4nyNJP6.js b/custom-toc-separator/assets/fieldProperties-Bq26w7gt-c4nyNJP6.js new file mode 100644 index 00000000..26bc8308 --- /dev/null +++ b/custom-toc-separator/assets/fieldProperties-Bq26w7gt-c4nyNJP6.js @@ -0,0 +1 @@ +import{K as n,a1 as r,ed as l}from"./story-DT1Ep1ux.js";import{y as o}from"./Field-C6hA1tZj-aKnzhZ32.js";import{o as d}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; diff --git a/custom-toc-separator/assets/fieldType-CD2CL2hr-B2sVi9me.js b/custom-toc-separator/assets/fieldType-CD2CL2hr-B2sVi9me.js new file mode 100644 index 00000000..57559b9b --- /dev/null +++ b/custom-toc-separator/assets/fieldType-CD2CL2hr-B2sVi9me.js @@ -0,0 +1 @@ +import{aK as e}from"./story-DT1Ep1ux.js";const l=new e({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; diff --git a/custom-toc-separator/assets/fieldType-CD2CL2hr-D-1zqE7t.js b/custom-toc-separator/assets/fieldType-CD2CL2hr-D-1zqE7t.js deleted file mode 100644 index aabdd3f0..00000000 --- a/custom-toc-separator/assets/fieldType-CD2CL2hr-D-1zqE7t.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as e}from"./story-OUarUCIt.js";const l=new e({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; diff --git a/custom-toc-separator/assets/floatRGBA-4pIJN00G-BOmhq_GU.js b/custom-toc-separator/assets/floatRGBA-4pIJN00G-BOmhq_GU.js new file mode 100644 index 00000000..b7ea08a9 --- /dev/null +++ b/custom-toc-separator/assets/floatRGBA-4pIJN00G-BOmhq_GU.js @@ -0,0 +1 @@ +import{ae as f}from"./story-DT1Ep1ux.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; diff --git a/custom-toc-separator/assets/floatRGBA-4pIJN00G-DCWbfrRi.js b/custom-toc-separator/assets/floatRGBA-4pIJN00G-DCWbfrRi.js deleted file mode 100644 index 36a22217..00000000 --- a/custom-toc-separator/assets/floatRGBA-4pIJN00G-DCWbfrRi.js +++ /dev/null @@ -1 +0,0 @@ -import{ae as f}from"./story-OUarUCIt.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; diff --git a/custom-toc-separator/assets/floating-ui-DKFFlLv3-Bi8PSsgj.js b/custom-toc-separator/assets/floating-ui-DKFFlLv3-Bi8PSsgj.js new file mode 100644 index 00000000..327dedc8 --- /dev/null +++ b/custom-toc-separator/assets/floating-ui-DKFFlLv3-Bi8PSsgj.js @@ -0,0 +1 @@ +import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; diff --git a/custom-toc-separator/assets/floating-ui-DKFFlLv3-elIRTcW0.js b/custom-toc-separator/assets/floating-ui-DKFFlLv3-elIRTcW0.js deleted file mode 100644 index 9259d4bf..00000000 --- a/custom-toc-separator/assets/floating-ui-DKFFlLv3-elIRTcW0.js +++ /dev/null @@ -1 +0,0 @@ -import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; diff --git a/custom-toc-separator/assets/form-CRSw616T-DM6mxOFq.js b/custom-toc-separator/assets/form-CRSw616T-DM6mxOFq.js new file mode 100644 index 00000000..6f890509 --- /dev/null +++ b/custom-toc-separator/assets/form-CRSw616T-DM6mxOFq.js @@ -0,0 +1 @@ +import{a as M}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; diff --git a/custom-toc-separator/assets/form-CRSw616T-DuqBvFSD.js b/custom-toc-separator/assets/form-CRSw616T-DuqBvFSD.js deleted file mode 100644 index 75cca02a..00000000 --- a/custom-toc-separator/assets/form-CRSw616T-DuqBvFSD.js +++ /dev/null @@ -1 +0,0 @@ -import{a as M}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; diff --git a/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-CbCbq6vS.js b/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-CbCbq6vS.js new file mode 100644 index 00000000..4b62e4fb --- /dev/null +++ b/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-CbCbq6vS.js @@ -0,0 +1 @@ +import{cZ as $,o as T,di as H,dd as ee,J,aO as te,m as ne,l as se}from"./story-DT1Ep1ux.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function L(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function B(e){const n=L(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function W(e,n,t){const{a:c,eSq:s}=B(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!L(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new T("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new T("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)Z(a,g,p,S*n,t),h.push(a.slice());Z(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}Z(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(J,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class V{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function Z(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=B(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,j=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),G=M/16*z*(4+M*(4-3*z)),P=j/q,U=(l+(D-(1-G)*M*S*(k+G*R*(y+G*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function X(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=B(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Y=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,E=i-s,_=Math.sin(E)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(E),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Y,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),j=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-j*z*(f+j/4*(I*(2*f*f-1)-j/6*f*(4*z*z-3)*(4*f*f-3)))),G=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=G/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?J.WGS84:null}export{V as D,X as E,Z as O,C as P,fe as c,ue as h,pe as u}; diff --git a/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-vCqdY65r.js b/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-vCqdY65r.js deleted file mode 100644 index 5e410105..00000000 --- a/custom-toc-separator/assets/geodesicUtils-B8mFUfTk-vCqdY65r.js +++ /dev/null @@ -1 +0,0 @@ -import{cZ as $,o as T,di as H,dd as ee,J,aO as te,m as ne,l as se}from"./story-OUarUCIt.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";function L(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function B(e){const n=L(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function W(e,n,t){const{a:c,eSq:s}=B(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!L(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new T("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new T("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)Z(a,g,p,S*n,t),h.push(a.slice());Z(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}Z(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(J,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class V{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function Z(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=B(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,j=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),G=M/16*z*(4+M*(4-3*z)),P=j/q,U=(l+(D-(1-G)*M*S*(k+G*R*(y+G*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function X(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=B(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Y=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,E=i-s,_=Math.sin(E)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(E),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Y,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),j=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-j*z*(f+j/4*(I*(2*f*f-1)-j/6*f*(4*z*z-3)*(4*f*f-3)))),G=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=G/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?J.WGS84:null}export{V as D,X as E,Z as O,C as P,fe as c,ue as h,pe as u}; diff --git a/custom-toc-separator/assets/geojson-CNt_qtQf-DAI1_86C.js b/custom-toc-separator/assets/geojson-CNt_qtQf-DAI1_86C.js deleted file mode 100644 index a2ab8486..00000000 --- a/custom-toc-separator/assets/geojson-CNt_qtQf-DAI1_86C.js +++ /dev/null @@ -1 +0,0 @@ -import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dc as C,cp as F,ch as N}from"./story-OUarUCIt.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function K(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function U(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=K(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{U as X,V as Y,W as _,w as h}; diff --git a/custom-toc-separator/assets/geojson-CNt_qtQf-DS1EMYq7.js b/custom-toc-separator/assets/geojson-CNt_qtQf-DS1EMYq7.js new file mode 100644 index 00000000..ad10b298 --- /dev/null +++ b/custom-toc-separator/assets/geojson-CNt_qtQf-DS1EMYq7.js @@ -0,0 +1 @@ +import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dc as C,cp as F,ch as N}from"./story-DT1Ep1ux.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function K(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function U(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=K(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{U as X,V as Y,W as _,w as h}; diff --git a/custom-toc-separator/assets/geomasync-uGYsifQH-CCOR2qPB.js b/custom-toc-separator/assets/geomasync-uGYsifQH-CCOR2qPB.js deleted file mode 100644 index 98ecfa5c..00000000 --- a/custom-toc-separator/assets/geomasync-uGYsifQH-CCOR2qPB.js +++ /dev/null @@ -1 +0,0 @@ -import{y as ie,c as le,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as i,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{n as B}from"./portalUtils-CKN9iXwH-BVEO1U-S.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./story-OUarUCIt.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js";import"./main-lj2zzr_L.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./workers-PiCjreoO-mU03Z-E4.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,i.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,i.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,i.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const l=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let l=e[1];if((g(e[1])||P(e[1]))&&(l=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(l instanceof d))throw new s(n,i.InvalidParameter,t);return De(a,l,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],l=e[1];if(!(a instanceof O))throw new s(n,i.InvalidParameter,t);if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,l]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);const l=R(w(e[4],10));if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,i.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),l,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],l=R(e[1]);if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,l);if(u instanceof O)return te(a,l,u);throw new s(n,i.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?ie(a):a instanceof H?le(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=oe(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);const l=e[1];if(l===null)return null;if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const u=ce(a,l);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=ue(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const l=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),l=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,l);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(l=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,l);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,i.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{ln as registerFunctions}; diff --git a/custom-toc-separator/assets/geomasync-uGYsifQH-DIUO-bgz.js b/custom-toc-separator/assets/geomasync-uGYsifQH-DIUO-bgz.js new file mode 100644 index 00000000..6e03947f --- /dev/null +++ b/custom-toc-separator/assets/geomasync-uGYsifQH-DIUO-bgz.js @@ -0,0 +1 @@ +import{y as ie,c as le,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as i,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-52VbaSQ6.js";import{n as B}from"./portalUtils-CKN9iXwH-CegMKdRo.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./story-DT1Ep1ux.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-Ca10MloJ.js";import"./main-BTdHgocv.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./workers-PiCjreoO-DrDY4oeh.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,i.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,i.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,i.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const l=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let l=e[1];if((g(e[1])||P(e[1]))&&(l=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(l instanceof d))throw new s(n,i.InvalidParameter,t);return De(a,l,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],l=e[1];if(!(a instanceof O))throw new s(n,i.InvalidParameter,t);if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,l]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);const l=R(w(e[4],10));if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,i.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),l,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],l=R(e[1]);if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,l);if(u instanceof O)return te(a,l,u);throw new s(n,i.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?ie(a):a instanceof H?le(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=oe(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);const l=e[1];if(l===null)return null;if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const u=ce(a,l);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=ue(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const l=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),l=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,l);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(l=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,l);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,i.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{ln as registerFunctions}; diff --git a/custom-toc-separator/assets/geometryEngine-CdPoFSE4-B4-kNUBs.js b/custom-toc-separator/assets/geometryEngine-CdPoFSE4-B4-kNUBs.js new file mode 100644 index 00000000..f7d568a5 --- /dev/null +++ b/custom-toc-separator/assets/geometryEngine-CdPoFSE4-B4-kNUBs.js @@ -0,0 +1 @@ +import{aO as p,J as l}from"./story-DT1Ep1ux.js";import{G as r}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as n}from"./hydrated-CplJC1Fs-Bf311639.js";import"./main-BTdHgocv.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function R(e){return r.extendedSpatialReferenceInfo(e)}function x(e,t){return r.clip(n,i(e),e,t)}function S(e,t){return r.cut(n,i(e),e,t)}function y(e,t){return r.contains(n,i(e),e,t)}function A(e,t){return r.crosses(n,i(e),e,t)}function D(e,t,a){return r.distance(n,i(e),e,t,a)}function L(e,t){return r.equals(n,i(e),e,t)}function T(e,t){return r.intersects(n,i(e),e,t)}function V(e,t){return r.touches(n,i(e),e,t)}function O(e,t){return r.within(n,i(e),e,t)}function v(e,t){return r.disjoint(n,i(e),e,t)}function z(e,t){return r.overlaps(n,i(e),e,t)}function H(e,t,a){return r.relate(n,i(e),e,t,a)}function J(e){return r.isSimple(n,i(e),e)}function C(e){return r.simplify(n,i(e),e)}function I(e,t=!1){return r.convexHull(n,i(e),e,t)}function N(e,t){return r.difference(n,i(e),e,t)}function b(e,t){return r.symmetricDifference(n,i(e),e,t)}function j(e,t){return r.intersect(n,i(e),e,t)}function q(e,t=null){return r.union(n,i(e),e,t)}function B(e,t,a,s,c,u){return r.offset(n,i(e),e,t,a,s,c,u)}function E(e,t,a,s=!1){return r.buffer(n,i(e),e,t,a,s)}function G(e,t,a,s,c,u){return r.geodesicBuffer(n,i(e),e,t,a,s,c,u)}function P(e,t,a=!0){return r.nearestCoordinate(n,i(e),e,t,a)}function W(e,t){return r.nearestVertex(n,i(e),e,t)}function k(e,t,a,s){return r.nearestVertices(n,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function F(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(r.rotate(e,t,a));return c.spatialReference=s,c}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipHorizontal(e,t));return s.spatialReference=a,s}function M(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipVertical(e,t));return s.spatialReference=a,s}function Q(e,t,a,s){return r.generalize(n,i(e),e,t,a,s)}function U(e,t,a){return r.densify(n,i(e),e,t,a)}function X(e,t,a,s=0){return r.geodesicDensify(n,i(e),e,t,a,s)}function Y(e,t){return r.planarArea(n,i(e),e,t)}function Z(e,t){return r.planarLength(n,i(e),e,t)}function $(e,t,a){return r.geodesicArea(n,i(e),e,t,a)}function _(e,t,a){return r.geodesicLength(n,i(e),e,t,a)}function ee(e,t){return r.intersectLinesToPoints(n,i(e),e,t)}function te(e,t){r.changeDefaultSpatialReferenceTolerance(e,t)}function re(e){r.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{E as buffer,te as changeDefaultSpatialReferenceTolerance,re as clearDefaultSpatialReferenceTolerance,x as clip,y as contains,I as convexHull,A as crosses,S as cut,U as densify,N as difference,v as disjoint,D as distance,L as equals,R as extendedSpatialReferenceInfo,K as flipHorizontal,M as flipVertical,Q as generalize,$ as geodesicArea,G as geodesicBuffer,X as geodesicDensify,_ as geodesicLength,j as intersect,ee as intersectLinesToPoints,T as intersects,J as isSimple,P as nearestCoordinate,W as nearestVertex,k as nearestVertices,B as offset,z as overlaps,Y as planarArea,Z as planarLength,H as relate,F as rotate,C as simplify,b as symmetricDifference,V as touches,q as union,O as within}; diff --git a/custom-toc-separator/assets/geometryEngine-CdPoFSE4-csWZJ4px.js b/custom-toc-separator/assets/geometryEngine-CdPoFSE4-csWZJ4px.js deleted file mode 100644 index a0b8c87d..00000000 --- a/custom-toc-separator/assets/geometryEngine-CdPoFSE4-csWZJ4px.js +++ /dev/null @@ -1 +0,0 @@ -import{aO as p,J as l}from"./story-OUarUCIt.js";import{G as r}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as n}from"./hydrated-CplJC1Fs-BcGP1hGu.js";import"./main-lj2zzr_L.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function R(e){return r.extendedSpatialReferenceInfo(e)}function x(e,t){return r.clip(n,i(e),e,t)}function S(e,t){return r.cut(n,i(e),e,t)}function y(e,t){return r.contains(n,i(e),e,t)}function A(e,t){return r.crosses(n,i(e),e,t)}function D(e,t,a){return r.distance(n,i(e),e,t,a)}function L(e,t){return r.equals(n,i(e),e,t)}function T(e,t){return r.intersects(n,i(e),e,t)}function V(e,t){return r.touches(n,i(e),e,t)}function O(e,t){return r.within(n,i(e),e,t)}function v(e,t){return r.disjoint(n,i(e),e,t)}function z(e,t){return r.overlaps(n,i(e),e,t)}function H(e,t,a){return r.relate(n,i(e),e,t,a)}function J(e){return r.isSimple(n,i(e),e)}function C(e){return r.simplify(n,i(e),e)}function I(e,t=!1){return r.convexHull(n,i(e),e,t)}function N(e,t){return r.difference(n,i(e),e,t)}function b(e,t){return r.symmetricDifference(n,i(e),e,t)}function j(e,t){return r.intersect(n,i(e),e,t)}function q(e,t=null){return r.union(n,i(e),e,t)}function B(e,t,a,s,c,u){return r.offset(n,i(e),e,t,a,s,c,u)}function E(e,t,a,s=!1){return r.buffer(n,i(e),e,t,a,s)}function G(e,t,a,s,c,u){return r.geodesicBuffer(n,i(e),e,t,a,s,c,u)}function P(e,t,a=!0){return r.nearestCoordinate(n,i(e),e,t,a)}function W(e,t){return r.nearestVertex(n,i(e),e,t)}function k(e,t,a,s){return r.nearestVertices(n,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function F(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(r.rotate(e,t,a));return c.spatialReference=s,c}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipHorizontal(e,t));return s.spatialReference=a,s}function M(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipVertical(e,t));return s.spatialReference=a,s}function Q(e,t,a,s){return r.generalize(n,i(e),e,t,a,s)}function U(e,t,a){return r.densify(n,i(e),e,t,a)}function X(e,t,a,s=0){return r.geodesicDensify(n,i(e),e,t,a,s)}function Y(e,t){return r.planarArea(n,i(e),e,t)}function Z(e,t){return r.planarLength(n,i(e),e,t)}function $(e,t,a){return r.geodesicArea(n,i(e),e,t,a)}function _(e,t,a){return r.geodesicLength(n,i(e),e,t,a)}function ee(e,t){return r.intersectLinesToPoints(n,i(e),e,t)}function te(e,t){r.changeDefaultSpatialReferenceTolerance(e,t)}function re(e){r.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{E as buffer,te as changeDefaultSpatialReferenceTolerance,re as clearDefaultSpatialReferenceTolerance,x as clip,y as contains,I as convexHull,A as crosses,S as cut,U as densify,N as difference,v as disjoint,D as distance,L as equals,R as extendedSpatialReferenceInfo,K as flipHorizontal,M as flipVertical,Q as generalize,$ as geodesicArea,G as geodesicBuffer,X as geodesicDensify,_ as geodesicLength,j as intersect,ee as intersectLinesToPoints,T as intersects,J as isSimple,P as nearestCoordinate,W as nearestVertex,k as nearestVertices,B as offset,z as overlaps,Y as planarArea,Z as planarLength,H as relate,F as rotate,C as simplify,b as symmetricDifference,V as touches,q as union,O as within}; diff --git a/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-Ca10MloJ.js b/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-Ca10MloJ.js new file mode 100644 index 00000000..784067e3 --- /dev/null +++ b/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-Ca10MloJ.js @@ -0,0 +1 @@ +import{w as l,g as w}from"./story-DT1Ep1ux.js";import{q as h}from"./workers-PiCjreoO-DrDY4oeh.js";import"./main-BTdHgocv.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function O(e){return r("extendedSpatialReferenceInfo",[e])}async function D(e,t){return c(await r("clip",[a(e),e,t]))}async function J(e,t){return c(await r("cut",[a(e),e,t]))}function N(e,t){return r("contains",[a(e),e,t])}function L(e,t){return r("crosses",[a(e),e,t])}function T(e,t,n){return r("distance",[a(e),e,t,n])}function V(e,t){return r("equals",[a(e),e,t])}function v(e,t){return r("intersects",[a(e),e,t])}function E(e,t){return r("touches",[a(e),e,t])}function b(e,t){return r("within",[a(e),e,t])}function q(e,t){return r("disjoint",[a(e),e,t])}function z(e,t){return r("overlaps",[a(e),e,t])}function H(e,t,n){return r("relate",[a(e),e,t,n])}function I(e){return r("isSimple",[a(e),e])}async function P(e){return c(await r("simplify",[a(e),e]))}async function j(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function k(e,t){return c(await r("difference",[a(e),e,t]))}async function B(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function C(e,t){return c(await r("intersect",[a(e),e,t]))}async function G(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function W(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function F(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function K(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function M(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function Q(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function U(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function X(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function _(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function $(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function ee(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function te(e,t){return r("planarArea",[a(e),e,t])}function ne(e,t){return r("planarLength",[a(e),e,t])}function re(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function ae(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ie(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ce(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function se(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{F as buffer,ce as changeDefaultSpatialReferenceTolerance,se as clearDefaultSpatialReferenceTolerance,D as clip,N as contains,j as convexHull,L as crosses,J as cut,$ as densify,k as difference,q as disjoint,T as distance,V as equals,O as extendedSpatialReferenceInfo,Y as flipHorizontal,Z as flipVertical,_ as generalize,re as geodesicArea,K as geodesicBuffer,ee as geodesicDensify,ae as geodesicLength,C as intersect,ie as intersectLinesToPoints,v as intersects,I as isSimple,M as nearestCoordinate,Q as nearestVertex,U as nearestVertices,W as offset,z as overlaps,te as planarArea,ne as planarLength,H as relate,X as rotate,P as simplify,B as symmetricDifference,E as touches,G as union,b as within}; diff --git a/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js b/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js deleted file mode 100644 index 15cb283b..00000000 --- a/custom-toc-separator/assets/geometryEngineAsync-D7oEu5dd-DKTuVJ-8.js +++ /dev/null @@ -1 +0,0 @@ -import{w as l,g as w}from"./story-OUarUCIt.js";import{q as h}from"./workers-PiCjreoO-mU03Z-E4.js";import"./main-lj2zzr_L.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function O(e){return r("extendedSpatialReferenceInfo",[e])}async function D(e,t){return c(await r("clip",[a(e),e,t]))}async function J(e,t){return c(await r("cut",[a(e),e,t]))}function N(e,t){return r("contains",[a(e),e,t])}function L(e,t){return r("crosses",[a(e),e,t])}function T(e,t,n){return r("distance",[a(e),e,t,n])}function V(e,t){return r("equals",[a(e),e,t])}function v(e,t){return r("intersects",[a(e),e,t])}function E(e,t){return r("touches",[a(e),e,t])}function b(e,t){return r("within",[a(e),e,t])}function q(e,t){return r("disjoint",[a(e),e,t])}function z(e,t){return r("overlaps",[a(e),e,t])}function H(e,t,n){return r("relate",[a(e),e,t,n])}function I(e){return r("isSimple",[a(e),e])}async function P(e){return c(await r("simplify",[a(e),e]))}async function j(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function k(e,t){return c(await r("difference",[a(e),e,t]))}async function B(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function C(e,t){return c(await r("intersect",[a(e),e,t]))}async function G(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function W(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function F(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function K(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function M(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function Q(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function U(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function X(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function _(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function $(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function ee(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function te(e,t){return r("planarArea",[a(e),e,t])}function ne(e,t){return r("planarLength",[a(e),e,t])}function re(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function ae(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ie(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ce(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function se(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{F as buffer,ce as changeDefaultSpatialReferenceTolerance,se as clearDefaultSpatialReferenceTolerance,D as clip,N as contains,j as convexHull,L as crosses,J as cut,$ as densify,k as difference,q as disjoint,T as distance,V as equals,O as extendedSpatialReferenceInfo,Y as flipHorizontal,Z as flipVertical,_ as generalize,re as geodesicArea,K as geodesicBuffer,ee as geodesicDensify,ae as geodesicLength,C as intersect,ie as intersectLinesToPoints,v as intersects,I as isSimple,M as nearestCoordinate,Q as nearestVertex,U as nearestVertices,W as offset,z as overlaps,te as planarArea,ne as planarLength,H as relate,X as rotate,P as simplify,B as symmetricDifference,E as touches,G as union,b as within}; diff --git a/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-BYj7eUAa.js b/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-BYj7eUAa.js new file mode 100644 index 00000000..8218bbe6 --- /dev/null +++ b/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-BYj7eUAa.js @@ -0,0 +1 @@ +import{C as a,o as n,r as s}from"./story-DT1Ep1ux.js";import{f,j as m}from"./project-DQKhruav-C6Tnpe-k.js";import"./main-BTdHgocv.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";async function g(e=null,i){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new n("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:i});const t=r.helperServices?.geometry?.url;if(!t)throw new n("internal:geometry-service-url-not-configured");return t}async function h(e,i,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:i}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new n("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,h as projectGeometry}; diff --git a/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-DHlTWeVi.js b/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-DHlTWeVi.js deleted file mode 100644 index ee18055b..00000000 --- a/custom-toc-separator/assets/geometryServiceUtils-nsujb7BH-DHlTWeVi.js +++ /dev/null @@ -1 +0,0 @@ -import{C as a,o as n,r as s}from"./story-OUarUCIt.js";import{f,j as m}from"./project-DQKhruav-BOvaUqEJ.js";import"./main-lj2zzr_L.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";async function g(e=null,i){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new n("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:i});const t=r.helperServices?.geometry?.url;if(!t)throw new n("internal:geometry-service-url-not-configured");return t}async function h(e,i,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:i}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new n("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,h as projectGeometry}; diff --git a/custom-toc-separator/assets/gif-BZzSowd2-DafcSN51.js b/custom-toc-separator/assets/gif-BZzSowd2-DafcSN51.js deleted file mode 100644 index 43af5c0f..00000000 --- a/custom-toc-separator/assets/gif-BZzSowd2-DafcSN51.js +++ /dev/null @@ -1 +0,0 @@ -import{aN as H}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function ne(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{ne as isAnimatedGIF,L as isGIF,te as parseGif}; diff --git a/custom-toc-separator/assets/gif-BZzSowd2-E75n8wqH.js b/custom-toc-separator/assets/gif-BZzSowd2-E75n8wqH.js new file mode 100644 index 00000000..03a51cf5 --- /dev/null +++ b/custom-toc-separator/assets/gif-BZzSowd2-E75n8wqH.js @@ -0,0 +1 @@ +import{aN as H}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function ne(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{ne as isAnimatedGIF,L as isGIF,te as parseGif}; diff --git a/custom-toc-separator/assets/gltfexport-Dj6nF2RN-BtL3V2y-.js b/custom-toc-separator/assets/gltfexport-Dj6nF2RN-BtL3V2y-.js new file mode 100644 index 00000000..b5077359 --- /dev/null +++ b/custom-toc-separator/assets/gltfexport-Dj6nF2RN-BtL3V2y-.js @@ -0,0 +1 @@ +import{dg as S,i8 as v,eI as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,cw as ae,dG as ce,a1 as he}from"./story-DT1Ep1ux.js";import{O as fe,X as ue}from"./quat-BODLR7mS-Cqne66qw.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{m as ge}from"./Mesh-DLzjDUIO-BGFhxEuV.js";import{b as we}from"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-C_KiPREG.js";import"./main-BTdHgocv.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-DmlAOJ8b.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BChBDP40.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-UtmvndF2.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./vec3-BazNroeq-xVxXS26y.js";import"./External-D_wl4XAw-CF3XmPYl.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CEZkOwEl.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function Ee(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=we({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,w=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,E,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(E=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),w.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),E&&E.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),w.finalize(),d&&d.finalize(),m&&m.finalize(),E&&E.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=Ee(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function yt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{yt as toBinaryGLTF}; diff --git a/custom-toc-separator/assets/gltfexport-Dj6nF2RN-Se_mmrc-.js b/custom-toc-separator/assets/gltfexport-Dj6nF2RN-Se_mmrc-.js deleted file mode 100644 index ddee8298..00000000 --- a/custom-toc-separator/assets/gltfexport-Dj6nF2RN-Se_mmrc-.js +++ /dev/null @@ -1 +0,0 @@ -import{dg as S,i8 as v,eI as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,cw as ae,dG as ce,a1 as he}from"./story-OUarUCIt.js";import{O as fe,X as ue}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{m as ge}from"./Mesh-DLzjDUIO-BlTrUdFo.js";import{b as we}from"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-CrS2VhCe.js";import"./main-lj2zzr_L.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Bin5_zrY.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./vec3-BazNroeq-C58EAHFm.js";import"./External-D_wl4XAw-BzQ8-YjD.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CF_vNE3j.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function Ee(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=we({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,w=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,E,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(E=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),w.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),E&&E.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),w.finalize(),d&&d.finalize(),m&&m.finalize(),E&&E.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=Ee(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function yt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{yt as toBinaryGLTF}; diff --git a/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-2hR_Bz29.js b/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-2hR_Bz29.js new file mode 100644 index 00000000..b81bf929 --- /dev/null +++ b/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-2hR_Bz29.js @@ -0,0 +1 @@ +import{C as l,D as y}from"./utils-BVWK2jiA-inSV67A_.js";import{i as f}from"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import{T as i}from"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function S(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function G(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{S as save,G as saveAs}; diff --git a/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-CTJK_9ZN.js b/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-CTJK_9ZN.js deleted file mode 100644 index fe827c32..00000000 --- a/custom-toc-separator/assets/groupLayerUtils-D-25JsA_-CTJK_9ZN.js +++ /dev/null @@ -1 +0,0 @@ -import{C as l,D as y}from"./utils-BVWK2jiA-Bnz0n_UG.js";import{i as f}from"./jsonContext-BA8GHqVk-CN6VxGdq.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import{T as i}from"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function S(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function G(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{S as save,G as saveAs}; diff --git a/custom-toc-separator/assets/grouping-RwmXkHDc-DhZ3sGff.js b/custom-toc-separator/assets/grouping-RwmXkHDc-DhZ3sGff.js new file mode 100644 index 00000000..f1fa1799 --- /dev/null +++ b/custom-toc-separator/assets/grouping-RwmXkHDc-DhZ3sGff.js @@ -0,0 +1 @@ +import{hm as o}from"./story-DT1Ep1ux.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; diff --git a/custom-toc-separator/assets/grouping-RwmXkHDc-saUNiwHr.js b/custom-toc-separator/assets/grouping-RwmXkHDc-saUNiwHr.js deleted file mode 100644 index 252a0439..00000000 --- a/custom-toc-separator/assets/grouping-RwmXkHDc-saUNiwHr.js +++ /dev/null @@ -1 +0,0 @@ -import{hm as o}from"./story-OUarUCIt.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; diff --git a/custom-toc-separator/assets/header-BRE2xzQs-BpMrIcO-.js b/custom-toc-separator/assets/header-BRE2xzQs-BpMrIcO-.js new file mode 100644 index 00000000..62621d89 --- /dev/null +++ b/custom-toc-separator/assets/header-BRE2xzQs-BpMrIcO-.js @@ -0,0 +1 @@ +import{eT as _,fQ as k,eX as I,eY as M,eZ as A,e_ as E,fa as G,e$ as p,fb as v,f2 as e,fc as n,fd as o,f4 as a,fo as m,f1 as d,fg as c,eU as H,eV as w}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=_({__name:"header",setup(T){const x=k(),{t:l}=I(),s=M("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=f=>x.headerControls.includes(f);return(f,t)=>{const u=E("dropdown-menu"),g=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[o,y()&&i("wizard")],[g,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[o,C()&&i("layerReorder")],[g,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},c(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},c(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[o,i("groupToggle")]]),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},c(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},c(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[o,i("visibilityToggle")]])])}}}),V=H(R,[["__scopeId","data-v-e8031c30"]]);export{V as default}; diff --git a/custom-toc-separator/assets/header-BRE2xzQs-DWujSuMn.js b/custom-toc-separator/assets/header-BRE2xzQs-DWujSuMn.js deleted file mode 100644 index 70953271..00000000 --- a/custom-toc-separator/assets/header-BRE2xzQs-DWujSuMn.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as _,fQ as k,eX as I,eY as M,eZ as A,e_ as E,fa as G,e$ as p,fb as v,f2 as e,fc as n,fd as o,f4 as a,fo as m,f1 as d,fg as c,eU as H,eV as w}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=_({__name:"header",setup(T){const x=k(),{t:l}=I(),s=M("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=f=>x.headerControls.includes(f);return(f,t)=>{const u=E("dropdown-menu"),g=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[o,y()&&i("wizard")],[g,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[o,C()&&i("layerReorder")],[g,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},c(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},c(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[o,i("groupToggle")]]),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},c(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},c(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[o,i("visibilityToggle")]])])}}}),V=H(R,[["__scopeId","data-v-e8031c30"]]);export{V as default}; diff --git a/custom-toc-separator/assets/heatmapUtils-seiMkkkR-BT5eGA8G.js b/custom-toc-separator/assets/heatmapUtils-seiMkkkR-BT5eGA8G.js deleted file mode 100644 index 7635db2e..00000000 --- a/custom-toc-separator/assets/heatmapUtils-seiMkkkR-BT5eGA8G.js +++ /dev/null @@ -1 +0,0 @@ -import{es as u,et as l,ae as m}from"./story-OUarUCIt.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const s=2.4;function g(o){return u(o*s)}function x(o){return l(o)/s}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const f=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),f)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,s as c,x as d,P as x,g as y}; diff --git a/custom-toc-separator/assets/heatmapUtils-seiMkkkR-D22mGlP8.js b/custom-toc-separator/assets/heatmapUtils-seiMkkkR-D22mGlP8.js new file mode 100644 index 00000000..c9c0e24a --- /dev/null +++ b/custom-toc-separator/assets/heatmapUtils-seiMkkkR-D22mGlP8.js @@ -0,0 +1 @@ +import{es as u,et as l,ae as m}from"./story-DT1Ep1ux.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const s=2.4;function g(o){return u(o*s)}function x(o){return l(o)/s}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const f=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),f)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,s as c,x as d,P as x,g as y}; diff --git a/custom-toc-separator/assets/hydrated-CplJC1Fs-BcGP1hGu.js b/custom-toc-separator/assets/hydrated-CplJC1Fs-BcGP1hGu.js deleted file mode 100644 index d3fe65a0..00000000 --- a/custom-toc-separator/assets/hydrated-CplJC1Fs-BcGP1hGu.js +++ /dev/null @@ -1 +0,0 @@ -import{w as r,l as c,m as h,G as x,n as m}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const y={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{y as hydratedAdapter}; diff --git a/custom-toc-separator/assets/hydrated-CplJC1Fs-Bf311639.js b/custom-toc-separator/assets/hydrated-CplJC1Fs-Bf311639.js new file mode 100644 index 00000000..c946c125 --- /dev/null +++ b/custom-toc-separator/assets/hydrated-CplJC1Fs-Bf311639.js @@ -0,0 +1 @@ +import{w as r,l as c,m as h,G as x,n as m}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const y={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{y as hydratedAdapter}; diff --git a/custom-toc-separator/assets/icon-BXFbBbop-BKvGneFm.js b/custom-toc-separator/assets/icon-BXFbBbop-BKvGneFm.js deleted file mode 100644 index b3bf495b..00000000 --- a/custom-toc-separator/assets/icon-BXFbBbop-BKvGneFm.js +++ /dev/null @@ -1 +0,0 @@ -import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-BCNzxmob.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; diff --git a/custom-toc-separator/assets/icon-BXFbBbop-CoY6CcfD.js b/custom-toc-separator/assets/icon-BXFbBbop-CoY6CcfD.js new file mode 100644 index 00000000..928bdade --- /dev/null +++ b/custom-toc-separator/assets/icon-BXFbBbop-CoY6CcfD.js @@ -0,0 +1 @@ +import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-C0_AGNdr.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; diff --git a/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-DfVYzy_v.js b/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-DfVYzy_v.js new file mode 100644 index 00000000..8a94c967 --- /dev/null +++ b/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-DfVYzy_v.js @@ -0,0 +1 @@ +import{o as c,$ as l}from"./story-DT1Ep1ux.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; diff --git a/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-zZ47VIK5.js b/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-zZ47VIK5.js deleted file mode 100644 index 769b7d4c..00000000 --- a/custom-toc-separator/assets/imageBitmapUtils-DA36kg39-zZ47VIK5.js +++ /dev/null @@ -1 +0,0 @@ -import{o as c,$ as l}from"./story-OUarUCIt.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; diff --git a/custom-toc-separator/assets/imageUtils-BA2D6Uf1-CX2rR9bn.js b/custom-toc-separator/assets/imageUtils-BA2D6Uf1-CX2rR9bn.js new file mode 100644 index 00000000..7cc5cc43 --- /dev/null +++ b/custom-toc-separator/assets/imageUtils-BA2D6Uf1-CX2rR9bn.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-E75n8wqH.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./apng-DuERAVke-cdN3r7Cf.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-BTdHgocv.js";import{dG as d,dH as p,f,aU as w,o as y}from"./story-DT1Ep1ux.js";let r=null,o=!0;function E(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function I(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw w(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function v(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-E75n8wqH.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-cdN3r7Cf.js"),__vite__mapDeps([5,6,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:p(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{v as T,I as g,E as y}; diff --git a/custom-toc-separator/assets/imageUtils-BA2D6Uf1-rtvarRV-.js b/custom-toc-separator/assets/imageUtils-BA2D6Uf1-rtvarRV-.js deleted file mode 100644 index 60bc2d49..00000000 --- a/custom-toc-separator/assets/imageUtils-BA2D6Uf1-rtvarRV-.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-DafcSN51.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./apng-DuERAVke-DKoS_DoG.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-lj2zzr_L.js";import{dG as d,dH as p,f,aU as w,o as y}from"./story-OUarUCIt.js";let r=null,o=!0;function E(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function I(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw w(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function v(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-DafcSN51.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-DKoS_DoG.js"),__vite__mapDeps([5,6,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:p(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{v as T,I as g,E as y}; diff --git a/custom-toc-separator/assets/imageUtils-Co-ELErj-CYao57HT.js b/custom-toc-separator/assets/imageUtils-Co-ELErj-CYao57HT.js deleted file mode 100644 index 08830dca..00000000 --- a/custom-toc-separator/assets/imageUtils-Co-ELErj-CYao57HT.js +++ /dev/null @@ -1 +0,0 @@ -import{v as V,i as y,bh as I}from"./story-OUarUCIt.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{I as M}from"./Bitmap-CcqmzvfR-BO796kOM.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{h as P}from"./TileContainer-D48pXXgL-DF8HooMp.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; diff --git a/custom-toc-separator/assets/imageUtils-Co-ELErj-DEpR3hKq.js b/custom-toc-separator/assets/imageUtils-Co-ELErj-DEpR3hKq.js new file mode 100644 index 00000000..ae4645b7 --- /dev/null +++ b/custom-toc-separator/assets/imageUtils-Co-ELErj-DEpR3hKq.js @@ -0,0 +1 @@ +import{v as V,i as y,bh as I}from"./story-DT1Ep1ux.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{I as M}from"./Bitmap-CcqmzvfR-ppkuK-SZ.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{h as P}from"./TileContainer-D48pXXgL-B6YzhmFG.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; diff --git a/custom-toc-separator/assets/imageryUtils-6MVSqijr-Bj5kHpFp.js b/custom-toc-separator/assets/imageryUtils-6MVSqijr-Bj5kHpFp.js deleted file mode 100644 index cd7cef6c..00000000 --- a/custom-toc-separator/assets/imageryUtils-6MVSqijr-Bj5kHpFp.js +++ /dev/null @@ -1 +0,0 @@ -import{C as y,D as n}from"./utils-BVWK2jiA-Bnz0n_UG.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./jsonContext-BA8GHqVk-CN6VxGdq.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function F(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function N(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{F as save,N as saveAs}; diff --git a/custom-toc-separator/assets/imageryUtils-6MVSqijr-igCij5M1.js b/custom-toc-separator/assets/imageryUtils-6MVSqijr-igCij5M1.js new file mode 100644 index 00000000..b680f0d5 --- /dev/null +++ b/custom-toc-separator/assets/imageryUtils-6MVSqijr-igCij5M1.js @@ -0,0 +1 @@ +import{C as y,D as n}from"./utils-BVWK2jiA-inSV67A_.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function F(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function N(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{F as save,N as saveAs}; diff --git a/custom-toc-separator/assets/index--i98kM5n-DwH2NwG-.js b/custom-toc-separator/assets/index--i98kM5n-DwH2NwG-.js new file mode 100644 index 00000000..6449eb48 --- /dev/null +++ b/custom-toc-separator/assets/index--i98kM5n-DwH2NwG-.js @@ -0,0 +1 @@ +import{a as o}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as s}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class f extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{f as default}; diff --git a/custom-toc-separator/assets/index--i98kM5n-JZXaJHS9.js b/custom-toc-separator/assets/index--i98kM5n-JZXaJHS9.js deleted file mode 100644 index 548a6925..00000000 --- a/custom-toc-separator/assets/index--i98kM5n-JZXaJHS9.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as s}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class f extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{f as default}; diff --git a/custom-toc-separator/assets/index-5nGe0Bgx-D0OSmI03.js b/custom-toc-separator/assets/index-5nGe0Bgx-D0OSmI03.js deleted file mode 100644 index dfa79445..00000000 --- a/custom-toc-separator/assets/index-5nGe0Bgx-D0OSmI03.js +++ /dev/null @@ -1,10 +0,0 @@ -import{eT as Y,fX as w,fq as q,fN as z,eY as N,f6 as s,eZ as b,fY as R,f8 as S,eV as T,fZ as W,f9 as B,fB as G,f_ as X,fK as F,f$ as O,g0 as V,e$ as Z,fb as j,f2 as D,fF as K}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class J extends q{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=Y({__name:"northarrow",setup(y){const t=z(),a=w(),e=N("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),p=s(0),r=s(0),h=s(!1),k=s(` - - - - - - - - - `),A=s(!1),x=R([]),I=s([]);let P;S(()=>{const i=t.config.map;I.value=i.tileSchemas,M?.value&&(k.value=``),e.geo.map.esriView?.ready&&C(e.geo.map.getExtent()),x.push(e.event.on(T.MAP_EXTENTCHANGE,W(300,C)))}),B(()=>{x.forEach(i=>e.event.off(i))});const C=async i=>{P=t.activeBasemapConfig;let f;for(const d of I.value)if(P?.tileSchemaId===d.id){f=d?.hasNorthPole;break}const l=e.$vApp.$el.querySelector(".inner-shell"),c=n.value.querySelector(".northarrow").getBoundingClientRect().width,v=e.$vApp.$el.querySelector(".appbar")?.clientWidth||0,_=i.sr;if(f||typeof f>"u"&&!_.isWebMercator()){const d=new G("pole",{x:-96,y:90}),E=await e.geo.proj.projectGeometry(_,d),u=e.geo.map.mapPointToScreenPoint(E);if(u.screenY<0){h.value=!0;const o={screenX:l.clientWidth/2,screenY:l.clientHeight};p.value=Math.atan((u.screenX-o.screenX)/(o.screenY-u.screenY))*180/Math.PI,r.value=l.clientWidth/2+l.clientHeight*Math.tan(p.value*Math.PI/180)-c/2,r.value=Math.max(v-c/2,Math.min(e.geo.map.getPixelWidth()-c/2,r.value))}else if(h.value=!1,!A.value){A.value=!0;let o;$.value?o={style:X.ICON,icon:$.value,height:16.5,width:16.5}:o=ie;const g=e.geo.layer.createLayer({id:m,layerType:F.GRAPHIC,url:"",cosmetic:!0});e.geo.map.addLayer(g),g.loadPromise().then(()=>{const L=new O(E,"northpole"),H=new V(o);L.style=H,g.addGraphic(L)})}}else h.value=!0,p.value=0,r.value=v+(l.clientWidth-v-c)/2};return(i,f)=>(Z(),j("div",{class:"absolute transition-all duration-300 ease-out",style:K({"transform-origin":"top center",transform:`rotate(${p.value}deg)`,left:`${r.value}px`,visibility:h.value?"visible":"hidden"}),ref_key:"el",ref:n},[D("span",{class:"northarrow",innerHTML:k.value},null,8,oe)],4))}}),m="RampPoleMarker";class pe extends J{async added(){this._parseConfig(this.config);const t=this.$vApp.$watch(()=>this.config,n=>this._parseConfig(n)),{destroy:a,el:e}=this.mount(re,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(e.childNodes[0]),this.removed=()=>{t(),this.$iApi.geo.layer.getLayer(m)&&this.$iApi.geo.map.removeLayer(m),w(this.$vApp.$pinia).$reset(),a()}}}export{m as POLE_MARKER_LAYER_ID,pe as default}; diff --git a/custom-toc-separator/assets/index-5nGe0Bgx-YlxbpqHO.js b/custom-toc-separator/assets/index-5nGe0Bgx-YlxbpqHO.js new file mode 100644 index 00000000..fc2e789f --- /dev/null +++ b/custom-toc-separator/assets/index-5nGe0Bgx-YlxbpqHO.js @@ -0,0 +1,10 @@ +import{eT as Y,fX as w,fq as q,fN as z,eY as N,f6 as s,eZ as b,fY as R,f8 as S,eV as T,fZ as W,f9 as B,fB as G,f_ as X,fK as F,f$ as O,g0 as V,e$ as Z,fb as j,f2 as D,fF as K}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class J extends q{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=Y({__name:"northarrow",setup(y){const t=z(),a=w(),e=N("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),p=s(0),r=s(0),h=s(!1),k=s(` + + + + + + + + + `),A=s(!1),x=R([]),I=s([]);let P;S(()=>{const i=t.config.map;I.value=i.tileSchemas,M?.value&&(k.value=``),e.geo.map.esriView?.ready&&C(e.geo.map.getExtent()),x.push(e.event.on(T.MAP_EXTENTCHANGE,W(300,C)))}),B(()=>{x.forEach(i=>e.event.off(i))});const C=async i=>{P=t.activeBasemapConfig;let f;for(const d of I.value)if(P?.tileSchemaId===d.id){f=d?.hasNorthPole;break}const l=e.$vApp.$el.querySelector(".inner-shell"),c=n.value.querySelector(".northarrow").getBoundingClientRect().width,v=e.$vApp.$el.querySelector(".appbar")?.clientWidth||0,_=i.sr;if(f||typeof f>"u"&&!_.isWebMercator()){const d=new G("pole",{x:-96,y:90}),E=await e.geo.proj.projectGeometry(_,d),u=e.geo.map.mapPointToScreenPoint(E);if(u.screenY<0){h.value=!0;const o={screenX:l.clientWidth/2,screenY:l.clientHeight};p.value=Math.atan((u.screenX-o.screenX)/(o.screenY-u.screenY))*180/Math.PI,r.value=l.clientWidth/2+l.clientHeight*Math.tan(p.value*Math.PI/180)-c/2,r.value=Math.max(v-c/2,Math.min(e.geo.map.getPixelWidth()-c/2,r.value))}else if(h.value=!1,!A.value){A.value=!0;let o;$.value?o={style:X.ICON,icon:$.value,height:16.5,width:16.5}:o=ie;const g=e.geo.layer.createLayer({id:m,layerType:F.GRAPHIC,url:"",cosmetic:!0});e.geo.map.addLayer(g),g.loadPromise().then(()=>{const L=new O(E,"northpole"),H=new V(o);L.style=H,g.addGraphic(L)})}}else h.value=!0,p.value=0,r.value=v+(l.clientWidth-v-c)/2};return(i,f)=>(Z(),j("div",{class:"absolute transition-all duration-300 ease-out",style:K({"transform-origin":"top center",transform:`rotate(${p.value}deg)`,left:`${r.value}px`,visibility:h.value?"visible":"hidden"}),ref_key:"el",ref:n},[D("span",{class:"northarrow",innerHTML:k.value},null,8,oe)],4))}}),m="RampPoleMarker";class pe extends J{async added(){this._parseConfig(this.config);const t=this.$vApp.$watch(()=>this.config,n=>this._parseConfig(n)),{destroy:a,el:e}=this.mount(re,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(e.childNodes[0]),this.removed=()=>{t(),this.$iApi.geo.layer.getLayer(m)&&this.$iApi.geo.map.removeLayer(m),w(this.$vApp.$pinia).$reset(),a()}}}export{m as POLE_MARKER_LAYER_ID,pe as default}; diff --git a/custom-toc-separator/assets/index-7blUq_oP--5Wouijx.js b/custom-toc-separator/assets/index-7blUq_oP--5Wouijx.js deleted file mode 100644 index 28d2be83..00000000 --- a/custom-toc-separator/assets/index-7blUq_oP--5Wouijx.js +++ /dev/null @@ -1 +0,0 @@ -import{a as i}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as a}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class m extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{m as default}; diff --git a/custom-toc-separator/assets/index-7blUq_oP-CSrOdB6r.js b/custom-toc-separator/assets/index-7blUq_oP-CSrOdB6r.js new file mode 100644 index 00000000..258b6e9e --- /dev/null +++ b/custom-toc-separator/assets/index-7blUq_oP-CSrOdB6r.js @@ -0,0 +1 @@ +import{a as i}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as a}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class m extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{m as default}; diff --git a/custom-toc-separator/assets/index-98it_ulG-CFyhIbXD.js b/custom-toc-separator/assets/index-98it_ulG-CFyhIbXD.js new file mode 100644 index 00000000..5eb435e4 --- /dev/null +++ b/custom-toc-separator/assets/index-98it_ulG-CFyhIbXD.js @@ -0,0 +1 @@ +import{a as o}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as k,fB as M,fz as y}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class P extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=i=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const i=new M("pole",{x:-96,y:90}),n=await this.$iApi.geo.proj.projectGeometry(p,i),r=this.$iApi.geo.map.mapPointToScreenPoint(n),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(i,n)=>{m.push(n)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{P as default}; diff --git a/custom-toc-separator/assets/index-98it_ulG-DpQBFiXZ.js b/custom-toc-separator/assets/index-98it_ulG-DpQBFiXZ.js deleted file mode 100644 index 9875fced..00000000 --- a/custom-toc-separator/assets/index-98it_ulG-DpQBFiXZ.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as k,fB as M,fz as y}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class P extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=i=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const i=new M("pole",{x:-96,y:90}),n=await this.$iApi.geo.proj.projectGeometry(p,i),r=this.$iApi.geo.map.mapPointToScreenPoint(n),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(i,n)=>{m.push(n)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{P as default}; diff --git a/custom-toc-separator/assets/index-B0lfXXMz-DqovihOc.js b/custom-toc-separator/assets/index-B0lfXXMz-DqovihOc.js new file mode 100644 index 00000000..311f53f0 --- /dev/null +++ b/custom-toc-separator/assets/index-B0lfXXMz-DqovihOc.js @@ -0,0 +1 @@ +import{a as r}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as n,fz as s}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{x as default}; diff --git a/custom-toc-separator/assets/index-B0lfXXMz-zD3uJ2JM.js b/custom-toc-separator/assets/index-B0lfXXMz-zD3uJ2JM.js deleted file mode 100644 index 3556f8f5..00000000 --- a/custom-toc-separator/assets/index-B0lfXXMz-zD3uJ2JM.js +++ /dev/null @@ -1 +0,0 @@ -import{a as r}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as n,fz as s}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{x as default}; diff --git a/custom-toc-separator/assets/index-BAU9PUzR-CFlpMekh.js b/custom-toc-separator/assets/index-BAU9PUzR-CFlpMekh.js deleted file mode 100644 index 30b1aded..00000000 --- a/custom-toc-separator/assets/index-BAU9PUzR-CFlpMekh.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-8ZF8Ib-P.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{_ as o}from"./main-lj2zzr_L.js";import{eT as h,fu as r,fw as c,fJ as p,fq as u,eY as f,eX as d,e_ as v,e$ as m,f0 as g,f1 as x,f2 as s,f4 as _,eV as $}from"./story-OUarUCIt.js";class A extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=p(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=h({__name:"nav-button",setup(i){const e=f("iApi"),{t}=d(),l=()=>e.event.emit($.HELP_TOGGLE);return(C,n)=>{const a=v("mapnav-button");return m(),g(a,{onClickFunction:l,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class z extends A{added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>r(o(()=>import("./screen-x-yg_fPu-8ZF8Ib-P.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&c(this.$vApp.$pinia).removeItem("help"),p(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{z as default}; diff --git a/custom-toc-separator/assets/index-BAU9PUzR-YbjXGoBt.js b/custom-toc-separator/assets/index-BAU9PUzR-YbjXGoBt.js new file mode 100644 index 00000000..a9e03061 --- /dev/null +++ b/custom-toc-separator/assets/index-BAU9PUzR-YbjXGoBt.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-CXKlXON_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{_ as o}from"./main-BTdHgocv.js";import{eT as h,fu as r,fw as c,fJ as p,fq as u,eY as f,eX as d,e_ as v,e$ as m,f0 as g,f1 as x,f2 as s,f4 as _,eV as $}from"./story-DT1Ep1ux.js";class A extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=p(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=h({__name:"nav-button",setup(i){const e=f("iApi"),{t}=d(),l=()=>e.event.emit($.HELP_TOGGLE);return(C,n)=>{const a=v("mapnav-button");return m(),g(a,{onClickFunction:l,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class z extends A{added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>r(o(()=>import("./screen-x-yg_fPu-CXKlXON_.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&c(this.$vApp.$pinia).removeItem("help"),p(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{z as default}; diff --git a/custom-toc-separator/assets/index-BCHMro24-BhsHOcpi.js b/custom-toc-separator/assets/index-BCHMro24-BhsHOcpi.js new file mode 100644 index 00000000..e10b1025 --- /dev/null +++ b/custom-toc-separator/assets/index-BCHMro24-BhsHOcpi.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-BYuMMlg_.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); +import{_ as m}from"./main-BTdHgocv.js";import{fu as u,eW as x,fI as n,fq as b}from"./story-DT1Ep1ux.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class A extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>u(m(()=>import("./screen-DOMT-YVI-BYuMMlg_.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{A as default}; diff --git a/custom-toc-separator/assets/index-BCHMro24-DOn_wpYw.js b/custom-toc-separator/assets/index-BCHMro24-DOn_wpYw.js deleted file mode 100644 index 07b6a297..00000000 --- a/custom-toc-separator/assets/index-BCHMro24-DOn_wpYw.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-DoCwNWas.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); -import{_ as m}from"./main-lj2zzr_L.js";import{fu as u,eW as x,fI as n,fq as b}from"./story-OUarUCIt.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class A extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>u(m(()=>import("./screen-DOMT-YVI-DoCwNWas.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{A as default}; diff --git a/custom-toc-separator/assets/index-BSr9u_6r-BatP-fv8.js b/custom-toc-separator/assets/index-BSr9u_6r-BatP-fv8.js deleted file mode 100644 index 521ed184..00000000 --- a/custom-toc-separator/assets/index-BSr9u_6r-BatP-fv8.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-DklIek-Q.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./index-DY4XJa1m-CssjAgnn.js","./index--i98kM5n-JZXaJHS9.js","./index-DLWeBByc-8qo7ZFOD.js","./index-98it_ulG-DpQBFiXZ.js","./index-7blUq_oP--5Wouijx.js","./index-B0lfXXMz-zD3uJ2JM.js","./index-CWPzg1w2-DoI-_oT1.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-lj2zzr_L.js";import{c0 as D,fu as M,eV as S,eW as k,fC as y,c1 as T,fq as P}from"./story-OUarUCIt.js";import B from"./screen-CmNk4p3g-Bnn1EAq9.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=r.URL||r.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(r.HTMLElement)||r.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=r.URL||r.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});r.saveAs=a.saveAs=a,$.exports=a})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-DklIek-Q.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const r=b.componentSelectedState,_=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(r.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),r.map&&a&&(h=await a.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),r.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),r.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),r.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!r.footnote||!i?F.height+40:F.height+20,c.timestamp=F),r.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),r.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:a}=await import("./index-DY4XJa1m-CssjAgnn.js");return{default:a}},__vite__mapDeps([5,0,1,2,3,4]),import.meta.url)).default,n=(await w(async()=>{const{default:a}=await import("./index--i98kM5n-JZXaJHS9.js");return{default:a}},__vite__mapDeps([6,0,1,2,3,4]),import.meta.url)).default,s=(await w(async()=>{const{default:a}=await import("./index-DLWeBByc-8qo7ZFOD.js");return{default:a}},__vite__mapDeps([7,1,2,3,4,0]),import.meta.url)).default,b=(await w(async()=>{const{default:a}=await import("./index-98it_ulG-DpQBFiXZ.js");return{default:a}},__vite__mapDeps([8,0,1,2,3,4]),import.meta.url)).default,c=(await w(async()=>{const{default:a}=await import("./index-7blUq_oP--5Wouijx.js");return{default:a}},__vite__mapDeps([9,0,1,2,3,4]),import.meta.url)).default,r=(await w(async()=>{const{default:a}=await import("./index-B0lfXXMz-zD3uJ2JM.js");return{default:a}},__vite__mapDeps([10,0,1,2,3,4]),import.meta.url)).default,_=(await w(async()=>{const{default:a}=await import("./index-CWPzg1w2-DoI-_oT1.js");return{default:a}},__vite__mapDeps([11,0,1,2,3,4]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",r),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; diff --git a/custom-toc-separator/assets/index-BSr9u_6r-CjwHzVPN.js b/custom-toc-separator/assets/index-BSr9u_6r-CjwHzVPN.js new file mode 100644 index 00000000..b1082b33 --- /dev/null +++ b/custom-toc-separator/assets/index-BSr9u_6r-CjwHzVPN.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-CA5QxRI5.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./index-DY4XJa1m-CJ7R3Ck9.js","./index--i98kM5n-DwH2NwG-.js","./index-DLWeBByc-R7jsd_5X.js","./index-98it_ulG-CFyhIbXD.js","./index-7blUq_oP-CSrOdB6r.js","./index-B0lfXXMz-DqovihOc.js","./index-CWPzg1w2-x6zViqbY.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-BTdHgocv.js";import{c0 as D,fu as M,eV as S,eW as k,fC as y,c1 as T,fq as P}from"./story-DT1Ep1ux.js";import B from"./screen-CmNk4p3g-DJtW4tFV.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=r.URL||r.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(r.HTMLElement)||r.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=r.URL||r.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});r.saveAs=a.saveAs=a,$.exports=a})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-CA5QxRI5.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const r=b.componentSelectedState,_=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(r.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),r.map&&a&&(h=await a.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),r.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),r.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),r.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!r.footnote||!i?F.height+40:F.height+20,c.timestamp=F),r.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),r.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:a}=await import("./index-DY4XJa1m-CJ7R3Ck9.js");return{default:a}},__vite__mapDeps([5,0,1,2,3,4]),import.meta.url)).default,n=(await w(async()=>{const{default:a}=await import("./index--i98kM5n-DwH2NwG-.js");return{default:a}},__vite__mapDeps([6,0,1,2,3,4]),import.meta.url)).default,s=(await w(async()=>{const{default:a}=await import("./index-DLWeBByc-R7jsd_5X.js");return{default:a}},__vite__mapDeps([7,1,2,3,4,0]),import.meta.url)).default,b=(await w(async()=>{const{default:a}=await import("./index-98it_ulG-CFyhIbXD.js");return{default:a}},__vite__mapDeps([8,0,1,2,3,4]),import.meta.url)).default,c=(await w(async()=>{const{default:a}=await import("./index-7blUq_oP-CSrOdB6r.js");return{default:a}},__vite__mapDeps([9,0,1,2,3,4]),import.meta.url)).default,r=(await w(async()=>{const{default:a}=await import("./index-B0lfXXMz-DqovihOc.js");return{default:a}},__vite__mapDeps([10,0,1,2,3,4]),import.meta.url)).default,_=(await w(async()=>{const{default:a}=await import("./index-CWPzg1w2-x6zViqbY.js");return{default:a}},__vite__mapDeps([11,0,1,2,3,4]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",r),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; diff --git a/custom-toc-separator/assets/index-Bo-4afBP-C2FcYFL4.js b/custom-toc-separator/assets/index-Bo-4afBP-C2FcYFL4.js new file mode 100644 index 00000000..77826754 --- /dev/null +++ b/custom-toc-separator/assets/index-Bo-4afBP-C2FcYFL4.js @@ -0,0 +1 @@ +import{eT as T,eU as F,eV as te,eW as S,eX as W,eY as V,eZ as q,e_ as G,e$ as l,f0 as k,f1 as X,f2 as A,f3 as E,f4 as O,f5 as L,f6 as I,f7 as ae,f8 as J,f9 as Q,fa as N,fb as g,fc as P,fd as ee,fe as ne,ff as ie,fg as se,fh as oe,fi as le,fj as re,fk as R,fl as x,fm as M,fn as K,fo as U,fp as pe,fq as ue,fr as ce,fs as j,ft as de}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class D{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const fe=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(v){const{t:a}=W(),r=V("iApi"),n=v,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=G("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:v.panelId},{default:X(()=>[A("div",{class:E(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":v.overflow}]),innerHTML:d.value.icon},null,10,fe)]),_:1},8,["tooltip","id"])):L("",!0)}}}),me={},ve={class:"border-b p-0 self-center w-2/3"};function he(v,a){return l(),g("span",ve)}const Y=F(me,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(v){var a=v.state,r=v.name,n=v.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,u=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",m=w==="top"?"top":"bottom";a.modifiersData[r]={width:u-d[_]-e,height:h-d[m]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(v,{expose:a,emit:r}){const{t:n}=W(),d=V("iApi"),o=v,e=r;function y(){e("updateParent")}const p=I(!1),u=I(0),h=I(),z=I(),w=I();function _(){y(),R(()=>{m(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const m=()=>{p.value=!p.value;const c=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:f}){const{width:i}=f.modifiersData.maxSize;f.styles.popper={...f.styles.popper,maxWidth:`${i}px`,maxHeight:`${c.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),c.offsetHeight-45);f.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),f.styles.popper.overflowY="auto",f.styles.popper.overflowX="hidden"}};z.value&&w.value&&(u.value++,ce(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:c}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:c}}],...o.popperOptions})),u.value===1&&_()};return J(()=>{window.addEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(c,b)=>{const f=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>m()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[f],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(c.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(v){const a=ie(),{t:r}=W(),n=V("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=G("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:X(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):L("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ie=["content"],Ee=T({__name:"appbar",setup(v){const a=oe(),r=S(),n=I(0),d=I(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=I(!1),u=I({}),h=I(),z=()=>{R(()=>{j()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=m=>{m.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const m=j();window.addEventListener("resize",()=>m?.proxy?.$forceUpdate())}),Q(()=>{const m=j();window.removeEventListener("resize",()=>m?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const m=h.value;let c,b=[...m.children],f=b[b.length-2].getBoundingClientRect().top;a.mobileView||(f=m.getBoundingClientRect().bottom-38);let i=m.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(f&&i&&(C>f||p.value&&C+56>f))b[s].classList.forEach(B=>{B.includes("identifier")&&(c=B.slice(11))}),c&&(u.value[c]=!0,c.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=m.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(c=void 0,p.value&&f&&$&&i&&t!==0&&(t<=f-56||i.childElementCount==1&&t<=f)){let s=i.childElementCount,C=0;for(;t<=f-56||s==1;){let B=i.children[C];if(B&&(B.classList.forEach(Z=>{Z.includes("identifier")&&(c=Z.slice(11))}),c&&(u.value[c]=!1,c.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(u.value).forEach(s=>{m.querySelector(`.identifier-${s}`)||(delete u.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(m,c)=>{const b=N("focus-list"),f=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):u.value[`${t}-${s}`]!==!0?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:E(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]!==!0?(l(),k(Y,{class:E(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):L("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(U(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:X(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):u.value[`${t}-${s}`]?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]?(l(),k(Y,{key:0,class:E(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):L("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),U(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),U(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ie)),[[b],[f,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ue{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new D(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof D?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof D?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Me extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ee,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(u=>this.$iApi.event.off(u));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(u=>e.removeButton(u)),p.forEach(u=>e.removeButton(u)),a(),e.$reset()}}}export{Me as default}; diff --git a/custom-toc-separator/assets/index-Bo-4afBP-CJUZCL2Q.js b/custom-toc-separator/assets/index-Bo-4afBP-CJUZCL2Q.js deleted file mode 100644 index 126d33bc..00000000 --- a/custom-toc-separator/assets/index-Bo-4afBP-CJUZCL2Q.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as T,eU as F,eV as te,eW as S,eX as W,eY as V,eZ as q,e_ as G,e$ as l,f0 as k,f1 as X,f2 as A,f3 as E,f4 as O,f5 as L,f6 as I,f7 as ae,f8 as J,f9 as Q,fa as N,fb as g,fc as P,fd as ee,fe as ne,ff as ie,fg as se,fh as oe,fi as le,fj as re,fk as R,fl as x,fm as M,fn as K,fo as U,fp as pe,fq as ue,fr as ce,fs as j,ft as de}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class D{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const fe=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(v){const{t:a}=W(),r=V("iApi"),n=v,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=G("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:v.panelId},{default:X(()=>[A("div",{class:E(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":v.overflow}]),innerHTML:d.value.icon},null,10,fe)]),_:1},8,["tooltip","id"])):L("",!0)}}}),me={},ve={class:"border-b p-0 self-center w-2/3"};function he(v,a){return l(),g("span",ve)}const Y=F(me,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(v){var a=v.state,r=v.name,n=v.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,u=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",m=w==="top"?"top":"bottom";a.modifiersData[r]={width:u-d[_]-e,height:h-d[m]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(v,{expose:a,emit:r}){const{t:n}=W(),d=V("iApi"),o=v,e=r;function y(){e("updateParent")}const p=I(!1),u=I(0),h=I(),z=I(),w=I();function _(){y(),R(()=>{m(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const m=()=>{p.value=!p.value;const c=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:f}){const{width:i}=f.modifiersData.maxSize;f.styles.popper={...f.styles.popper,maxWidth:`${i}px`,maxHeight:`${c.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),c.offsetHeight-45);f.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),f.styles.popper.overflowY="auto",f.styles.popper.overflowX="hidden"}};z.value&&w.value&&(u.value++,ce(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:c}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:c}}],...o.popperOptions})),u.value===1&&_()};return J(()=>{window.addEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(c,b)=>{const f=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>m()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[f],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(c.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(v){const a=ie(),{t:r}=W(),n=V("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=G("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:X(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):L("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ie=["content"],Ee=T({__name:"appbar",setup(v){const a=oe(),r=S(),n=I(0),d=I(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=I(!1),u=I({}),h=I(),z=()=>{R(()=>{j()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=m=>{m.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const m=j();window.addEventListener("resize",()=>m?.proxy?.$forceUpdate())}),Q(()=>{const m=j();window.removeEventListener("resize",()=>m?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const m=h.value;let c,b=[...m.children],f=b[b.length-2].getBoundingClientRect().top;a.mobileView||(f=m.getBoundingClientRect().bottom-38);let i=m.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(f&&i&&(C>f||p.value&&C+56>f))b[s].classList.forEach(B=>{B.includes("identifier")&&(c=B.slice(11))}),c&&(u.value[c]=!0,c.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=m.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(c=void 0,p.value&&f&&$&&i&&t!==0&&(t<=f-56||i.childElementCount==1&&t<=f)){let s=i.childElementCount,C=0;for(;t<=f-56||s==1;){let B=i.children[C];if(B&&(B.classList.forEach(Z=>{Z.includes("identifier")&&(c=Z.slice(11))}),c&&(u.value[c]=!1,c.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(u.value).forEach(s=>{m.querySelector(`.identifier-${s}`)||(delete u.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(m,c)=>{const b=N("focus-list"),f=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):u.value[`${t}-${s}`]!==!0?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:E(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]!==!0?(l(),k(Y,{class:E(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):L("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(U(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:X(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):u.value[`${t}-${s}`]?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]?(l(),k(Y,{key:0,class:E(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):L("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),U(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),U(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ie)),[[b],[f,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ue{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new D(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof D?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof D?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Me extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ee,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(u=>this.$iApi.event.off(u));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(u=>e.removeButton(u)),p.forEach(u=>e.removeButton(u)),a(),e.$reset()}}}export{Me as default}; diff --git a/custom-toc-separator/assets/index-CDhNyq-A-6YEYZJN3.js b/custom-toc-separator/assets/index-CDhNyq-A-6YEYZJN3.js new file mode 100644 index 00000000..7b242ebd --- /dev/null +++ b/custom-toc-separator/assets/index-CDhNyq-A-6YEYZJN3.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-WSjk9RpP.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_ as n}from"./main-BTdHgocv.js";import{eT as l,fH as a,fu as h,eW as p,fw as g,fq as v,eX as f,eY as m,e_ as u,e$ as d,f0 as x,f1 as $,f2 as e,f4 as b}from"./story-DT1Ep1ux.js";class w extends v{}const A=l({__name:"nav-button",setup(s){const{t}=f(),o=m("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(E,r)=>{const c=u("mapnav-button");return d(),x(c,{onClickFunction:i,tooltip:b(t)("geosearch.title")},{default:$(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>h(n(()=>import("./screen-oq2ZVtwf-WSjk9RpP.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; diff --git a/custom-toc-separator/assets/index-CDhNyq-A-Cu1yT7yL.js b/custom-toc-separator/assets/index-CDhNyq-A-Cu1yT7yL.js deleted file mode 100644 index 52b69b71..00000000 --- a/custom-toc-separator/assets/index-CDhNyq-A-Cu1yT7yL.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-BUI18Bzk.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_ as n}from"./main-lj2zzr_L.js";import{eT as l,fH as a,fu as h,eW as p,fw as g,fq as v,eX as f,eY as m,e_ as u,e$ as d,f0 as x,f1 as $,f2 as e,f4 as b}from"./story-OUarUCIt.js";class w extends v{}const A=l({__name:"nav-button",setup(s){const{t}=f(),o=m("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(E,r)=>{const c=u("mapnav-button");return d(),x(c,{onClickFunction:i,tooltip:b(t)("geosearch.title")},{default:$(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>h(n(()=>import("./screen-oq2ZVtwf-BUI18Bzk.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; diff --git a/custom-toc-separator/assets/index-CMEOtVDx-DNq3WAw4.js b/custom-toc-separator/assets/index-CMEOtVDx-DNq3WAw4.js new file mode 100644 index 00000000..c235a99b --- /dev/null +++ b/custom-toc-separator/assets/index-CMEOtVDx-DNq3WAw4.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-omfYDdmY.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{_ as s}from"./main-BTdHgocv.js";import{fu as o,eW as d,fW as i,fq as l}from"./story-DT1Ep1ux.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class u extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>o(s(()=>import("./screen-D-fcMt_1-omfYDdmY.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{u as default}; diff --git a/custom-toc-separator/assets/index-CMEOtVDx-HJLIrvg7.js b/custom-toc-separator/assets/index-CMEOtVDx-HJLIrvg7.js deleted file mode 100644 index 2e3ab5e3..00000000 --- a/custom-toc-separator/assets/index-CMEOtVDx-HJLIrvg7.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-D2Nfhzn1.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{_ as s}from"./main-lj2zzr_L.js";import{fu as o,eW as d,fW as i,fq as l}from"./story-OUarUCIt.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class u extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>o(s(()=>import("./screen-D-fcMt_1-D2Nfhzn1.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{u as default}; diff --git a/custom-toc-separator/assets/index-CRabsHaP-WSDZ4QNs.js b/custom-toc-separator/assets/index-CRabsHaP-WSDZ4QNs.js new file mode 100644 index 00000000..39300bba --- /dev/null +++ b/custom-toc-separator/assets/index-CRabsHaP-WSDZ4QNs.js @@ -0,0 +1 @@ +import{fq as f,fK as y,fL as m,fM as u,eV as l,fN as w,fO as A,fP as L}from"./story-DT1Ep1ux.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";import"./main-BTdHgocv.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class F extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{F as default}; diff --git a/custom-toc-separator/assets/index-CRabsHaP-l2q6xPB7.js b/custom-toc-separator/assets/index-CRabsHaP-l2q6xPB7.js deleted file mode 100644 index 1413f7b3..00000000 --- a/custom-toc-separator/assets/index-CRabsHaP-l2q6xPB7.js +++ /dev/null @@ -1 +0,0 @@ -import{fq as f,fK as y,fL as m,fM as u,eV as l,fN as w,fO as A,fP as L}from"./story-OUarUCIt.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";import"./main-lj2zzr_L.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class F extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{F as default}; diff --git a/custom-toc-separator/assets/index-CWPzg1w2-DoI-_oT1.js b/custom-toc-separator/assets/index-CWPzg1w2-DoI-_oT1.js deleted file mode 100644 index a9929776..00000000 --- a/custom-toc-separator/assets/index-CWPzg1w2-DoI-_oT1.js +++ /dev/null @@ -1 +0,0 @@ -import{a as s}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as a,fz as f}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=f(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; diff --git a/custom-toc-separator/assets/index-CWPzg1w2-x6zViqbY.js b/custom-toc-separator/assets/index-CWPzg1w2-x6zViqbY.js new file mode 100644 index 00000000..42883dce --- /dev/null +++ b/custom-toc-separator/assets/index-CWPzg1w2-x6zViqbY.js @@ -0,0 +1 @@ +import{a as s}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as a,fz as f}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=f(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; diff --git a/custom-toc-separator/assets/index-CfINOE3J-BqcWZB1C.js b/custom-toc-separator/assets/index-CfINOE3J-BqcWZB1C.js new file mode 100644 index 00000000..7ea792b3 --- /dev/null +++ b/custom-toc-separator/assets/index-CfINOE3J-BqcWZB1C.js @@ -0,0 +1 @@ +import{fD as c,eV as o,fE as f,fq as r}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{d as default}; diff --git a/custom-toc-separator/assets/index-CfINOE3J-DwQB1PfX.js b/custom-toc-separator/assets/index-CfINOE3J-DwQB1PfX.js deleted file mode 100644 index 049dc32f..00000000 --- a/custom-toc-separator/assets/index-CfINOE3J-DwQB1PfX.js +++ /dev/null @@ -1 +0,0 @@ -import{fD as c,eV as o,fE as f,fq as r}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{d as default}; diff --git a/custom-toc-separator/assets/index-ChMe1Rap-BAxcNPni.js b/custom-toc-separator/assets/index-ChMe1Rap-BAxcNPni.js new file mode 100644 index 00000000..815f1e81 --- /dev/null +++ b/custom-toc-separator/assets/index-ChMe1Rap-BAxcNPni.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-BvGJ0BJJ.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_ as l}from"./main-BTdHgocv.js";import{eT as o,fq as m,fu as r,eW as c,fw as b,eX as v,eY as f,e_ as h,e$ as d,f0 as u,f1 as g,f2 as e,f4 as w}from"./story-DT1Ep1ux.js";const x=o({__name:"nav-button",setup(t){const{t:s}=v(),i=f("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return d(),u(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class z extends m{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>r(l(()=>import("./screen-CcinMdyM-BvGJ0BJJ.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&c(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{z as default}; diff --git a/custom-toc-separator/assets/index-ChMe1Rap-MOGs8aLX.js b/custom-toc-separator/assets/index-ChMe1Rap-MOGs8aLX.js deleted file mode 100644 index de48906d..00000000 --- a/custom-toc-separator/assets/index-ChMe1Rap-MOGs8aLX.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-7EQ4XGgC.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_ as l}from"./main-lj2zzr_L.js";import{eT as o,fq as m,fu as r,eW as c,fw as b,eX as v,eY as f,e_ as h,e$ as d,f0 as u,f1 as g,f2 as e,f4 as w}from"./story-OUarUCIt.js";const x=o({__name:"nav-button",setup(t){const{t:s}=v(),i=f("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return d(),u(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class z extends m{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>r(l(()=>import("./screen-CcinMdyM-7EQ4XGgC.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&c(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{z as default}; diff --git a/custom-toc-separator/assets/index-CobT58Py-DN7BCOar.js b/custom-toc-separator/assets/index-CobT58Py-DN7BCOar.js new file mode 100644 index 00000000..48a3be68 --- /dev/null +++ b/custom-toc-separator/assets/index-CobT58Py-DN7BCOar.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-DczIDCpl.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./vue.esm-bundler-D2erd_gM-upufHWko.js"])))=>i.map(i=>d[i]); +import{_ as f}from"./main-BTdHgocv.js";import{fu as p,g7 as y,fq as g,fL as m,fK as i,g8 as n,g9 as w}from"./story-DT1Ep1ux.js";class h extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends m{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new w(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class b extends h{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>p(f(()=>import("./screen-NGXXpKUs-DczIDCpl.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{b as default}; diff --git a/custom-toc-separator/assets/index-CobT58Py-DVZyeZ38.js b/custom-toc-separator/assets/index-CobT58Py-DVZyeZ38.js deleted file mode 100644 index acf9b122..00000000 --- a/custom-toc-separator/assets/index-CobT58Py-DVZyeZ38.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-D3LBBqWj.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./vue.esm-bundler-D2erd_gM-CUmoCxCJ.js"])))=>i.map(i=>d[i]); -import{_ as f}from"./main-lj2zzr_L.js";import{fu as p,g7 as y,fq as g,fL as m,fK as i,g8 as n,g9 as w}from"./story-OUarUCIt.js";class h extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends m{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new w(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class b extends h{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>p(f(()=>import("./screen-NGXXpKUs-D3LBBqWj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{b as default}; diff --git a/custom-toc-separator/assets/index-CuDicHX--Bms5gQPK.js b/custom-toc-separator/assets/index-CuDicHX--Bms5gQPK.js deleted file mode 100644 index b353ca43..00000000 --- a/custom-toc-separator/assets/index-CuDicHX--Bms5gQPK.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as I,eU as P,g1 as m,fq as O,eX as R,eY as F,fN as $,f6 as f,eZ as l,fY as M,f8 as T,eV as d,fZ as k,f9 as z,fa as D,e$ as y,fb as g,f2 as v,f3 as H,fc as N,f4 as x,fF as L,g2 as q,fK as W,fu as G,g3 as Z,f$ as K,g4 as Y,g5 as j}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class U extends q{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:W.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await Z.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Y({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return j.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class X extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const J={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=f(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new U(i));const o=f(!0),E=f(!1),c=M([]);T(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());c.push(i.event.on(d.MAP_EXTENTCHANGE,k(100,s=>{p.then(()=>{r.updateOverview(s)})}))),c.push(i.event.on(d.MAP_CREATED,()=>{u()})),c.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),c.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{c.forEach(p=>i.event.off(p)),r.destroyMap()});const V=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},C=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return y(),g("div",{class:"relative",ref_key:"el",ref:h},[v("div",{style:L(C()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[v("div",J,[v("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:V},null,34)]),v("div",Q,[N((y(),g("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(y(),g("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[v("g",{id:"apple-keyboard-control"},[v("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class ne extends X{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{ne as default}; diff --git a/custom-toc-separator/assets/index-CuDicHX--Ca8hpm_o.js b/custom-toc-separator/assets/index-CuDicHX--Ca8hpm_o.js new file mode 100644 index 00000000..f2acbec0 --- /dev/null +++ b/custom-toc-separator/assets/index-CuDicHX--Ca8hpm_o.js @@ -0,0 +1 @@ +import{eT as I,eU as P,g1 as m,fq as O,eX as R,eY as F,fN as $,f6 as f,eZ as l,fY as M,f8 as T,eV as d,fZ as k,f9 as z,fa as D,e$ as y,fb as g,f2 as v,f3 as H,fc as N,f4 as x,fF as L,g2 as q,fK as W,fu as G,g3 as Z,f$ as K,g4 as Y,g5 as j}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class U extends q{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:W.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await Z.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Y({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return j.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class X extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const J={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=f(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new U(i));const o=f(!0),E=f(!1),c=M([]);T(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());c.push(i.event.on(d.MAP_EXTENTCHANGE,k(100,s=>{p.then(()=>{r.updateOverview(s)})}))),c.push(i.event.on(d.MAP_CREATED,()=>{u()})),c.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),c.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{c.forEach(p=>i.event.off(p)),r.destroyMap()});const V=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},C=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return y(),g("div",{class:"relative",ref_key:"el",ref:h},[v("div",{style:L(C()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[v("div",J,[v("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:V},null,34)]),v("div",Q,[N((y(),g("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(y(),g("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[v("g",{id:"apple-keyboard-control"},[v("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class ne extends X{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{ne as default}; diff --git a/custom-toc-separator/assets/index-Czft7XuG-BD2yKmer.js b/custom-toc-separator/assets/index-Czft7XuG-BD2yKmer.js new file mode 100644 index 00000000..08133863 --- /dev/null +++ b/custom-toc-separator/assets/index-Czft7XuG-BD2yKmer.js @@ -0,0 +1 @@ +import{eT as p,eU as d,g6 as i,eX as g,eY as u,f6 as v,eZ as h,f8 as f,eV as $,f9 as m,e$ as A,fb as b,f2 as w,fg as _,f4 as C,fq as E}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},q={class:"sg-label"},L=p({__name:"map-scrollguard",setup(o){const e=i(),{t:r}=g(),s=u("iApi"),t=v(),c=h(()=>e.enabled);f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on($.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),m(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!c.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),b("div",{class:"sg",ref_key:"scrollGuard",ref:t},[w("p",q,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(L,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class N extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{N as default}; diff --git a/custom-toc-separator/assets/index-Czft7XuG-Sukq9ac5.js b/custom-toc-separator/assets/index-Czft7XuG-Sukq9ac5.js deleted file mode 100644 index be9e0654..00000000 --- a/custom-toc-separator/assets/index-Czft7XuG-Sukq9ac5.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as p,eU as d,g6 as i,eX as g,eY as u,f6 as v,eZ as h,f8 as f,eV as $,f9 as m,e$ as A,fb as b,f2 as w,fg as _,f4 as C,fq as E}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},q={class:"sg-label"},L=p({__name:"map-scrollguard",setup(o){const e=i(),{t:r}=g(),s=u("iApi"),t=v(),c=h(()=>e.enabled);f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on($.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),m(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!c.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),b("div",{class:"sg",ref_key:"scrollGuard",ref:t},[w("p",q,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(L,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class N extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{N as default}; diff --git a/custom-toc-separator/assets/index-DDW2D8Uj-B2BdOmkB.js b/custom-toc-separator/assets/index-DDW2D8Uj-B2BdOmkB.js deleted file mode 100644 index d15d973c..00000000 --- a/custom-toc-separator/assets/index-DDW2D8Uj-B2BdOmkB.js +++ /dev/null @@ -1 +0,0 @@ -import{fu as r,eW as a,fv as s,fq as n}from"./story-OUarUCIt.js";import o from"./screen-bYjBkDBU-Bd7Kjphf.js";import"./main-lj2zzr_L.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class g extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{g as default}; diff --git a/custom-toc-separator/assets/index-DDW2D8Uj-BB48WtXZ.js b/custom-toc-separator/assets/index-DDW2D8Uj-BB48WtXZ.js new file mode 100644 index 00000000..de8c1986 --- /dev/null +++ b/custom-toc-separator/assets/index-DDW2D8Uj-BB48WtXZ.js @@ -0,0 +1 @@ +import{fu as r,eW as a,fv as s,fq as n}from"./story-DT1Ep1ux.js";import o from"./screen-bYjBkDBU-Bo2MBRCz.js";import"./main-BTdHgocv.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class g extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{g as default}; diff --git a/custom-toc-separator/assets/index-DH-yVcMF-Bby4fSok.js b/custom-toc-separator/assets/index-DH-yVcMF-Bby4fSok.js deleted file mode 100644 index 478c4c11..00000000 --- a/custom-toc-separator/assets/index-DH-yVcMF-Bby4fSok.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as w,eU as E,fq as y,eX as T,eY as _,f6 as h,fY as f,f8 as M,eV as p,f9 as A,e$ as x,fb as R,f2 as $,fg as I,f4 as P}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(m){const{t:r}=T(),t=_("iApi"),s=h(),u=h(-1),o=f([]),n=f([]);M(()=>{c(),n.push(t.event.on(p.MAP_CREATED,()=>{c()})),n.push(t.event.on(p.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_END,()=>{c()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const c=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:v,pointerType:g,x:l,y:d}=a,i=e.get(v);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(l-i.x,2)+Math.pow(d-i.y,2))<20||(s.value.classList.add("pg-active"),u.value!==-1&&clearTimeout(u.value),u.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-l,i.y-d))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[$("p",L,I(P(r)("panguard.instructions")),1)],512))}}),V=E(S,[["__scopeId","data-v-e91f9000"]]);class C extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:r,el:t}=this.mount(V,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{r()}}}export{C as default}; diff --git a/custom-toc-separator/assets/index-DH-yVcMF-Cvk9hHLl.js b/custom-toc-separator/assets/index-DH-yVcMF-Cvk9hHLl.js new file mode 100644 index 00000000..0d05ee41 --- /dev/null +++ b/custom-toc-separator/assets/index-DH-yVcMF-Cvk9hHLl.js @@ -0,0 +1 @@ +import{eT as w,eU as E,fq as y,eX as T,eY as _,f6 as h,fY as f,f8 as M,eV as p,f9 as A,e$ as x,fb as R,f2 as $,fg as I,f4 as P}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(m){const{t:r}=T(),t=_("iApi"),s=h(),u=h(-1),o=f([]),n=f([]);M(()=>{c(),n.push(t.event.on(p.MAP_CREATED,()=>{c()})),n.push(t.event.on(p.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_END,()=>{c()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const c=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:v,pointerType:g,x:l,y:d}=a,i=e.get(v);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(l-i.x,2)+Math.pow(d-i.y,2))<20||(s.value.classList.add("pg-active"),u.value!==-1&&clearTimeout(u.value),u.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-l,i.y-d))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[$("p",L,I(P(r)("panguard.instructions")),1)],512))}}),V=E(S,[["__scopeId","data-v-e91f9000"]]);class C extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:r,el:t}=this.mount(V,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{r()}}}export{C as default}; diff --git a/custom-toc-separator/assets/index-DLWeBByc-8qo7ZFOD.js b/custom-toc-separator/assets/index-DLWeBByc-8qo7ZFOD.js deleted file mode 100644 index bef1c7e1..00000000 --- a/custom-toc-separator/assets/index-DLWeBByc-8qo7ZFOD.js +++ /dev/null @@ -1 +0,0 @@ -import{fq as k}from"./story-OUarUCIt.js";import{a}from"./fabric-Df28hv38-DklIek-Q.js";import"./main-lj2zzr_L.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class Y extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{Y as default}; diff --git a/custom-toc-separator/assets/index-DLWeBByc-R7jsd_5X.js b/custom-toc-separator/assets/index-DLWeBByc-R7jsd_5X.js new file mode 100644 index 00000000..b5e1a0fa --- /dev/null +++ b/custom-toc-separator/assets/index-DLWeBByc-R7jsd_5X.js @@ -0,0 +1 @@ +import{fq as k}from"./story-DT1Ep1ux.js";import{a}from"./fabric-Df28hv38-CA5QxRI5.js";import"./main-BTdHgocv.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class Y extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{Y as default}; diff --git a/custom-toc-separator/assets/index-DMxHNnSm-Ne_6irc8.js b/custom-toc-separator/assets/index-DMxHNnSm-Ne_6irc8.js new file mode 100644 index 00000000..a4bf6bec --- /dev/null +++ b/custom-toc-separator/assets/index-DMxHNnSm-Ne_6irc8.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-BIZz3E9T.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_ as c}from"./main-BTdHgocv.js";import{eT as y,fu as u,eW as m,fw as f,fQ as a,fq as v,fR as L,fS as s,fT as x,fU as g,fK as b,eX as I,eY as E,e_ as A,e$ as $,f0 as w,f1 as _,f2 as h,f4 as C}from"./story-DT1Ep1ux.js";class S extends v{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=y({__name:"nav-button",setup(p){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class z extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>u(c(()=>import("./screen-DTrOvIb7-BIZz3E9T.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&f(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{z as default}; diff --git a/custom-toc-separator/assets/index-DMxHNnSm-ZdsRjFZ3.js b/custom-toc-separator/assets/index-DMxHNnSm-ZdsRjFZ3.js deleted file mode 100644 index 1e5db2c3..00000000 --- a/custom-toc-separator/assets/index-DMxHNnSm-ZdsRjFZ3.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-BPIQ-kXM.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_ as c}from"./main-lj2zzr_L.js";import{eT as y,fu as u,eW as m,fw as f,fQ as a,fq as v,fR as L,fS as s,fT as x,fU as g,fK as b,eX as I,eY as E,e_ as A,e$ as $,f0 as w,f1 as _,f2 as h,f4 as C}from"./story-OUarUCIt.js";class S extends v{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=y({__name:"nav-button",setup(p){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class z extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>u(c(()=>import("./screen-DTrOvIb7-BPIQ-kXM.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&f(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{z as default}; diff --git a/custom-toc-separator/assets/index-DRrktYRZ-DND0yWIU.js b/custom-toc-separator/assets/index-DRrktYRZ-DND0yWIU.js new file mode 100644 index 00000000..99b4d9fe --- /dev/null +++ b/custom-toc-separator/assets/index-DRrktYRZ-DND0yWIU.js @@ -0,0 +1 @@ +import{eT as r,fq as i,f6 as p,f8 as m,e$ as u,fb as d,f2 as l,eY as c,e_ as f,f0 as h,f1 as b}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const v=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),a=p("https://i.imgur.com/p13yknD.png");return m(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(n,o)=>(u(),d("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[l("img",{style:{width:"250px"},src:a.value,alt:"Snowman",srcset:""},null,8,v)],512))}}),w=r({__name:"appbar-button",setup(s){const e=c("iApi"),t=()=>{e.fixture.add("snowman")};return(a,n)=>{const o=f("appbar-button",!0);return u(),h(o,{onClickFunction:t,tooltip:"⛄"},{default:b(()=>n[0]||(n[0]=[l("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class C extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{C as default}; diff --git a/custom-toc-separator/assets/index-DRrktYRZ-Q5lemzxK.js b/custom-toc-separator/assets/index-DRrktYRZ-Q5lemzxK.js deleted file mode 100644 index 3e4a824b..00000000 --- a/custom-toc-separator/assets/index-DRrktYRZ-Q5lemzxK.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as r,fq as i,f6 as p,f8 as m,e$ as u,fb as d,f2 as l,eY as c,e_ as f,f0 as h,f1 as b}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const v=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),a=p("https://i.imgur.com/p13yknD.png");return m(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(n,o)=>(u(),d("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[l("img",{style:{width:"250px"},src:a.value,alt:"Snowman",srcset:""},null,8,v)],512))}}),w=r({__name:"appbar-button",setup(s){const e=c("iApi"),t=()=>{e.fixture.add("snowman")};return(a,n)=>{const o=f("appbar-button",!0);return u(),h(o,{onClickFunction:t,tooltip:"⛄"},{default:b(()=>n[0]||(n[0]=[l("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class C extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{C as default}; diff --git a/custom-toc-separator/assets/index-DY4XJa1m-CJ7R3Ck9.js b/custom-toc-separator/assets/index-DY4XJa1m-CJ7R3Ck9.js new file mode 100644 index 00000000..119e92df --- /dev/null +++ b/custom-toc-separator/assets/index-DY4XJa1m-CJ7R3Ck9.js @@ -0,0 +1 @@ +import{a}from"./fabric-Df28hv38-CA5QxRI5.js";import{fq as n,fz as s}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";class p extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{p as default}; diff --git a/custom-toc-separator/assets/index-DY4XJa1m-CssjAgnn.js b/custom-toc-separator/assets/index-DY4XJa1m-CssjAgnn.js deleted file mode 100644 index 5f98d088..00000000 --- a/custom-toc-separator/assets/index-DY4XJa1m-CssjAgnn.js +++ /dev/null @@ -1 +0,0 @@ -import{a}from"./fabric-Df28hv38-DklIek-Q.js";import{fq as n,fz as s}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";class p extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{p as default}; diff --git a/custom-toc-separator/assets/index-DfBq89c3-BB8RGxJ_.js b/custom-toc-separator/assets/index-DfBq89c3-BB8RGxJ_.js deleted file mode 100644 index 56ccef69..00000000 --- a/custom-toc-separator/assets/index-DfBq89c3-BB8RGxJ_.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-BqyOVNBt.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./vue.esm-bundler-D2erd_gM-CUmoCxCJ.js"])))=>i.map(i=>d[i]); -import{_ as o}from"./main-lj2zzr_L.js";import{fu as l,eW as s,fq as d}from"./story-OUarUCIt.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class y extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>l(o(()=>import("./screen-N-CoZlcH-BqyOVNBt.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{y as default}; diff --git a/custom-toc-separator/assets/index-DfBq89c3-CpTZ1tR2.js b/custom-toc-separator/assets/index-DfBq89c3-CpTZ1tR2.js new file mode 100644 index 00000000..983935c7 --- /dev/null +++ b/custom-toc-separator/assets/index-DfBq89c3-CpTZ1tR2.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-Cu5oyo_3.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./vue.esm-bundler-D2erd_gM-upufHWko.js"])))=>i.map(i=>d[i]); +import{_ as o}from"./main-BTdHgocv.js";import{fu as l,eW as s,fq as d}from"./story-DT1Ep1ux.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class y extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>l(o(()=>import("./screen-N-CoZlcH-Cu5oyo_3.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{y as default}; diff --git a/custom-toc-separator/assets/index-DmuJEjwc-7Uw19qxF.js b/custom-toc-separator/assets/index-DmuJEjwc-7Uw19qxF.js deleted file mode 100644 index 0885b8ea..00000000 --- a/custom-toc-separator/assets/index-DmuJEjwc-7Uw19qxF.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-BsTsPhUC.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./toggle-switch-control-B4JzuvHa-1eidiLPY.js"])))=>i.map(i=>d[i]); -import{_ as h}from"./main-lj2zzr_L.js";import{fu as p,eW as g,fx as m,fq as u,fy as c}from"./story-OUarUCIt.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class $ extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>p(h(()=>import("./details-screen-DE85sbTV-BsTsPhUC.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{$ as default}; diff --git a/custom-toc-separator/assets/index-DmuJEjwc-Ca1gDHPy.js b/custom-toc-separator/assets/index-DmuJEjwc-Ca1gDHPy.js new file mode 100644 index 00000000..53000f32 --- /dev/null +++ b/custom-toc-separator/assets/index-DmuJEjwc-Ca1gDHPy.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-DTHCDQTr.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./toggle-switch-control-B4JzuvHa-GDrthgIt.js"])))=>i.map(i=>d[i]); +import{_ as h}from"./main-BTdHgocv.js";import{fu as p,eW as g,fx as m,fq as u,fy as c}from"./story-DT1Ep1ux.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class $ extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>p(h(()=>import("./details-screen-DE85sbTV-DTHCDQTr.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{$ as default}; diff --git a/custom-toc-separator/assets/index-DxH-DOHz-CnC439Yk.js b/custom-toc-separator/assets/index-DxH-DOHz-CnC439Yk.js new file mode 100644 index 00000000..b88fa8a9 --- /dev/null +++ b/custom-toc-separator/assets/index-DxH-DOHz-CnC439Yk.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-CrpdC6qd.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-BTdHgocv.js";import{eT as i,fq as v,fu as m,eY as x,e_ as b,e$ as u,f0 as g,f1 as r,f2 as e,fF as G,fG as c,eX as y,fg as p,f4 as h}from"./story-DT1Ep1ux.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,s)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:r(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:r(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:r(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:r(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),s=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:r(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:r(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=_=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=_=>s()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),T={class:"flex flex-col items-center mt-16"},D={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q={class:"ml-32 font-bold"},I=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const s=b("panel-screen");return u(),g(s,{panel:l.panel},{header:r(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:r(()=>[e("div",T,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",D,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",$,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",q,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class J extends v{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>w(()=>import("./p2-screen-1-CQoqpp13-CrpdC6qd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(I)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{J as default}; diff --git a/custom-toc-separator/assets/index-DxH-DOHz-DXLJPt_g.js b/custom-toc-separator/assets/index-DxH-DOHz-DXLJPt_g.js deleted file mode 100644 index bd280bc6..00000000 --- a/custom-toc-separator/assets/index-DxH-DOHz-DXLJPt_g.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-DNRRGiVg.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-lj2zzr_L.js";import{eT as i,fq as v,fu as m,eY as x,e_ as b,e$ as u,f0 as g,f1 as r,f2 as e,fF as G,fG as c,eX as y,fg as p,f4 as h}from"./story-OUarUCIt.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,s)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:r(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:r(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:r(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:r(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),s=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:r(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:r(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=_=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=_=>s()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),T={class:"flex flex-col items-center mt-16"},D={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q={class:"ml-32 font-bold"},I=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const s=b("panel-screen");return u(),g(s,{panel:l.panel},{header:r(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:r(()=>[e("div",T,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",D,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",$,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",q,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class J extends v{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>w(()=>import("./p2-screen-1-CQoqpp13-DNRRGiVg.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(I)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{J as default}; diff --git a/custom-toc-separator/assets/index-I3HFsMjx-DCRuCNkP.js b/custom-toc-separator/assets/index-I3HFsMjx-DCRuCNkP.js deleted file mode 100644 index 55d9341e..00000000 --- a/custom-toc-separator/assets/index-I3HFsMjx-DCRuCNkP.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as r,eU as p,fq as v,eY as n,f6 as h,f8 as u,eV as l,f9 as c,e$ as f,fb as m,f2 as t,f3 as w}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const M=r({__name:"crosshairs",setup(d){const e=n("iApi"),s=h(!1),a=h([]);return u(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),c(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=p(M,[["__scopeId","data-v-55a2f166"]]);class k extends v{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{k as default}; diff --git a/custom-toc-separator/assets/index-I3HFsMjx-DncX1ZjK.js b/custom-toc-separator/assets/index-I3HFsMjx-DncX1ZjK.js new file mode 100644 index 00000000..821d64b3 --- /dev/null +++ b/custom-toc-separator/assets/index-I3HFsMjx-DncX1ZjK.js @@ -0,0 +1 @@ +import{eT as r,eU as p,fq as v,eY as n,f6 as h,f8 as u,eV as l,f9 as c,e$ as f,fb as m,f2 as t,f3 as w}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const M=r({__name:"crosshairs",setup(d){const e=n("iApi"),s=h(!1),a=h([]);return u(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),c(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=p(M,[["__scopeId","data-v-55a2f166"]]);class k extends v{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{k as default}; diff --git a/custom-toc-separator/assets/index-WLSkOrf3-BxZxXYXQ.js b/custom-toc-separator/assets/index-WLSkOrf3-BxZxXYXQ.js new file mode 100644 index 00000000..6520a26f --- /dev/null +++ b/custom-toc-separator/assets/index-WLSkOrf3-BxZxXYXQ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-CdgdVIWY.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./vue.esm-bundler-D2erd_gM-upufHWko.js","./toggle-switch-control-B4JzuvHa-GDrthgIt.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-BTdHgocv.js";import{fu as n,eW as r,fq as o}from"./story-DT1Ep1ux.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class h extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>n(a(()=>import("./screen-BGsID61t-CdgdVIWY.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{h as default}; diff --git a/custom-toc-separator/assets/index-WLSkOrf3-CLyTb3LM.js b/custom-toc-separator/assets/index-WLSkOrf3-CLyTb3LM.js deleted file mode 100644 index 39854f07..00000000 --- a/custom-toc-separator/assets/index-WLSkOrf3-CLyTb3LM.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-g_-gWyjU.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./vue.esm-bundler-D2erd_gM-CUmoCxCJ.js","./toggle-switch-control-B4JzuvHa-1eidiLPY.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-lj2zzr_L.js";import{fu as n,eW as r,fq as o}from"./story-OUarUCIt.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class h extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>n(a(()=>import("./screen-BGsID61t-g_-gWyjU.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{h as default}; diff --git a/custom-toc-separator/assets/index-sFd78-sx-5ValwFHH.js b/custom-toc-separator/assets/index-sFd78-sx-5ValwFHH.js deleted file mode 100644 index db8110e3..00000000 --- a/custom-toc-separator/assets/index-sFd78-sx-5ValwFHH.js +++ /dev/null @@ -1 +0,0 @@ -import{eU as _,eT as $,eV as I,fw as u,eX as z,eY as A,fV as d,e_ as O,e$ as r,fb as p,fo as v,f1 as g,f2 as l,f4 as m,f6 as M,f8 as F,f9 as L,eZ as S,fa as b,fc as V,fl as w,fm as Z,f0 as x,fn as B,f5 as H,fq as P}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const T={},q={class:"border-b p-0 self-center w-2/3"};function N(c,a){return r(),p("span",q)}const k=_(T,[["render",N]]),Y=$({__name:"zoom-nav",setup(c){const{t:a}=z(),t=A("iApi"),e=d(400,!0,()=>t.geo.map.zoomIn()),s=d(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),p("div",null,[v(n,{onClickFunction:m(e),tooltip:m(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:m(s),tooltip:m(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13H5v-2h14v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),j={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},W=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=$({__name:"mapnav",setup(c){const a=u(),{t}=z(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};F(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),L(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=S(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),p("div",j,[V((r(),p("div",{class:"flex flex-col",content:m(t)("panels.controls.items"),ref_key:"el",ref:e},[v(Y,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=l("span",{class:"py-1"},null,-1)),l("div",D,[(r(!0),p(w,null,Z(i.value,(f,C)=>(r(),p(w,{key:f.id+"button"},[(r(),x(B(f.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):H("",!0)],64))),128))])],8,W)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),U=_(G,[["__scopeId","data-v-41a5c7b7"]]);class J extends P{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const K={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class X extends J{async added(){Object.entries(K).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(U,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{X as default}; diff --git a/custom-toc-separator/assets/index-sFd78-sx-CWC5d9V3.js b/custom-toc-separator/assets/index-sFd78-sx-CWC5d9V3.js new file mode 100644 index 00000000..c51bfa01 --- /dev/null +++ b/custom-toc-separator/assets/index-sFd78-sx-CWC5d9V3.js @@ -0,0 +1 @@ +import{eU as _,eT as $,eV as I,fw as u,eX as z,eY as A,fV as d,e_ as O,e$ as r,fb as p,fo as v,f1 as g,f2 as l,f4 as m,f6 as M,f8 as F,f9 as L,eZ as S,fa as b,fc as V,fl as w,fm as Z,f0 as x,fn as B,f5 as H,fq as P}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const T={},q={class:"border-b p-0 self-center w-2/3"};function N(c,a){return r(),p("span",q)}const k=_(T,[["render",N]]),Y=$({__name:"zoom-nav",setup(c){const{t:a}=z(),t=A("iApi"),e=d(400,!0,()=>t.geo.map.zoomIn()),s=d(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),p("div",null,[v(n,{onClickFunction:m(e),tooltip:m(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:m(s),tooltip:m(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13H5v-2h14v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),j={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},W=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=$({__name:"mapnav",setup(c){const a=u(),{t}=z(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};F(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),L(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=S(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),p("div",j,[V((r(),p("div",{class:"flex flex-col",content:m(t)("panels.controls.items"),ref_key:"el",ref:e},[v(Y,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=l("span",{class:"py-1"},null,-1)),l("div",D,[(r(!0),p(w,null,Z(i.value,(f,C)=>(r(),p(w,{key:f.id+"button"},[(r(),x(B(f.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):H("",!0)],64))),128))])],8,W)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),U=_(G,[["__scopeId","data-v-41a5c7b7"]]);class J extends P{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const K={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class X extends J{async added(){Object.entries(K).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(U,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{X as default}; diff --git a/custom-toc-separator/assets/input2-eOtqu-iO-l9oxBLp5.js b/custom-toc-separator/assets/input2-eOtqu-iO-l9oxBLp5.js deleted file mode 100644 index 43ba0fe2..00000000 --- a/custom-toc-separator/assets/input2-eOtqu-iO-l9oxBLp5.js +++ /dev/null @@ -1,31 +0,0 @@ -import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-DuqBvFSD.js";import{l as R,p as q}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{c as se}from"./observers-BigwqTsw-BCNzxmob.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-BKvGneFm.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-color-status-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-color-status-danger);outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-color-foreground-2);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-color-text-1);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-color-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-color-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.clear-button:disabled{opacity:var(--calcite-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-color-text-2)}.prefix{order:2;border-inline-end-width:0px;inline-size:var(--calcite-input-prefix-size, auto)}.suffix{order:5;border-inline-start-width:0px;inline-size:var(--calcite-input-suffix-size, auto)}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-color-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-color-text-1)}.number-button-item:active{background-color:var(--calcite-color-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-color-border-1)}input.inline-child{background-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,Ie=ze,Ee=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=v(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=v(this,"calciteInternalInputBlur",6),this.calciteInputInput=v(this,"calciteInputInput",7),this.calciteInputChange=v(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=se("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||e.defaultPrevented||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&$(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId),this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=e.composedPath();!t.includes(this.inputWrapperEl)||t.includes(this.actionWrapperEl)||this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly||this.value==="Infinity"||this.value==="-Infinity")return;const t=e.target.value;u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=u.delocalize(t);e.inputType==="insertFromPaste"?(p(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:Z(i)}),this.childNumberEl.value=this.displayedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(this.value==="Infinity"||this.value==="-Infinity"){e.preventDefault(),(e.key==="Backspace"||e.key==="Delete")&&this.clearInputValue(e);return}if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[..._,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===u.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(u.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,s=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,s,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let o=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(o){o=!1;return}this.incrementOrDecrementNumberValue(e,i,s,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!P(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.onHiddenFormInputInput=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),this.setFocus(),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:s,value:a})=>{if(this.setPreviousValue(s??this.value),this.previousValueOrigin=i,this.type==="number"){u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const o=this.previousValue?.length>a.length||this.value?.length>a.length,l=a.charAt(a.length-1)===".",c=l&&o?a:ee(a),d=a&&!c?p(this.previousValue)?this.previousValue:"":c;let h=u.localize(d);i!=="connected"&&!l&&(h=te(h,d,u)),this.displayedValue=l&&o?`${h}${u.decimal}`:h,this.userChangedValue=i==="user"&&this.value!==d,this.value=["-","."].includes(d)?"":d}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.displayedValue=this.type==="number"?u.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=void 0,this.clearable=!1,this.disabled=!1,this.enterKeyHint=void 0,this.form=void 0,this.groupSeparator=!1,this.icon=void 0,this.iconFlipRtl=!1,this.inputMode=void 0,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.displayedValue=void 0,this.slottedActionElDisabledInternally=!1}handleGlobalAttributesChanged(){T(this)}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(e,t){if(!this.userChangedValue){if(this.type==="number"&&(e==="Infinity"||e==="-Infinity")){this.displayedValue=e,this.previousEmittedValue=e;return}this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?p(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)}this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=g(D,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value?.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){oe(this,this.effectiveLocale)}connectedCallback(){ie(this),re(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),G(this),K(this),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener(V,this.onHiddenFormInputInput)}disconnectedCallback(){X(this),j(this),ne(this),le(this),this.mutationObserver?.disconnect(),this.el.removeEventListener(V,this.onHiddenFormInputInput)}async componentWillLoad(){J(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=g(D,this.icon,this.type),await ce(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.value==="Infinity"||this.value==="-Infinity"?(this.displayedValue=this.value,this.previousEmittedValue=this.value):(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:p(this.value)?this.value:""})))}componentDidLoad(){Q(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!p(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){R(this)}async setFocus(){await Y(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,s){const{value:a}=this;if(a==="Infinity"||a==="-Infinity")return;const o=e==="up"?1:-1,l=this.step==="any"?1:Math.abs(this.step||1),c=new ae(a!==""?a:"0").add(`${l*o}`),d=()=>typeof i=="number"&&!isNaN(i)&&c.subtract(`${i}`).isNegative,h=()=>typeof t=="number"&&!isNaN(t)&&!c.subtract(`${t}`).isNegative,f=d()?`${i}`:h()?`${t}`:c.toString();this.setValue({committing:!0,nativeEvent:s,origin:"user",value:f})}syncHiddenFormInput(e){me(this.type,this,e)}setDisabledAction(){const e=W(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?p(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!p(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=A(this.el),t=n("div",{key:"ed9acea9dbc18f4cfc5e7095c1e2de0b1adfdf35",class:r.loader},n("calcite-progress",{key:"58321a27c25dd848a648d2e3d5ca6dfc3f5fd649",label:this.messages.loading,type:"indeterminate"})),i=n("button",{key:"348d8dee0c032afe986b1e253c9d667256f3d9f0","aria-label":this.messages.clear,class:r.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},n("calcite-icon",{key:"334b68a283b767c0e9bea09ccfd83d09c8c17711",icon:"x",scale:m(this.scale)})),s=n("calcite-icon",{key:"4ab83aa9268277a38449ebe4a6e3db4dc9badcae",class:r.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:m(this.scale)}),a=this.numberButtonType==="horizontal",o=n("button",{key:"2dd700034d38581aaea39c019e626ffa1a2c1c16","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"6ca9a7c93aa14520292ad8c800c4e099bd46f30d",icon:"chevron-up",scale:m(this.scale)})),l=n("button",{key:"cdbd88ddd308bd82b6d239a83f365a2c5e226cfc","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"f1b9cf329da9add564d690c517ddcc414c4fbfa3",icon:"chevron-down",scale:m(this.scale)})),c=n("div",{key:"247efdce33568f219b1bf3bf252b8b19a74d03ea",class:r.numberButtonWrapper},o,l),d=n("div",{key:"01819a850399fb20a29471861e011695bf80af97",class:r.prefix},this.prefixText),h=n("div",{key:"dcc073305f3824a0eb72ef230bd217dabdb72104",class:r.suffix},this.suffixText),f=this.el.autofocus||this.el.hasAttribute("autofocus")?!0:null,z=this.el.enterKeyHint||this.el.getAttribute("enterkeyhint"),I=this.el.inputMode||this.el.getAttribute("inputmode"),S=this.type==="number"?n("input",{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.displayedValue}):null,F=this.type!=="number"?[n(this.childElType,{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,class:{[r.editingEnabled]:this.editingEnabled,[r.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?n("div",{class:r.resizeIconWrapper},n("calcite-icon",{icon:"chevron-down",scale:m(this.scale)})):null]:null;return n(O,{key:"23d6092960315f172a56105b9af75ddc6497874c",onClick:this.clickHandler,onKeyDown:this.keyDownHandler},n(q,{key:"1bb063f39c14a829a376465fa8c2bbc288046ac7",disabled:this.disabled},n("div",{key:"7f3644f002b7cb75d93d9c0218508b502ddcfd0b",class:{[r.inputWrapper]:!0,[N.rtl]:e==="rtl"},ref:y=>this.inputWrapperEl=y},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?l:null,this.prefixText?d:null,n("div",{key:"0d01898e4949a60e0853c1a72669f5c9d6c91ba5",class:r.wrapper},S,F,this.isClearable?i:null,this.requestedIcon?s:null,this.loading?t:null),n("div",{key:"42e7adec440e417128feb9845c36d0444e6c1ae4",class:r.actionWrapper,ref:y=>this.actionWrapperEl=y},n("slot",{key:"f391b035ad9fc108d1f99c4cedf539425c20a36d",name:we.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?c:null,this.suffixText?h:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,n(U,{key:"df415df551b4a9a16565c8f554454d01aa89327e",component:this})),this.validationMessage&&this.status==="invalid"?n(de,{icon:this.validationIcon,id:x.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ie}},[1,"calcite-input",{alignment:[513],autofocus:[4],clearable:[516],disabled:[516],enterKeyHint:[1,"enter-key-hint"],form:[513],groupSeparator:[516,"group-separator"],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],inputMode:[1,"input-mode"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],validationMessage:[1,"validation-message"],validationIcon:[520,"validation-icon"],validity:[1040],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],displayedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]},void 0,{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function Ve(){typeof customElements>"u"||["calcite-input","calcite-icon","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,Ee);break;case"calcite-icon":customElements.get(e)||L();break;case"calcite-input-message":customElements.get(e)||B();break;case"calcite-progress":customElements.get(e)||M();break}})}Ve();export{Ee as F,Ve as M,B as w,M as z}; diff --git a/custom-toc-separator/assets/input2-eOtqu-iO-rjNm5YCZ.js b/custom-toc-separator/assets/input2-eOtqu-iO-rjNm5YCZ.js new file mode 100644 index 00000000..424a8d15 --- /dev/null +++ b/custom-toc-separator/assets/input2-eOtqu-iO-rjNm5YCZ.js @@ -0,0 +1,31 @@ +import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-DM6mxOFq.js";import{l as R,p as q}from"./interactive-DqhNilgd-C3lhdKPd.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{c as se}from"./observers-BigwqTsw-C0_AGNdr.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-CoY6CcfD.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-color-status-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-color-status-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-color-foreground-2);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-color-text-1);transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-color-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-color-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-color-text-2)}.prefix{order:2;border-inline-end-width:0px;inline-size:var(--calcite-input-prefix-size, auto)}.suffix{order:5;border-inline-start-width:0px;inline-size:var(--calcite-input-suffix-size, auto)}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-color-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-color-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-color-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-color-text-1)}.number-button-item:active{background-color:var(--calcite-color-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-color-border-1)}input.inline-child{background-color:transparent;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,Ie=ze,Ee=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=v(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=v(this,"calciteInternalInputBlur",6),this.calciteInputInput=v(this,"calciteInputInput",7),this.calciteInputChange=v(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=se("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||e.defaultPrevented||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&$(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId),this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=e.composedPath();!t.includes(this.inputWrapperEl)||t.includes(this.actionWrapperEl)||this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly||this.value==="Infinity"||this.value==="-Infinity")return;const t=e.target.value;u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=u.delocalize(t);e.inputType==="insertFromPaste"?(p(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:Z(i)}),this.childNumberEl.value=this.displayedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(this.value==="Infinity"||this.value==="-Infinity"){e.preventDefault(),(e.key==="Backspace"||e.key==="Delete")&&this.clearInputValue(e);return}if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[..._,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===u.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(u.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,s=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,s,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let o=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(o){o=!1;return}this.incrementOrDecrementNumberValue(e,i,s,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!P(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.onHiddenFormInputInput=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),this.setFocus(),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:s,value:a})=>{if(this.setPreviousValue(s??this.value),this.previousValueOrigin=i,this.type==="number"){u.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const o=this.previousValue?.length>a.length||this.value?.length>a.length,l=a.charAt(a.length-1)===".",c=l&&o?a:ee(a),d=a&&!c?p(this.previousValue)?this.previousValue:"":c;let h=u.localize(d);i!=="connected"&&!l&&(h=te(h,d,u)),this.displayedValue=l&&o?`${h}${u.decimal}`:h,this.userChangedValue=i==="user"&&this.value!==d,this.value=["-","."].includes(d)?"":d}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.displayedValue=this.type==="number"?u.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=void 0,this.clearable=!1,this.disabled=!1,this.enterKeyHint=void 0,this.form=void 0,this.groupSeparator=!1,this.icon=void 0,this.iconFlipRtl=!1,this.inputMode=void 0,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.displayedValue=void 0,this.slottedActionElDisabledInternally=!1}handleGlobalAttributesChanged(){T(this)}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(e,t){if(!this.userChangedValue){if(this.type==="number"&&(e==="Infinity"||e==="-Infinity")){this.displayedValue=e,this.previousEmittedValue=e;return}this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?p(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)}this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=g(D,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value?.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){oe(this,this.effectiveLocale)}connectedCallback(){ie(this),re(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),G(this),K(this),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener(V,this.onHiddenFormInputInput)}disconnectedCallback(){X(this),j(this),ne(this),le(this),this.mutationObserver?.disconnect(),this.el.removeEventListener(V,this.onHiddenFormInputInput)}async componentWillLoad(){J(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=g(D,this.icon,this.type),await ce(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.value==="Infinity"||this.value==="-Infinity"?(this.displayedValue=this.value,this.previousEmittedValue=this.value):(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:p(this.value)?this.value:""})))}componentDidLoad(){Q(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!p(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){R(this)}async setFocus(){await Y(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,s){const{value:a}=this;if(a==="Infinity"||a==="-Infinity")return;const o=e==="up"?1:-1,l=this.step==="any"?1:Math.abs(this.step||1),c=new ae(a!==""?a:"0").add(`${l*o}`),d=()=>typeof i=="number"&&!isNaN(i)&&c.subtract(`${i}`).isNegative,h=()=>typeof t=="number"&&!isNaN(t)&&!c.subtract(`${t}`).isNegative,f=d()?`${i}`:h()?`${t}`:c.toString();this.setValue({committing:!0,nativeEvent:s,origin:"user",value:f})}syncHiddenFormInput(e){me(this.type,this,e)}setDisabledAction(){const e=W(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?p(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!p(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=A(this.el),t=n("div",{key:"ed9acea9dbc18f4cfc5e7095c1e2de0b1adfdf35",class:r.loader},n("calcite-progress",{key:"58321a27c25dd848a648d2e3d5ca6dfc3f5fd649",label:this.messages.loading,type:"indeterminate"})),i=n("button",{key:"348d8dee0c032afe986b1e253c9d667256f3d9f0","aria-label":this.messages.clear,class:r.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},n("calcite-icon",{key:"334b68a283b767c0e9bea09ccfd83d09c8c17711",icon:"x",scale:m(this.scale)})),s=n("calcite-icon",{key:"4ab83aa9268277a38449ebe4a6e3db4dc9badcae",class:r.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:m(this.scale)}),a=this.numberButtonType==="horizontal",o=n("button",{key:"2dd700034d38581aaea39c019e626ffa1a2c1c16","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"6ca9a7c93aa14520292ad8c800c4e099bd46f30d",icon:"chevron-up",scale:m(this.scale)})),l=n("button",{key:"cdbd88ddd308bd82b6d239a83f365a2c5e226cfc","aria-hidden":"true",class:{[r.numberButtonItem]:!0,[r.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{key:"f1b9cf329da9add564d690c517ddcc414c4fbfa3",icon:"chevron-down",scale:m(this.scale)})),c=n("div",{key:"247efdce33568f219b1bf3bf252b8b19a74d03ea",class:r.numberButtonWrapper},o,l),d=n("div",{key:"01819a850399fb20a29471861e011695bf80af97",class:r.prefix},this.prefixText),h=n("div",{key:"dcc073305f3824a0eb72ef230bd217dabdb72104",class:r.suffix},this.suffixText),f=this.el.autofocus||this.el.hasAttribute("autofocus")?!0:null,z=this.el.enterKeyHint||this.el.getAttribute("enterkeyhint"),I=this.el.inputMode||this.el.getAttribute("inputmode"),S=this.type==="number"?n("input",{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.displayedValue}):null,F=this.type!=="number"?[n(this.childElType,{accept:this.accept,"aria-errormessage":x.validationMessage,"aria-invalid":E(this.status==="invalid"),"aria-label":H(this),autocomplete:this.autocomplete,autofocus:f,class:{[r.editingEnabled]:this.editingEnabled,[r.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:z,inputMode:I,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?n("div",{class:r.resizeIconWrapper},n("calcite-icon",{icon:"chevron-down",scale:m(this.scale)})):null]:null;return n(O,{key:"23d6092960315f172a56105b9af75ddc6497874c",onClick:this.clickHandler,onKeyDown:this.keyDownHandler},n(q,{key:"1bb063f39c14a829a376465fa8c2bbc288046ac7",disabled:this.disabled},n("div",{key:"7f3644f002b7cb75d93d9c0218508b502ddcfd0b",class:{[r.inputWrapper]:!0,[N.rtl]:e==="rtl"},ref:y=>this.inputWrapperEl=y},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?l:null,this.prefixText?d:null,n("div",{key:"0d01898e4949a60e0853c1a72669f5c9d6c91ba5",class:r.wrapper},S,F,this.isClearable?i:null,this.requestedIcon?s:null,this.loading?t:null),n("div",{key:"42e7adec440e417128feb9845c36d0444e6c1ae4",class:r.actionWrapper,ref:y=>this.actionWrapperEl=y},n("slot",{key:"f391b035ad9fc108d1f99c4cedf539425c20a36d",name:we.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?c:null,this.suffixText?h:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,n(U,{key:"df415df551b4a9a16565c8f554454d01aa89327e",component:this})),this.validationMessage&&this.status==="invalid"?n(de,{icon:this.validationIcon,id:x.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ie}},[1,"calcite-input",{alignment:[513],autofocus:[4],clearable:[516],disabled:[516],enterKeyHint:[1,"enter-key-hint"],form:[513],groupSeparator:[516,"group-separator"],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],inputMode:[1,"input-mode"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],validationMessage:[1,"validation-message"],validationIcon:[520,"validation-icon"],validity:[1040],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],displayedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]},void 0,{autofocus:["handleGlobalAttributesChanged"],enterkeyhint:["handleGlobalAttributesChanged"],inputmode:["handleGlobalAttributesChanged"],disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}]);function Ve(){typeof customElements>"u"||["calcite-input","calcite-icon","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,Ee);break;case"calcite-icon":customElements.get(e)||L();break;case"calcite-input-message":customElements.get(e)||B();break;case"calcite-progress":customElements.get(e)||M();break}})}Ve();export{Ee as F,Ve as M,B as w,M as z}; diff --git a/custom-toc-separator/assets/interactive-DqhNilgd-Bw4n2n3w.js b/custom-toc-separator/assets/interactive-DqhNilgd-Bw4n2n3w.js deleted file mode 100644 index 8697ec15..00000000 --- a/custom-toc-separator/assets/interactive-DqhNilgd-Bw4n2n3w.js +++ /dev/null @@ -1 +0,0 @@ -import{a as r}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; diff --git a/custom-toc-separator/assets/interactive-DqhNilgd-C3lhdKPd.js b/custom-toc-separator/assets/interactive-DqhNilgd-C3lhdKPd.js new file mode 100644 index 00000000..38921bea --- /dev/null +++ b/custom-toc-separator/assets/interactive-DqhNilgd-C3lhdKPd.js @@ -0,0 +1 @@ +import{a as r}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; diff --git a/custom-toc-separator/assets/item-DaimTDdD-CD-D1cVt.js b/custom-toc-separator/assets/item-DaimTDdD-CD-D1cVt.js new file mode 100644 index 00000000..3c8023de --- /dev/null +++ b/custom-toc-separator/assets/item-DaimTDdD-CD-D1cVt.js @@ -0,0 +1 @@ +import{eT as Y,eX as ne,f6 as H,f8 as ce,fa as q,e$ as t,fb as n,fc as k,f2 as o,f4 as l,gb as x,gc as ie,f3 as M,fS as v,eY as ge,fh as me,eZ as U,gy as u,gg as C,e_ as ye,fo as fe,f1 as re,fG as Z,fg as w,eU as oe,fl as te,fm as ae,fF as Le,f5 as p,gj as xe,fQ as ke,f7 as we,jp as b,jq as _,jr as de,f0 as j,fR as Me,js as O,fn as Ce,fT as Te,gr as ze,eV as W,jt as Se,ju as ee}from"./story-DT1Ep1ux.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";import"./main-BTdHgocv.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],_e=["aria-label"],je=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,_e),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,je),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},_l=["innerHTML"],jl={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===_.Expand||d===_.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(_.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(_).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(_).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),j(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(_).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),j(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),j(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(_).Visibility)?(t(),j(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),j(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,_l)])):p("",!0),k((t(),n("div",jl,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),j(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),j(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Fl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Fl as default}; diff --git a/custom-toc-separator/assets/item-DaimTDdD-fmH5Mq9b.js b/custom-toc-separator/assets/item-DaimTDdD-fmH5Mq9b.js deleted file mode 100644 index 6a1d5d8d..00000000 --- a/custom-toc-separator/assets/item-DaimTDdD-fmH5Mq9b.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as Y,eX as ne,f6 as H,f8 as ce,fa as q,e$ as t,fb as n,fc as k,f2 as o,f4 as l,gb as x,gc as ie,f3 as M,fS as v,eY as ge,fh as me,eZ as U,gy as u,gg as C,e_ as ye,fo as fe,f1 as re,fG as Z,fg as w,eU as oe,fl as te,fm as ae,fF as Le,f5 as p,gj as xe,fQ as ke,f7 as we,jp as b,jq as _,jr as de,f0 as j,fR as Me,js as O,fn as Ce,fT as Te,gr as ze,eV as W,jt as Se,ju as ee}from"./story-OUarUCIt.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";import"./main-lj2zzr_L.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],_e=["aria-label"],je=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,_e),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,je),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},_l=["innerHTML"],jl={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===_.Expand||d===_.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(_.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(_).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(_).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),j(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(_).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),j(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),j(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(_).Visibility)?(t(),j(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),j(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,_l)])):p("",!0),k((t(),n("div",jl,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),j(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),j(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Fl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Fl as default}; diff --git a/custom-toc-separator/assets/jsonContext-BA8GHqVk-CN6VxGdq.js b/custom-toc-separator/assets/jsonContext-BA8GHqVk-CN6VxGdq.js deleted file mode 100644 index 7e0b4203..00000000 --- a/custom-toc-separator/assets/jsonContext-BA8GHqVk-CN6VxGdq.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o,r as n}from"./story-OUarUCIt.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; diff --git a/custom-toc-separator/assets/jsonContext-BA8GHqVk-Q4gT-eB4.js b/custom-toc-separator/assets/jsonContext-BA8GHqVk-Q4gT-eB4.js new file mode 100644 index 00000000..1d773c21 --- /dev/null +++ b/custom-toc-separator/assets/jsonContext-BA8GHqVk-Q4gT-eB4.js @@ -0,0 +1 @@ +import{a as o,r as n}from"./story-DT1Ep1ux.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; diff --git a/custom-toc-separator/assets/jsonUtils-C64Zfu7c-COIuPQy9.js b/custom-toc-separator/assets/jsonUtils-C64Zfu7c-COIuPQy9.js deleted file mode 100644 index 6bb73c41..00000000 --- a/custom-toc-separator/assets/jsonUtils-C64Zfu7c-COIuPQy9.js +++ /dev/null @@ -1 +0,0 @@ -import{P as a,d7 as O,v as t,S as s,ac as X,i as j,ar as w,ad as ae,d_ as G,d$ as ue,bz as L,bB as pe,aa as K,e as T,dN as W,e0 as ee,aq as ye,a1 as M,ct as de,b0 as ce,aU as he,ca as me,cb as fe,f as Y,dW as ge,o as be,e1 as ve,e2 as we,dU as Se,dX as xe}from"./story-OUarUCIt.js";import{$ as A,h as _e,E as R,L as je,A as Ie,d as te,o as ie,a as Ve,G as Ee,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-BruVICcm.js";import{b as De}from"./LRUCache-C3erQTWv-6ABNHME-.js";import{m as Ne}from"./Version-CoKzbupV-5qCYzF4G.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-BNEY6jgo.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-BT5eGA8G.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-CotdYMFm.js";import"./main-lj2zzr_L.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./colorRamps-q0bZVhs2-D0XKNTvx.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-BSOWzUJi.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./styleUtils-BtpNqZyT-BHhk4mUO.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./colorUtils-Cthpxcks-DchH3ayn.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const c=$e(this.fieldMap[y],this._fieldIndex);if(c){const n=e.attributes[c];u[y]=o?n:n!=null?""+e.attributes[c]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const d=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(_==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:_,value:g,defaultValue:null})}}else if(c.includes("|")){for(const n of c.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(c))b.push(c);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:d}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(d),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],_=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());_.length>0&&y.push({..._[0],type:f?_[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const c=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(_,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:_});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const d of l.symbolLayers)d.effects==null?d.effects=l.effects:d.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([j("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([j("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([j("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([j("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([j("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([j("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:d,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([j("esri.renderers.HeatmapRenderer")],p);const oe=p;let E=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],E.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],E.prototype,"threshold",void 0),E=t([j("esri.renderers.support.OthersCategory")],E);const Be={base:Ve,key:"type",typeMap:{size:Ee,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new E,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(je)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:E,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([j("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let V=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s(Ie)],V.prototype,"symbol",void 0),t([L({simple:"simple"})],V.prototype,"type",void 0),V=U=t([j("esri.renderers.SimpleRenderer")],V);const ne=V,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},_t={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=de({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new ce("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,_t as u}; diff --git a/custom-toc-separator/assets/jsonUtils-C64Zfu7c-D7O5HWOd.js b/custom-toc-separator/assets/jsonUtils-C64Zfu7c-D7O5HWOd.js new file mode 100644 index 00000000..231f7488 --- /dev/null +++ b/custom-toc-separator/assets/jsonUtils-C64Zfu7c-D7O5HWOd.js @@ -0,0 +1 @@ +import{P as a,d7 as O,v as t,S as s,ac as X,i as j,ar as w,ad as ae,d_ as G,d$ as ue,bz as L,bB as pe,aa as K,e as T,dN as W,e0 as ee,aq as ye,a1 as M,ct as de,b0 as ce,aU as he,ca as me,cb as fe,f as Y,dW as ge,o as be,e1 as ve,e2 as we,dU as Se,dX as xe}from"./story-DT1Ep1ux.js";import{$ as A,h as _e,E as R,L as je,A as Ie,d as te,o as ie,a as Ve,G as Ee,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-CPM6FhL4.js";import{b as De}from"./LRUCache-C3erQTWv-D3oKynNB.js";import{m as Ne}from"./Version-CoKzbupV-CGLbrkRD.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-BKynsqQg.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-D22mGlP8.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-DkzIw6pB.js";import"./main-BTdHgocv.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./colorRamps-q0bZVhs2-Yy2GlotV.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-DAfTVTEf.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./styleUtils-BtpNqZyT-DM-kTnEs.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./colorUtils-Cthpxcks-DXg8vX2o.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const c=$e(this.fieldMap[y],this._fieldIndex);if(c){const n=e.attributes[c];u[y]=o?n:n!=null?""+e.attributes[c]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const d=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(_==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:_,value:g,defaultValue:null})}}else if(c.includes("|")){for(const n of c.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(c))b.push(c);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:d}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(d),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],_=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());_.length>0&&y.push({..._[0],type:f?_[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const c=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(_,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:_});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const d of l.symbolLayers)d.effects==null?d.effects=l.effects:d.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([j("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([j("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([j("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([j("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([j("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([j("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:d,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([j("esri.renderers.HeatmapRenderer")],p);const oe=p;let E=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],E.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],E.prototype,"threshold",void 0),E=t([j("esri.renderers.support.OthersCategory")],E);const Be={base:Ve,key:"type",typeMap:{size:Ee,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new E,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(je)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:E,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([j("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let V=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s(Ie)],V.prototype,"symbol",void 0),t([L({simple:"simple"})],V.prototype,"type",void 0),V=U=t([j("esri.renderers.SimpleRenderer")],V);const ne=V,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},_t={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=de({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new ce("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,_t as u}; diff --git a/custom-toc-separator/assets/jsonUtils-wIllKWI4-ChoaxSoX.js b/custom-toc-separator/assets/jsonUtils-wIllKWI4-ChoaxSoX.js new file mode 100644 index 00000000..77cfdc41 --- /dev/null +++ b/custom-toc-separator/assets/jsonUtils-wIllKWI4-ChoaxSoX.js @@ -0,0 +1 @@ +import{dK as f,o}from"./story-DT1Ep1ux.js";import{c as u,a as i}from"./parser-DyDJ-rlI-BVBmjSW8.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; diff --git a/custom-toc-separator/assets/jsonUtils-wIllKWI4-DQMnFF3M.js b/custom-toc-separator/assets/jsonUtils-wIllKWI4-DQMnFF3M.js deleted file mode 100644 index 9b7bb5d0..00000000 --- a/custom-toc-separator/assets/jsonUtils-wIllKWI4-DQMnFF3M.js +++ /dev/null @@ -1 +0,0 @@ -import{dK as f,o}from"./story-OUarUCIt.js";import{c as u,a as i}from"./parser-DyDJ-rlI-BZnJ9Tpt.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; diff --git a/custom-toc-separator/assets/jszip.min-C61Pcz7i-BJKcbdwB.js b/custom-toc-separator/assets/jszip.min-C61Pcz7i-BJKcbdwB.js deleted file mode 100644 index 214949bc..00000000 --- a/custom-toc-separator/assets/jszip.min-C61Pcz7i-BJKcbdwB.js +++ /dev/null @@ -1,2 +0,0 @@ -import{c0 as Bt,c1 as vt}from"./story-OUarUCIt.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";import"./main-lj2zzr_L.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` -\0`,K+=h(A,2),K+=D.magic,K+=h(y,2),K+=h(z,2),K+=h(H.crc32,4),K+=h(H.compressedSize,4),K+=h(H.uncompressedSize,4),K+=h(j.length,2),K+=h(F.length,2),{fileRecord:m.LOCAL_FILE_HEADER+K+j+F,dirRecord:m.CENTRAL_FILE_HEADER+h(J,2)+K+h(q.length,2)+"\0\0\0\0"+h(E,4)+h(l,4)+j+F+q}}var n=_("../utils"),u=_("../stream/GenericWorker"),g=_("../utf8"),v=_("../crc32"),m=_("../signature");function b(i,c,r,l){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=c,this.zipPlatform=r,this.encodeFileName=l,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(b,u),b.prototype.push=function(i){var c=i.meta.percent||0,r=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(c+100*(r-l-1))/r:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var c=this.streamFiles&&!i.file.dir;if(c){var r=o(i,c,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var c=this.streamFiles&&!i.file.dir,r=o(i,c,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),c)this.push({data:function(l){return m.DATA_DESCRIPTOR+h(l.crc32,4)+h(l.compressedSize,4)+h(l.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,c=0;c=this.index;u--)g=(g<<8)+this.byteAt(u);return this.index+=n,g},readString:function(n){return h.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(_,U,w){var h=_("./Uint8ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(_,U,w){var h=_("./DataReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(_,U,w){var h=_("./ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(_,U,w){var h=_("../utils"),o=_("../support"),n=_("./ArrayReader"),u=_("./StringReader"),g=_("./NodeBufferReader"),v=_("./Uint8ArrayReader");U.exports=function(m){var b=h.getTypeOf(m);return h.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(m):o.uint8array?new v(h.transformTo("uint8array",m)):new n(h.transformTo("array",m)):new u(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(_,U,w){w.LOCAL_FILE_HEADER="PK",w.CENTRAL_FILE_HEADER="PK",w.CENTRAL_DIRECTORY_END="PK",w.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",w.ZIP64_CENTRAL_DIRECTORY_END="PK",w.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(_,U,w){var h=_("./GenericWorker"),o=_("../utils");function n(u){h.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,h),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(_,U,w){var h=_("./GenericWorker"),o=_("../crc32");function n(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}_("../utils").inherits(n,h),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}h.inherits(n,o),n.prototype.processChunk=function(u){if(u){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=h.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}h.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,g);break;case"uint8array":u=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":u=this.data.slice(this.index,g)}return this.index=g,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(_,U,w){function h(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u "+o:o}},U.exports=h},{}],29:[function(_,U,w){var h=_("../utils"),o=_("./ConvertWorker"),n=_("./GenericWorker"),u=_("../base64"),g=_("../support"),v=_("../external"),m=null;if(g.nodestream)try{m=_("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(c,r){return new v.Promise(function(l,a){var d=[],y=c._internalType,z=c._outputType,x=c._mimeType;c.on("data",function(D,I){d.push(D),r&&r(I)}).on("error",function(D){d=[],a(D)}).on("end",function(){try{var D=function(I,j,C){switch(I){case"blob":return h.newBlob(h.transformTo("arraybuffer",j),C);case"base64":return u.encode(j);default:return h.transformTo(I,j)}}(z,function(I,j){var C,W=0,q=null,p=0;for(C=0;C"u")w.blob=!1;else{var h=new ArrayBuffer(0);try{w.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(h),w.blob=o.getBlob("application/zip").size===0}catch{w.blob=!1}}}try{w.nodestream=!!_("readable-stream").Readable}catch{w.nodestream=!1}},{"readable-stream":16}],31:[function(_,U,w){for(var h=_("./utils"),o=_("./support"),n=_("./nodejsUtils"),u=_("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function m(){u.call(this,"utf-8 decode"),this.leftOver=null}function b(){u.call(this,"utf-8 encode")}w.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(c){var r,l,a,d,y,z=c.length,x=0;for(d=0;d>>6:(l<65536?r[y++]=224|l>>>12:(r[y++]=240|l>>>18,r[y++]=128|l>>>12&63),r[y++]=128|l>>>6&63),r[y++]=128|63&l);return r}(i)},w.utf8decode=function(i){return o.nodebuffer?h.transformTo("nodebuffer",i).toString("utf-8"):function(c){var r,l,a,d,y=c.length,z=new Array(2*y);for(r=l=0;r>10&1023,z[l++]=56320|1023&a)}return z.length!==l&&(z.subarray?z=z.subarray(0,l):z.length=l),h.applyFromCharCode(z)}(i=h.transformTo(o.uint8array?"uint8array":"array",i))},h.inherits(m,u),m.prototype.processChunk=function(i){var c=h.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=c;(c=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),c.set(r,this.leftOver.length)}else c=this.leftOver.concat(c);this.leftOver=null}var l=function(d,y){var z;for((y=y||d.length)>d.length&&(y=d.length),z=y-1;0<=z&&(192&d[z])==128;)z--;return z<0||z===0?y:z+g[d[z]]>y?z:y}(c),a=c;l!==c.length&&(o.uint8array?(a=c.subarray(0,l),this.leftOver=c.subarray(l,c.length)):(a=c.slice(0,l),this.leftOver=c.slice(l,c.length))),this.push({data:w.utf8decode(a),meta:i.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:w.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},w.Utf8DecodeWorker=m,h.inherits(b,u),b.prototype.processChunk=function(i){this.push({data:w.utf8encode(i.data),meta:i.meta})},w.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(_,U,w){var h=_("./support"),o=_("./base64"),n=_("./nodejsUtils"),u=_("./external");function g(r){return r}function v(r,l){for(var a=0;a>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=h(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var c,r,l,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4>>6:(i<65536?b[l++]=224|i>>>12:(b[l++]=240|i>>>18,b[l++]=128|i>>>12&63),b[l++]=128|i>>>6&63),b[l++]=128|63&i);return b},w.buf2binstring=function(m){return v(m,m.length)},w.binstring2buf=function(m){for(var b=new h.Buf8(m.length),i=0,c=b.length;i>10&1023,d[c++]=56320|1023&r)}return v(d,c)},w.utf8border=function(m,b){var i;for((b=b||m.length)>m.length&&(b=m.length),i=b-1;0<=i&&(192&m[i])==128;)i--;return i<0||i===0?b:i+u[m[i]]>b?i:b}},{"./common":41}],43:[function(_,U,w){U.exports=function(h,o,n,u){for(var g=65535&h|0,v=h>>>16&65535|0,m=0;n!==0;){for(n-=m=2e3>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,g){var v=h,m=g+u;o^=-1;for(var b=g;b>>8^v[255&(o^n[b])];return-1^o}},{}],46:[function(_,U,w){var h,o=_("../utils/common"),n=_("./trees"),u=_("./adler32"),g=_("./crc32"),v=_("./messages"),m=0,b=4,i=0,c=-2,r=-1,l=4,a=2,d=8,y=9,z=286,x=30,D=19,I=2*z+1,j=15,C=3,W=258,q=W+C+1,p=42,B=113,e=1,F=2,X=3,N=4;function $(t,R){return t.msg=v[R],R}function L(t){return(t<<1)-(4t.avail_out&&(O=t.avail_out),O!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,A(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function K(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function G(t,R){var O,f,s=t.max_chain_length,k=t.strstart,T=t.prev_length,P=t.nice_match,S=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,Y=t.w_mask,M=t.prev,V=t.strstart+W,rt=Z[k+T-1],tt=Z[k+T];t.prev_length>=t.good_match&&(s>>=2),P>t.lookahead&&(P=t.lookahead);do if(Z[(O=R)+T]===tt&&Z[O+T-1]===rt&&Z[O]===Z[k]&&Z[++O]===Z[k+1]){k+=2,O++;do;while(Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&kS&&--s!=0);return T<=t.lookahead?T:t.lookahead}function nt(t){var R,O,f,s,k,T,P,S,Z,Y,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=O=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--O;);for(R=O=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--O;);s+=M}if(t.strm.avail_in===0)break;if(T=t.strm,P=t.window,S=t.strstart+t.lookahead,Z=s,Y=void 0,Y=T.avail_in,Z=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-C,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===m)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+O;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===b?(E(t,!0),t.strm.avail_out===0?X:N):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],w.deflateInit=function(t,R){return ut(t,R,d,15,8,0)},w.deflateInit2=ut,w.deflateReset=lt,w.deflateResetKeep=it,w.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?c:(t.state.gzhead=R,i):c},w.deflate=function(t,R){var O,f,s,k;if(!t||!t.state||5>8&255),J(f,f.gzhead.time>>16&255),J(f,f.gzhead.time>>24&255),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(J(f,255&f.gzhead.extra.length),J(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=g(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(J(f,0),J(f,0),J(f,0),J(f,0),J(f,0),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,3),f.status=B);else{var T=d+(f.w_bits-8<<4)<<8;T|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(T|=32),T+=31-T%31,f.status=B,K(f,T),f.strstart!==0&&(K(f,t.adler>>>16),K(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending!==f.pending_buf_size));)J(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&A(t),f.pending+2<=f.pending_buf_size&&(J(f,255&t.adler),J(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(A(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(O)&&R!==b)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==m&&f.status!==666){var P=f.strategy===2?function(S,Z){for(var Y;;){if(S.lookahead===0&&(nt(S),S.lookahead===0)){if(Z===m)return e;break}if(S.match_length=0,Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):f.strategy===3?function(S,Z){for(var Y,M,V,rt,tt=S.window;;){if(S.lookahead<=W){if(nt(S),S.lookahead<=W&&Z===m)return e;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=C&&0S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=C?(Y=n._tr_tally(S,1,S.match_length-C),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):h[f.level].func(f,R);if(P!==X&&P!==N||(f.status=666),P===e||P===X)return t.avail_out===0&&(f.last_flush=-1),i;if(P===F&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(H(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),A(t),t.avail_out===0))return f.last_flush=-1,i}return R!==b?i:f.wrap<=0?1:(f.wrap===2?(J(f,255&t.adler),J(f,t.adler>>8&255),J(f,t.adler>>16&255),J(f,t.adler>>24&255),J(f,255&t.total_in),J(f,t.total_in>>8&255),J(f,t.total_in>>16&255),J(f,t.total_in>>24&255)):(K(f,t.adler>>>16),K(f,65535&t.adler)),A(t),0=O.w_size&&(k===0&&(H(O.head),O.strstart=0,O.block_start=0,O.insert=0),Z=new o.Buf8(O.w_size),o.arraySet(Z,R,Y-O.w_size,O.w_size,0),R=Z,Y=O.w_size),T=t.avail_in,P=t.next_in,S=t.input,t.avail_in=Y,t.next_in=0,t.input=R,nt(O);O.lookahead>=C;){for(f=O.strstart,s=O.lookahead-(C-1);O.ins_h=(O.ins_h<>>=C=j>>>24,y-=C,(C=j>>>16&255)===0)F[v++]=65535&j;else{if(!(16&C)){if(!(64&C)){j=z[(65535&j)+(d&(1<>>=C,y-=C),y<15&&(d+=e[u++]<>>=C=j>>>24,y-=C,!(16&(C=j>>>16&255))){if(!(64&C)){j=x[(65535&j)+(d&(1<>>=C,y-=C,(C=v-m)>3,d&=(1<<(y-=W<<3))-1,h.next_in=u,h.next_out=v,h.avail_in=u>>24&255)+(p>>>8&65280)+((65280&p)<<8)+((255&p)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(p){var B;return p&&p.state?(B=p.state,p.total_in=p.total_out=B.total=0,p.msg="",B.wrap&&(p.adler=1&B.wrap),B.mode=c,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new h.Buf32(r),B.distcode=B.distdyn=new h.Buf32(l),B.sane=1,B.back=-1,b):i}function z(p){var B;return p&&p.state?((B=p.state).wsize=0,B.whave=0,B.wnext=0,y(p)):i}function x(p,B){var e,F;return p&&p.state?(F=p.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15=N.wsize?(h.arraySet(N.window,B,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(F<(X=N.wsize-N.wnext)&&(X=F),h.arraySet(N.window,B,e-F,X,N.wnext),(F-=X)?(h.arraySet(N.window,B,e-F,F,0),N.wnext=F,N.whave=N.wsize):(N.wnext+=X,N.wnext===N.wsize&&(N.wnext=0),N.whave>>8&255,e.check=n(e.check,k,2,0),E=A=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&A)<<8)+(A>>8))%31){p.msg="incorrect header check",e.mode=30;break}if((15&A)!=8){p.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(A>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){p.msg="invalid window size",e.mode=30;break}e.dmax=1<>8&1),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=3;case 3:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>8&255,k[2]=A>>>16&255,k[3]=A>>>24&255,e.check=n(e.check,k,4,0)),E=A=0,e.mode=4;case 4:for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>8),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>>8&255,e.check=n(e.check,k,2,0)),E=A=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(G=e.length)&&(G=L),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),h.arraySet(e.head.extra,F,N,G,t)),512&e.flags&&(e.check=n(e.check,F,G,N)),L-=G,N+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(G=0;t=F[N+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G>9&1,e.head.done=!0),p.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(L===0)break t;L--,A+=F[N++]<>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;A>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:p.msg="invalid block type",e.mode=30}A>>>=2,E-=2;break;case 14:for(A>>>=7&E,E-=7&E;E<32;){if(L===0)break t;L--,A+=F[N++]<>>16^65535)){p.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&A,E=A=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(L>>=5,E-=5,e.ndist=1+(31&A),A>>>=5,E-=5,e.ncode=4+(15&A),A>>>=4,E-=4,286>>=3,E-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=Q,E-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;E>>=Q,E-=Q,e.have===0){p.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&A),A>>>=2,E-=2}else if(st===17){for(f=Q+3;E>>=Q)),A>>>=3,E-=3}else{for(f=Q+7;E>>=Q)),A>>>=7,E-=7}if(e.have+G>e.nlen+e.ndist){p.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){p.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(m,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){p.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=H){p.next_out=$,p.avail_out=H,p.next_in=N,p.avail_in=L,e.hold=A,e.bits=E,u(p,K),$=p.next_out,X=p.output,H=p.avail_out,N=p.next_in,F=p.input,L=p.avail_in,A=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){p.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,64&et){p.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){p.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(H===0)break t;if(G=K-H,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){p.msg="invalid distance too far back",e.mode=30;break}nt=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ot=e.window}else ot=X,nt=$-e.offset,G=e.length;for(HI?(C=nt[ot+l[B]],E[J+l[B]]):(C=96,0),d=1<>$)+(y-=d)]=j<<24|C<<16|W|0,y!==0;);for(d=1<>=1;if(d!==0?(A&=d-1,A+=d):A=0,B++,--K[p]==0){if(p===F)break;p=m[b+l[B]]}if(X>>7)]}function J(s,k){s.pending_buf[s.pending++]=255&k,s.pending_buf[s.pending++]=k>>>8&255}function K(s,k,T){s.bi_valid>a-T?(s.bi_buf|=k<>a-s.bi_valid,s.bi_valid+=T-a):(s.bi_buf|=k<>>=1,T<<=1,0<--k;);return T>>>1}function ot(s,k,T){var P,S,Z=new Array(l+1),Y=0;for(P=1;P<=l;P++)Z[P]=Y=Y+T[P-1]<<1;for(S=0;S<=k;S++){var M=s[2*S+1];M!==0&&(s[2*S]=nt(Z[M]++,M))}}function Q(s){var k;for(k=0;k>1;1<=T;T--)it(s,Z,T);for(S=V;T=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),P=s.heap[1],s.heap[--s.heap_max]=T,s.heap[--s.heap_max]=P,Z[2*S]=Z[2*T]+Z[2*P],s.depth[S]=(s.depth[T]>=s.depth[P]?s.depth[T]:s.depth[P])+1,Z[2*T+1]=Z[2*P+1]=S,s.heap[1]=S++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ht){var pt,ft,mt,at,gt,kt,ct=ht.dyn_tree,xt=ht.max_code,Ot=ht.stat_desc.static_tree,Ct=ht.stat_desc.has_stree,It=ht.stat_desc.extra_bits,zt=ht.stat_desc.extra_base,_t=ht.stat_desc.max_length,bt=0;for(at=0;at<=l;at++)tt.bl_count[at]=0;for(ct[2*tt.heap[tt.heap_max]+1]=0,pt=tt.heap_max+1;pt>=7;S>>=1)if(1&rt&&M.dyn_ltree[2*V]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(V=32;V>>3,(Z=s.static_len+3+7>>>3)<=S&&(S=Z)):S=Z=T+5,T+4<=S&&k!==-1?f(s,k,T,P):s.strategy===4||Z===S?(K(s,2+(P?1:0),3),lt(s,q,p)):(K(s,4+(P?1:0),3),function(M,V,rt,tt){var ht;for(K(M,V-257,5),K(M,rt-1,5),K(M,tt-4,4),ht=0;ht>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&k,s.pending_buf[s.l_buf+s.last_lit]=255&T,s.last_lit++,k===0?s.dyn_ltree[2*T]++:(s.matches++,k--,s.dyn_ltree[2*(e[T]+m+1)]++,s.dyn_dtree[2*E(k)]++),s.last_lit===s.lit_bufsize-1},w._tr_align=function(s){K(s,2,3),G(s,y,q),function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(_,U,w){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(_,U,w){(function(h){(function(o,n){if(!o.setImmediate){var u,g,v,m,b=1,i={},c=!1,r=o.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(o);l=l&&l.setTimeout?l:o,u={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){d(z)})}:function(){if(o.postMessage&&!o.importScripts){var z=!0,x=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=x,z}}()?(m="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(z){o.postMessage(m+z,"*")}):o.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){d(z.data)},function(z){v.port2.postMessage(z)}):r&&"onreadystatechange"in r.createElement("script")?(g=r.documentElement,function(z){var x=r.createElement("script");x.onreadystatechange=function(){d(z),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(z){setTimeout(d,0,z)},l.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var x=new Array(arguments.length-1),D=0;D"u"?h===void 0?this:h:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(St)),St.exports}var At=Ft();const Dt=Bt(At),Nt=Rt({__proto__:null,default:Dt},[At]);export{Nt as j}; diff --git a/custom-toc-separator/assets/jszip.min-C61Pcz7i-D_1l-gq9.js b/custom-toc-separator/assets/jszip.min-C61Pcz7i-D_1l-gq9.js new file mode 100644 index 00000000..88862e84 --- /dev/null +++ b/custom-toc-separator/assets/jszip.min-C61Pcz7i-D_1l-gq9.js @@ -0,0 +1,2 @@ +import{c0 as Bt,c1 as vt}from"./story-DT1Ep1ux.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";import"./main-BTdHgocv.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` +\0`,K+=h(A,2),K+=D.magic,K+=h(y,2),K+=h(z,2),K+=h(H.crc32,4),K+=h(H.compressedSize,4),K+=h(H.uncompressedSize,4),K+=h(j.length,2),K+=h(F.length,2),{fileRecord:m.LOCAL_FILE_HEADER+K+j+F,dirRecord:m.CENTRAL_FILE_HEADER+h(J,2)+K+h(q.length,2)+"\0\0\0\0"+h(E,4)+h(l,4)+j+F+q}}var n=_("../utils"),u=_("../stream/GenericWorker"),g=_("../utf8"),v=_("../crc32"),m=_("../signature");function b(i,c,r,l){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=c,this.zipPlatform=r,this.encodeFileName=l,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(b,u),b.prototype.push=function(i){var c=i.meta.percent||0,r=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(c+100*(r-l-1))/r:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var c=this.streamFiles&&!i.file.dir;if(c){var r=o(i,c,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var c=this.streamFiles&&!i.file.dir,r=o(i,c,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),c)this.push({data:function(l){return m.DATA_DESCRIPTOR+h(l.crc32,4)+h(l.compressedSize,4)+h(l.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,c=0;c=this.index;u--)g=(g<<8)+this.byteAt(u);return this.index+=n,g},readString:function(n){return h.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(_,U,w){var h=_("./Uint8ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(_,U,w){var h=_("./DataReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(_,U,w){var h=_("./ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(_,U,w){var h=_("../utils"),o=_("../support"),n=_("./ArrayReader"),u=_("./StringReader"),g=_("./NodeBufferReader"),v=_("./Uint8ArrayReader");U.exports=function(m){var b=h.getTypeOf(m);return h.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(m):o.uint8array?new v(h.transformTo("uint8array",m)):new n(h.transformTo("array",m)):new u(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(_,U,w){w.LOCAL_FILE_HEADER="PK",w.CENTRAL_FILE_HEADER="PK",w.CENTRAL_DIRECTORY_END="PK",w.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",w.ZIP64_CENTRAL_DIRECTORY_END="PK",w.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(_,U,w){var h=_("./GenericWorker"),o=_("../utils");function n(u){h.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,h),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(_,U,w){var h=_("./GenericWorker"),o=_("../crc32");function n(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}_("../utils").inherits(n,h),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}h.inherits(n,o),n.prototype.processChunk=function(u){if(u){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=h.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}h.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,g);break;case"uint8array":u=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":u=this.data.slice(this.index,g)}return this.index=g,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(_,U,w){function h(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u "+o:o}},U.exports=h},{}],29:[function(_,U,w){var h=_("../utils"),o=_("./ConvertWorker"),n=_("./GenericWorker"),u=_("../base64"),g=_("../support"),v=_("../external"),m=null;if(g.nodestream)try{m=_("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(c,r){return new v.Promise(function(l,a){var d=[],y=c._internalType,z=c._outputType,x=c._mimeType;c.on("data",function(D,I){d.push(D),r&&r(I)}).on("error",function(D){d=[],a(D)}).on("end",function(){try{var D=function(I,j,C){switch(I){case"blob":return h.newBlob(h.transformTo("arraybuffer",j),C);case"base64":return u.encode(j);default:return h.transformTo(I,j)}}(z,function(I,j){var C,W=0,q=null,p=0;for(C=0;C"u")w.blob=!1;else{var h=new ArrayBuffer(0);try{w.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(h),w.blob=o.getBlob("application/zip").size===0}catch{w.blob=!1}}}try{w.nodestream=!!_("readable-stream").Readable}catch{w.nodestream=!1}},{"readable-stream":16}],31:[function(_,U,w){for(var h=_("./utils"),o=_("./support"),n=_("./nodejsUtils"),u=_("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function m(){u.call(this,"utf-8 decode"),this.leftOver=null}function b(){u.call(this,"utf-8 encode")}w.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(c){var r,l,a,d,y,z=c.length,x=0;for(d=0;d>>6:(l<65536?r[y++]=224|l>>>12:(r[y++]=240|l>>>18,r[y++]=128|l>>>12&63),r[y++]=128|l>>>6&63),r[y++]=128|63&l);return r}(i)},w.utf8decode=function(i){return o.nodebuffer?h.transformTo("nodebuffer",i).toString("utf-8"):function(c){var r,l,a,d,y=c.length,z=new Array(2*y);for(r=l=0;r>10&1023,z[l++]=56320|1023&a)}return z.length!==l&&(z.subarray?z=z.subarray(0,l):z.length=l),h.applyFromCharCode(z)}(i=h.transformTo(o.uint8array?"uint8array":"array",i))},h.inherits(m,u),m.prototype.processChunk=function(i){var c=h.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=c;(c=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),c.set(r,this.leftOver.length)}else c=this.leftOver.concat(c);this.leftOver=null}var l=function(d,y){var z;for((y=y||d.length)>d.length&&(y=d.length),z=y-1;0<=z&&(192&d[z])==128;)z--;return z<0||z===0?y:z+g[d[z]]>y?z:y}(c),a=c;l!==c.length&&(o.uint8array?(a=c.subarray(0,l),this.leftOver=c.subarray(l,c.length)):(a=c.slice(0,l),this.leftOver=c.slice(l,c.length))),this.push({data:w.utf8decode(a),meta:i.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:w.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},w.Utf8DecodeWorker=m,h.inherits(b,u),b.prototype.processChunk=function(i){this.push({data:w.utf8encode(i.data),meta:i.meta})},w.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(_,U,w){var h=_("./support"),o=_("./base64"),n=_("./nodejsUtils"),u=_("./external");function g(r){return r}function v(r,l){for(var a=0;a>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=h(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var c,r,l,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4>>6:(i<65536?b[l++]=224|i>>>12:(b[l++]=240|i>>>18,b[l++]=128|i>>>12&63),b[l++]=128|i>>>6&63),b[l++]=128|63&i);return b},w.buf2binstring=function(m){return v(m,m.length)},w.binstring2buf=function(m){for(var b=new h.Buf8(m.length),i=0,c=b.length;i>10&1023,d[c++]=56320|1023&r)}return v(d,c)},w.utf8border=function(m,b){var i;for((b=b||m.length)>m.length&&(b=m.length),i=b-1;0<=i&&(192&m[i])==128;)i--;return i<0||i===0?b:i+u[m[i]]>b?i:b}},{"./common":41}],43:[function(_,U,w){U.exports=function(h,o,n,u){for(var g=65535&h|0,v=h>>>16&65535|0,m=0;n!==0;){for(n-=m=2e3>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,g){var v=h,m=g+u;o^=-1;for(var b=g;b>>8^v[255&(o^n[b])];return-1^o}},{}],46:[function(_,U,w){var h,o=_("../utils/common"),n=_("./trees"),u=_("./adler32"),g=_("./crc32"),v=_("./messages"),m=0,b=4,i=0,c=-2,r=-1,l=4,a=2,d=8,y=9,z=286,x=30,D=19,I=2*z+1,j=15,C=3,W=258,q=W+C+1,p=42,B=113,e=1,F=2,X=3,N=4;function $(t,R){return t.msg=v[R],R}function L(t){return(t<<1)-(4t.avail_out&&(O=t.avail_out),O!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,A(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function K(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function G(t,R){var O,f,s=t.max_chain_length,k=t.strstart,T=t.prev_length,P=t.nice_match,S=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,Y=t.w_mask,M=t.prev,V=t.strstart+W,rt=Z[k+T-1],tt=Z[k+T];t.prev_length>=t.good_match&&(s>>=2),P>t.lookahead&&(P=t.lookahead);do if(Z[(O=R)+T]===tt&&Z[O+T-1]===rt&&Z[O]===Z[k]&&Z[++O]===Z[k+1]){k+=2,O++;do;while(Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&kS&&--s!=0);return T<=t.lookahead?T:t.lookahead}function nt(t){var R,O,f,s,k,T,P,S,Z,Y,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=O=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--O;);for(R=O=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--O;);s+=M}if(t.strm.avail_in===0)break;if(T=t.strm,P=t.window,S=t.strstart+t.lookahead,Z=s,Y=void 0,Y=T.avail_in,Z=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-C,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===m)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+O;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===b?(E(t,!0),t.strm.avail_out===0?X:N):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],w.deflateInit=function(t,R){return ut(t,R,d,15,8,0)},w.deflateInit2=ut,w.deflateReset=lt,w.deflateResetKeep=it,w.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?c:(t.state.gzhead=R,i):c},w.deflate=function(t,R){var O,f,s,k;if(!t||!t.state||5>8&255),J(f,f.gzhead.time>>16&255),J(f,f.gzhead.time>>24&255),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(J(f,255&f.gzhead.extra.length),J(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=g(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(J(f,0),J(f,0),J(f,0),J(f,0),J(f,0),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,3),f.status=B);else{var T=d+(f.w_bits-8<<4)<<8;T|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(T|=32),T+=31-T%31,f.status=B,K(f,T),f.strstart!==0&&(K(f,t.adler>>>16),K(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending!==f.pending_buf_size));)J(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&A(t),f.pending+2<=f.pending_buf_size&&(J(f,255&t.adler),J(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(A(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(O)&&R!==b)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==m&&f.status!==666){var P=f.strategy===2?function(S,Z){for(var Y;;){if(S.lookahead===0&&(nt(S),S.lookahead===0)){if(Z===m)return e;break}if(S.match_length=0,Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):f.strategy===3?function(S,Z){for(var Y,M,V,rt,tt=S.window;;){if(S.lookahead<=W){if(nt(S),S.lookahead<=W&&Z===m)return e;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=C&&0S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=C?(Y=n._tr_tally(S,1,S.match_length-C),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):h[f.level].func(f,R);if(P!==X&&P!==N||(f.status=666),P===e||P===X)return t.avail_out===0&&(f.last_flush=-1),i;if(P===F&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(H(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),A(t),t.avail_out===0))return f.last_flush=-1,i}return R!==b?i:f.wrap<=0?1:(f.wrap===2?(J(f,255&t.adler),J(f,t.adler>>8&255),J(f,t.adler>>16&255),J(f,t.adler>>24&255),J(f,255&t.total_in),J(f,t.total_in>>8&255),J(f,t.total_in>>16&255),J(f,t.total_in>>24&255)):(K(f,t.adler>>>16),K(f,65535&t.adler)),A(t),0=O.w_size&&(k===0&&(H(O.head),O.strstart=0,O.block_start=0,O.insert=0),Z=new o.Buf8(O.w_size),o.arraySet(Z,R,Y-O.w_size,O.w_size,0),R=Z,Y=O.w_size),T=t.avail_in,P=t.next_in,S=t.input,t.avail_in=Y,t.next_in=0,t.input=R,nt(O);O.lookahead>=C;){for(f=O.strstart,s=O.lookahead-(C-1);O.ins_h=(O.ins_h<>>=C=j>>>24,y-=C,(C=j>>>16&255)===0)F[v++]=65535&j;else{if(!(16&C)){if(!(64&C)){j=z[(65535&j)+(d&(1<>>=C,y-=C),y<15&&(d+=e[u++]<>>=C=j>>>24,y-=C,!(16&(C=j>>>16&255))){if(!(64&C)){j=x[(65535&j)+(d&(1<>>=C,y-=C,(C=v-m)>3,d&=(1<<(y-=W<<3))-1,h.next_in=u,h.next_out=v,h.avail_in=u>>24&255)+(p>>>8&65280)+((65280&p)<<8)+((255&p)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(p){var B;return p&&p.state?(B=p.state,p.total_in=p.total_out=B.total=0,p.msg="",B.wrap&&(p.adler=1&B.wrap),B.mode=c,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new h.Buf32(r),B.distcode=B.distdyn=new h.Buf32(l),B.sane=1,B.back=-1,b):i}function z(p){var B;return p&&p.state?((B=p.state).wsize=0,B.whave=0,B.wnext=0,y(p)):i}function x(p,B){var e,F;return p&&p.state?(F=p.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15=N.wsize?(h.arraySet(N.window,B,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(F<(X=N.wsize-N.wnext)&&(X=F),h.arraySet(N.window,B,e-F,X,N.wnext),(F-=X)?(h.arraySet(N.window,B,e-F,F,0),N.wnext=F,N.whave=N.wsize):(N.wnext+=X,N.wnext===N.wsize&&(N.wnext=0),N.whave>>8&255,e.check=n(e.check,k,2,0),E=A=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&A)<<8)+(A>>8))%31){p.msg="incorrect header check",e.mode=30;break}if((15&A)!=8){p.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(A>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){p.msg="invalid window size",e.mode=30;break}e.dmax=1<>8&1),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=3;case 3:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>8&255,k[2]=A>>>16&255,k[3]=A>>>24&255,e.check=n(e.check,k,4,0)),E=A=0,e.mode=4;case 4:for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>8),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>>8&255,e.check=n(e.check,k,2,0)),E=A=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(G=e.length)&&(G=L),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),h.arraySet(e.head.extra,F,N,G,t)),512&e.flags&&(e.check=n(e.check,F,G,N)),L-=G,N+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(G=0;t=F[N+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G>9&1,e.head.done=!0),p.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(L===0)break t;L--,A+=F[N++]<>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;A>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:p.msg="invalid block type",e.mode=30}A>>>=2,E-=2;break;case 14:for(A>>>=7&E,E-=7&E;E<32;){if(L===0)break t;L--,A+=F[N++]<>>16^65535)){p.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&A,E=A=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(L>>=5,E-=5,e.ndist=1+(31&A),A>>>=5,E-=5,e.ncode=4+(15&A),A>>>=4,E-=4,286>>=3,E-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=Q,E-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;E>>=Q,E-=Q,e.have===0){p.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&A),A>>>=2,E-=2}else if(st===17){for(f=Q+3;E>>=Q)),A>>>=3,E-=3}else{for(f=Q+7;E>>=Q)),A>>>=7,E-=7}if(e.have+G>e.nlen+e.ndist){p.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){p.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(m,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){p.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=H){p.next_out=$,p.avail_out=H,p.next_in=N,p.avail_in=L,e.hold=A,e.bits=E,u(p,K),$=p.next_out,X=p.output,H=p.avail_out,N=p.next_in,F=p.input,L=p.avail_in,A=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){p.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,64&et){p.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){p.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(H===0)break t;if(G=K-H,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){p.msg="invalid distance too far back",e.mode=30;break}nt=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ot=e.window}else ot=X,nt=$-e.offset,G=e.length;for(HI?(C=nt[ot+l[B]],E[J+l[B]]):(C=96,0),d=1<>$)+(y-=d)]=j<<24|C<<16|W|0,y!==0;);for(d=1<>=1;if(d!==0?(A&=d-1,A+=d):A=0,B++,--K[p]==0){if(p===F)break;p=m[b+l[B]]}if(X>>7)]}function J(s,k){s.pending_buf[s.pending++]=255&k,s.pending_buf[s.pending++]=k>>>8&255}function K(s,k,T){s.bi_valid>a-T?(s.bi_buf|=k<>a-s.bi_valid,s.bi_valid+=T-a):(s.bi_buf|=k<>>=1,T<<=1,0<--k;);return T>>>1}function ot(s,k,T){var P,S,Z=new Array(l+1),Y=0;for(P=1;P<=l;P++)Z[P]=Y=Y+T[P-1]<<1;for(S=0;S<=k;S++){var M=s[2*S+1];M!==0&&(s[2*S]=nt(Z[M]++,M))}}function Q(s){var k;for(k=0;k>1;1<=T;T--)it(s,Z,T);for(S=V;T=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),P=s.heap[1],s.heap[--s.heap_max]=T,s.heap[--s.heap_max]=P,Z[2*S]=Z[2*T]+Z[2*P],s.depth[S]=(s.depth[T]>=s.depth[P]?s.depth[T]:s.depth[P])+1,Z[2*T+1]=Z[2*P+1]=S,s.heap[1]=S++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ht){var pt,ft,mt,at,gt,kt,ct=ht.dyn_tree,xt=ht.max_code,Ot=ht.stat_desc.static_tree,Ct=ht.stat_desc.has_stree,It=ht.stat_desc.extra_bits,zt=ht.stat_desc.extra_base,_t=ht.stat_desc.max_length,bt=0;for(at=0;at<=l;at++)tt.bl_count[at]=0;for(ct[2*tt.heap[tt.heap_max]+1]=0,pt=tt.heap_max+1;pt>=7;S>>=1)if(1&rt&&M.dyn_ltree[2*V]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(V=32;V>>3,(Z=s.static_len+3+7>>>3)<=S&&(S=Z)):S=Z=T+5,T+4<=S&&k!==-1?f(s,k,T,P):s.strategy===4||Z===S?(K(s,2+(P?1:0),3),lt(s,q,p)):(K(s,4+(P?1:0),3),function(M,V,rt,tt){var ht;for(K(M,V-257,5),K(M,rt-1,5),K(M,tt-4,4),ht=0;ht>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&k,s.pending_buf[s.l_buf+s.last_lit]=255&T,s.last_lit++,k===0?s.dyn_ltree[2*T]++:(s.matches++,k--,s.dyn_ltree[2*(e[T]+m+1)]++,s.dyn_dtree[2*E(k)]++),s.last_lit===s.lit_bufsize-1},w._tr_align=function(s){K(s,2,3),G(s,y,q),function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(_,U,w){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(_,U,w){(function(h){(function(o,n){if(!o.setImmediate){var u,g,v,m,b=1,i={},c=!1,r=o.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(o);l=l&&l.setTimeout?l:o,u={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){d(z)})}:function(){if(o.postMessage&&!o.importScripts){var z=!0,x=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=x,z}}()?(m="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(z){o.postMessage(m+z,"*")}):o.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){d(z.data)},function(z){v.port2.postMessage(z)}):r&&"onreadystatechange"in r.createElement("script")?(g=r.documentElement,function(z){var x=r.createElement("script");x.onreadystatechange=function(){d(z),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(z){setTimeout(d,0,z)},l.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var x=new Array(arguments.length-1),D=0;D"u"?h===void 0?this:h:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(St)),St.exports}var At=Ft();const Dt=Bt(At),Nt=Rt({__proto__:null,default:Dt},[At]);export{Nt as j}; diff --git a/custom-toc-separator/assets/kmlUtils-C5oIEoOy-CwR9R5MT.js b/custom-toc-separator/assets/kmlUtils-C5oIEoOy-CwR9R5MT.js new file mode 100644 index 00000000..c8b4623b --- /dev/null +++ b/custom-toc-separator/assets/kmlUtils-C5oIEoOy-CwR9R5MT.js @@ -0,0 +1 @@ +import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./story-DT1Ep1ux.js";import{t as O}from"./jsonUtils-C64Zfu7c-D7O5HWOd.js";import{O as M}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; diff --git a/custom-toc-separator/assets/kmlUtils-C5oIEoOy-DWwDrVZj.js b/custom-toc-separator/assets/kmlUtils-C5oIEoOy-DWwDrVZj.js deleted file mode 100644 index d6c38cca..00000000 --- a/custom-toc-separator/assets/kmlUtils-C5oIEoOy-DWwDrVZj.js +++ /dev/null @@ -1 +0,0 @@ -import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./story-OUarUCIt.js";import{t as O}from"./jsonUtils-C64Zfu7c-COIuPQy9.js";import{O as M}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; diff --git a/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-BspkM59i.js b/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-BspkM59i.js deleted file mode 100644 index 71a8657a..00000000 --- a/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-BspkM59i.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"])))=>i.map(i=>d[i]); -import{_ as Ee}from"./main-lj2zzr_L.js";import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./story-OUarUCIt.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-D5mx9kys.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const rr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,rr as k,I as r}; diff --git a/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-CKY-uOox.js b/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-CKY-uOox.js new file mode 100644 index 00000000..da95daa3 --- /dev/null +++ b/custom-toc-separator/assets/knowledgeGraphService-DOJz0fzA-CKY-uOox.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"])))=>i.map(i=>d[i]); +import{_ as Ee}from"./main-BTdHgocv.js";import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./story-DT1Ep1ux.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-D8hB6lBb.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const rr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,rr as k,I as r}; diff --git a/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-Bsl7byUf.js b/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-Bsl7byUf.js deleted file mode 100644 index 4c0956ec..00000000 --- a/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-Bsl7byUf.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-BspkM59i.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./Relationship-Db9GUmYx-D5mx9kys.js"])))=>i.map(i=>d[i]); -import{_ as D}from"./main-lj2zzr_L.js";import{r as _,C as E,J as $,d as k,d6 as N,b7 as j}from"./story-OUarUCIt.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-idKUZPHi.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as M,C as S,e as O,S as C,d as b,c as V,h as K,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-Dxi5SK_d.js";import{n as U}from"./portalUtils-CKN9iXwH-BVEO1U-S.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-Cytmrlsd.js";import X from"./PortalItem-CctGdnxF-DgukgleB.js";import{f as Y,j as Z}from"./project-DQKhruav-BOvaUqEJ.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-D5mx9kys.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./number-eRKYXfX9-DRLtE8-p.js";import"./shared-D1w-26bA-BhDdbtTQ.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-BspkM59i.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(V(t))return t.toStorageFormat();if(K(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function At(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-BspkM59i.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(a=>a.k));let f=null;const h=M(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{At as registerFunctions}; diff --git a/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-D9I5gLfJ.js b/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-D9I5gLfJ.js new file mode 100644 index 00000000..f5217660 --- /dev/null +++ b/custom-toc-separator/assets/knowledgegraph-Dt7zfNlJ-D9I5gLfJ.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-CKY-uOox.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./Relationship-Db9GUmYx-D8hB6lBb.js"])))=>i.map(i=>d[i]); +import{_ as D}from"./main-BTdHgocv.js";import{r as _,C as E,J as $,d as k,d6 as N,b7 as j}from"./story-DT1Ep1ux.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-DX8HgrX0.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as M,C as S,e as O,S as C,d as b,c as V,h as K,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-5dy33zDL.js";import{n as U}from"./portalUtils-CKN9iXwH-CegMKdRo.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-DTN1X2Bt.js";import X from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{f as Y,j as Z}from"./project-DQKhruav-C6Tnpe-k.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-D8hB6lBb.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./number-eRKYXfX9-BO7ByyLZ.js";import"./shared-D1w-26bA-BBBcUeQg.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-CKY-uOox.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(V(t))return t.toStorageFormat();if(K(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function At(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-CKY-uOox.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(a=>a.k));let f=null;const h=M(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{At as registerFunctions}; diff --git a/custom-toc-separator/assets/labelUtils-BW14kBqX-B_97vWvS.js b/custom-toc-separator/assets/labelUtils-BW14kBqX-B_97vWvS.js new file mode 100644 index 00000000..96a8e474 --- /dev/null +++ b/custom-toc-separator/assets/labelUtils-BW14kBqX-B_97vWvS.js @@ -0,0 +1 @@ +import{c2 as p}from"./story-DT1Ep1ux.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; diff --git a/custom-toc-separator/assets/labelUtils-BW14kBqX-DeXQjA1z.js b/custom-toc-separator/assets/labelUtils-BW14kBqX-DeXQjA1z.js deleted file mode 100644 index 9d787d54..00000000 --- a/custom-toc-separator/assets/labelUtils-BW14kBqX-DeXQjA1z.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as p}from"./story-OUarUCIt.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; diff --git a/custom-toc-separator/assets/labelingInfo-DGVNul26-DxpYAQDw.js b/custom-toc-separator/assets/labelingInfo-DGVNul26-DxpYAQDw.js new file mode 100644 index 00000000..173bf599 --- /dev/null +++ b/custom-toc-separator/assets/labelingInfo-DGVNul26-DxpYAQDw.js @@ -0,0 +1 @@ +import{v as i,S as s,a0 as x,ac as u,i as S,aK as C,dN as j,ee as I,ef as B,eg as h,e as P,eh as N,ei as $,P as d,o as D,a1 as G}from"./story-DT1Ep1ux.js";import{p as g,$ as M,u as O,t as V,b as z,m as J}from"./labelUtils-BW14kBqX-B_97vWvS.js";var m;let p=m=class extends P{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?g(r.value):e}writeExpression(e,r,n){this.value!=null&&(e=g(this.value)),e!=null&&(r[n]=e)}clone(){return new m({expression:this.expression,title:this.title,value:this.value})}};i([s({type:String,json:{write:{writerEnsuresNonNull:!0}}})],p.prototype,"expression",void 0),i([x("expression",["expression","value"])],p.prototype,"readExpression",null),i([u("expression")],p.prototype,"writeExpression",null),i([s({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"title",void 0),i([s({json:{read:!1,write:!1}})],p.prototype,"value",void 0),p=m=i([S("esri.layers.support.LabelExpressionInfo")],p);const L=p;var f;const v=new C({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function w(e,r,n){return{enabled:!N(n?.layer)}}function E(e){return!e||e.origin!=="service"&&e.layer?.type!=="map-image"}function R(e){return e?.type==="map-image"}function A(e){return!!R(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function U(e){return E(e)||A(e?.layer)}let l=f=class extends P{static evaluateWhere(e,r){const n=(t,o,a)=>{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tU(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;t{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tU(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;tthis.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; diff --git a/custom-toc-separator/assets/languageUtils-BYxF9hRA-Dxi5SK_d.js b/custom-toc-separator/assets/languageUtils-BYxF9hRA-Dxi5SK_d.js deleted file mode 100644 index 33937e36..00000000 --- a/custom-toc-separator/assets/languageUtils-BYxF9hRA-Dxi5SK_d.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as K,t as kn,w as M,l as V,m as W,G as Q,n as X,d as k,h as cn,F as on,g as On,D as Dn,c8 as In,J as Rn,C as wn}from"./story-OUarUCIt.js";import{r as I,O as _n,m as vn,u as Un}from"./TimeOnly-DSMefxKy-C9JclgbM.js";import{n as F}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{b as En,h as sn}from"./shared-D1w-26bA-BhDdbtTQ.js";import{z as Ln,M as Pn}from"./number-eRKYXfX9-DRLtE8-p.js";import{b as zn}from"./Query-BrwMGK8U-gUIs0TS1.js";let fn=class{};var o;(function(n){n.AsyncNotEnabled="AsyncNotEnabled",n.ModulesNotSupported="ModulesNotSupported",n.CircularModules="CircularModules",n.CannotCompareDateAndTime="CannotCompareDateAndTime",n.NeverReach="NeverReach",n.UnsupportedHashType="UnsupportedHashType",n.InvalidParameter="InvalidParameter",n.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",n.UnexpectedToken="UnexpectedToken",n.Unrecognized="Unrecognized",n.UnrecognizedType="UnrecognizedType",n.MaximumCallDepth="MaximumCallDepth",n.BooleanConditionRequired="BooleanConditionRequired",n.TypeNotAllowedInFeature="TypeNotAllowedInFeature",n.KeyMustBeString="KeyMustBeString",n.WrongNumberOfParameters="WrongNumberOfParameters",n.CallNonFunction="CallNonFunction",n.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",n.NoFunctionInDictionary="NoFunctionInDictionary",n.NoFunctionInArray="NoFunctionInArray",n.AssignModuleFunction="AssignModuleFunction",n.LogicExpressionOrAnd="LogicExpressionOrAnd",n.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",n.FunctionNotFound="FunctionNotFound",n.InvalidMemberAccessKey="InvalidMemberAccessKey",n.UnsupportedUnaryOperator="UnsupportUnaryOperator",n.InvalidIdentifier="InvalidIdentifier",n.MemberOfNull="MemberOfNull",n.UnsupportedOperator="UnsupportedOperator",n.Cancelled="Cancelled",n.ModuleAccessorMustBeString="ModuleAccessorMustBeString",n.ModuleExportNotFound="ModuleExportNotFound",n.Immutable="Immutable",n.OutOfBounds="OutOfBounds",n.IllegalResult="IllegalResult",n.FieldNotFound="FieldNotFound",n.PortalRequired="PortalRequired",n.LogicError="LogicError",n.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",n.KeyAccessorMustBeString="KeyAccessorMustBeString",n.WrongSpatialReference="WrongSpatialReference",n.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",n.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(o||(o={}));const dn={[o.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[o.LogicError]:"Logic error - {reason}",[o.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[o.NeverReach]:"Encountered unreachable logic",[o.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[o.ModuleAccessorMustBeString]:"Module accessor must be a string",[o.ModuleExportNotFound]:"Module has no export with provided identifier",[o.ModulesNotSupported]:"Current profile does not support modules",[o.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[o.FunctionNotFound]:"Function not found",[o.FieldNotFound]:"Key not found - {key}",[o.CircularModules]:"Circular module dependencies are not allowed",[o.Cancelled]:"Execution cancelled",[o.UnsupportedHashType]:"Type not supported in hash function",[o.IllegalResult]:"Value is not a supported return type",[o.PortalRequired]:"Portal is required",[o.InvalidParameter]:"Invalid parameter",[o.WrongNumberOfParameters]:"Call with wrong number of parameters",[o.Unrecognized]:"Unrecognized code structure",[o.UnrecognizedType]:"Unrecognized type",[o.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[o.BooleanConditionRequired]:"Conditions must use booleans",[o.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[o.NoFunctionInArray]:"Arrays cannot contain functions.",[o.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[o.KeyAccessorMustBeString]:"Accessor must be a string",[o.KeyMustBeString]:"Object keys must be a string",[o.Immutable]:"Object is immutable",[o.UnexpectedToken]:"Unexpected token",[o.MemberOfNull]:"Cannot access property of null object",[o.MaximumCallDepth]:"Exceeded maximum function depth",[o.OutOfBounds]:"Out of bounds",[o.InvalidIdentifier]:"Identifier not recognized",[o.CallNonFunction]:"Expression is not a function",[o.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[o.AssignModuleFunction]:"Cannot assign function to module variable",[o.UnsupportedUnaryOperator]:"Unsupported unary operator",[o.UnsupportedOperator]:"Unsupported operator",[o.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[o.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[o.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[o.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[o.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let Jn=class extends Error{constructor(...n){super(...n)}};class U extends Jn{constructor(e,r){super($(r)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,U),r?.loc&&(this.loc=r.loc)}}class T extends Error{constructor(e,r,t,a){super("Execution error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,T),t?.loc&&(this.loc=t.loc)}}function $(n){return n&&n.loc?`Line : ${n.loc.start?.line}, ${n.loc.start?.column}: `:""}class pn extends Error{constructor(e,r,t,a){super("Compilation error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,pn),t?.loc&&(this.loc=t.loc)}}let Re=class mn extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,mn)}};function we(n,e,r){return r.declaredRootClass==="esri.arcade.arcadeexecutionerror"||r.declaredRootClass==="esri.arcade.arcadecompilationerror"?r.loc===null&&e?.loc?new U(r,{cause:r}):r:(r.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||r.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||r.declaredRootClass,e?.loc?new U(r,{cause:r}):r)}var E;(function(n){n.UnrecognizedUri="UnrecognizedUri",n.UnsupportedUriProtocol="UnsupportedUriProtocol"})(E||(E={}));const jn={[E.UnrecognizedUri]:"Unrecognized uri - {uri}",[E.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class hn extends Error{constructor(e,r){super(K(jn[e],r)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,hn)}}class R{constructor(){}}function un(n,e,r){if(n instanceof R&&!(n instanceof Y)){const t=new Y;return t.fn=n,t.parameterEvaluator=r,t.context=e,t}return n}class _e extends R{constructor(e){super(),this.fn=e}createFunction(e){return(...r)=>this.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; diff --git a/custom-toc-separator/assets/layerViewUtils-DURAPenP-1iVHX8OF.js b/custom-toc-separator/assets/layerViewUtils-DURAPenP-1iVHX8OF.js new file mode 100644 index 00000000..e80735da --- /dev/null +++ b/custom-toc-separator/assets/layerViewUtils-DURAPenP-1iVHX8OF.js @@ -0,0 +1 @@ +import"./story-DT1Ep1ux.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; diff --git a/custom-toc-separator/assets/layerViewUtils-DURAPenP-XPLsaos3.js b/custom-toc-separator/assets/layerViewUtils-DURAPenP-XPLsaos3.js deleted file mode 100644 index d9f70b40..00000000 --- a/custom-toc-separator/assets/layerViewUtils-DURAPenP-XPLsaos3.js +++ /dev/null @@ -1 +0,0 @@ -import"./story-OUarUCIt.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; diff --git a/custom-toc-separator/assets/layersCreator-CW56kDKc-BV4FNk7k.js b/custom-toc-separator/assets/layersCreator-CW56kDKc-BV4FNk7k.js deleted file mode 100644 index 7535b104..00000000 --- a/custom-toc-separator/assets/layersCreator-CW56kDKc-BV4FNk7k.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as f}from"./story-OUarUCIt.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-DRZYQiud.js";import{p as n}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import d from"./PortalItem-CctGdnxF-DgukgleB.js";import{g as b}from"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./main-lj2zzr_L.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; diff --git a/custom-toc-separator/assets/layersCreator-CW56kDKc-DnJXdOOq.js b/custom-toc-separator/assets/layersCreator-CW56kDKc-DnJXdOOq.js new file mode 100644 index 00000000..3879dbe6 --- /dev/null +++ b/custom-toc-separator/assets/layersCreator-CW56kDKc-DnJXdOOq.js @@ -0,0 +1 @@ +import{ag as f}from"./story-DT1Ep1ux.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-iIxSwWC_.js";import{p as n}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import d from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{g as b}from"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./main-BTdHgocv.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; diff --git a/custom-toc-separator/assets/layersLoader-CYI-LpLl-DGf4-gq6.js b/custom-toc-separator/assets/layersLoader-CYI-LpLl-DGf4-gq6.js new file mode 100644 index 00000000..0ecf55bb --- /dev/null +++ b/custom-toc-separator/assets/layersLoader-CYI-LpLl-DGf4-gq6.js @@ -0,0 +1 @@ +import{o as p,r as S}from"./story-DT1Ep1ux.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-iIxSwWC_.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-DnJXdOOq.js";import{a as h}from"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import{o as k}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import{g as E}from"./styleUtils-ChrJTYIw-DnWMc-4t.js";import"./main-BTdHgocv.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";async function oe(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{oe as load}; diff --git a/custom-toc-separator/assets/layersLoader-CYI-LpLl-DjOMrTof.js b/custom-toc-separator/assets/layersLoader-CYI-LpLl-DjOMrTof.js deleted file mode 100644 index a3159510..00000000 --- a/custom-toc-separator/assets/layersLoader-CYI-LpLl-DjOMrTof.js +++ /dev/null @@ -1 +0,0 @@ -import{o as p,r as S}from"./story-OUarUCIt.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-DRZYQiud.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-BV4FNk7k.js";import{a as h}from"./jsonContext-BA8GHqVk-CN6VxGdq.js";import{o as k}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import{g as E}from"./styleUtils-ChrJTYIw-CbI3fdq_.js";import"./main-lj2zzr_L.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";async function oe(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{oe as load}; diff --git a/custom-toc-separator/assets/lengthUtils-DKpMe5qR-BJJJQeiz.js b/custom-toc-separator/assets/lengthUtils-DKpMe5qR-BJJJQeiz.js deleted file mode 100644 index 1a84b7d7..00000000 --- a/custom-toc-separator/assets/lengthUtils-DKpMe5qR-BJJJQeiz.js +++ /dev/null @@ -1 +0,0 @@ -import{di as e,dj as s,dk as t}from"./story-OUarUCIt.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; diff --git a/custom-toc-separator/assets/lengthUtils-DKpMe5qR-C4JQidi_.js b/custom-toc-separator/assets/lengthUtils-DKpMe5qR-C4JQidi_.js new file mode 100644 index 00000000..143e9618 --- /dev/null +++ b/custom-toc-separator/assets/lengthUtils-DKpMe5qR-C4JQidi_.js @@ -0,0 +1 @@ +import{di as e,dj as s,dk as t}from"./story-DT1Ep1ux.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; diff --git a/custom-toc-separator/assets/lineSegment-CcqvCARM-CJhaINhC.js b/custom-toc-separator/assets/lineSegment-CcqvCARM-CJhaINhC.js new file mode 100644 index 00000000..277ef6a7 --- /dev/null +++ b/custom-toc-separator/assets/lineSegment-CcqvCARM-CJhaINhC.js @@ -0,0 +1 @@ +import{i8 as v,dg as m,ae as a}from"./story-DT1Ep1ux.js";import{X as y}from"./sphere-BenPORjV-B4r28WKg.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{f as g}from"./plane-Dt8R0KeE-CP4TXD5k.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function b(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function h(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function k(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,b as q,p as u,h as x,k as y}; diff --git a/custom-toc-separator/assets/lineSegment-CcqvCARM-CznIGfdF.js b/custom-toc-separator/assets/lineSegment-CcqvCARM-CznIGfdF.js deleted file mode 100644 index b1ac9d5a..00000000 --- a/custom-toc-separator/assets/lineSegment-CcqvCARM-CznIGfdF.js +++ /dev/null @@ -1 +0,0 @@ -import{i8 as v,dg as m,ae as a}from"./story-OUarUCIt.js";import{X as y}from"./sphere-BenPORjV-CkV41Bdd.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{f as g}from"./plane-Dt8R0KeE-DlxNxa6f.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function b(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function h(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function k(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,b as q,p as u,h as x,k as y}; diff --git a/custom-toc-separator/assets/loadAll-e978YItg-EK1YwFYX.js b/custom-toc-separator/assets/loadAll-e978YItg-EK1YwFYX.js new file mode 100644 index 00000000..65f2d7d2 --- /dev/null +++ b/custom-toc-separator/assets/loadAll-e978YItg-EK1YwFYX.js @@ -0,0 +1 @@ +import{cC as c,ag as e,aB as f,b6 as u}from"./story-DT1Ep1ux.js";async function p(n,t){return await n.load(),y(n,t)}async function y(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(d(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function d(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{y as s,p as y}; diff --git a/custom-toc-separator/assets/loadAll-e978YItg-cyBswBq0.js b/custom-toc-separator/assets/loadAll-e978YItg-cyBswBq0.js deleted file mode 100644 index bfc68125..00000000 --- a/custom-toc-separator/assets/loadAll-e978YItg-cyBswBq0.js +++ /dev/null @@ -1 +0,0 @@ -import{cC as c,ag as e,aB as f,b6 as u}from"./story-OUarUCIt.js";async function p(n,t){return await n.load(),y(n,t)}async function y(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(d(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function d(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{y as s,p as y}; diff --git a/custom-toc-separator/assets/loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js b/custom-toc-separator/assets/loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js deleted file mode 100644 index 240c4467..00000000 --- a/custom-toc-separator/assets/loadGLTFMesh-C3-0Tu0H-CsE3Bk_D.js +++ /dev/null @@ -1,8 +0,0 @@ -import{o as G,f as P,an as j,ar as C,hf as R,hZ as L,B as U}from"./story-OUarUCIt.js";import{U as z,P as k}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as S}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as D}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{G as V,m as q,z as N,V as K}from"./Mesh-DLzjDUIO-BlTrUdFo.js";import{o as Q}from"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import{x as $}from"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import{X as F,L as I,C as X,g as A,l as O,M as Z,m as H,p as J}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{q as W,v as Y,R as tt,x as E}from"./vec3-BazNroeq-C58EAHFm.js";import{T as et,k as rt,A as M}from"./vec4-DWDdg1fj-CF_vNE3j.js";import{c as ot}from"./types-ChhhI6OU-Cxh6dPlX.js";import{loadGLTF as nt}from"./loader-CkLCe-E_-C05zTnsA.js";import{U as st,E as it,h as at,g as b,m as lt,_ as ut,b as ct,B as ft,k as mt}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js";import{b as pt}from"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import{f as dt}from"./resourceUtils-Ds65naCv-CrS2VhCe.js";import{G as v}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./main-lj2zzr_L.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Bin5_zrY.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./External-D_wl4XAw-BzQ8-YjD.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function xt(t,e,r){const l=t.typedBuffer,n=t.typedBufferStride,i=e.typedBuffer,c=e.typedBufferStride,a=r?r.count:e.count;let s=(r?.dstIndex??0)*n,m=(r?.srcIndex??0)*c;for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` - ${T(a,l)}/ - ${T(s,l)}/ - ${T(m,l)}/ - ${T(u,l)}/ - ${T(o,l)}/ - ${Tt(c.transform)} - `;let p=!1;const d=j(n,f,()=>(p=!0,{start:e,length:a.count}));p&&(e+=a.count),s&&(r.normal=!0),m&&(r.color=!0),u&&(r.tangent=!0),o&&(r.texCoord0=!0),i.push({gltf:c,writeVertices:p,region:d})}return{vertexAttributes:{position:y(H,e),normal:r.normal?y(O,e):null,tangent:r.tangent?y(F,e):null,color:r.color?y(I,e):null,texCoord0:r.texCoord0?y(J,e):null},parts:i,components:[]}}function bt(t){return new V({data:(dt(t.data),t.data),wrap:Rt(t.parameters.wrap)})}function vt(t,e){const r=new C(St(t.color,t.opacity)),l=t.emissiveFactor?new C($t(t.emissiveFactor)):null,n=i=>i?new K({scale:i.scale?[i.scale[0],i.scale[1]]:[1,1],rotation:U(i.rotation??0),offset:i.offset?[i.offset[0],i.offset[1]]:[0,0]}):null;return new q({color:r,colorTexture:e.get(t.textureColor),normalTexture:e.get(t.textureNormal),emissiveColor:l,emissiveTexture:e.get(t.textureEmissive),occlusionTexture:e.get(t.textureOcclusion),alphaMode:Ct(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:e.get(t.textureMetallicRoughness),colorTextureTransform:n(t.colorTextureTransform),normalTextureTransform:n(t.normalTextureTransform),occlusionTextureTransform:n(t.occlusionTextureTransform),emissiveTextureTransform:n(t.emissiveTextureTransform),metallicRoughnessTextureTransform:n(t.metallicRoughnessTextureTransform)})}function wt(t,e,r){e.writeVertices&&Bt(t,e);const{indices:l,attributes:n,primitiveType:i,material:c}=e.gltf;let a=it(l||n.position.count,i);const s=e.region.start;if(s){const m=new Uint32Array(a);for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` + ${T(a,l)}/ + ${T(s,l)}/ + ${T(m,l)}/ + ${T(u,l)}/ + ${T(o,l)}/ + ${Tt(c.transform)} + `;let p=!1;const d=j(n,f,()=>(p=!0,{start:e,length:a.count}));p&&(e+=a.count),s&&(r.normal=!0),m&&(r.color=!0),u&&(r.tangent=!0),o&&(r.texCoord0=!0),i.push({gltf:c,writeVertices:p,region:d})}return{vertexAttributes:{position:y(H,e),normal:r.normal?y(O,e):null,tangent:r.tangent?y(F,e):null,color:r.color?y(I,e):null,texCoord0:r.texCoord0?y(J,e):null},parts:i,components:[]}}function bt(t){return new V({data:(dt(t.data),t.data),wrap:Rt(t.parameters.wrap)})}function vt(t,e){const r=new C(St(t.color,t.opacity)),l=t.emissiveFactor?new C($t(t.emissiveFactor)):null,n=i=>i?new K({scale:i.scale?[i.scale[0],i.scale[1]]:[1,1],rotation:U(i.rotation??0),offset:i.offset?[i.offset[0],i.offset[1]]:[0,0]}):null;return new q({color:r,colorTexture:e.get(t.textureColor),normalTexture:e.get(t.textureNormal),emissiveColor:l,emissiveTexture:e.get(t.textureEmissive),occlusionTexture:e.get(t.textureOcclusion),alphaMode:Ct(t.alphaMode),alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,metallic:t.metallicFactor,roughness:t.roughnessFactor,metallicRoughnessTexture:e.get(t.textureMetallicRoughness),colorTextureTransform:n(t.colorTextureTransform),normalTextureTransform:n(t.normalTextureTransform),occlusionTextureTransform:n(t.occlusionTextureTransform),emissiveTextureTransform:n(t.emissiveTextureTransform),metallicRoughnessTextureTransform:n(t.metallicRoughnessTextureTransform)})}function wt(t,e,r){e.writeVertices&&Bt(t,e);const{indices:l,attributes:n,primitiveType:i,material:c}=e.gltf;let a=it(l||n.position.count,i);const s=e.region.start;if(s){const m=new Uint32Array(a);for(let u=0;ut.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; diff --git a/custom-toc-separator/assets/loadable-DbNDKH4r-DyDwqoXd.js b/custom-toc-separator/assets/loadable-DbNDKH4r-DyDwqoXd.js deleted file mode 100644 index ea724043..00000000 --- a/custom-toc-separator/assets/loadable-DbNDKH4r-DyDwqoXd.js +++ /dev/null @@ -1 +0,0 @@ -import{c as a,n as i}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";const t=new WeakMap,r=new WeakMap;function s(e){r.set(e,new Promise(n=>t.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; diff --git a/custom-toc-separator/assets/loader-Ch7Jr16w-B4sW6aLS.js b/custom-toc-separator/assets/loader-Ch7Jr16w-B4sW6aLS.js deleted file mode 100644 index b9548b66..00000000 --- a/custom-toc-separator/assets/loader-Ch7Jr16w-B4sW6aLS.js +++ /dev/null @@ -1 +0,0 @@ -import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-CnEFMUdd.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; diff --git a/custom-toc-separator/assets/loader-Ch7Jr16w-DWxaqSJX.js b/custom-toc-separator/assets/loader-Ch7Jr16w-DWxaqSJX.js new file mode 100644 index 00000000..e6e1dd13 --- /dev/null +++ b/custom-toc-separator/assets/loader-Ch7Jr16w-DWxaqSJX.js @@ -0,0 +1 @@ +import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-Dy9CelfZ.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; diff --git a/custom-toc-separator/assets/loader-CkLCe-E_-C05zTnsA.js b/custom-toc-separator/assets/loader-CkLCe-E_-C05zTnsA.js deleted file mode 100644 index 4a797835..00000000 --- a/custom-toc-separator/assets/loader-CkLCe-E_-C05zTnsA.js +++ /dev/null @@ -1 +0,0 @@ -import{a1 as N,o as i,cw as Q,dG as W,k7 as Z,an as ee,Y as te,bf as B}from"./story-OUarUCIt.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-5qCYzF4G.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{j as ie}from"./quat-BODLR7mS-BrN0ZBC_.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-CrS2VhCe.js";import"./main-lj2zzr_L.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function ut(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{ut as loadGLTF}; diff --git a/custom-toc-separator/assets/loader-CkLCe-E_-CzV-xLxU.js b/custom-toc-separator/assets/loader-CkLCe-E_-CzV-xLxU.js new file mode 100644 index 00000000..99a13c81 --- /dev/null +++ b/custom-toc-separator/assets/loader-CkLCe-E_-CzV-xLxU.js @@ -0,0 +1 @@ +import{a1 as N,o as i,cw as Q,dG as W,k7 as Z,an as ee,Y as te,bf as B}from"./story-DT1Ep1ux.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-CGLbrkRD.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-B27FdgMD.js";import{j as ie}from"./quat-BODLR7mS-Cqne66qw.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-Dv7NCnc6.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-C_KiPREG.js";import"./main-BTdHgocv.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function ut(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{ut as loadGLTF}; diff --git a/custom-toc-separator/assets/locale-Cn_GDVD_-CnEFMUdd.js b/custom-toc-separator/assets/locale-Cn_GDVD_-CnEFMUdd.js deleted file mode 100644 index f2d448f9..00000000 --- a/custom-toc-separator/assets/locale-Cn_GDVD_-CnEFMUdd.js +++ /dev/null @@ -1 +0,0 @@ -import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-BCNzxmob.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; diff --git a/custom-toc-separator/assets/locale-Cn_GDVD_-Dy9CelfZ.js b/custom-toc-separator/assets/locale-Cn_GDVD_-Dy9CelfZ.js new file mode 100644 index 00000000..0c0ab60c --- /dev/null +++ b/custom-toc-separator/assets/locale-Cn_GDVD_-Dy9CelfZ.js @@ -0,0 +1 @@ +import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-C0_AGNdr.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; diff --git a/custom-toc-separator/assets/main-BTdHgocv.js b/custom-toc-separator/assets/main-BTdHgocv.js new file mode 100644 index 00000000..35d69636 --- /dev/null +++ b/custom-toc-separator/assets/main-BTdHgocv.js @@ -0,0 +1,74 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-DT1Ep1ux.js","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +function yp(t,e){for(var i=0;in[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Os(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const Pt={},ln=[],Te=()=>{},xp=()=>!1,Er=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),va=t=>t.startsWith("onUpdate:"),Bt=Object.assign,ya=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},bp=Object.prototype.hasOwnProperty,Mt=(t,e)=>bp.call(t,e),_t=Array.isArray,cn=t=>Mn(t)==="[object Map]",Ki=t=>Mn(t)==="[object Set]",gl=t=>Mn(t)==="[object Date]",_p=t=>Mn(t)==="[object RegExp]",Ct=t=>typeof t=="function",Ut=t=>typeof t=="string",He=t=>typeof t=="symbol",jt=t=>t!==null&&typeof t=="object",xa=t=>(jt(t)||Ct(t))&&Ct(t.then)&&Ct(t.catch),Nu=Object.prototype.toString,Mn=t=>Nu.call(t),wp=t=>Mn(t).slice(8,-1),As=t=>Mn(t)==="[object Object]",ba=t=>Ut(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,un=Os(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ps=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},Ep=/-(\w)/g,ne=Ps(t=>t.replace(Ep,(e,i)=>i?i.toUpperCase():"")),Cp=/\B([A-Z])/g,ye=Ps(t=>t.replace(Cp,"-$1").toLowerCase()),Cr=Ps(t=>t.charAt(0).toUpperCase()+t.slice(1)),zn=Ps(t=>t?`on${Cr(t)}`:""),de=(t,e)=>!Object.is(t,e),hn=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},ns=t=>{const e=parseFloat(t);return isNaN(e)?t:e},rs=t=>{const e=Ut(t)?Number(t):NaN;return isNaN(e)?t:e};let ml;const ks=()=>ml||(ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Sp="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",Tp=Os(Sp);function Sr(t){if(_t(t)){const e={};for(let i=0;i{if(i){const n=i.split(Ap);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Tr(t){let e="";if(Ut(t))e=t;else if(_t(t))for(let i=0;iTi(i,e))}const Fu=t=>!!(t&&t.__v_isRef===!0),Bu=t=>Ut(t)?t:t==null?"":_t(t)||jt(t)&&(t.toString===Nu||!Ct(t.toString))?Fu(t)?Bu(t.value):JSON.stringify(t,Hu,2):String(t),Hu=(t,e)=>Fu(e)?Hu(t,e.value):cn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[n,r],s)=>(i[to(n,s)+" =>"]=r,i),{})}:Ki(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>to(i))}:He(e)?to(e):jt(e)&&!_t(e)&&!As(e)?String(e):e,to=(t,e="")=>{var i;return He(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let fe;class _a{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=fe,!e&&fe&&(this.index=(fe.scopes||(fe.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes)for(e=0,i=this.scopes.length;e0)return;if(qn){let e=qn;for(qn=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Kn;){let e=Kn;for(Kn=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=i}}if(t)throw t}function $u(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Xu(t){let e,i=t.depsTail,n=i;for(;n;){const r=n.prevDep;n.version===-1?(n===i&&(i=r),Ca(n),Dp(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}t.deps=e,t.depsTail=i}function ko(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Yu(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Yu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===ar))return;t.globalVersion=ar;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!ko(t)){t.flags&=-3;return}const i=Ht,n=Fe;Ht=t,Fe=!0;try{$u(t);const r=t.fn(t._value);(e.version===0||de(r,t._value))&&(t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Ht=i,Fe=n,Xu(t),t.flags&=-3}}function Ca(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let s=i.computed.deps;s;s=s.nextDep)Ca(s,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function Dp(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}function jp(t,e){t.effect instanceof or&&(t=t.effect.fn);const i=new or(t);e&&Bt(i,e);try{i.run()}catch(r){throw i.stop(),r}const n=i.run.bind(i);return n.effect=i,n}function Fp(t){t.effect.stop()}let Fe=!0;const zu=[];function Li(){zu.push(Fe),Fe=!1}function Mi(){const t=zu.pop();Fe=t===void 0?!0:t}function vl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=Ht;Ht=void 0;try{e()}finally{Ht=i}}}let ar=0;class Bp{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ms{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Ht||!Fe||Ht===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==Ht)i=this.activeLink=new Bp(Ht,this),Ht.deps?(i.prevDep=Ht.depsTail,Ht.depsTail.nextDep=i,Ht.depsTail=i):Ht.deps=Ht.depsTail=i,Ku(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=Ht.depsTail,i.nextDep=void 0,Ht.depsTail.nextDep=i,Ht.depsTail=i,Ht.deps===i&&(Ht.deps=n)}return i}trigger(e){this.version++,ar++,this.notify(e)}notify(e){wa();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{Ea()}}}function Ku(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Ku(n)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const ss=new WeakMap,Ui=Symbol(""),Lo=Symbol(""),lr=Symbol("");function se(t,e,i){if(Fe&&Ht){let n=ss.get(t);n||ss.set(t,n=new Map);let r=n.get(i);r||(n.set(i,r=new Ms),r.map=n,r.key=i),r.track()}}function li(t,e,i,n,r,s){const o=ss.get(t);if(!o){ar++;return}const c=l=>{l&&l.trigger()};if(wa(),e==="clear")o.forEach(c);else{const l=_t(t),O=l&&ba(i);if(l&&i==="length"){const _=Number(n);o.forEach((v,E)=>{(E==="length"||E===lr||!He(E)&&E>=_)&&c(v)})}else switch((i!==void 0||o.has(void 0))&&c(o.get(i)),O&&c(o.get(lr)),e){case"add":l?O&&c(o.get("length")):(c(o.get(Ui)),cn(t)&&c(o.get(Lo)));break;case"delete":l||(c(o.get(Ui)),cn(t)&&c(o.get(Lo)));break;case"set":cn(t)&&c(o.get(Ui));break}}Ea()}function Hp(t,e){const i=ss.get(t);return i&&i.get(e)}function Qi(t){const e=Lt(t);return e===t?e:(se(e,"iterate",lr),_e(t)?e:e.map(oe))}function Is(t){return se(t=Lt(t),"iterate",lr),t}const Vp={__proto__:null,[Symbol.iterator](){return io(this,Symbol.iterator,oe)},concat(...t){return Qi(this).concat(...t.map(e=>_t(e)?Qi(e):e))},entries(){return io(this,"entries",t=>(t[1]=oe(t[1]),t))},every(t,e){return ii(this,"every",t,e,void 0,arguments)},filter(t,e){return ii(this,"filter",t,e,i=>i.map(oe),arguments)},find(t,e){return ii(this,"find",t,e,oe,arguments)},findIndex(t,e){return ii(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return ii(this,"findLast",t,e,oe,arguments)},findLastIndex(t,e){return ii(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return ii(this,"forEach",t,e,void 0,arguments)},includes(...t){return no(this,"includes",t)},indexOf(...t){return no(this,"indexOf",t)},join(t){return Qi(this).join(t)},lastIndexOf(...t){return no(this,"lastIndexOf",t)},map(t,e){return ii(this,"map",t,e,void 0,arguments)},pop(){return Fn(this,"pop")},push(...t){return Fn(this,"push",t)},reduce(t,...e){return yl(this,"reduce",t,e)},reduceRight(t,...e){return yl(this,"reduceRight",t,e)},shift(){return Fn(this,"shift")},some(t,e){return ii(this,"some",t,e,void 0,arguments)},splice(...t){return Fn(this,"splice",t)},toReversed(){return Qi(this).toReversed()},toSorted(t){return Qi(this).toSorted(t)},toSpliced(...t){return Qi(this).toSpliced(...t)},unshift(...t){return Fn(this,"unshift",t)},values(){return io(this,"values",oe)}};function io(t,e,i){const n=Is(t),r=n[e]();return n!==t&&!_e(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=i(s.value)),s}),r}const Up=Array.prototype;function ii(t,e,i,n,r,s){const o=Is(t),c=o!==t&&!_e(t),l=o[e];if(l!==Up[e]){const v=l.apply(t,s);return c?oe(v):v}let O=i;o!==t&&(c?O=function(v,E){return i.call(this,oe(v),E,t)}:i.length>2&&(O=function(v,E){return i.call(this,v,E,t)}));const _=l.call(o,O,n);return c&&r?r(_):_}function yl(t,e,i,n){const r=Is(t);let s=i;return r!==t&&(_e(t)?i.length>3&&(s=function(o,c,l){return i.call(this,o,c,l,t)}):s=function(o,c,l){return i.call(this,o,oe(c),l,t)}),r[e](s,...n)}function no(t,e,i){const n=Lt(t);se(n,"iterate",lr);const r=n[e](...i);return(r===-1||r===!1)&&Ds(i[0])?(i[0]=Lt(i[0]),n[e](...i)):r}function Fn(t,e,i=[]){Li(),wa();const n=Lt(t)[e].apply(t,i);return Ea(),Mi(),n}const Wp=Os("__proto__,__v_isRef,__isVue"),qu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(He));function Gp(t){He(t)||(t=String(t));const e=Lt(this);return se(e,"has",t),e.hasOwnProperty(t)}class Zu{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,n){if(i==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(i==="__v_isReactive")return!r;if(i==="__v_isReadonly")return r;if(i==="__v_isShallow")return s;if(i==="__v_raw")return n===(r?s?nh:ih:s?eh:th).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=_t(e);if(!r){let l;if(o&&(l=Vp[i]))return l;if(i==="hasOwnProperty")return Gp}const c=Reflect.get(e,i,Dt(e)?e:n);return(He(i)?qu.has(i):Wp(i))||(r||se(e,"get",i),s)?c:Dt(c)?o&&ba(i)?c:c.value:jt(c)?r?Ta(c):qi(c):c}}class Ju extends Zu{constructor(e=!1){super(!1,e)}set(e,i,n,r){let s=e[i];if(!this._isShallow){const l=Oi(s);if(!_e(n)&&!Oi(n)&&(s=Lt(s),n=Lt(n)),!_t(e)&&Dt(s)&&!Dt(n))return l?!1:(s.value=n,!0)}const o=_t(e)&&ba(i)?Number(i)t,Ir=t=>Reflect.getPrototypeOf(t);function Kp(t,e,i){return function(...n){const r=this.__v_raw,s=Lt(r),o=cn(s),c=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,O=r[t](...n),_=i?Mo:e?Io:oe;return!e&&se(s,"iterate",l?Lo:Ui),{next(){const{value:v,done:E}=O.next();return E?{value:v,done:E}:{value:c?[_(v[0]),_(v[1])]:_(v),done:E}},[Symbol.iterator](){return this}}}}function Rr(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function qp(t,e){const i={get(r){const s=this.__v_raw,o=Lt(s),c=Lt(r);t||(de(r,c)&&se(o,"get",r),se(o,"get",c));const{has:l}=Ir(o),O=e?Mo:t?Io:oe;if(l.call(o,r))return O(s.get(r));if(l.call(o,c))return O(s.get(c));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&se(Lt(r),"iterate",Ui),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=Lt(s),c=Lt(r);return t||(de(r,c)&&se(o,"has",r),se(o,"has",c)),r===c?s.has(r):s.has(r)||s.has(c)},forEach(r,s){const o=this,c=o.__v_raw,l=Lt(c),O=e?Mo:t?Io:oe;return!t&&se(l,"iterate",Ui),c.forEach((_,v)=>r.call(s,O(_),O(v),o))}};return Bt(i,t?{add:Rr("add"),set:Rr("set"),delete:Rr("delete"),clear:Rr("clear")}:{add(r){!e&&!_e(r)&&!Oi(r)&&(r=Lt(r));const s=Lt(this);return Ir(s).has.call(s,r)||(s.add(r),li(s,"add",r,r)),this},set(r,s){!e&&!_e(s)&&!Oi(s)&&(s=Lt(s));const o=Lt(this),{has:c,get:l}=Ir(o);let O=c.call(o,r);O||(r=Lt(r),O=c.call(o,r));const _=l.call(o,r);return o.set(r,s),O?de(s,_)&&li(o,"set",r,s):li(o,"add",r,s),this},delete(r){const s=Lt(this),{has:o,get:c}=Ir(s);let l=o.call(s,r);l||(r=Lt(r),l=o.call(s,r)),c&&c.call(s,r);const O=s.delete(r);return l&&li(s,"delete",r,void 0),O},clear(){const r=Lt(this),s=r.size!==0,o=r.clear();return s&&li(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=Kp(r,t,e)}),i}function Rs(t,e){const i=qp(t,e);return(n,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(Mt(i,r)&&r in n?i:n,r,s)}const Zp={get:Rs(!1,!1)},Jp={get:Rs(!1,!0)},Qp={get:Rs(!0,!1)},tg={get:Rs(!0,!0)},th=new WeakMap,eh=new WeakMap,ih=new WeakMap,nh=new WeakMap;function eg(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ig(t){return t.__v_skip||!Object.isExtensible(t)?0:eg(wp(t))}function qi(t){return Oi(t)?t:Ns(t,!1,$p,Zp,th)}function Sa(t){return Ns(t,!1,Yp,Jp,eh)}function Ta(t){return Ns(t,!0,Xp,Qp,ih)}function ng(t){return Ns(t,!0,zp,tg,nh)}function Ns(t,e,i,n,r){if(!jt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=r.get(t);if(s)return s;const o=ig(t);if(o===0)return t;const c=new Proxy(t,o===2?n:i);return r.set(t,c),c}function qe(t){return Oi(t)?qe(t.__v_raw):!!(t&&t.__v_isReactive)}function Oi(t){return!!(t&&t.__v_isReadonly)}function _e(t){return!!(t&&t.__v_isShallow)}function Ds(t){return t?!!t.__v_raw:!1}function Lt(t){const e=t&&t.__v_raw;return e?Lt(e):t}function rh(t){return!Mt(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const oe=t=>jt(t)?qi(t):t,Io=t=>jt(t)?Ta(t):t;function Dt(t){return t?t.__v_isRef===!0:!1}function Yt(t){return sh(t,!1)}function In(t){return sh(t,!0)}function sh(t,e){return Dt(t)?t:new rg(t,e)}class rg{constructor(e,i){this.dep=new Ms,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Lt(e),this._value=i?e:oe(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,n=this.__v_isShallow||_e(e)||Oi(e);e=n?e:Lt(e),de(e,i)&&(this._rawValue=e,this._value=n?e:oe(e),this.dep.trigger())}}function sg(t){t.dep&&t.dep.trigger()}function Be(t){return Dt(t)?t.value:t}function og(t){return Ct(t)?t():Be(t)}const ag={get:(t,e,i)=>e==="__v_raw"?t:Be(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return Dt(r)&&!Dt(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function cr(t){return qe(t)?t:new Proxy(t,ag)}class lg{constructor(e){this.__v_isRef=!0,this._value=void 0;const i=this.dep=new Ms,{get:n,set:r}=e(i.track.bind(i),i.trigger.bind(i));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function oh(t){return new lg(t)}function ah(t){const e=_t(t)?new Array(t.length):{};for(const i in t)e[i]=lh(t,i);return e}class cg{constructor(e,i,n){this._object=e,this._key=i,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Hp(Lt(this._object),this._key)}}class ug{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function hg(t,e,i){return Dt(t)?t:Ct(t)?new ug(t):jt(t)&&arguments.length>1?lh(t,e,i):Yt(t)}function lh(t,e,i){const n=t[e];return Dt(n)?n:new cg(t,e,i)}class fg{constructor(e,i,n){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Ms(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ar-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ht!==this)return Gu(this,!0),!0}get value(){const e=this.dep.track();return Yu(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function dg(t,e,i=!1){let n,r;return Ct(t)?n=t:(n=t.get,r=t.set),new fg(n,r,i)}const pg={GET:"get",HAS:"has",ITERATE:"iterate"},gg={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Nr={},os=new WeakMap;let bi;function mg(){return bi}function ch(t,e=!1,i=bi){if(i){let n=os.get(i);n||os.set(i,n=[]),n.push(t)}}function vg(t,e,i=Pt){const{immediate:n,deep:r,once:s,scheduler:o,augmentJob:c,call:l}=i,O=a=>r?a:_e(a)||r===!1||r===0?ci(a,1):ci(a);let _,v,E,b,P=!1,m=!1;if(Dt(t)?(v=()=>t.value,P=_e(t)):qe(t)?(v=()=>O(t),P=!0):_t(t)?(m=!0,P=t.some(a=>qe(a)||_e(a)),v=()=>t.map(a=>{if(Dt(a))return a.value;if(qe(a))return O(a);if(Ct(a))return l?l(a,2):a()})):Ct(t)?e?v=l?()=>l(t,2):t:v=()=>{if(E){Li();try{E()}finally{Mi()}}const a=bi;bi=_;try{return l?l(t,3,[b]):t(b)}finally{bi=a}}:v=Te,e&&r){const a=v,S=r===!0?1/0:r;v=()=>ci(a(),S)}const T=Uu(),k=()=>{_.stop(),T&&T.active&&ya(T.effects,_)};if(s&&e){const a=e;e=(...S)=>{a(...S),k()}}let M=m?new Array(t.length).fill(Nr):Nr;const y=a=>{if(!(!(_.flags&1)||!_.dirty&&!a))if(e){const S=_.run();if(r||P||(m?S.some((w,A)=>de(w,M[A])):de(S,M))){E&&E();const w=bi;bi=_;try{const A=[S,M===Nr?void 0:m&&M[0]===Nr?[]:M,b];l?l(e,3,A):e(...A),M=S}finally{bi=w}}}else _.run()};return c&&c(y),_=new or(v),_.scheduler=o?()=>o(y,!1):y,b=a=>ch(a,!1,_),E=_.onStop=()=>{const a=os.get(_);if(a){if(l)l(a,4);else for(const S of a)S();os.delete(_)}},e?n?y(!0):M=_.run():o?o(y.bind(null,!0),!0):_.run(),k.pause=_.pause.bind(_),k.resume=_.resume.bind(_),k.stop=k,k}function ci(t,e=1/0,i){if(e<=0||!jt(t)||t.__v_skip||(i=i||new Set,i.has(t)))return t;if(i.add(t),e--,Dt(t))ci(t.value,e,i);else if(_t(t))for(let n=0;n{ci(n,e,i)});else if(As(t)){for(const n in t)ci(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&ci(t[n],e,i)}return t}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const uh=[];function yg(t){uh.push(t)}function xg(){uh.pop()}function bg(t,e){}const _g={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},wg={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Rn(t,e,i,n){try{return n?t(...n):t()}catch(r){Zi(r,e,i)}}function ke(t,e,i,n){if(Ct(t)){const r=Rn(t,e,i,n);return r&&xa(r)&&r.catch(s=>{Zi(s,e,i)}),r}if(_t(t)){const r=[];for(let s=0;s>>1,r=pe[n],s=hr(r);s=hr(i)?pe.push(t):pe.splice(Cg(e),0,t),t.flags|=1,fh()}}function fh(){as||(as=hh.then(dh))}function ur(t){_t(t)?fn.push(...t):_i&&t.id===-1?_i.splice(en+1,0,t):t.flags&1||(fn.push(t),t.flags|=1),fh()}function xl(t,e,i=Xe+1){for(;ihr(i)-hr(n));if(fn.length=0,_i){_i.push(...e);return}for(_i=e,en=0;en<_i.length;en++){const i=_i[en];i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2}_i=null,en=0}}const hr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function dh(t){try{for(Xe=0;Xenn.emit(r,...s)),Dr=[]):typeof window<"u"&&window.HTMLElement&&!((n=(i=window.navigator)==null?void 0:i.userAgent)!=null&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{ph(s,e)}),setTimeout(()=>{nn||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Dr=[])},3e3)):Dr=[]}let Qt=null,js=null;function fr(t){const e=Qt;return Qt=t,js=t&&t.type.__scopeId||null,e}function Sg(t){js=t}function Tg(){js=null}const Og=t=>Aa;function Aa(t,e=Qt,i){if(!e||t._n)return t;const n=(...r)=>{n._d&&Vo(-1);const s=fr(e);let o;try{o=t(...r)}finally{fr(s),n._d&&Vo(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Ag(t,e){if(Qt===null)return t;const i=Pr(Qt),n=t.dirs||(t.dirs=[]);for(let r=0;rt.__isTeleport,Zn=t=>t&&(t.disabled||t.disabled===""),bl=t=>t&&(t.defer||t.defer===""),_l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,wl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Ro=(t,e)=>{const i=t&&t.to;return Ut(i)?e?e(i):null:i},vh={name:"Teleport",__isTeleport:!0,process(t,e,i,n,r,s,o,c,l,O){const{mc:_,pc:v,pbc:E,o:{insert:b,querySelector:P,createText:m,createComment:T}}=O,k=Zn(e.props);let{shapeFlag:M,children:y,dynamicChildren:a}=e;if(t==null){const S=e.el=m(""),w=e.anchor=m("");b(S,i,n),b(w,i,n);const A=(u,g)=>{M&16&&(r&&r.isCE&&(r.ce._teleportTarget=u),_(y,u,g,r,s,o,c,l))},f=()=>{const u=e.target=Ro(e.props,P),g=xh(u,e,m,b);u&&(o!=="svg"&&_l(u)?o="svg":o!=="mathml"&&wl(u)&&(o="mathml"),k||(A(u,g),qr(e,!1)))};k&&(A(i,w),qr(e,!0)),bl(e.props)?qt(()=>{f(),e.el.__isMounted=!0},s):f()}else{if(bl(e.props)&&!t.el.__isMounted){qt(()=>{vh.process(t,e,i,n,r,s,o,c,l,O),delete t.el.__isMounted},s);return}e.el=t.el,e.targetStart=t.targetStart;const S=e.anchor=t.anchor,w=e.target=t.target,A=e.targetAnchor=t.targetAnchor,f=Zn(t.props),u=f?i:w,g=f?S:A;if(o==="svg"||_l(w)?o="svg":(o==="mathml"||wl(w))&&(o="mathml"),a?(E(t.dynamicChildren,a,u,r,s,o,c),Ba(t,e,!0)):l||v(t,e,u,g,r,s,o,c,!1),k)f?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):jr(e,i,S,O,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const h=e.target=Ro(e.props,P);h&&jr(e,h,null,O,0)}else f&&jr(e,w,A,O,1);qr(e,k)}},remove(t,e,i,{um:n,o:{remove:r}},s){const{shapeFlag:o,children:c,anchor:l,targetStart:O,targetAnchor:_,target:v,props:E}=t;if(v&&(r(O),r(_)),s&&r(l),o&16){const b=s||!Zn(E);for(let P=0;P{t.isMounted=!0}),Vs(()=>{t.isUnmounting=!0}),t}const Ee=[Function,Array],ka={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},bh=t=>{const e=t.subTree;return e.component?bh(e.component):e},kg={name:"BaseTransition",props:ka,setup(t,{slots:e}){const i=ie(),n=Pa();return()=>{const r=e.default&&Fs(e.default(),!0);if(!r||!r.length)return;const s=_h(r),o=Lt(t),{mode:c}=o;if(n.isLeaving)return ro(s);const l=El(s);if(!l)return ro(s);let O=gn(l,o,n,i,v=>O=v);l.type!==Kt&&di(l,O);let _=i.subTree&&El(i.subTree);if(_&&_.type!==Kt&&!Ne(l,_)&&bh(i).type!==Kt){let v=gn(_,o,n,i);if(di(_,v),c==="out-in"&&l.type!==Kt)return n.isLeaving=!0,v.afterLeave=()=>{n.isLeaving=!1,i.job.flags&8||i.update(),delete v.afterLeave,_=void 0},ro(s);c==="in-out"&&l.type!==Kt?v.delayLeave=(E,b,P)=>{const m=Eh(n,_);m[String(_.key)]=_,E[wi]=()=>{b(),E[wi]=void 0,delete O.delayedLeave,_=void 0},O.delayedLeave=()=>{P(),delete O.delayedLeave,_=void 0}}:_=void 0}else _&&(_=void 0);return s}}};function _h(t){let e=t[0];if(t.length>1){for(const i of t)if(i.type!==Kt){e=i;break}}return e}const wh=kg;function Eh(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function gn(t,e,i,n,r){const{appear:s,mode:o,persisted:c=!1,onBeforeEnter:l,onEnter:O,onAfterEnter:_,onEnterCancelled:v,onBeforeLeave:E,onLeave:b,onAfterLeave:P,onLeaveCancelled:m,onBeforeAppear:T,onAppear:k,onAfterAppear:M,onAppearCancelled:y}=e,a=String(t.key),S=Eh(i,t),w=(u,g)=>{u&&ke(u,n,9,g)},A=(u,g)=>{const h=g[1];w(u,g),_t(u)?u.every(x=>x.length<=1)&&h():u.length<=1&&h()},f={mode:o,persisted:c,beforeEnter(u){let g=l;if(!i.isMounted)if(s)g=T||l;else return;u[wi]&&u[wi](!0);const h=S[a];h&&Ne(t,h)&&h.el[wi]&&h.el[wi](),w(g,[u])},enter(u){let g=O,h=_,x=v;if(!i.isMounted)if(s)g=k||O,h=M||_,x=y||v;else return;let d=!1;const p=u[Fr]=R=>{d||(d=!0,R?w(x,[u]):w(h,[u]),f.delayedLeave&&f.delayedLeave(),u[Fr]=void 0)};g?A(g,[u,p]):p()},leave(u,g){const h=String(t.key);if(u[Fr]&&u[Fr](!0),i.isUnmounting)return g();w(E,[u]);let x=!1;const d=u[wi]=p=>{x||(x=!0,g(),p?w(m,[u]):w(P,[u]),u[wi]=void 0,S[h]===t&&delete S[h])};S[h]=t,b?A(b,[u,d]):d()},clone(u){const g=gn(u,e,i,n,r);return r&&r(g),g}};return f}function ro(t){if(Or(t))return t=Qe(t),t.children=null,t}function El(t){if(!Or(t))return mh(t.type)&&t.children?_h(t.children):t;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&Ct(i.default))return i.default()}}function di(t,e){t.shapeFlag&6&&t.component?(t.transition=e,di(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Fs(t,e=!1,i){let n=[],r=0;for(let s=0;s1)for(let s=0;si.value,set:s=>i.value=s})}return i}function dr(t,e,i,n,r=!1){if(_t(t)){t.forEach((P,m)=>dr(P,e&&(_t(e)?e[m]:e),i,n,r));return}if(Si(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&dr(t,e,i,n.component.subTree);return}const s=n.shapeFlag&4?Pr(n.component):n.el,o=r?null:s,{i:c,r:l}=t,O=e&&e.r,_=c.refs===Pt?c.refs={}:c.refs,v=c.setupState,E=Lt(v),b=v===Pt?()=>!1:P=>Mt(E,P);if(O!=null&&O!==l&&(Ut(O)?(_[O]=null,b(O)&&(v[O]=null)):Dt(O)&&(O.value=null)),Ct(l))Rn(l,c,12,[o,_]);else{const P=Ut(l),m=Dt(l);if(P||m){const T=()=>{if(t.f){const k=P?b(l)?v[l]:_[l]:l.value;r?_t(k)&&ya(k,s):_t(k)?k.includes(s)||k.push(s):P?(_[l]=[s],b(l)&&(v[l]=_[l])):(l.value=[s],t.k&&(_[t.k]=l.value))}else P?(_[l]=o,b(l)&&(v[l]=o)):m&&(l.value=o,t.k&&(_[t.k]=o))};o?(T.id=-1,qt(T,i)):T()}}}let Cl=!1;const tn=()=>{Cl||(console.error("Hydration completed but contains mismatches."),Cl=!0)},Ig=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",Rg=t=>t.namespaceURI.includes("MathML"),Br=t=>{if(t.nodeType===1){if(Ig(t))return"svg";if(Rg(t))return"mathml"}},on=t=>t.nodeType===8;function Ng(t){const{mt:e,p:i,o:{patchProp:n,createText:r,nextSibling:s,parentNode:o,remove:c,insert:l,createComment:O}}=t,_=(y,a)=>{if(!a.hasChildNodes()){i(null,y,a),ls(),a._vnode=y;return}v(a.firstChild,y,null,null,null),ls(),a._vnode=y},v=(y,a,S,w,A,f=!1)=>{f=f||!!a.dynamicChildren;const u=on(y)&&y.data==="[",g=()=>m(y,a,S,w,A,u),{type:h,ref:x,shapeFlag:d,patchFlag:p}=a;let R=y.nodeType;a.el=y,p===-2&&(f=!1,a.dynamicChildren=null);let I=null;switch(h){case fi:R!==3?a.children===""?(l(a.el=r(""),o(y),y),I=y):I=g():(y.data!==a.children&&(tn(),y.data=a.children),I=s(y));break;case Kt:M(y)?(I=s(y),k(a.el=y.content.firstChild,y,S)):R!==8||u?I=g():I=s(y);break;case Gi:if(u&&(y=s(y),R=y.nodeType),R===1||R===3){I=y;const j=!a.children.length;for(let $=0;${f=f||!!a.dynamicChildren;const{type:u,props:g,patchFlag:h,shapeFlag:x,dirs:d,transition:p}=a,R=u==="input"||u==="option";if(R||h!==-1){d&&Ye(a,null,S,"created");let I=!1;if(M(y)){I=Kh(null,p)&&S&&S.vnode.props&&S.vnode.props.appear;const $=y.content.firstChild;I&&p.beforeEnter($),k($,y,S),a.el=y=$}if(x&16&&!(g&&(g.innerHTML||g.textContent))){let $=b(y.firstChild,a,y,S,w,A,f);for(;$;){Hr(y,1)||tn();const et=$;$=$.nextSibling,c(et)}}else if(x&8){let $=a.children;$[0]===` +`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&($=$.slice(1)),y.textContent!==$&&(Hr(y,0)||tn(),y.textContent=a.children)}if(g){if(R||!f||h&48){const $=y.tagName.includes("-");for(const et in g)(R&&(et.endsWith("value")||et==="indeterminate")||Er(et)&&!un(et)||et[0]==="."||$)&&n(y,et,null,g[et],void 0,S)}else if(g.onClick)n(y,"onClick",null,g.onClick,void 0,S);else if(h&4&&qe(g.style))for(const $ in g.style)g.style[$]}let j;(j=g&&g.onVnodeBeforeMount)&&me(j,S,a),d&&Ye(a,null,S,"beforeMount"),((j=g&&g.onVnodeMounted)||d||I)&&sf(()=>{j&&me(j,S,a),I&&p.enter(y),d&&Ye(a,null,S,"mounted")},w)}return y.nextSibling},b=(y,a,S,w,A,f,u)=>{u=u||!!a.dynamicChildren;const g=a.children,h=g.length;for(let x=0;x{const{slotScopeIds:u}=a;u&&(A=A?A.concat(u):u);const g=o(y),h=b(s(y),a,g,S,w,A,f);return h&&on(h)&&h.data==="]"?s(a.anchor=h):(tn(),l(a.anchor=O("]"),g,h),h)},m=(y,a,S,w,A,f)=>{if(Hr(y.parentElement,1)||tn(),a.el=null,f){const h=T(y);for(;;){const x=s(y);if(x&&x!==h)c(x);else break}}const u=s(y),g=o(y);return c(y),i(null,a,g,u,S,w,Br(g),A),S&&(S.vnode.el=a.el,Ws(S,a.el)),u},T=(y,a="[",S="]")=>{let w=0;for(;y;)if(y=s(y),y&&on(y)&&(y.data===a&&w++,y.data===S)){if(w===0)return s(y);w--}return y},k=(y,a,S)=>{const w=a.parentNode;w&&w.replaceChild(y,a);let A=S;for(;A;)A.vnode.el===a&&(A.vnode.el=A.subTree.el=y),A=A.parent},M=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[_,v]}const Sl="data-allow-mismatch",Dg={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Hr(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(Sl);)t=t.parentElement;const i=t&&t.getAttribute(Sl);if(i==null)return!1;if(i==="")return!0;{const n=i.split(",");return e===0&&n.includes("children")?!0:i.split(",").includes(Dg[e])}}const jg=ks().requestIdleCallback||(t=>setTimeout(t,1)),Fg=ks().cancelIdleCallback||(t=>clearTimeout(t)),Bg=(t=1e4)=>e=>{const i=jg(e,{timeout:t});return()=>Fg(i)};function Hg(t){const{top:e,left:i,bottom:n,right:r}=t.getBoundingClientRect(),{innerHeight:s,innerWidth:o}=window;return(e>0&&e0&&n0&&i0&&r(e,i)=>{const n=new IntersectionObserver(r=>{for(const s of r)if(s.isIntersecting){n.disconnect(),e();break}},t);return i(r=>{if(r instanceof Element){if(Hg(r))return e(),n.disconnect(),!1;n.observe(r)}}),()=>n.disconnect()},Ug=t=>e=>{if(t){const i=matchMedia(t);if(i.matches)e();else return i.addEventListener("change",e,{once:!0}),()=>i.removeEventListener("change",e)}},Wg=(t=[])=>(e,i)=>{Ut(t)&&(t=[t]);let n=!1;const r=o=>{n||(n=!0,s(),e(),o.target.dispatchEvent(new o.constructor(o.type,o)))},s=()=>{i(o=>{for(const c of t)o.removeEventListener(c,r)})};return i(o=>{for(const c of t)o.addEventListener(c,r,{once:!0})}),s};function Gg(t,e){if(on(t)&&t.data==="["){let i=1,n=t.nextSibling;for(;n;){if(n.nodeType===1){if(e(n)===!1)break}else if(on(n))if(n.data==="]"){if(--i===0)break}else n.data==="["&&i++;n=n.nextSibling}}else e(t)}const Si=t=>!!t.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function $g(t){Ct(t)&&(t={loader:t});const{loader:e,loadingComponent:i,errorComponent:n,delay:r=200,hydrate:s,timeout:o,suspensible:c=!0,onError:l}=t;let O=null,_,v=0;const E=()=>(v++,O=null,b()),b=()=>{let P;return O||(P=O=e().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),l)return new Promise((T,k)=>{l(m,()=>T(E()),()=>k(m),v+1)});throw m}).then(m=>P!==O&&O?O:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),_=m,m)))};return Ue({name:"AsyncComponentWrapper",__asyncLoader:b,__asyncHydrate(P,m,T){const k=s?()=>{const M=s(T,y=>Gg(P,y));M&&(m.bum||(m.bum=[])).push(M)}:T;_?k():b().then(()=>!m.isUnmounted&&k())},get __asyncResolved(){return _},setup(){const P=Zt;if(La(P),_)return()=>so(_,P);const m=y=>{O=null,Zi(y,P,13,!n)};if(c&&P.suspense||vn)return b().then(y=>()=>so(y,P)).catch(y=>(m(y),()=>n?Ft(n,{error:y}):null));const T=Yt(!1),k=Yt(),M=Yt(!!r);return r&&setTimeout(()=>{M.value=!1},r),o!=null&&setTimeout(()=>{if(!T.value&&!k.value){const y=new Error(`Async component timed out after ${o}ms.`);m(y),k.value=y}},o),b().then(()=>{T.value=!0,P.parent&&Or(P.parent.vnode)&&P.parent.update()}).catch(y=>{m(y),k.value=y}),()=>{if(T.value&&_)return so(_,P);if(k.value&&n)return Ft(n,{error:k.value});if(i&&!M.value)return Ft(i)}}})}function so(t,e){const{ref:i,props:n,children:r,ce:s}=e.vnode,o=Ft(t,n,r);return o.ref=i,o.ce=s,delete e.vnode.ce,o}const Or=t=>t.type.__isKeepAlive,Xg={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const i=ie(),n=i.ctx;if(!n.renderer)return()=>{const M=e.default&&e.default();return M&&M.length===1?M[0]:M};const r=new Map,s=new Set;let o=null;const c=i.suspense,{renderer:{p:l,m:O,um:_,o:{createElement:v}}}=n,E=v("div");n.activate=(M,y,a,S,w)=>{const A=M.component;O(M,y,a,0,c),l(A.vnode,M,y,a,A,c,S,M.slotScopeIds,w),qt(()=>{A.isDeactivated=!1,A.a&&hn(A.a);const f=M.props&&M.props.onVnodeMounted;f&&me(f,A.parent,M)},c)},n.deactivate=M=>{const y=M.component;us(y.m),us(y.a),O(M,E,null,1,c),qt(()=>{y.da&&hn(y.da);const a=M.props&&M.props.onVnodeUnmounted;a&&me(a,y.parent,M),y.isDeactivated=!0},c)};function b(M){oo(M),_(M,i,c,!0)}function P(M){r.forEach((y,a)=>{const S=Xo(y.type);S&&!M(S)&&m(a)})}function m(M){const y=r.get(M);y&&(!o||!Ne(y,o))?b(y):o&&oo(o),r.delete(M),s.delete(M)}le(()=>[t.include,t.exclude],([M,y])=>{M&&P(a=>Xn(M,a)),y&&P(a=>!Xn(y,a))},{flush:"post",deep:!0});let T=null;const k=()=>{T!=null&&(hs(i.subTree.type)?qt(()=>{r.set(T,Vr(i.subTree))},i.subTree.suspense):r.set(T,Vr(i.subTree)))};return gi(k),Hs(k),Vs(()=>{r.forEach(M=>{const{subTree:y,suspense:a}=i,S=Vr(y);if(M.type===S.type&&M.key===S.key){oo(S);const w=S.component.da;w&&qt(w,a);return}b(M)})}),()=>{if(T=null,!e.default)return o=null;const M=e.default(),y=M[0];if(M.length>1)return o=null,M;if(!Je(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return o=null,y;let a=Vr(y);if(a.type===Kt)return o=null,a;const S=a.type,w=Xo(Si(a)?a.type.__asyncResolved||{}:S),{include:A,exclude:f,max:u}=t;if(A&&(!w||!Xn(A,w))||f&&w&&Xn(f,w))return a.shapeFlag&=-257,o=a,y;const g=a.key==null?S:a.key,h=r.get(g);return a.el&&(a=Qe(a),y.shapeFlag&128&&(y.ssContent=a)),T=g,h?(a.el=h.el,a.component=h.component,a.transition&&di(a,a.transition),a.shapeFlag|=512,s.delete(g),s.add(g)):(s.add(g),u&&s.size>parseInt(u,10)&&m(s.values().next().value)),a.shapeFlag|=256,o=a,hs(y.type)?y:a}}},Yg=Xg;function Xn(t,e){return _t(t)?t.some(i=>Xn(i,e)):Ut(t)?t.split(",").includes(e):_p(t)?(t.lastIndex=0,t.test(e)):!1}function Ch(t,e){Th(t,"a",e)}function Sh(t,e){Th(t,"da",e)}function Th(t,e,i=Zt){const n=t.__wdc||(t.__wdc=()=>{let r=i;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(Bs(e,n,i),i){let r=i.parent;for(;r&&r.parent;)Or(r.parent.vnode)&&zg(n,e,i,r),r=r.parent}}function zg(t,e,i,n){const r=Bs(e,t,n,!0);Dn(()=>{ya(n[e],r)},i)}function oo(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function Vr(t){return t.shapeFlag&128?t.ssContent:t}function Bs(t,e,i=Zt,n=!1){if(i){const r=i[t]||(i[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Li();const c=zi(i),l=ke(e,i,t,o);return c(),Mi(),l});return n?r.unshift(s):r.push(s),s}}const pi=t=>(e,i=Zt)=>{(!vn||t==="sp")&&Bs(t,(...n)=>e(...n),i)},Ma=pi("bm"),gi=pi("m"),Ia=pi("bu"),Hs=pi("u"),Vs=pi("bum"),Dn=pi("um"),Oh=pi("sp"),Ah=pi("rtg"),Ph=pi("rtc");function kh(t,e=Zt){Bs("ec",t,e)}const Ra="components",Kg="directives";function Lh(t,e){return Na(Ra,t,!0,e)||t}const Mh=Symbol.for("v-ndc");function qg(t){return Ut(t)?Na(Ra,t,!1)||t:t||Mh}function Zg(t){return Na(Kg,t)}function Na(t,e,i=!0,n=!1){const r=Qt||Zt;if(r){const s=r.type;if(t===Ra){const c=Xo(s,!1);if(c&&(c===e||c===ne(e)||c===Cr(ne(e))))return s}const o=Tl(r[t]||s[t],e)||Tl(r.appContext[t],e);return!o&&n?s:o}}function Tl(t,e){return t&&(t[e]||t[ne(e)]||t[Cr(ne(e))])}function Jg(t,e,i,n){let r;const s=i&&i[n],o=_t(t);if(o||Ut(t)){const c=o&&qe(t);let l=!1;c&&(l=!_e(t),t=Is(t)),r=new Array(t.length);for(let O=0,_=t.length;O<_;O++)r[O]=e(l?oe(t[O]):t[O],O,void 0,s&&s[O])}else if(typeof t=="number"){r=new Array(t);for(let c=0;ce(c,l,void 0,s&&s[l]));else{const c=Object.keys(t);r=new Array(c.length);for(let l=0,O=c.length;l{const s=n.fn(...r);return s&&(s.key=n.key),s}:n.fn)}return t}function Ih(t,e,i={},n,r){if(Qt.ce||Qt.parent&&Si(Qt.parent)&&Qt.parent.ce)return e!=="default"&&(i.name=e),Ai(),mn(zt,null,[Ft("slot",i,n&&n())],64);let s=t[e];s&&s._c&&(s._d=!1),Ai();const o=s&&Da(s(i)),c=i.key||o&&o.key,l=mn(zt,{key:(c&&!He(c)?c:`_${e}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&t._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Da(t){return t.some(e=>Je(e)?!(e.type===Kt||e.type===zt&&!Da(e.children)):!0)?t:null}function tm(t,e){const i={};for(const n in t)i[e&&/[A-Z]/.test(n)?`on:${n}`:zn(n)]=t[n];return i}const No=t=>t?ff(t)?Pr(t):No(t.parent):null,Jn=Bt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>No(t.parent),$root:t=>No(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>ja(t),$forceUpdate:t=>t.f||(t.f=()=>{Oa(t.update)}),$nextTick:t=>t.n||(t.n=Nn.bind(t.proxy)),$watch:t=>Mm.bind(t)}),ao=(t,e)=>t!==Pt&&!t.__isScriptSetup&&Mt(t,e),Do={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:n,data:r,props:s,accessCache:o,type:c,appContext:l}=t;let O;if(e[0]!=="$"){const b=o[e];if(b!==void 0)switch(b){case 1:return n[e];case 2:return r[e];case 4:return i[e];case 3:return s[e]}else{if(ao(n,e))return o[e]=1,n[e];if(r!==Pt&&Mt(r,e))return o[e]=2,r[e];if((O=t.propsOptions[0])&&Mt(O,e))return o[e]=3,s[e];if(i!==Pt&&Mt(i,e))return o[e]=4,i[e];jo&&(o[e]=0)}}const _=Jn[e];let v,E;if(_)return e==="$attrs"&&se(t.attrs,"get",""),_(t);if((v=c.__cssModules)&&(v=v[e]))return v;if(i!==Pt&&Mt(i,e))return o[e]=4,i[e];if(E=l.config.globalProperties,Mt(E,e))return E[e]},set({_:t},e,i){const{data:n,setupState:r,ctx:s}=t;return ao(r,e)?(r[e]=i,!0):n!==Pt&&Mt(n,e)?(n[e]=i,!0):Mt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:r,propsOptions:s}},o){let c;return!!i[o]||t!==Pt&&Mt(t,o)||ao(e,o)||(c=s[0])&&Mt(c,o)||Mt(n,o)||Mt(Jn,o)||Mt(r.config.globalProperties,o)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Mt(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}},em=Bt({},Do,{get(t,e){if(e!==Symbol.unscopables)return Do.get(t,e,t)},has(t,e){return e[0]!=="_"&&!Tp(e)}});function im(){return null}function nm(){return null}function rm(t){}function sm(t){}function om(){return null}function am(){}function lm(t,e){return null}function cm(){return Rh().slots}function um(){return Rh().attrs}function Rh(){const t=ie();return t.setupContext||(t.setupContext=gf(t))}function pr(t){return _t(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}function hm(t,e){const i=pr(t);for(const n in e){if(n.startsWith("__skip"))continue;let r=i[n];r?_t(r)||Ct(r)?r=i[n]={type:r,default:e[n]}:r.default=e[n]:r===null&&(r=i[n]={default:e[n]}),r&&e[`__skip_${n}`]&&(r.skipFactory=!0)}return i}function fm(t,e){return!t||!e?t||e:_t(t)&&_t(e)?t.concat(e):Bt({},pr(t),pr(e))}function dm(t,e){const i={};for(const n in t)e.includes(n)||Object.defineProperty(i,n,{enumerable:!0,get:()=>t[n]});return i}function pm(t){const e=ie();let i=t();return Wo(),xa(i)&&(i=i.catch(n=>{throw zi(e),n})),[i,()=>zi(e)]}let jo=!0;function gm(t){const e=ja(t),i=t.proxy,n=t.ctx;jo=!1,e.beforeCreate&&Ol(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:c,provide:l,inject:O,created:_,beforeMount:v,mounted:E,beforeUpdate:b,updated:P,activated:m,deactivated:T,beforeDestroy:k,beforeUnmount:M,destroyed:y,unmounted:a,render:S,renderTracked:w,renderTriggered:A,errorCaptured:f,serverPrefetch:u,expose:g,inheritAttrs:h,components:x,directives:d,filters:p}=e;if(O&&mm(O,n,null),o)for(const j in o){const $=o[j];Ct($)&&(n[j]=$.bind(i))}if(r){const j=r.call(i,i);jt(j)&&(t.data=qi(j))}if(jo=!0,s)for(const j in s){const $=s[j],et=Ct($)?$.bind(i,i):Ct($.get)?$.get.bind(i,i):Te,it=!Ct($)&&Ct($.set)?$.set.bind(i):Te,H=$t({get:et,set:it});Object.defineProperty(n,j,{enumerable:!0,configurable:!0,get:()=>H.value,set:z=>H.value=z})}if(c)for(const j in c)Nh(c[j],n,i,j);if(l){const j=Ct(l)?l.call(i):l;Reflect.ownKeys(j).forEach($=>{Qn($,j[$])})}_&&Ol(_,t,"c");function I(j,$){_t($)?$.forEach(et=>j(et.bind(i))):$&&j($.bind(i))}if(I(Ma,v),I(gi,E),I(Ia,b),I(Hs,P),I(Ch,m),I(Sh,T),I(kh,f),I(Ph,w),I(Ah,A),I(Vs,M),I(Dn,a),I(Oh,u),_t(g))if(g.length){const j=t.exposed||(t.exposed={});g.forEach($=>{Object.defineProperty(j,$,{get:()=>i[$],set:et=>i[$]=et})})}else t.exposed||(t.exposed={});S&&t.render===Te&&(t.render=S),h!=null&&(t.inheritAttrs=h),x&&(t.components=x),d&&(t.directives=d),u&&La(t)}function mm(t,e,i=Te){_t(t)&&(t=Fo(t));for(const n in t){const r=t[n];let s;jt(r)?"default"in r?s=Oe(r.from||n,r.default,!0):s=Oe(r.from||n):s=Oe(r),Dt(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function Ol(t,e,i){ke(_t(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,i)}function Nh(t,e,i,n){let r=n.includes(".")?tf(i,n):()=>i[n];if(Ut(t)){const s=e[t];Ct(s)&&le(r,s)}else if(Ct(t))le(r,t.bind(i));else if(jt(t))if(_t(t))t.forEach(s=>Nh(s,e,i,n));else{const s=Ct(t.handler)?t.handler.bind(i):e[t.handler];Ct(s)&&le(r,s,t)}}function ja(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,c=s.get(e);let l;return c?l=c:!r.length&&!i&&!n?l=e:(l={},r.length&&r.forEach(O=>cs(l,O,o,!0)),cs(l,e,o)),jt(e)&&s.set(e,l),l}function cs(t,e,i,n=!1){const{mixins:r,extends:s}=e;s&&cs(t,s,i,!0),r&&r.forEach(o=>cs(t,o,i,!0));for(const o in e)if(!(n&&o==="expose")){const c=vm[o]||i&&i[o];t[o]=c?c(t[o],e[o]):e[o]}return t}const vm={data:Al,props:Pl,emits:Pl,methods:Yn,computed:Yn,beforeCreate:ue,created:ue,beforeMount:ue,mounted:ue,beforeUpdate:ue,updated:ue,beforeDestroy:ue,beforeUnmount:ue,destroyed:ue,unmounted:ue,activated:ue,deactivated:ue,errorCaptured:ue,serverPrefetch:ue,components:Yn,directives:Yn,watch:xm,provide:Al,inject:ym};function Al(t,e){return e?t?function(){return Bt(Ct(t)?t.call(this,this):t,Ct(e)?e.call(this,this):e)}:e:t}function ym(t,e){return Yn(Fo(t),Fo(e))}function Fo(t){if(_t(t)){const e={};for(let i=0;i1)return i&&Ct(e)?e.call(n&&n.proxy):e}}function wm(){return!!(Zt||Qt||Wi)}const jh={},Fh=()=>Object.create(jh),Bh=t=>Object.getPrototypeOf(t)===jh;function Em(t,e,i,n=!1){const r={},s=Fh();t.propsDefaults=Object.create(null),Hh(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);i?t.props=n?r:Sa(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function Cm(t,e,i,n){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,c=Lt(r),[l]=t.propsOptions;let O=!1;if((n||o>0)&&!(o&16)){if(o&8){const _=t.vnode.dynamicProps;for(let v=0;v<_.length;v++){let E=_[v];if(Us(t.emitsOptions,E))continue;const b=e[E];if(l)if(Mt(s,E))b!==s[E]&&(s[E]=b,O=!0);else{const P=ne(E);r[P]=Bo(l,c,P,b,t,!1)}else b!==s[E]&&(s[E]=b,O=!0)}}}else{Hh(t,e,r,s)&&(O=!0);let _;for(const v in c)(!e||!Mt(e,v)&&((_=ye(v))===v||!Mt(e,_)))&&(l?i&&(i[v]!==void 0||i[_]!==void 0)&&(r[v]=Bo(l,c,v,void 0,t,!0)):delete r[v]);if(s!==c)for(const v in s)(!e||!Mt(e,v))&&(delete s[v],O=!0)}O&&li(t.attrs,"set","")}function Hh(t,e,i,n){const[r,s]=t.propsOptions;let o=!1,c;if(e)for(let l in e){if(un(l))continue;const O=e[l];let _;r&&Mt(r,_=ne(l))?!s||!s.includes(_)?i[_]=O:(c||(c={}))[_]=O:Us(t.emitsOptions,l)||(!(l in n)||O!==n[l])&&(n[l]=O,o=!0)}if(s){const l=Lt(i),O=c||Pt;for(let _=0;_{l=!0;const[E,b]=Vh(v,e,!0);Bt(o,E),b&&c.push(...b)};!i&&e.mixins.length&&e.mixins.forEach(_),t.extends&&_(t.extends),t.mixins&&t.mixins.forEach(_)}if(!s&&!l)return jt(t)&&n.set(t,ln),ln;if(_t(s))for(let _=0;_t[0]==="_"||t==="$stable",Fa=t=>_t(t)?t.map(ve):[ve(t)],Tm=(t,e,i)=>{if(e._n)return e;const n=Aa((...r)=>Fa(e(...r)),i);return n._c=!1,n},Wh=(t,e,i)=>{const n=t._ctx;for(const r in t){if(Uh(r))continue;const s=t[r];if(Ct(s))e[r]=Tm(r,s,n);else if(s!=null){const o=Fa(s);e[r]=()=>o}}},Gh=(t,e)=>{const i=Fa(e);t.slots.default=()=>i},$h=(t,e,i)=>{for(const n in e)(i||n!=="_")&&(t[n]=e[n])},Om=(t,e,i)=>{const n=t.slots=Fh();if(t.vnode.shapeFlag&32){const r=e._;r?($h(n,e,i),i&&Du(n,"_",r,!0)):Wh(e,n)}else e&&Gh(t,e)},Am=(t,e,i)=>{const{vnode:n,slots:r}=t;let s=!0,o=Pt;if(n.shapeFlag&32){const c=e._;c?i&&c===1?s=!1:$h(r,e,i):(s=!e.$stable,Wh(e,r)),o=e}else e&&(Gh(t,e),o={default:1});if(s)for(const c in r)!Uh(c)&&o[c]==null&&delete r[c]},qt=sf;function Xh(t){return zh(t)}function Yh(t){return zh(t,Ng)}function zh(t,e){const i=ks();i.__VUE__=!0;const{insert:n,remove:r,patchProp:s,createElement:o,createText:c,createComment:l,setText:O,setElementText:_,parentNode:v,nextSibling:E,setScopeId:b=Te,insertStaticContent:P}=t,m=(D,F,X,st=null,ot=null,lt=null,ct=void 0,q=null,Y=!!F.dynamicChildren)=>{if(D===F)return;D&&!Ne(D,F)&&(st=G(D),z(D,ot,lt,!0),D=null),F.patchFlag===-2&&(Y=!1,F.dynamicChildren=null);const{type:Z,ref:W,shapeFlag:Q}=F;switch(Z){case fi:T(D,F,X,st);break;case Kt:k(D,F,X,st);break;case Gi:D==null&&M(F,X,st,ct);break;case zt:x(D,F,X,st,ot,lt,ct,q,Y);break;default:Q&1?S(D,F,X,st,ot,lt,ct,q,Y):Q&6?d(D,F,X,st,ot,lt,ct,q,Y):(Q&64||Q&128)&&Z.process(D,F,X,st,ot,lt,ct,q,Y,U)}W!=null&&ot&&dr(W,D&&D.ref,lt,F||D,!F)},T=(D,F,X,st)=>{if(D==null)n(F.el=c(F.children),X,st);else{const ot=F.el=D.el;F.children!==D.children&&O(ot,F.children)}},k=(D,F,X,st)=>{D==null?n(F.el=l(F.children||""),X,st):F.el=D.el},M=(D,F,X,st)=>{[D.el,D.anchor]=P(D.children,F,X,st,D.el,D.anchor)},y=({el:D,anchor:F},X,st)=>{let ot;for(;D&&D!==F;)ot=E(D),n(D,X,st),D=ot;n(F,X,st)},a=({el:D,anchor:F})=>{let X;for(;D&&D!==F;)X=E(D),r(D),D=X;r(F)},S=(D,F,X,st,ot,lt,ct,q,Y)=>{F.type==="svg"?ct="svg":F.type==="math"&&(ct="mathml"),D==null?w(F,X,st,ot,lt,ct,q,Y):u(D,F,ot,lt,ct,q,Y)},w=(D,F,X,st,ot,lt,ct,q)=>{let Y,Z;const{props:W,shapeFlag:Q,transition:rt,dirs:nt}=D;if(Y=D.el=o(D.type,lt,W&&W.is,W),Q&8?_(Y,D.children):Q&16&&f(D.children,Y,null,st,ot,lo(D,lt),ct,q),nt&&Ye(D,null,st,"created"),A(Y,D,D.scopeId,ct,st),W){for(const ut in W)ut!=="value"&&!un(ut)&&s(Y,ut,null,W[ut],lt,st);"value"in W&&s(Y,"value",null,W.value,lt),(Z=W.onVnodeBeforeMount)&&me(Z,st,D)}nt&&Ye(D,null,st,"beforeMount");const at=Kh(ot,rt);at&&rt.beforeEnter(Y),n(Y,F,X),((Z=W&&W.onVnodeMounted)||at||nt)&&qt(()=>{Z&&me(Z,st,D),at&&rt.enter(Y),nt&&Ye(D,null,st,"mounted")},ot)},A=(D,F,X,st,ot)=>{if(X&&b(D,X),st)for(let lt=0;lt{for(let Z=Y;Z{const q=F.el=D.el;let{patchFlag:Y,dynamicChildren:Z,dirs:W}=F;Y|=D.patchFlag&16;const Q=D.props||Pt,rt=F.props||Pt;let nt;if(X&&Di(X,!1),(nt=rt.onVnodeBeforeUpdate)&&me(nt,X,F,D),W&&Ye(F,D,X,"beforeUpdate"),X&&Di(X,!0),(Q.innerHTML&&rt.innerHTML==null||Q.textContent&&rt.textContent==null)&&_(q,""),Z?g(D.dynamicChildren,Z,q,X,st,lo(F,ot),lt):ct||$(D,F,q,null,X,st,lo(F,ot),lt,!1),Y>0){if(Y&16)h(q,Q,rt,X,ot);else if(Y&2&&Q.class!==rt.class&&s(q,"class",null,rt.class,ot),Y&4&&s(q,"style",Q.style,rt.style,ot),Y&8){const at=F.dynamicProps;for(let ut=0;ut{nt&&me(nt,X,F,D),W&&Ye(F,D,X,"updated")},st)},g=(D,F,X,st,ot,lt,ct)=>{for(let q=0;q{if(F!==X){if(F!==Pt)for(const lt in F)!un(lt)&&!(lt in X)&&s(D,lt,F[lt],null,ot,st);for(const lt in X){if(un(lt))continue;const ct=X[lt],q=F[lt];ct!==q&<!=="value"&&s(D,lt,q,ct,ot,st)}"value"in X&&s(D,"value",F.value,X.value,ot)}},x=(D,F,X,st,ot,lt,ct,q,Y)=>{const Z=F.el=D?D.el:c(""),W=F.anchor=D?D.anchor:c("");let{patchFlag:Q,dynamicChildren:rt,slotScopeIds:nt}=F;nt&&(q=q?q.concat(nt):nt),D==null?(n(Z,X,st),n(W,X,st),f(F.children||[],X,W,ot,lt,ct,q,Y)):Q>0&&Q&64&&rt&&D.dynamicChildren?(g(D.dynamicChildren,rt,X,ot,lt,ct,q),(F.key!=null||ot&&F===ot.subTree)&&Ba(D,F,!0)):$(D,F,X,W,ot,lt,ct,q,Y)},d=(D,F,X,st,ot,lt,ct,q,Y)=>{F.slotScopeIds=q,D==null?F.shapeFlag&512?ot.ctx.activate(F,X,st,ct,Y):p(F,X,st,ot,lt,ct,Y):R(D,F,Y)},p=(D,F,X,st,ot,lt,ct)=>{const q=D.component=hf(D,st,ot);if(Or(D)&&(q.ctx.renderer=U),df(q,!1,ct),q.asyncDep){if(ot&&ot.registerDep(q,I,ct),!D.el){const Y=q.subTree=Ft(Kt);k(null,Y,F,X)}}else I(q,D,F,X,ot,lt,ct)},R=(D,F,X)=>{const st=F.component=D.component;if(Fm(D,F,X))if(st.asyncDep&&!st.asyncResolved){j(st,F,X);return}else st.next=F,st.update();else F.el=D.el,st.vnode=F},I=(D,F,X,st,ot,lt,ct)=>{const q=()=>{if(D.isMounted){let{next:Q,bu:rt,u:nt,parent:at,vnode:ut}=D;{const dt=qh(D);if(dt){Q&&(Q.el=ut.el,j(D,Q,ct)),dt.asyncDep.then(()=>{D.isUnmounted||q()});return}}let ft=Q,gt;Di(D,!1),Q?(Q.el=ut.el,j(D,Q,ct)):Q=ut,rt&&hn(rt),(gt=Q.props&&Q.props.onVnodeBeforeUpdate)&&me(gt,at,Q,ut),Di(D,!0);const xt=Zr(D),vt=D.subTree;D.subTree=xt,m(vt,xt,v(vt.el),G(vt),D,ot,lt),Q.el=xt.el,ft===null&&Ws(D,xt.el),nt&&qt(nt,ot),(gt=Q.props&&Q.props.onVnodeUpdated)&&qt(()=>me(gt,at,Q,ut),ot)}else{let Q;const{el:rt,props:nt}=F,{bm:at,m:ut,parent:ft,root:gt,type:xt}=D,vt=Si(F);if(Di(D,!1),at&&hn(at),!vt&&(Q=nt&&nt.onVnodeBeforeMount)&&me(Q,ft,F),Di(D,!0),rt&&tt){const dt=()=>{D.subTree=Zr(D),tt(rt,D.subTree,D,ot,null)};vt&&xt.__asyncHydrate?xt.__asyncHydrate(rt,D,dt):dt()}else{gt.ce&>.ce._injectChildStyle(xt);const dt=D.subTree=Zr(D);m(null,dt,X,st,D,ot,lt),F.el=dt.el}if(ut&&qt(ut,ot),!vt&&(Q=nt&&nt.onVnodeMounted)){const dt=F;qt(()=>me(Q,ft,dt),ot)}(F.shapeFlag&256||ft&&Si(ft.vnode)&&ft.vnode.shapeFlag&256)&&D.a&&qt(D.a,ot),D.isMounted=!0,F=X=st=null}};D.scope.on();const Y=D.effect=new or(q);D.scope.off();const Z=D.update=Y.run.bind(Y),W=D.job=Y.runIfDirty.bind(Y);W.i=D,W.id=D.uid,Y.scheduler=()=>Oa(W),Di(D,!0),Z()},j=(D,F,X)=>{F.component=D;const st=D.vnode.props;D.vnode=F,D.next=null,Cm(D,F.props,st,X),Am(D,F.children,X),Li(),xl(D),Mi()},$=(D,F,X,st,ot,lt,ct,q,Y=!1)=>{const Z=D&&D.children,W=D?D.shapeFlag:0,Q=F.children,{patchFlag:rt,shapeFlag:nt}=F;if(rt>0){if(rt&128){it(Z,Q,X,st,ot,lt,ct,q,Y);return}else if(rt&256){et(Z,Q,X,st,ot,lt,ct,q,Y);return}}nt&8?(W&16&&K(Z,ot,lt),Q!==Z&&_(X,Q)):W&16?nt&16?it(Z,Q,X,st,ot,lt,ct,q,Y):K(Z,ot,lt,!0):(W&8&&_(X,""),nt&16&&f(Q,X,st,ot,lt,ct,q,Y))},et=(D,F,X,st,ot,lt,ct,q,Y)=>{D=D||ln,F=F||ln;const Z=D.length,W=F.length,Q=Math.min(Z,W);let rt;for(rt=0;rtW?K(D,ot,lt,!0,!1,Q):f(F,X,st,ot,lt,ct,q,Y,Q)},it=(D,F,X,st,ot,lt,ct,q,Y)=>{let Z=0;const W=F.length;let Q=D.length-1,rt=W-1;for(;Z<=Q&&Z<=rt;){const nt=D[Z],at=F[Z]=Y?Ei(F[Z]):ve(F[Z]);if(Ne(nt,at))m(nt,at,X,null,ot,lt,ct,q,Y);else break;Z++}for(;Z<=Q&&Z<=rt;){const nt=D[Q],at=F[rt]=Y?Ei(F[rt]):ve(F[rt]);if(Ne(nt,at))m(nt,at,X,null,ot,lt,ct,q,Y);else break;Q--,rt--}if(Z>Q){if(Z<=rt){const nt=rt+1,at=ntrt)for(;Z<=Q;)z(D[Z],ot,lt,!0),Z++;else{const nt=Z,at=Z,ut=new Map;for(Z=at;Z<=rt;Z++){const mt=F[Z]=Y?Ei(F[Z]):ve(F[Z]);mt.key!=null&&ut.set(mt.key,Z)}let ft,gt=0;const xt=rt-at+1;let vt=!1,dt=0;const ht=new Array(xt);for(Z=0;Z=xt){z(mt,ot,lt,!0);continue}let yt;if(mt.key!=null)yt=ut.get(mt.key);else for(ft=at;ft<=rt;ft++)if(ht[ft-at]===0&&Ne(mt,F[ft])){yt=ft;break}yt===void 0?z(mt,ot,lt,!0):(ht[yt-at]=Z+1,yt>=dt?dt=yt:vt=!0,m(mt,F[yt],X,null,ot,lt,ct,q,Y),gt++)}const pt=vt?Pm(ht):ln;for(ft=pt.length-1,Z=xt-1;Z>=0;Z--){const mt=at+Z,yt=F[mt],wt=mt+1{const{el:lt,type:ct,transition:q,children:Y,shapeFlag:Z}=D;if(Z&6){H(D.component.subTree,F,X,st);return}if(Z&128){D.suspense.move(F,X,st);return}if(Z&64){ct.move(D,F,X,U);return}if(ct===zt){n(lt,F,X);for(let Q=0;Qq.enter(lt),ot);else{const{leave:Q,delayLeave:rt,afterLeave:nt}=q,at=()=>n(lt,F,X),ut=()=>{Q(lt,()=>{at(),nt&&nt()})};rt?rt(lt,at,ut):ut()}else n(lt,F,X)},z=(D,F,X,st=!1,ot=!1)=>{const{type:lt,props:ct,ref:q,children:Y,dynamicChildren:Z,shapeFlag:W,patchFlag:Q,dirs:rt,cacheIndex:nt}=D;if(Q===-2&&(ot=!1),q!=null&&dr(q,null,X,D,!0),nt!=null&&(F.renderCache[nt]=void 0),W&256){F.ctx.deactivate(D);return}const at=W&1&&rt,ut=!Si(D);let ft;if(ut&&(ft=ct&&ct.onVnodeBeforeUnmount)&&me(ft,F,D),W&6)V(D.component,X,st);else{if(W&128){D.suspense.unmount(X,st);return}at&&Ye(D,null,F,"beforeUnmount"),W&64?D.type.remove(D,F,X,U,st):Z&&!Z.hasOnce&&(lt!==zt||Q>0&&Q&64)?K(Z,F,X,!1,!0):(lt===zt&&Q&384||!ot&&W&16)&&K(Y,F,X),st&&L(D)}(ut&&(ft=ct&&ct.onVnodeUnmounted)||at)&&qt(()=>{ft&&me(ft,F,D),at&&Ye(D,null,F,"unmounted")},X)},L=D=>{const{type:F,el:X,anchor:st,transition:ot}=D;if(F===zt){N(X,st);return}if(F===Gi){a(D);return}const lt=()=>{r(X),ot&&!ot.persisted&&ot.afterLeave&&ot.afterLeave()};if(D.shapeFlag&1&&ot&&!ot.persisted){const{leave:ct,delayLeave:q}=ot,Y=()=>ct(X,lt);q?q(D.el,lt,Y):Y()}else lt()},N=(D,F)=>{let X;for(;D!==F;)X=E(D),r(D),D=X;r(F)},V=(D,F,X)=>{const{bum:st,scope:ot,job:lt,subTree:ct,um:q,m:Y,a:Z}=D;us(Y),us(Z),st&&hn(st),ot.stop(),lt&&(lt.flags|=8,z(ct,D,F,X)),q&&qt(q,F),qt(()=>{D.isUnmounted=!0},F),F&&F.pendingBranch&&!F.isUnmounted&&D.asyncDep&&!D.asyncResolved&&D.suspenseId===F.pendingId&&(F.deps--,F.deps===0&&F.resolve())},K=(D,F,X,st=!1,ot=!1,lt=0)=>{for(let ct=lt;ct{if(D.shapeFlag&6)return G(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const F=E(D.anchor||D.el),X=F&&F[gh];return X?E(X):F};let J=!1;const C=(D,F,X)=>{D==null?F._vnode&&z(F._vnode,null,null,!0):m(F._vnode||null,D,F,null,null,null,X),F._vnode=D,J||(J=!0,xl(),ls(),J=!1)},U={p:m,um:z,m:H,r:L,mt:p,mc:f,pc:$,pbc:g,n:G,o:t};let B,tt;return e&&([B,tt]=e(U)),{render:C,hydrate:B,createApp:_m(C,B)}}function lo({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function Di({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Kh(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ba(t,e,i=!1){const n=t.children,r=e.children;if(_t(n)&&_t(r))for(let s=0;s>1,t[i[c]]0&&(e[n]=i[s-1]),i[s]=n)}}for(s=i.length,o=i[s-1];s-- >0;)i[s]=o,o=e[o];return i}function qh(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:qh(e)}function us(t){if(t)for(let e=0;eOe(Zh);function km(t,e){return Ar(t,null,e)}function Lm(t,e){return Ar(t,null,{flush:"post"})}function Qh(t,e){return Ar(t,null,{flush:"sync"})}function le(t,e,i){return Ar(t,e,i)}function Ar(t,e,i=Pt){const{immediate:n,deep:r,flush:s,once:o}=i,c=Bt({},i),l=e&&n||!e&&s!=="post";let O;if(vn){if(s==="sync"){const b=Jh();O=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=Te,b.resume=Te,b.pause=Te,b}}const _=Zt;c.call=(b,P,m)=>ke(b,_,P,m);let v=!1;s==="post"?c.scheduler=b=>{qt(b,_&&_.suspense)}:s!=="sync"&&(v=!0,c.scheduler=(b,P)=>{P?b():Oa(b)}),c.augmentJob=b=>{e&&(b.flags|=4),v&&(b.flags|=2,_&&(b.id=_.uid,b.i=_))};const E=vg(t,e,c);return vn&&(O?O.push(E):l&&E()),E}function Mm(t,e,i){const n=this.proxy,r=Ut(t)?t.includes(".")?tf(n,t):()=>n[t]:t.bind(n,n);let s;Ct(e)?s=e:(s=e.handler,i=e);const o=zi(this),c=Ar(r,s.bind(n),i);return o(),c}function tf(t,e){const i=e.split(".");return()=>{let n=t;for(let r=0;r{let _,v=Pt,E;return Qh(()=>{const b=t[r];de(_,b)&&(_=b,O())}),{get(){return l(),i.get?i.get(_):_},set(b){const P=i.set?i.set(b):b;if(!de(P,_)&&!(v!==Pt&&de(b,v)))return;const m=n.vnode.props;m&&(e in m||r in m||s in m)&&(`onUpdate:${e}`in m||`onUpdate:${r}`in m||`onUpdate:${s}`in m)||(_=b,O()),n.emit(`update:${e}`,P),de(b,P)&&de(b,v)&&!de(P,E)&&O(),v=b,E=P}}});return c[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||Pt:c,done:!1}:{done:!0}}}},c}const ef=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${ne(e)}Modifiers`]||t[`${ye(e)}Modifiers`];function Rm(t,e,...i){if(t.isUnmounted)return;const n=t.vnode.props||Pt;let r=i;const s=e.startsWith("update:"),o=s&&ef(n,e.slice(7));o&&(o.trim&&(r=i.map(_=>Ut(_)?_.trim():_)),o.number&&(r=i.map(ns)));let c,l=n[c=zn(e)]||n[c=zn(ne(e))];!l&&s&&(l=n[c=zn(ye(e))]),l&&ke(l,t,6,r);const O=n[c+"Once"];if(O){if(!t.emitted)t.emitted={};else if(t.emitted[c])return;t.emitted[c]=!0,ke(O,t,6,r)}}function nf(t,e,i=!1){const n=e.emitsCache,r=n.get(t);if(r!==void 0)return r;const s=t.emits;let o={},c=!1;if(!Ct(t)){const l=O=>{const _=nf(O,e,!0);_&&(c=!0,Bt(o,_))};!i&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!c?(jt(t)&&n.set(t,null),null):(_t(s)?s.forEach(l=>o[l]=null):Bt(o,s),jt(t)&&n.set(t,o),o)}function Us(t,e){return!t||!Er(e)?!1:(e=e.slice(2).replace(/Once$/,""),Mt(t,e[0].toLowerCase()+e.slice(1))||Mt(t,ye(e))||Mt(t,e))}function Zr(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[s],slots:o,attrs:c,emit:l,render:O,renderCache:_,props:v,data:E,setupState:b,ctx:P,inheritAttrs:m}=t,T=fr(t);let k,M;try{if(i.shapeFlag&4){const a=r||n,S=a;k=ve(O.call(S,a,_,v,b,E,P)),M=c}else{const a=e;k=ve(a.length>1?a(v,{attrs:c,slots:o,emit:l}):a(v,null)),M=e.props?c:Dm(c)}}catch(a){tr.length=0,Zi(a,t,1),k=Ft(Kt)}let y=k;if(M&&m!==!1){const a=Object.keys(M),{shapeFlag:S}=y;a.length&&S&7&&(s&&a.some(va)&&(M=jm(M,s)),y=Qe(y,M,!1,!0))}return i.dirs&&(y=Qe(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(i.dirs):i.dirs),i.transition&&di(y,i.transition),k=y,fr(T),k}function Nm(t,e=!0){let i;for(let n=0;n{let e;for(const i in t)(i==="class"||i==="style"||Er(i))&&((e||(e={}))[i]=t[i]);return e},jm=(t,e)=>{const i={};for(const n in t)(!va(n)||!(n.slice(9)in e))&&(i[n]=t[n]);return i};function Fm(t,e,i){const{props:n,children:r,component:s}=t,{props:o,children:c,patchFlag:l}=e,O=s.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return n?Ll(n,o,O):!!o;if(l&8){const _=e.dynamicProps;for(let v=0;v<_.length;v++){const E=_[v];if(o[E]!==n[E]&&!Us(O,E))return!0}}}else return(r||c)&&(!c||!c.$stable)?!0:n===o?!1:n?o?Ll(n,o,O):!0:!!o;return!1}function Ll(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;rt.__isSuspense;let Ho=0;const Bm={name:"Suspense",__isSuspense:!0,process(t,e,i,n,r,s,o,c,l,O){if(t==null)Vm(e,i,n,r,s,o,c,l,O);else{if(s&&s.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}Um(t,e,i,n,r,o,c,l,O)}},hydrate:Wm,normalize:Gm},Hm=Bm;function gr(t,e){const i=t.props&&t.props[e];Ct(i)&&i()}function Vm(t,e,i,n,r,s,o,c,l){const{p:O,o:{createElement:_}}=l,v=_("div"),E=t.suspense=rf(t,r,n,e,v,i,s,o,c,l);O(null,E.pendingBranch=t.ssContent,v,null,n,E,s,o),E.deps>0?(gr(t,"onPending"),gr(t,"onFallback"),O(null,t.ssFallback,e,i,n,null,s,o),dn(E,t.ssFallback)):E.resolve(!1,!0)}function Um(t,e,i,n,r,s,o,c,{p:l,um:O,o:{createElement:_}}){const v=e.suspense=t.suspense;v.vnode=e,e.el=t.el;const E=e.ssContent,b=e.ssFallback,{activeBranch:P,pendingBranch:m,isInFallback:T,isHydrating:k}=v;if(m)v.pendingBranch=E,Ne(E,m)?(l(m,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0?v.resolve():T&&(k||(l(P,b,i,n,r,null,s,o,c),dn(v,b)))):(v.pendingId=Ho++,k?(v.isHydrating=!1,v.activeBranch=m):O(m,r,v),v.deps=0,v.effects.length=0,v.hiddenContainer=_("div"),T?(l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0?v.resolve():(l(P,b,i,n,r,null,s,o,c),dn(v,b))):P&&Ne(E,P)?(l(P,E,i,n,r,v,s,o,c),v.resolve(!0)):(l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0&&v.resolve()));else if(P&&Ne(E,P))l(P,E,i,n,r,v,s,o,c),dn(v,E);else if(gr(e,"onPending"),v.pendingBranch=E,E.shapeFlag&512?v.pendingId=E.component.suspenseId:v.pendingId=Ho++,l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0)v.resolve();else{const{timeout:M,pendingId:y}=v;M>0?setTimeout(()=>{v.pendingId===y&&v.fallback(b)},M):M===0&&v.fallback(b)}}function rf(t,e,i,n,r,s,o,c,l,O,_=!1){const{p:v,m:E,um:b,n:P,o:{parentNode:m,remove:T}}=O;let k;const M=$m(t);M&&e&&e.pendingBranch&&(k=e.pendingId,e.deps++);const y=t.props?rs(t.props.timeout):void 0,a=s,S={vnode:t,parent:e,parentComponent:i,namespace:o,container:n,hiddenContainer:r,deps:0,pendingId:Ho++,timeout:typeof y=="number"?y:-1,activeBranch:null,pendingBranch:null,isInFallback:!_,isHydrating:_,isUnmounted:!1,effects:[],resolve(w=!1,A=!1){const{vnode:f,activeBranch:u,pendingBranch:g,pendingId:h,effects:x,parentComponent:d,container:p}=S;let R=!1;S.isHydrating?S.isHydrating=!1:w||(R=u&&g.transition&&g.transition.mode==="out-in",R&&(u.transition.afterLeave=()=>{h===S.pendingId&&(E(g,p,s===a?P(u):s,0),ur(x))}),u&&(m(u.el)===p&&(s=P(u)),b(u,d,S,!0)),R||E(g,p,s,0)),dn(S,g),S.pendingBranch=null,S.isInFallback=!1;let I=S.parent,j=!1;for(;I;){if(I.pendingBranch){I.effects.push(...x),j=!0;break}I=I.parent}!j&&!R&&ur(x),S.effects=[],M&&e&&e.pendingBranch&&k===e.pendingId&&(e.deps--,e.deps===0&&!A&&e.resolve()),gr(f,"onResolve")},fallback(w){if(!S.pendingBranch)return;const{vnode:A,activeBranch:f,parentComponent:u,container:g,namespace:h}=S;gr(A,"onFallback");const x=P(f),d=()=>{S.isInFallback&&(v(null,w,g,x,u,null,h,c,l),dn(S,w))},p=w.transition&&w.transition.mode==="out-in";p&&(f.transition.afterLeave=d),S.isInFallback=!0,b(f,u,null,!0),p||d()},move(w,A,f){S.activeBranch&&E(S.activeBranch,w,A,f),S.container=w},next(){return S.activeBranch&&P(S.activeBranch)},registerDep(w,A,f){const u=!!S.pendingBranch;u&&S.deps++;const g=w.vnode.el;w.asyncDep.catch(h=>{Zi(h,w,0)}).then(h=>{if(w.isUnmounted||S.isUnmounted||S.pendingId!==w.suspenseId)return;w.asyncResolved=!0;const{vnode:x}=w;Go(w,h,!1),g&&(x.el=g);const d=!g&&w.subTree.el;A(w,x,m(g||w.subTree.el),g?null:P(w.subTree),S,o,f),d&&T(d),Ws(w,x.el),u&&--S.deps===0&&S.resolve()})},unmount(w,A){S.isUnmounted=!0,S.activeBranch&&b(S.activeBranch,i,w,A),S.pendingBranch&&b(S.pendingBranch,i,w,A)}};return S}function Wm(t,e,i,n,r,s,o,c,l){const O=e.suspense=rf(e,n,i,t.parentNode,document.createElement("div"),null,r,s,o,c,!0),_=l(t,O.pendingBranch=e.ssContent,i,O,s,o);return O.deps===0&&O.resolve(!1,!0),_}function Gm(t){const{shapeFlag:e,children:i}=t,n=e&32;t.ssContent=Ml(n?i.default:i),t.ssFallback=n?Ml(i.fallback):Ft(Kt)}function Ml(t){let e;if(Ct(t)){const i=Yi&&t._c;i&&(t._d=!1,Ai()),t=t(),i&&(t._d=!0,e=ae,of())}return _t(t)&&(t=Nm(t)),t=ve(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(i=>i!==t)),t}function sf(t,e){e&&e.pendingBranch?_t(t)?e.effects.push(...t):e.effects.push(t):ur(t)}function dn(t,e){t.activeBranch=e;const{vnode:i,parentComponent:n}=t;let r=e.el;for(;!r&&e.component;)e=e.component.subTree,r=e.el;i.el=r,n&&n.subTree===i&&(n.vnode.el=r,Ws(n,r))}function $m(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const zt=Symbol.for("v-fgt"),fi=Symbol.for("v-txt"),Kt=Symbol.for("v-cmt"),Gi=Symbol.for("v-stc"),tr=[];let ae=null;function Ai(t=!1){tr.push(ae=t?null:[])}function of(){tr.pop(),ae=tr[tr.length-1]||null}let Yi=1;function Vo(t,e=!1){Yi+=t,t<0&&ae&&e&&(ae.hasOnce=!0)}function af(t){return t.dynamicChildren=Yi>0?ae||ln:null,of(),Yi>0&&ae&&ae.push(t),t}function lf(t,e,i,n,r,s){return af(Ha(t,e,i,n,r,s,!0))}function mn(t,e,i,n,r){return af(Ft(t,e,i,n,r,!0))}function Je(t){return t?t.__v_isVNode===!0:!1}function Ne(t,e){return t.type===e.type&&t.key===e.key}function Xm(t){}const cf=({key:t})=>t??null,Jr=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?Ut(t)||Dt(t)||Ct(t)?{i:Qt,r:t,k:e,f:!!i}:t:null);function Ha(t,e=null,i=null,n=0,r=null,s=t===zt?0:1,o=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&cf(e),ref:e&&Jr(e),scopeId:js,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Qt};return c?(Ua(l,i),s&128&&t.normalize(l)):i&&(l.shapeFlag|=Ut(i)?8:16),Yi>0&&!o&&ae&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ae.push(l),l}const Ft=Ym;function Ym(t,e=null,i=null,n=0,r=null,s=!1){if((!t||t===Mh)&&(t=Kt),Je(t)){const c=Qe(t,e,!0);return i&&Ua(c,i),Yi>0&&!s&&ae&&(c.shapeFlag&6?ae[ae.indexOf(t)]=c:ae.push(c)),c.patchFlag=-2,c}if(iv(t)&&(t=t.__vccOpts),e){e=uf(e);let{class:c,style:l}=e;c&&!Ut(c)&&(e.class=Tr(c)),jt(l)&&(Ds(l)&&!_t(l)&&(l=Bt({},l)),e.style=Sr(l))}const o=Ut(t)?1:hs(t)?128:mh(t)?64:jt(t)?4:Ct(t)?2:0;return Ha(t,e,i,n,r,o,s,!0)}function uf(t){return t?Ds(t)||Bh(t)?Bt({},t):t:null}function Qe(t,e,i=!1,n=!1){const{props:r,ref:s,patchFlag:o,children:c,transition:l}=t,O=e?Wa(r||{},e):r,_={__v_isVNode:!0,__v_skip:!0,type:t.type,props:O,key:O&&cf(O),ref:e&&e.ref?i&&s?_t(s)?s.concat(Jr(e)):[s,Jr(e)]:Jr(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==zt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Qe(t.ssContent),ssFallback:t.ssFallback&&Qe(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&n&&di(_,l.clone(_)),_}function Va(t=" ",e=0){return Ft(fi,null,t,e)}function zm(t,e){const i=Ft(Gi,null,t);return i.staticCount=e,i}function Km(t="",e=!1){return e?(Ai(),mn(Kt,null,t)):Ft(Kt,null,t)}function ve(t){return t==null||typeof t=="boolean"?Ft(Kt):_t(t)?Ft(zt,null,t.slice()):Je(t)?Ei(t):Ft(fi,null,String(t))}function Ei(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Qe(t)}function Ua(t,e){let i=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(_t(e))i=16;else if(typeof e=="object")if(n&65){const r=e.default;r&&(r._c&&(r._d=!1),Ua(t,r()),r._c&&(r._d=!0));return}else{i=32;const r=e._;!r&&!Bh(e)?e._ctx=Qt:r===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Ct(e)?(e={default:e,_ctx:Qt},i=32):(e=String(e),n&64?(i=16,e=[Va(e)]):i=8);t.children=e,t.shapeFlag|=i}function Wa(...t){const e={};for(let i=0;iZt||Qt;let fs,Uo;{const t=ks(),e=(i,n)=>{let r;return(r=t[i])||(r=t[i]=[]),r.push(n),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};fs=e("__VUE_INSTANCE_SETTERS__",i=>Zt=i),Uo=e("__VUE_SSR_SETTERS__",i=>vn=i)}const zi=t=>{const e=Zt;return fs(t),t.scope.on(),()=>{t.scope.off(),fs(e)}},Wo=()=>{Zt&&Zt.scope.off(),fs(null)};function ff(t){return t.vnode.shapeFlag&4}let vn=!1;function df(t,e=!1,i=!1){e&&Uo(e);const{props:n,children:r}=t.vnode,s=ff(t);Em(t,n,s,e),Om(t,r,i);const o=s?Jm(t,e):void 0;return e&&Uo(!1),o}function Jm(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Do);const{setup:n}=i;if(n){Li();const r=t.setupContext=n.length>1?gf(t):null,s=zi(t),o=Rn(n,t,0,[t.props,r]),c=xa(o);if(Mi(),s(),(c||t.sp)&&!Si(t)&&La(t),c){if(o.then(Wo,Wo),e)return o.then(l=>{Go(t,l,e)}).catch(l=>{Zi(l,t,0)});t.asyncDep=o}else Go(t,o,e)}else pf(t,e)}function Go(t,e,i){Ct(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:jt(e)&&(t.setupState=cr(e)),pf(t,i)}let ds,$o;function Qm(t){ds=t,$o=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,em))}}const tv=()=>!ds;function pf(t,e,i){const n=t.type;if(!t.render){if(!e&&ds&&!n.render){const r=n.template||ja(t).template;if(r){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:c,compilerOptions:l}=n,O=Bt(Bt({isCustomElement:s,delimiters:c},o),l);n.render=ds(r,O)}}t.render=n.render||Te,$o&&$o(t)}{const r=zi(t);Li();try{gm(t)}finally{Mi(),r()}}}const ev={get(t,e){return se(t,"get",""),t[e]}};function gf(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,ev),slots:t.slots,emit:t.emit,expose:e}}function Pr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(cr(rh(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Jn)return Jn[i](t)},has(e,i){return i in e||i in Jn}})):t.proxy}function Xo(t,e=!0){return Ct(t)?t.displayName||t.name:t.name||e&&t.__name}function iv(t){return Ct(t)&&"__vccOpts"in t}const $t=(t,e)=>dg(t,e,vn);function Se(t,e,i){const n=arguments.length;return n===2?jt(e)&&!_t(e)?Je(e)?Ft(t,null,[e]):Ft(t,e):Ft(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&Je(i)&&(i=[i]),Ft(t,e,i))}function nv(){}function rv(t,e,i,n){const r=i[n];if(r&&mf(r,t))return r;const s=e();return s.memo=t.slice(),s.cacheIndex=n,i[n]=s}function mf(t,e){const i=t.memo;if(i.length!=e.length)return!1;for(let n=0;n0&&ae&&ae.push(t),!0}const vf="3.5.13",sv=Te,ov=wg,av=nn,lv=ph,cv={createComponentInstance:hf,setupComponent:df,renderComponentRoot:Zr,setCurrentRenderingInstance:fr,isVNode:Je,normalizeVNode:ve,getComponentPublicInstance:Pr,ensureValidVNode:Da,pushWarningContext:yg,popWarningContext:xg},uv=cv,hv=null,fv=null,dv=null;/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Yo;const Il=typeof window<"u"&&window.trustedTypes;if(Il)try{Yo=Il.createPolicy("vue",{createHTML:t=>t})}catch{}const yf=Yo?t=>Yo.createHTML(t):t=>t,pv="http://www.w3.org/2000/svg",gv="http://www.w3.org/1998/Math/MathML",ai=typeof document<"u"?document:null,Rl=ai&&ai.createElement("template"),mv={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r=e==="svg"?ai.createElementNS(pv,t):e==="mathml"?ai.createElementNS(gv,t):i?ai.createElement(t,{is:i}):ai.createElement(t);return t==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:t=>ai.createTextNode(t),createComment:t=>ai.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ai.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,s){const o=i?i.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),!(r===s||!(r=r.nextSibling)););else{Rl.innerHTML=yf(n==="svg"?`${t}`:n==="mathml"?`${t}`:t);const c=Rl.content;if(n==="svg"||n==="mathml"){const l=c.firstChild;for(;l.firstChild;)c.appendChild(l.firstChild);c.removeChild(l)}e.insertBefore(c,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},mi="transition",Bn="animation",yn=Symbol("_vtc"),xf={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bf=Bt({},ka,xf),vv=t=>(t.displayName="Transition",t.props=bf,t),yv=vv((t,{slots:e})=>Se(wh,_f(t),e)),ji=(t,e=[])=>{_t(t)?t.forEach(i=>i(...e)):t&&t(...e)},Nl=t=>t?_t(t)?t.some(e=>e.length>1):t.length>1:!1;function _f(t){const e={};for(const x in t)x in xf||(e[x]=t[x]);if(t.css===!1)return e;const{name:i="v",type:n,duration:r,enterFromClass:s=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:c=`${i}-enter-to`,appearFromClass:l=s,appearActiveClass:O=o,appearToClass:_=c,leaveFromClass:v=`${i}-leave-from`,leaveActiveClass:E=`${i}-leave-active`,leaveToClass:b=`${i}-leave-to`}=t,P=xv(r),m=P&&P[0],T=P&&P[1],{onBeforeEnter:k,onEnter:M,onEnterCancelled:y,onLeave:a,onLeaveCancelled:S,onBeforeAppear:w=k,onAppear:A=M,onAppearCancelled:f=y}=e,u=(x,d,p,R)=>{x._enterCancelled=R,xi(x,d?_:c),xi(x,d?O:o),p&&p()},g=(x,d)=>{x._isLeaving=!1,xi(x,v),xi(x,b),xi(x,E),d&&d()},h=x=>(d,p)=>{const R=x?A:M,I=()=>u(d,x,p);ji(R,[d,I]),Dl(()=>{xi(d,x?l:s),$e(d,x?_:c),Nl(R)||jl(d,n,m,I)})};return Bt(e,{onBeforeEnter(x){ji(k,[x]),$e(x,s),$e(x,o)},onBeforeAppear(x){ji(w,[x]),$e(x,l),$e(x,O)},onEnter:h(!1),onAppear:h(!0),onLeave(x,d){x._isLeaving=!0;const p=()=>g(x,d);$e(x,v),x._enterCancelled?($e(x,E),zo()):(zo(),$e(x,E)),Dl(()=>{x._isLeaving&&(xi(x,v),$e(x,b),Nl(a)||jl(x,n,T,p))}),ji(a,[x,p])},onEnterCancelled(x){u(x,!1,void 0,!0),ji(y,[x])},onAppearCancelled(x){u(x,!0,void 0,!0),ji(f,[x])},onLeaveCancelled(x){g(x),ji(S,[x])}})}function xv(t){if(t==null)return null;if(jt(t))return[co(t.enter),co(t.leave)];{const e=co(t);return[e,e]}}function co(t){return rs(t)}function $e(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[yn]||(t[yn]=new Set)).add(e)}function xi(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const i=t[yn];i&&(i.delete(e),i.size||(t[yn]=void 0))}function Dl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let bv=0;function jl(t,e,i,n){const r=t._endId=++bv,s=()=>{r===t._endId&&n()};if(i!=null)return setTimeout(s,i);const{type:o,timeout:c,propCount:l}=wf(t,e);if(!o)return n();const O=o+"end";let _=0;const v=()=>{t.removeEventListener(O,E),s()},E=b=>{b.target===t&&++_>=l&&v()};setTimeout(()=>{_(i[P]||"").split(", "),r=n(`${mi}Delay`),s=n(`${mi}Duration`),o=Fl(r,s),c=n(`${Bn}Delay`),l=n(`${Bn}Duration`),O=Fl(c,l);let _=null,v=0,E=0;e===mi?o>0&&(_=mi,v=o,E=s.length):e===Bn?O>0&&(_=Bn,v=O,E=l.length):(v=Math.max(o,O),_=v>0?o>O?mi:Bn:null,E=_?_===mi?s.length:l.length:0);const b=_===mi&&/\b(transform|all)(,|$)/.test(n(`${mi}Property`).toString());return{type:_,timeout:v,propCount:E,hasTransform:b}}function Fl(t,e){for(;t.lengthBl(i)+Bl(t[n])))}function Bl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function zo(){return document.body.offsetHeight}function _v(t,e,i){const n=t[yn];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const ps=Symbol("_vod"),Ef=Symbol("_vsh"),Cf={beforeMount(t,{value:e},{transition:i}){t[ps]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):Hn(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:n}){!e!=!i&&(n?e?(n.beforeEnter(t),Hn(t,!0),n.enter(t)):n.leave(t,()=>{Hn(t,!1)}):Hn(t,e))},beforeUnmount(t,{value:e}){Hn(t,e)}};function Hn(t,e){t.style.display=e?t[ps]:"none",t[Ef]=!e}function wv(){Cf.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const Sf=Symbol("");function Ev(t){const e=ie();if(!e)return;const i=e.ut=(r=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>gs(s,r))},n=()=>{const r=t(e.proxy);e.ce?gs(e.ce,r):Ko(e.subTree,r),i(r)};Ia(()=>{ur(n)}),gi(()=>{le(n,Te,{flush:"post"});const r=new MutationObserver(n);r.observe(e.subTree.el.parentNode,{childList:!0}),Dn(()=>r.disconnect())})}function Ko(t,e){if(t.shapeFlag&128){const i=t.suspense;t=i.activeBranch,i.pendingBranch&&!i.isHydrating&&i.effects.push(()=>{Ko(i.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)gs(t.el,e);else if(t.type===zt)t.children.forEach(i=>Ko(i,e));else if(t.type===Gi){let{el:i,anchor:n}=t;for(;i&&(gs(i,e),i!==n);)i=i.nextSibling}}function gs(t,e){if(t.nodeType===1){const i=t.style;let n="";for(const r in e)i.setProperty(`--${r}`,e[r]),n+=`--${r}: ${e[r]};`;i[Sf]=n}}const Cv=/(^|;)\s*display\s*:/;function Sv(t,e,i){const n=t.style,r=Ut(i);let s=!1;if(i&&!r){if(e)if(Ut(e))for(const o of e.split(";")){const c=o.slice(0,o.indexOf(":")).trim();i[c]==null&&Qr(n,c,"")}else for(const o in e)i[o]==null&&Qr(n,o,"");for(const o in i)o==="display"&&(s=!0),Qr(n,o,i[o])}else if(r){if(e!==i){const o=n[Sf];o&&(i+=";"+o),n.cssText=i,s=Cv.test(i)}}else e&&t.removeAttribute("style");ps in t&&(t[ps]=s?n.display:"",t[Ef]&&(n.display="none"))}const Hl=/\s*!important$/;function Qr(t,e,i){if(_t(i))i.forEach(n=>Qr(t,e,n));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=Tv(t,e);Hl.test(i)?t.setProperty(ye(n),i.replace(Hl,""),"important"):t[n]=i}}const Vl=["Webkit","Moz","ms"],uo={};function Tv(t,e){const i=uo[e];if(i)return i;let n=ne(e);if(n!=="filter"&&n in t)return uo[e]=n;n=Cr(n);for(let r=0;rho||(kv.then(()=>ho=0),ho=Date.now());function Mv(t,e){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;ke(Iv(n,i.value),e,5,[n])};return i.value=t,i.attached=Lv(),i}function Iv(t,e){if(_t(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(n=>r=>!r._stopped&&n&&n(r))}else return e}const Yl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Rv=(t,e,i,n,r,s)=>{const o=r==="svg";e==="class"?_v(t,n,o):e==="style"?Sv(t,i,n):Er(e)?va(e)||Av(t,e,i,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Nv(t,e,n,o))?(Gl(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Wl(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Ut(n))?Gl(t,ne(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),Wl(t,e,n,o))};function Nv(t,e,i,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&Yl(e)&&Ct(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Yl(e)&&Ut(i)?!1:e in t}const zl={};/*! #__NO_SIDE_EFFECTS__ */function Tf(t,e,i){const n=Ue(t,e);As(n)&&Bt(n,e);class r extends Gs{constructor(o){super(n,o,i)}}return r.def=n,r}/*! #__NO_SIDE_EFFECTS__ */const Dv=(t,e)=>Tf(t,e,Ff),jv=typeof HTMLElement<"u"?HTMLElement:class{};class Gs extends jv{constructor(e,i={},n=bn){super(),this._def=e,this._props=i,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==bn?this._root=this.shadowRoot:e.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof Gs){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,Nn(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n{for(const r of n)this._setAttr(r.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(n,r=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:o}=n;let c;if(s&&!_t(s))for(const l in s){const O=s[l];(O===Number||O&&O.type===Number)&&(l in this._props&&(this._props[l]=rs(this._props[l])),(c||(c=Object.create(null)))[ne(l)]=!0)}this._numberProps=c,r&&this._resolveProps(n),this.shadowRoot&&this._applyStyles(o),this._mount(n)},i=this._def.__asyncLoader;i?this._pendingResolve=i().then(n=>e(this._def=n,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const i=this._instance&&this._instance.exposed;if(i)for(const n in i)Mt(this,n)||Object.defineProperty(this,n,{get:()=>Be(i[n])})}_resolveProps(e){const{props:i}=e,n=_t(i)?i:Object.keys(i||{});for(const r of Object.keys(this))r[0]!=="_"&&n.includes(r)&&this._setProp(r,this[r]);for(const r of n.map(ne))Object.defineProperty(this,r,{get(){return this._getProp(r)},set(s){this._setProp(r,s,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const i=this.hasAttribute(e);let n=i?this.getAttribute(e):zl;const r=ne(e);i&&this._numberProps&&this._numberProps[r]&&(n=rs(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,i,n=!0,r=!1){if(i!==this._props[e]&&(i===zl?delete this._props[e]:(this._props[e]=i,e==="key"&&this._app&&(this._app._ceVNode.key=i)),r&&this._instance&&this._update(),n)){const s=this._ob;s&&s.disconnect(),i===!0?this.setAttribute(ye(e),""):typeof i=="string"||typeof i=="number"?this.setAttribute(ye(e),i+""):i||this.removeAttribute(ye(e)),s&&s.observe(this,{attributes:!0})}}_update(){jf(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const i=Ft(this._def,Bt(e,this._props));return this._instance||(i.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const r=(s,o)=>{this.dispatchEvent(new CustomEvent(s,As(o[0])?Bt({detail:o},o[0]):{detail:o}))};n.emit=(s,...o)=>{r(s,o),ye(s)!==s&&r(ye(s),o)},this._setParent()}),i}_applyStyles(e,i){if(!e)return;if(i){if(i===this._def||this._styleChildren.has(i))return;this._styleChildren.add(i)}const n=this._nonce;for(let r=e.length-1;r>=0;r--){const s=document.createElement("style");n&&s.setAttribute("nonce",n),s.textContent=e[r],this.shadowRoot.prepend(s)}}_parseSlots(){const e=this._slots={};let i;for(;i=this.firstChild;){const n=i.nodeType===1&&i.getAttribute("slot")||"default";(e[n]||(e[n]=[])).push(i),this.removeChild(i)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),i=this._instance.type.__scopeId;for(let n=0;n(delete t.props.mode,t),Vv=Hv({name:"TransitionGroup",props:Bt({},bf,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=ie(),n=Pa();let r,s;return Hs(()=>{if(!r.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!Xv(r[0].el,i.vnode.el,o))return;r.forEach(Wv),r.forEach(Gv);const c=r.filter($v);zo(),c.forEach(l=>{const O=l.el,_=O.style;$e(O,o),_.transform=_.webkitTransform=_.transitionDuration="";const v=O[ms]=E=>{E&&E.target!==O||(!E||/transform$/.test(E.propertyName))&&(O.removeEventListener("transitionend",v),O[ms]=null,xi(O,o))};O.addEventListener("transitionend",v)})}),()=>{const o=Lt(t),c=_f(o);let l=o.tag||zt;if(r=[],s)for(let O=0;O{c.split(/\s+/).forEach(l=>l&&n.classList.remove(l))}),i.split(/\s+/).forEach(c=>c&&n.classList.add(c)),n.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(n);const{hasTransform:o}=wf(n);return s.removeChild(n),o}const Pi=t=>{const e=t.props["onUpdate:modelValue"]||!1;return _t(e)?i=>hn(e,i):e};function Yv(t){t.target.composing=!0}function ql(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ae=Symbol("_assign"),vs={created(t,{modifiers:{lazy:e,trim:i,number:n}},r){t[Ae]=Pi(r);const s=n||r.props&&r.props.type==="number";ui(t,e?"change":"input",o=>{if(o.target.composing)return;let c=t.value;i&&(c=c.trim()),s&&(c=ns(c)),t[Ae](c)}),i&&ui(t,"change",()=>{t.value=t.value.trim()}),e||(ui(t,"compositionstart",Yv),ui(t,"compositionend",ql),ui(t,"change",ql))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:n,trim:r,number:s}},o){if(t[Ae]=Pi(o),t.composing)return;const c=(s||t.type==="number")&&!/^0\d/.test(t.value)?ns(t.value):t.value,l=e??"";c!==l&&(document.activeElement===t&&t.type!=="range"&&(n&&e===i||r&&t.value.trim()===l)||(t.value=l))}},Ga={deep:!0,created(t,e,i){t[Ae]=Pi(i),ui(t,"change",()=>{const n=t._modelValue,r=xn(t),s=t.checked,o=t[Ae];if(_t(n)){const c=Ls(n,r),l=c!==-1;if(s&&!l)o(n.concat(r));else if(!s&&l){const O=[...n];O.splice(c,1),o(O)}}else if(Ki(n)){const c=new Set(n);s?c.add(r):c.delete(r),o(c)}else o(Lf(t,s))})},mounted:Zl,beforeUpdate(t,e,i){t[Ae]=Pi(i),Zl(t,e,i)}};function Zl(t,{value:e,oldValue:i},n){t._modelValue=e;let r;if(_t(e))r=Ls(e,n.props.value)>-1;else if(Ki(e))r=e.has(n.props.value);else{if(e===i)return;r=Ti(e,Lf(t,!0))}t.checked!==r&&(t.checked=r)}const $a={created(t,{value:e},i){t.checked=Ti(e,i.props.value),t[Ae]=Pi(i),ui(t,"change",()=>{t[Ae](xn(t))})},beforeUpdate(t,{value:e,oldValue:i},n){t[Ae]=Pi(n),e!==i&&(t.checked=Ti(e,n.props.value))}},kf={deep:!0,created(t,{value:e,modifiers:{number:i}},n){const r=Ki(e);ui(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>i?ns(xn(o)):xn(o));t[Ae](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Nn(()=>{t._assigning=!1})}),t[Ae]=Pi(n)},mounted(t,{value:e}){Jl(t,e)},beforeUpdate(t,e,i){t[Ae]=Pi(i)},updated(t,{value:e}){t._assigning||Jl(t,e)}};function Jl(t,e){const i=t.multiple,n=_t(e);if(!(i&&!n&&!Ki(e))){for(let r=0,s=t.options.length;rString(O)===String(c)):o.selected=Ls(e,c)>-1}else o.selected=e.has(c);else if(Ti(xn(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function xn(t){return"_value"in t?t._value:t.value}function Lf(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const Mf={created(t,e,i){Ur(t,e,i,null,"created")},mounted(t,e,i){Ur(t,e,i,null,"mounted")},beforeUpdate(t,e,i,n){Ur(t,e,i,n,"beforeUpdate")},updated(t,e,i,n){Ur(t,e,i,n,"updated")}};function If(t,e){switch(t){case"SELECT":return kf;case"TEXTAREA":return vs;default:switch(e){case"checkbox":return Ga;case"radio":return $a;default:return vs}}}function Ur(t,e,i,n,r){const o=If(t.tagName,i.props&&i.props.type)[r];o&&o(t,e,i,n)}function zv(){vs.getSSRProps=({value:t})=>({value:t}),$a.getSSRProps=({value:t},e)=>{if(e.props&&Ti(e.props.value,t))return{checked:!0}},Ga.getSSRProps=({value:t},e)=>{if(_t(t)){if(e.props&&Ls(t,e.props.value)>-1)return{checked:!0}}else if(Ki(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},Mf.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const i=If(e.type.toUpperCase(),e.props&&e.props.type);if(i.getSSRProps)return i.getSSRProps(t,e)}}const Kv=["ctrl","shift","alt","meta"],qv={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Kv.some(i=>t[`${i}Key`]&&!e.includes(i))},Zv=(t,e)=>{const i=t._withMods||(t._withMods={}),n=e.join(".");return i[n]||(i[n]=(r,...s)=>{for(let o=0;o{const i=t._withKeys||(t._withKeys={}),n=e.join(".");return i[n]||(i[n]=r=>{if(!("key"in r))return;const s=ye(r.key);if(e.some(o=>o===s||Jv[o]===s))return t(r)})},Rf=Bt({patchProp:Rv},mv);let er,Ql=!1;function Nf(){return er||(er=Xh(Rf))}function Df(){return er=Ql?er:Yh(Rf),Ql=!0,er}const jf=(...t)=>{Nf().render(...t)},ty=(...t)=>{Df().hydrate(...t)},bn=(...t)=>{const e=Nf().createApp(...t),{mount:i}=e;return e.mount=n=>{const r=Hf(n);if(!r)return;const s=e._component;!Ct(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=i(r,!1,Bf(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e},Ff=(...t)=>{const e=Df().createApp(...t),{mount:i}=e;return e.mount=n=>{const r=Hf(n);if(r)return i(r,!0,Bf(r))},e};function Bf(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Hf(t){return Ut(t)?document.querySelector(t):t}let tc=!1;const ey=()=>{tc||(tc=!0,zv(),wv())};/** +* vue v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const iy=()=>{},ny=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:wh,BaseTransitionPropsValidators:ka,Comment:Kt,DeprecationTypes:dv,EffectScope:_a,ErrorCodes:_g,ErrorTypeStrings:ov,Fragment:zt,KeepAlive:Yg,ReactiveEffect:or,Static:Gi,Suspense:Hm,Teleport:yh,Text:fi,TrackOpTypes:pg,Transition:yv,TransitionGroup:Uv,TriggerOpTypes:gg,VueElement:Gs,assertNumber:bg,callWithAsyncErrorHandling:ke,callWithErrorHandling:Rn,camelize:ne,capitalize:Cr,cloneVNode:Qe,compatUtils:fv,compile:iy,computed:$t,createApp:bn,createBlock:mn,createCommentVNode:Km,createElementBlock:lf,createElementVNode:Ha,createHydrationRenderer:Yh,createPropsRestProxy:dm,createRenderer:Xh,createSSRApp:Ff,createSlots:Qg,createStaticVNode:zm,createTextVNode:Va,createVNode:Ft,customRef:oh,defineAsyncComponent:$g,defineComponent:Ue,defineCustomElement:Tf,defineEmits:nm,defineExpose:rm,defineModel:am,defineOptions:sm,defineProps:im,defineSSRCustomElement:Dv,defineSlots:om,devtools:av,effect:jp,effectScope:Vu,getCurrentInstance:ie,getCurrentScope:Uu,getCurrentWatcher:mg,getTransitionRawChildren:Fs,guardReactiveProps:uf,h:Se,handleError:Zi,hasInjectionContext:wm,hydrate:ty,hydrateOnIdle:Bg,hydrateOnInteraction:Wg,hydrateOnMediaQuery:Ug,hydrateOnVisible:Vg,initCustomFormatter:nv,initDirectivesForSSR:ey,inject:Oe,isMemoSame:mf,isProxy:Ds,isReactive:qe,isReadonly:Oi,isRef:Dt,isRuntimeOnly:tv,isShallow:_e,isVNode:Je,markRaw:rh,mergeDefaults:hm,mergeModels:fm,mergeProps:Wa,nextTick:Nn,normalizeClass:Tr,normalizeProps:Lp,normalizeStyle:Sr,onActivated:Ch,onBeforeMount:Ma,onBeforeUnmount:Vs,onBeforeUpdate:Ia,onDeactivated:Sh,onErrorCaptured:kh,onMounted:gi,onRenderTracked:Ph,onRenderTriggered:Ah,onScopeDispose:Np,onServerPrefetch:Oh,onUnmounted:Dn,onUpdated:Hs,onWatcherCleanup:ch,openBlock:Ai,popScopeId:Tg,provide:Qn,proxyRefs:cr,pushScopeId:Sg,queuePostFlushCb:ur,reactive:qi,readonly:Ta,ref:Yt,registerRuntimeCompiler:Qm,render:jf,renderList:Jg,renderSlot:Ih,resolveComponent:Lh,resolveDirective:Zg,resolveDynamicComponent:qg,resolveFilter:hv,resolveTransitionHooks:gn,setBlockTracking:Vo,setDevtoolsHook:lv,setTransitionHooks:di,shallowReactive:Sa,shallowReadonly:ng,shallowRef:In,ssrContextKey:Zh,ssrUtils:uv,stop:Fp,toDisplayString:Bu,toHandlerKey:zn,toHandlers:tm,toRaw:Lt,toRef:hg,toRefs:ah,toValue:og,transformVNodeArgs:Xm,triggerRef:sg,unref:Be,useAttrs:um,useCssModule:Bv,useCssVars:Ev,useHost:Of,useId:Lg,useModel:Im,useSSRContext:Jh,useShadowRoot:Fv,useSlots:cm,useTemplateRef:Mg,useTransitionState:Pa,vModelCheckbox:Ga,vModelDynamic:Mf,vModelRadio:$a,vModelSelect:kf,vModelText:vs,vShow:Cf,version:vf,warn:sv,watch:le,watchEffect:km,watchPostEffect:Lm,watchSyncEffect:Qh,withAsyncContext:pm,withCtx:Aa,withDefaults:lm,withDirectives:Ag,withKeys:Qv,withMemo:rv,withModifiers:Zv,withScopeId:Og},Symbol.toStringTag,{value:"Module"}));/** + * vue-class-component v8.0.0-rc.1 + * (c) 2015-present Evan You + * @license MIT + */function ec(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ry(t,e){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function cy(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uy(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:cy(t)}function hy(t){var e=ly();return function(){var n=ys(t),r;if(e){var s=ys(this).constructor;r=Reflect.construct(n,arguments,s)}else r=n.apply(this,arguments);return uy(this,r)}}function fy(t){return dy(t)||py(t)||gy(t)||my()}function dy(t){if(Array.isArray(t))return Zo(t)}function py(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function gy(t,e){if(t){if(typeof t=="string")return Zo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Zo(t,e)}}function Zo(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i-1){r[_]=c[_];return}var v=Object.getOwnPropertyDescriptor(c,_);if(typeof v.value=="function"){r.methods[_]=v.value;return}if(v.get||v.set){r.computed[_]={get:v.get,set:v.set};return}}}),r.setup=function(_,v){var E,b=new i(_,v),P=Object.keys(b),m={},T=null;return P.forEach(function(k){b[k]===void 0||b[k]&&b[k].__s||(m[k]=Yt(b[k]),vy(b,k,m))}),P.forEach(function(k){if(b[k]&&b[k].__s){var M=b[k].__s();M instanceof Promise?(T||(T=Promise.resolve(m)),T=T.then(function(){return M.then(function(y){return m[k]=cr(y),m})})):m[k]=cr(M)}}),(E=T)!==null&&E!==void 0?E:m};var l=Gr(i,"__d");l&&l.forEach(function(_){return _(r)});var O=["render","ssrRender","__file","__cssModules","__scopeId","__hmrId"];return O.forEach(function(_){i[_]&&(r[_]=i[_])}),r}}]),t}();Vf.__h=["data","beforeCreate","created","beforeMount","mounted","beforeUnmount","unmounted","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];var Xa=Vf;let xy=class extends Xa{};const by=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},_y={class:"bg-white"};function wy(t,e,i,n,r,s){const o=Lh("router-view");return Ai(),lf("div",_y,[(Ai(),mn(o,{key:t.$route.path}))])}const Ey=by(xy,[["render",wy]]);Xa.registerHooks(["beforeRouterEnter","beforeRouteLeave","beforeRouteUpdate"]);const Cy="modulepreload",Sy=function(t,e){return new URL(t,e).href},nc={},po=function(e,i,n){let r=Promise.resolve();if(i&&i.length>0){const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),l=c?.nonce||c?.getAttribute("nonce");r=Promise.allSettled(i.map(O=>{if(O=Sy(O,n),O in nc)return;nc[O]=!0;const _=O.endsWith(".css"),v=_?'[rel="stylesheet"]':"";if(!!n)for(let P=o.length-1;P>=0;P--){const m=o[P];if(m.href===O&&(!_||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${O}"]${v}`))return;const b=document.createElement("link");if(b.rel=_?"stylesheet":Cy,_||(b.as="script"),b.crossOrigin="",b.href=O,l&&b.setAttribute("nonce",l),document.head.appendChild(b),_)return new Promise((P,m)=>{b.addEventListener("load",P),b.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${O}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return r.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};/*! + * vue-router v4.4.3 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const rn=typeof document<"u";function Ty(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function go(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ve(r)?r.map(t):t(r)}return i}const ir=()=>{},Ve=Array.isArray,Uf=/#/g,Oy=/&/g,Ay=/\//g,Py=/=/g,ky=/\?/g,Wf=/\+/g,Ly=/%5B/g,My=/%5D/g,Gf=/%5E/g,Iy=/%60/g,$f=/%7B/g,Ry=/%7C/g,Xf=/%7D/g,Ny=/%20/g;function Ya(t){return encodeURI(""+t).replace(Ry,"|").replace(Ly,"[").replace(My,"]")}function Dy(t){return Ya(t).replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function Jo(t){return Ya(t).replace(Wf,"%2B").replace(Ny,"+").replace(Uf,"%23").replace(Oy,"%26").replace(Iy,"`").replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function jy(t){return Jo(t).replace(Py,"%3D")}function Fy(t){return Ya(t).replace(Uf,"%23").replace(ky,"%3F")}function By(t){return t==null?"":Fy(t).replace(Ay,"%2F")}function mr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Hy=/\/$/,Vy=t=>t.replace(Hy,"");function mo(t,e,i="/"){let n,r={},s="",o="";const c=e.indexOf("#");let l=e.indexOf("?");return c=0&&(l=-1),l>-1&&(n=e.slice(0,l),s=e.slice(l+1,c>-1?c:e.length),r=t(s)),c>-1&&(n=n||e.slice(0,c),o=e.slice(c,e.length)),n=$y(n??e,i),{fullPath:n+(s&&"?")+s+o,path:n,query:r,hash:mr(o)}}function Uy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function rc(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Wy(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&_n(e.matched[n],i.matched[r])&&Yf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function _n(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Yf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!Gy(t[i],e[i]))return!1;return!0}function Gy(t,e){return Ve(t)?sc(t,e):Ve(e)?sc(e,t):t===e}function sc(t,e){return Ve(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function $y(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let s=i.length-1,o,c;for(o=0;o1&&s--;else break;return i.slice(0,s).join("/")+"/"+n.slice(o).join("/")}const vi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var vr;(function(t){t.pop="pop",t.push="push"})(vr||(vr={}));var nr;(function(t){t.back="back",t.forward="forward",t.unknown=""})(nr||(nr={}));function Xy(t){if(!t)if(rn){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Vy(t)}const Yy=/^[^#]+#/;function zy(t,e){return t.replace(Yy,"#")+e}function Ky(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const $s=()=>({left:window.scrollX,top:window.scrollY});function qy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ky(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function oc(t,e){return(history.state?history.state.position-e:-1)+t}const Qo=new Map;function Zy(t,e){Qo.set(t,e)}function Jy(t){const e=Qo.get(t);return Qo.delete(t),e}let Qy=()=>location.protocol+"//"+location.host;function zf(t,e){const{pathname:i,search:n,hash:r}=e,s=t.indexOf("#");if(s>-1){let c=r.includes(t.slice(s))?t.slice(s).length:1,l=r.slice(c);return l[0]!=="/"&&(l="/"+l),rc(l,"")}return rc(i,t)+n+r}function t0(t,e,i,n){let r=[],s=[],o=null;const c=({state:E})=>{const b=zf(t,location),P=i.value,m=e.value;let T=0;if(E){if(i.value=b,e.value=E,o&&o===P){o=null;return}T=m?E.position-m.position:0}else n(b);r.forEach(k=>{k(i.value,P,{delta:T,type:vr.pop,direction:T?T>0?nr.forward:nr.back:nr.unknown})})};function l(){o=i.value}function O(E){r.push(E);const b=()=>{const P=r.indexOf(E);P>-1&&r.splice(P,1)};return s.push(b),b}function _(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:$s()}),"")}function v(){for(const E of s)E();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",_)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",_,{passive:!0}),{pauseListeners:l,listen:O,destroy:v}}function ac(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?$s():null}}function e0(t){const{history:e,location:i}=window,n={value:zf(t,i)},r={value:e.state};r.value||s(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,O,_){const v=t.indexOf("#"),E=v>-1?(i.host&&document.querySelector("base")?t:t.slice(v))+l:Qy()+t+l;try{e[_?"replaceState":"pushState"](O,"",E),r.value=O}catch(b){console.error(b),i[_?"replace":"assign"](E)}}function o(l,O){const _=Nt({},e.state,ac(r.value.back,l,r.value.forward,!0),O,{position:r.value.position});s(l,_,!0),n.value=l}function c(l,O){const _=Nt({},r.value,e.state,{forward:l,scroll:$s()});s(_.current,_,!0);const v=Nt({},ac(n.value,l,null),{position:_.position+1},O);s(l,v,!1),n.value=l}return{location:n,state:r,push:c,replace:o}}function i0(t){t=Xy(t);const e=e0(t),i=t0(t,e.state,e.location,e.replace);function n(s,o=!0){o||i.pauseListeners(),history.go(s)}const r=Nt({location:"",base:t,go:n,createHref:zy.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function n0(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),i0(t)}function r0(t){return typeof t=="string"||t&&typeof t=="object"}function Kf(t){return typeof t=="string"||typeof t=="symbol"}const qf=Symbol("");var lc;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(lc||(lc={}));function wn(t,e){return Nt(new Error,{type:t,[qf]:!0},e)}function ni(t,e){return t instanceof Error&&qf in t&&(e==null||!!(t.type&e))}const cc="[^/]+?",s0={sensitive:!1,strict:!1,start:!0,end:!0},o0=/[.+*?^${}()[\]/\\]/g;function a0(t,e){const i=Nt({},s0,e),n=[];let r=i.start?"^":"";const s=[];for(const O of t){const _=O.length?[]:[90];i.strict&&!O.length&&(r+="/");for(let v=0;ve.length?e.length===1&&e[0]===80?1:-1:0}function Zf(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const c0={type:0,value:""},u0=/[a-zA-Z0-9_]/;function h0(t){if(!t)return[[]];if(t==="/")return[[c0]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${O}": ${b}`)}let i=0,n=i;const r=[];let s;function o(){s&&r.push(s),s=[]}let c=0,l,O="",_="";function v(){O&&(i===0?s.push({type:0,value:O}):i===1||i===2||i===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${O}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:O,regexp:_,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),O="")}function E(){O+=l}for(;c{o(y)}:ir}function o(v){if(Kf(v)){const E=n.get(v);E&&(n.delete(v),i.splice(i.indexOf(E),1),E.children.forEach(o),E.alias.forEach(o))}else{const E=i.indexOf(v);E>-1&&(i.splice(E,1),v.record.name&&n.delete(v.record.name),v.children.forEach(o),v.alias.forEach(o))}}function c(){return i}function l(v){const E=v0(v,i);i.splice(E,0,v),v.record.name&&!fc(v)&&n.set(v.record.name,v)}function O(v,E){let b,P={},m,T;if("name"in v&&v.name){if(b=n.get(v.name),!b)throw wn(1,{location:v});T=b.record.name,P=Nt(hc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),v.params&&hc(v.params,b.keys.map(y=>y.name))),m=b.stringify(P)}else if(v.path!=null)m=v.path,b=i.find(y=>y.re.test(m)),b&&(P=b.parse(m),T=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw wn(1,{location:v,currentLocation:E});T=b.record.name,P=Nt({},E.params,v.params),m=b.stringify(P)}const k=[];let M=b;for(;M;)k.unshift(M.record),M=M.parent;return{name:T,path:m,params:P,matched:k,meta:m0(k)}}t.forEach(v=>s(v));function _(){i.length=0,n.clear()}return{addRoute:s,resolve:O,removeRoute:o,clearRoutes:_,getRoutes:c,getRecordMatcher:r}}function hc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function p0(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:g0(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function g0(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function fc(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function m0(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function dc(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function v0(t,e){let i=0,n=e.length;for(;i!==n;){const s=i+n>>1;Zf(t,e[s])<0?n=s:i=s+1}const r=y0(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function y0(t){let e=t;for(;e=e.parent;)if(Jf(e)&&Zf(t,e)===0)return e}function Jf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function x0(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;rs&&Jo(s)):[n&&Jo(n)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+i,s!=null&&(e+="="+s))})}return e}function b0(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ve(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const _0=Symbol(""),gc=Symbol(""),za=Symbol(""),Ka=Symbol(""),ta=Symbol("");function Vn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function Ci(t,e,i,n,r,s=o=>o()){const o=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((c,l)=>{const O=E=>{E===!1?l(wn(4,{from:i,to:e})):E instanceof Error?l(E):r0(E)?l(wn(2,{from:e,to:E})):(o&&n.enterCallbacks[r]===o&&typeof E=="function"&&o.push(E),c())},_=s(()=>t.call(n&&n.instances[r],e,i,O));let v=Promise.resolve(_);t.length<3&&(v=v.then(O)),v.catch(E=>l(E))})}function vo(t,e,i,n,r=s=>s()){const s=[];for(const o of t)for(const c in o.components){let l=o.components[c];if(!(e!=="beforeRouteEnter"&&!o.instances[c]))if(w0(l)){const _=(l.__vccOpts||l)[e];_&&s.push(Ci(_,i,n,o,c,r))}else{let O=l();s.push(()=>O.then(_=>{if(!_)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${o.path}"`));const v=Ty(_)?_.default:_;o.components[c]=v;const b=(v.__vccOpts||v)[e];return b&&Ci(b,i,n,o,c,r)()}))}}return s}function w0(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function mc(t){const e=Oe(za),i=Oe(Ka),n=$t(()=>{const l=Be(t.to);return e.resolve(l)}),r=$t(()=>{const{matched:l}=n.value,{length:O}=l,_=l[O-1],v=i.matched;if(!_||!v.length)return-1;const E=v.findIndex(_n.bind(null,_));if(E>-1)return E;const b=vc(l[O-2]);return O>1&&vc(_)===b&&v[v.length-1].path!==b?v.findIndex(_n.bind(null,l[O-2])):E}),s=$t(()=>r.value>-1&&T0(i.params,n.value.params)),o=$t(()=>r.value>-1&&r.value===i.matched.length-1&&Yf(i.params,n.value.params));function c(l={}){return S0(l)?e[Be(t.replace)?"replace":"push"](Be(t.to)).catch(ir):Promise.resolve()}return{route:n,href:$t(()=>n.value.href),isActive:s,isExactActive:o,navigate:c}}const E0=Ue({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:mc,setup(t,{slots:e}){const i=qi(mc(t)),{options:n}=Oe(za),r=$t(()=>({[yc(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[yc(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const s=e.default&&e.default(i);return t.custom?s:Se("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},s)}}}),C0=E0;function S0(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function T0(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ve(r)||r.length!==n.length||n.some((s,o)=>s!==r[o]))return!1}return!0}function vc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const yc=(t,e,i)=>t??e??i,O0=Ue({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Oe(ta),r=$t(()=>t.route||n.value),s=Oe(gc,0),o=$t(()=>{let O=Be(s);const{matched:_}=r.value;let v;for(;(v=_[O])&&!v.components;)O++;return O}),c=$t(()=>r.value.matched[o.value]);Qn(gc,$t(()=>o.value+1)),Qn(_0,c),Qn(ta,r);const l=Yt();return le(()=>[l.value,c.value,t.name],([O,_,v],[E,b,P])=>{_&&(_.instances[v]=O,b&&b!==_&&O&&O===E&&(_.leaveGuards.size||(_.leaveGuards=b.leaveGuards),_.updateGuards.size||(_.updateGuards=b.updateGuards))),O&&_&&(!b||!_n(_,b)||!E)&&(_.enterCallbacks[v]||[]).forEach(m=>m(O))},{flush:"post"}),()=>{const O=r.value,_=t.name,v=c.value,E=v&&v.components[_];if(!E)return xc(i.default,{Component:E,route:O});const b=v.props[_],P=b?b===!0?O.params:typeof b=="function"?b(O):b:null,T=Se(E,Nt({},P,e,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(v.instances[_]=null)},ref:l}));return xc(i.default,{Component:T,route:O})||T}}});function xc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const A0=O0;function P0(t){const e=d0(t.routes,t),i=t.parseQuery||x0,n=t.stringifyQuery||pc,r=t.history,s=Vn(),o=Vn(),c=Vn(),l=In(vi);let O=vi;rn&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=go.bind(null,G=>""+G),v=go.bind(null,By),E=go.bind(null,mr);function b(G,J){let C,U;return Kf(G)?(C=e.getRecordMatcher(G),U=J):U=G,e.addRoute(U,C)}function P(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function m(){return e.getRoutes().map(G=>G.record)}function T(G){return!!e.getRecordMatcher(G)}function k(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=mo(i,G,J.path),X=e.resolve({path:F.path},J),st=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:mr(F.hash),redirectedFrom:void 0,href:st})}let C;if(G.path!=null)C=Nt({},G,{path:mo(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];C=Nt({},G,{params:v(F)}),J.params=v(J.params)}const U=e.resolve(C,J),B=G.hash||"";U.params=_(E(U.params));const tt=Uy(n,Nt({},G,{hash:Dy(B),path:U.path})),D=r.createHref(tt);return Nt({fullPath:tt,hash:B,query:n===pc?b0(G.query):G.query||{}},U,{redirectedFrom:void 0,href:D})}function M(G){return typeof G=="string"?mo(i,G,l.value.path):Nt({},G)}function y(G,J){if(O!==G)return wn(8,{from:J,to:G})}function a(G){return A(G)}function S(G){return a(Nt(M(G),{replace:!0}))}function w(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:C}=J;let U=typeof C=="function"?C(G):C;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=M(U):{path:U},U.params={}),Nt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function A(G,J){const C=O=k(G),U=l.value,B=G.state,tt=G.force,D=G.replace===!0,F=w(C);if(F)return A(Nt(M(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:tt,replace:D}),J||C);const X=C;X.redirectedFrom=J;let st;return!tt&&Wy(n,U,C)&&(st=wn(16,{to:X,from:U}),H(U,U,!0,!1)),(st?Promise.resolve(st):g(X,U)).catch(ot=>ni(ot)?ni(ot,2)?ot:it(ot):$(ot,X,U)).then(ot=>{if(ot){if(ni(ot,2))return A(Nt({replace:D},M(ot.to),{state:typeof ot.to=="object"?Nt({},B,ot.to.state):B,force:tt}),J||X)}else ot=x(X,U,!0,D,B);return h(X,U,ot),ot})}function f(G,J){const C=y(G,J);return C?Promise.reject(C):Promise.resolve()}function u(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let C;const[U,B,tt]=k0(G,J);C=vo(U.reverse(),"beforeRouteLeave",G,J);for(const F of U)F.leaveGuards.forEach(X=>{C.push(Ci(X,G,J))});const D=f.bind(null,G,J);return C.push(D),K(C).then(()=>{C=[];for(const F of s.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).then(()=>{C=vo(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{C.push(Ci(X,G,J))});return C.push(D),K(C)}).then(()=>{C=[];for(const F of tt)if(F.beforeEnter)if(Ve(F.beforeEnter))for(const X of F.beforeEnter)C.push(Ci(X,G,J));else C.push(Ci(F.beforeEnter,G,J));return C.push(D),K(C)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),C=vo(tt,"beforeRouteEnter",G,J,u),C.push(D),K(C))).then(()=>{C=[];for(const F of o.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).catch(F=>ni(F,8)?F:Promise.reject(F))}function h(G,J,C){c.list().forEach(U=>u(()=>U(G,J,C)))}function x(G,J,C,U,B){const tt=y(G,J);if(tt)return tt;const D=J===vi,F=rn?history.state:{};C&&(U||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,C,D),it()}let d;function p(){d||(d=r.listen((G,J,C)=>{if(!V.listening)return;const U=k(G),B=w(U);if(B){A(Nt(B,{replace:!0}),U).catch(ir);return}O=U;const tt=l.value;rn&&Zy(oc(tt.fullPath,C.delta),$s()),g(U,tt).catch(D=>ni(D,12)?D:ni(D,2)?(A(D.to,U).then(F=>{ni(F,20)&&!C.delta&&C.type===vr.pop&&r.go(-1,!1)}).catch(ir),Promise.reject()):(C.delta&&r.go(-C.delta,!1),$(D,U,tt))).then(D=>{D=D||x(U,tt,!1),D&&(C.delta&&!ni(D,8)?r.go(-C.delta,!1):C.type===vr.pop&&ni(D,20)&&r.go(-1,!1)),h(U,tt,D)}).catch(ir)}))}let R=Vn(),I=Vn(),j;function $(G,J,C){it(G);const U=I.list();return U.length?U.forEach(B=>B(G,J,C)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==vi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,C])=>G?C(G):J()),R.reset()),G}function H(G,J,C,U){const{scrollBehavior:B}=t;if(!rn||!B)return Promise.resolve();const tt=!C&&Jy(oc(G.fullPath,0))||(U||!C)&&history.state&&history.state.scroll||null;return Nn().then(()=>B(G,J,tt)).then(D=>D&&qy(D)).catch(D=>$(D,G,J))}const z=G=>r.go(G);let L;const N=new Set,V={currentRoute:l,listening:!0,addRoute:b,removeRoute:P,clearRoutes:e.clearRoutes,hasRoute:T,getRoutes:m,resolve:k,options:t,push:a,replace:S,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:s.add,beforeResolve:o.add,afterEach:c.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",C0),G.component("RouterView",A0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(l)}),rn&&!L&&l.value===vi&&(L=!0,a(r.location).catch(B=>{}));const C={};for(const B in vi)Object.defineProperty(C,B,{get:()=>l.value[B],enumerable:!0});G.provide(za,J),G.provide(Ka,Sa(C)),G.provide(ta,l);const U=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(O=vi,d&&d(),d=null,l.value=vi,L=!1,j=!1),U()}}};function K(G){return G.reduce((J,C)=>J.then(()=>u(C)),Promise.resolve())}return V}function k0(t,e){const i=[],n=[],r=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;o_n(O,c))?n.push(c):i.push(c));const l=t.matched[o];l&&(e.matched.find(O=>_n(O,l))||r.push(l))}return[i,n,r]}function w1(t){return Oe(Ka)}const L0=[{path:"/",component:()=>po(()=>import("./story-DT1Ep1ux.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>po(()=>import("./story-DT1Ep1ux.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>po(()=>import("./story-DT1Ep1ux.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)}],M0=P0({routes:L0,history:n0(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! + * shared v9.14.0 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */const xs=typeof window<"u",Ii=(t,e=!1)=>e?Symbol.for(t):Symbol(t),I0=(t,e,i)=>R0({l:t,k:e,s:i}),R0=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Jt=t=>typeof t=="number"&&isFinite(t),N0=t=>td(t)==="[object Date]",ki=t=>td(t)==="[object RegExp]",Xs=t=>Tt(t)&&Object.keys(t).length===0,re=Object.assign;let bc;const hi=()=>bc||(bc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function _c(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const D0=Object.prototype.hasOwnProperty;function bs(t,e){return D0.call(t,e)}const Gt=Array.isArray,Vt=t=>typeof t=="function",bt=t=>typeof t=="string",At=t=>typeof t=="boolean",Rt=t=>t!==null&&typeof t=="object",j0=t=>Rt(t)&&Vt(t.then)&&Vt(t.catch),Qf=Object.prototype.toString,td=t=>Qf.call(t),Tt=t=>{if(!Rt(t))return!1;const e=Object.getPrototypeOf(t);return e===null||e.constructor===Object},F0=t=>t==null?"":Gt(t)||Tt(t)&&t.toString===Qf?JSON.stringify(t,null,2):String(t);function B0(t,e=""){return t.reduce((i,n,r)=>r===0?i+n:i+e+n,"")}function Ys(t){let e=t;return()=>++e}function H0(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const $r=t=>!Rt(t)||Gt(t);function ts(t,e){if($r(t)||$r(e))throw new Error("Invalid value");const i=[{src:t,des:e}];for(;i.length;){const{src:n,des:r}=i.pop();Object.keys(n).forEach(s=>{$r(n[s])||$r(r[s])?r[s]=n[s]:i.push({src:n[s],des:r[s]})})}}/*! + * message-compiler v9.14.0 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */function V0(t,e,i){return{line:t,column:e,offset:i}}function _s(t,e,i){return{start:t,end:e}}const U0=/\{([0-9a-zA-Z]+)\}/g;function ed(t,...e){return e.length===1&&W0(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(U0,(i,n)=>e.hasOwnProperty(n)?e[n]:"")}const id=Object.assign,wc=t=>typeof t=="string",W0=t=>t!==null&&typeof t=="object";function nd(t,e=""){return t.reduce((i,n,r)=>r===0?i+n:i+e+n,"")}const qa={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},G0={[qa.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function $0(t,e,...i){const n=ed(G0[t],...i||[]),r={message:String(n),code:t};return e&&(r.location=e),r}const St={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},X0={[St.EXPECTED_TOKEN]:"Expected token: '{0}'",[St.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[St.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[St.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[St.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[St.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[St.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[St.EMPTY_PLACEHOLDER]:"Empty placeholder",[St.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[St.INVALID_LINKED_FORMAT]:"Invalid linked format",[St.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[St.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[St.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[St.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[St.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[St.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function jn(t,e,i={}){const{domain:n,messages:r,args:s}=i,o=ed((r||X0)[t]||"",...s||[]),c=new SyntaxError(String(o));return c.code=t,e&&(c.location=e),c.domain=n,c}function Y0(t){throw t}const ri=" ",z0="\r",he=` +`,K0="\u2028",q0="\u2029";function Z0(t){const e=t;let i=0,n=1,r=1,s=0;const o=A=>e[A]===z0&&e[A+1]===he,c=A=>e[A]===he,l=A=>e[A]===q0,O=A=>e[A]===K0,_=A=>o(A)||c(A)||l(A)||O(A),v=()=>i,E=()=>n,b=()=>r,P=()=>s,m=A=>o(A)||l(A)||O(A)?he:e[A],T=()=>m(i),k=()=>m(i+s);function M(){return s=0,_(i)&&(n++,r=0),o(i)&&i++,i++,r++,e[i]}function y(){return o(i+s)&&s++,s++,e[i+s]}function a(){i=0,n=1,r=1,s=0}function S(A=0){s=A}function w(){const A=i+s;for(;A!==i;)M();s=0}return{index:v,line:E,column:b,peekOffset:P,charAt:m,currentChar:T,currentPeek:k,next:M,peek:y,reset:a,resetPeek:S,skipToPeek:w}}const yi=void 0,J0=".",Ec="'",Q0="tokenizer";function tx(t,e={}){const i=e.location!==!1,n=Z0(t),r=()=>n.index(),s=()=>V0(n.line(),n.column(),n.index()),o=s(),c=r(),l={currentType:14,offset:c,startLoc:o,endLoc:o,lastType:14,lastOffset:c,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},O=()=>l,{onError:_}=e;function v(q,Y,Z,...W){const Q=O();if(Y.column+=Z,Y.offset+=Z,_){const rt=i?_s(Q.startLoc,Y):null,nt=jn(q,rt,{domain:Q0,args:W});_(nt)}}function E(q,Y,Z){q.endLoc=s(),q.currentType=Y;const W={type:Y};return i&&(W.loc=_s(q.startLoc,q.endLoc)),Z!=null&&(W.value=Z),W}const b=q=>E(q,14);function P(q,Y){return q.currentChar()===Y?(q.next(),Y):(v(St.EXPECTED_TOKEN,s(),0,Y),"")}function m(q){let Y="";for(;q.currentPeek()===ri||q.currentPeek()===he;)Y+=q.currentPeek(),q.peek();return Y}function T(q){const Y=m(q);return q.skipToPeek(),Y}function k(q){if(q===yi)return!1;const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function M(q){if(q===yi)return!1;const Y=q.charCodeAt(0);return Y>=48&&Y<=57}function y(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=k(q.currentPeek());return q.resetPeek(),W}function a(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=q.currentPeek()==="-"?q.peek():q.currentPeek(),Q=M(W);return q.resetPeek(),Q}function S(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=q.currentPeek()===Ec;return q.resetPeek(),W}function w(q,Y){const{currentType:Z}=Y;if(Z!==8)return!1;m(q);const W=q.currentPeek()===".";return q.resetPeek(),W}function A(q,Y){const{currentType:Z}=Y;if(Z!==9)return!1;m(q);const W=k(q.currentPeek());return q.resetPeek(),W}function f(q,Y){const{currentType:Z}=Y;if(!(Z===8||Z===12))return!1;m(q);const W=q.currentPeek()===":";return q.resetPeek(),W}function u(q,Y){const{currentType:Z}=Y;if(Z!==10)return!1;const W=()=>{const rt=q.currentPeek();return rt==="{"?k(q.peek()):rt==="@"||rt==="%"||rt==="|"||rt===":"||rt==="."||rt===ri||!rt?!1:rt===he?(q.peek(),W()):x(q,!1)},Q=W();return q.resetPeek(),Q}function g(q){m(q);const Y=q.currentPeek()==="|";return q.resetPeek(),Y}function h(q){const Y=m(q),Z=q.currentPeek()==="%"&&q.peek()==="{";return q.resetPeek(),{isModulo:Z,hasSpace:Y.length>0}}function x(q,Y=!0){const Z=(Q=!1,rt="",nt=!1)=>{const at=q.currentPeek();return at==="{"?rt==="%"?!1:Q:at==="@"||!at?rt==="%"?!0:Q:at==="%"?(q.peek(),Z(Q,"%",!0)):at==="|"?rt==="%"||nt?!0:!(rt===ri||rt===he):at===ri?(q.peek(),Z(!0,ri,nt)):at===he?(q.peek(),Z(!0,he,nt)):!0},W=Z();return Y&&q.resetPeek(),W}function d(q,Y){const Z=q.currentChar();return Z===yi?yi:Y(Z)?(q.next(),Z):null}function p(q){const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function R(q){return d(q,p)}function I(q){const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function j(q){return d(q,I)}function $(q){const Y=q.charCodeAt(0);return Y>=48&&Y<=57}function et(q){return d(q,$)}function it(q){const Y=q.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function H(q){return d(q,it)}function z(q){let Y="",Z="";for(;Y=et(q);)Z+=Y;return Z}function L(q){T(q);const Y=q.currentChar();return Y!=="%"&&v(St.EXPECTED_TOKEN,s(),0,Y),q.next(),"%"}function N(q){let Y="";for(;;){const Z=q.currentChar();if(Z==="{"||Z==="}"||Z==="@"||Z==="|"||!Z)break;if(Z==="%")if(x(q))Y+=Z,q.next();else break;else if(Z===ri||Z===he)if(x(q))Y+=Z,q.next();else{if(g(q))break;Y+=Z,q.next()}else Y+=Z,q.next()}return Y}function V(q){T(q);let Y="",Z="";for(;Y=j(q);)Z+=Y;return q.currentChar()===yi&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z}function K(q){T(q);let Y="";return q.currentChar()==="-"?(q.next(),Y+=`-${z(q)}`):Y+=z(q),q.currentChar()===yi&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Y}function G(q){return q!==Ec&&q!==he}function J(q){T(q),P(q,"'");let Y="",Z="";for(;Y=d(q,G);)Y==="\\"?Z+=C(q):Z+=Y;const W=q.currentChar();return W===he||W===yi?(v(St.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),W===he&&(q.next(),P(q,"'")),Z):(P(q,"'"),Z)}function C(q){const Y=q.currentChar();switch(Y){case"\\":case"'":return q.next(),`\\${Y}`;case"u":return U(q,Y,4);case"U":return U(q,Y,6);default:return v(St.UNKNOWN_ESCAPE_SEQUENCE,s(),0,Y),""}}function U(q,Y,Z){P(q,Y);let W="";for(let Q=0;Q{const W=q.currentChar();return W==="{"||W==="%"||W==="@"||W==="|"||W==="("||W===")"||!W||W===ri?Z:(Z+=W,q.next(),Y(Z))};return Y("")}function X(q){T(q);const Y=P(q,"|");return T(q),Y}function st(q,Y){let Z=null;switch(q.currentChar()){case"{":return Y.braceNest>=1&&v(St.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),q.next(),Z=E(Y,2,"{"),T(q),Y.braceNest++,Z;case"}":return Y.braceNest>0&&Y.currentType===2&&v(St.EMPTY_PLACEHOLDER,s(),0),q.next(),Z=E(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&T(q),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),Z;case"@":return Y.braceNest>0&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z=ot(q,Y)||b(Y),Y.braceNest=0,Z;default:{let Q=!0,rt=!0,nt=!0;if(g(q))return Y.braceNest>0&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,Z;if(Y.braceNest>0&&(Y.currentType===5||Y.currentType===6||Y.currentType===7))return v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Y.braceNest=0,lt(q,Y);if(Q=y(q,Y))return Z=E(Y,5,V(q)),T(q),Z;if(rt=a(q,Y))return Z=E(Y,6,K(q)),T(q),Z;if(nt=S(q,Y))return Z=E(Y,7,J(q)),T(q),Z;if(!Q&&!rt&&!nt)return Z=E(Y,13,tt(q)),v(St.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,Z.value),T(q),Z;break}}return Z}function ot(q,Y){const{currentType:Z}=Y;let W=null;const Q=q.currentChar();switch((Z===8||Z===9||Z===12||Z===10)&&(Q===he||Q===ri)&&v(St.INVALID_LINKED_FORMAT,s(),0),Q){case"@":return q.next(),W=E(Y,8,"@"),Y.inLinked=!0,W;case".":return T(q),q.next(),E(Y,9,".");case":":return T(q),q.next(),E(Y,10,":");default:return g(q)?(W=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,W):w(q,Y)||f(q,Y)?(T(q),ot(q,Y)):A(q,Y)?(T(q),E(Y,12,D(q))):u(q,Y)?(T(q),Q==="{"?st(q,Y)||W:E(Y,11,F(q))):(Z===8&&v(St.INVALID_LINKED_FORMAT,s(),0),Y.braceNest=0,Y.inLinked=!1,lt(q,Y))}}function lt(q,Y){let Z={type:14};if(Y.braceNest>0)return st(q,Y)||b(Y);if(Y.inLinked)return ot(q,Y)||b(Y);switch(q.currentChar()){case"{":return st(q,Y)||b(Y);case"}":return v(St.UNBALANCED_CLOSING_BRACE,s(),0),q.next(),E(Y,3,"}");case"@":return ot(q,Y)||b(Y);default:{if(g(q))return Z=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,Z;const{isModulo:Q,hasSpace:rt}=h(q);if(Q)return rt?E(Y,0,N(q)):E(Y,4,L(q));if(x(q))return E(Y,0,N(q));break}}return Z}function ct(){const{currentType:q,offset:Y,startLoc:Z,endLoc:W}=l;return l.lastType=q,l.lastOffset=Y,l.lastStartLoc=Z,l.lastEndLoc=W,l.offset=r(),l.startLoc=s(),n.currentChar()===yi?E(l,14):lt(n,l)}return{nextToken:ct,currentOffset:r,currentPosition:s,context:O}}const ex="parser",ix=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function nx(t,e,i){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const n=parseInt(e||i,16);return n<=55295||n>=57344?String.fromCodePoint(n):"�"}}}function rx(t={}){const e=t.location!==!1,{onError:i,onWarn:n}=t;function r(y,a,S,w,...A){const f=y.currentPosition();if(f.offset+=w,f.column+=w,i){const u=e?_s(S,f):null,g=jn(a,u,{domain:ex,args:A});i(g)}}function s(y,a,S,w,...A){const f=y.currentPosition();if(f.offset+=w,f.column+=w,n){const u=e?_s(S,f):null;n($0(a,u,A))}}function o(y,a,S){const w={type:y};return e&&(w.start=a,w.end=a,w.loc={start:S,end:S}),w}function c(y,a,S,w){e&&(y.end=a,y.loc&&(y.loc.end=S))}function l(y,a){const S=y.context(),w=o(3,S.offset,S.startLoc);return w.value=a,c(w,y.currentOffset(),y.currentPosition()),w}function O(y,a){const S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(5,w,A);return f.index=parseInt(a,10),y.nextToken(),c(f,y.currentOffset(),y.currentPosition()),f}function _(y,a,S){const w=y.context(),{lastOffset:A,lastStartLoc:f}=w,u=o(4,A,f);return u.key=a,S===!0&&(u.modulo=!0),y.nextToken(),c(u,y.currentOffset(),y.currentPosition()),u}function v(y,a){const S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(9,w,A);return f.value=a.replace(ix,nx),y.nextToken(),c(f,y.currentOffset(),y.currentPosition()),f}function E(y){const a=y.nextToken(),S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(8,w,A);return a.type!==12?(r(y,St.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.lastStartLoc,0),f.value="",c(f,w,A),{nextConsumeToken:a,node:f}):(a.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Re(a)),f.value=a.value||"",c(f,y.currentOffset(),y.currentPosition()),{node:f})}function b(y,a){const S=y.context(),w=o(7,S.offset,S.startLoc);return w.value=a,c(w,y.currentOffset(),y.currentPosition()),w}function P(y){const a=y.context(),S=o(6,a.offset,a.startLoc);let w=y.nextToken();if(w.type===9){const A=E(y);S.modifier=A.node,w=A.nextConsumeToken||y.nextToken()}switch(w.type!==10&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),w=y.nextToken(),w.type===2&&(w=y.nextToken()),w.type){case 11:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=b(y,w.value||"");break;case 5:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=_(y,w.value||"");break;case 6:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=O(y,w.value||"");break;case 7:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=v(y,w.value||"");break;default:{r(y,St.UNEXPECTED_EMPTY_LINKED_KEY,a.lastStartLoc,0);const A=y.context(),f=o(7,A.offset,A.startLoc);return f.value="",c(f,A.offset,A.startLoc),S.key=f,c(S,A.offset,A.startLoc),{nextConsumeToken:w,node:S}}}return c(S,y.currentOffset(),y.currentPosition()),{node:S}}function m(y){const a=y.context(),S=a.currentType===1?y.currentOffset():a.offset,w=a.currentType===1?a.endLoc:a.startLoc,A=o(2,S,w);A.items=[];let f=null,u=null;do{const x=f||y.nextToken();switch(f=null,x.type){case 0:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(l(y,x.value||""));break;case 6:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(O(y,x.value||""));break;case 4:u=!0;break;case 5:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(_(y,x.value||"",!!u)),u&&(s(y,qa.USE_MODULO_SYNTAX,a.lastStartLoc,0,Re(x)),u=null);break;case 7:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(v(y,x.value||""));break;case 8:{const d=P(y);A.items.push(d.node),f=d.nextConsumeToken||null;break}}}while(a.currentType!==14&&a.currentType!==1);const g=a.currentType===1?a.lastOffset:y.currentOffset(),h=a.currentType===1?a.lastEndLoc:y.currentPosition();return c(A,g,h),A}function T(y,a,S,w){const A=y.context();let f=w.items.length===0;const u=o(1,a,S);u.cases=[],u.cases.push(w);do{const g=m(y);f||(f=g.items.length===0),u.cases.push(g)}while(A.currentType!==14);return f&&r(y,St.MUST_HAVE_MESSAGES_IN_PLURAL,S,0),c(u,y.currentOffset(),y.currentPosition()),u}function k(y){const a=y.context(),{offset:S,startLoc:w}=a,A=m(y);return a.currentType===14?A:T(y,S,w,A)}function M(y){const a=tx(y,id({},t)),S=a.context(),w=o(0,S.offset,S.startLoc);return e&&w.loc&&(w.loc.source=y),w.body=k(a),t.onCacheKey&&(w.cacheKey=t.onCacheKey(y)),S.currentType!==14&&r(a,St.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,y[S.offset]||""),c(w,a.currentOffset(),a.currentPosition()),w}return{parse:M}}function Re(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function sx(t,e={}){const i={ast:t,helpers:new Set};return{context:()=>i,helper:s=>(i.helpers.add(s),s)}}function Cc(t,e){for(let i=0;iSc(i)),t}function Sc(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let i=0;ic;function O(T,k){c.code+=T}function _(T,k=!0){const M=k?r:"";O(s?M+" ".repeat(T):M)}function v(T=!0){const k=++c.indentLevel;T&&_(k)}function E(T=!0){const k=--c.indentLevel;T&&_(k)}function b(){_(c.indentLevel)}return{context:l,push:O,indent:v,deindent:E,newline:b,helper:T=>`_${T}`,needIndent:()=>c.needIndent}}function hx(t,e){const{helper:i}=t;t.push(`${i("linked")}(`),En(t,e.key),e.modifier?(t.push(", "),En(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function fx(t,e){const{helper:i,needIndent:n}=t;t.push(`${i("normalize")}([`),t.indent(n());const r=e.items.length;for(let s=0;s1){t.push(`${i("plural")}([`),t.indent(n());const r=e.cases.length;for(let s=0;s{const i=wc(e.mode)?e.mode:"normal",n=wc(e.filename)?e.filename:"message.intl",r=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:i==="arrow"?";":` +`,o=e.needIndent?e.needIndent:i!=="arrow",c=t.helpers||[],l=ux(t,{mode:i,filename:n,sourceMap:r,breakLineCode:s,needIndent:o});l.push(i==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),c.length>0&&(l.push(`const { ${nd(c.map(v=>`${v}: _${v}`),", ")} } = ctx`),l.newline()),l.push("return "),En(l,t),l.deindent(o),l.push("}"),delete t.helpers;const{code:O,map:_}=l.context();return{ast:t,code:O,map:_?_.toJSON():void 0}};function mx(t,e={}){const i=id({},e),n=!!i.jit,r=!!i.minify,s=i.optimize==null?!0:i.optimize,c=rx(i).parse(t);return n?(s&&ax(c),r&&sn(c),{ast:c,code:""}):(ox(c,i),gx(c,i))}/*! + * core-base v9.14.0 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */function vx(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hi().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hi().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const Ri=[];Ri[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ri[1]={w:[1],".":[2],"[":[4],o:[7]};Ri[2]={w:[2],i:[3,0],0:[3,0]};Ri[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ri[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ri[5]={"'":[4,0],o:8,l:[5,0]};Ri[6]={'"':[4,0],o:8,l:[6,0]};const yx=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function xx(t){return yx.test(t)}function bx(t){const e=t.charCodeAt(0),i=t.charCodeAt(t.length-1);return e===i&&(e===34||e===39)?t.slice(1,-1):t}function _x(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function wx(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:xx(e)?bx(e):"*"+e}function Ex(t){const e=[];let i=-1,n=0,r=0,s,o,c,l,O,_,v;const E=[];E[0]=()=>{o===void 0?o=c:o+=c},E[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},E[2]=()=>{E[0](),r++},E[3]=()=>{if(r>0)r--,n=4,E[0]();else{if(r=0,o===void 0||(o=wx(o),o===!1))return!1;E[1]()}};function b(){const P=t[i+1];if(n===5&&P==="'"||n===6&&P==='"')return i++,c="\\"+P,E[0](),!0}for(;n!==null;)if(i++,s=t[i],!(s==="\\"&&b())){if(l=_x(s),v=Ri[n],O=v[l]||v.l||8,O===8||(n=O[0],O[1]!==void 0&&(_=E[O[1]],_&&(c=s,_()===!1))))return;if(n===7)return e}}const Tc=new Map;function Cx(t,e){return Rt(t)?t[e]:null}function Sx(t,e){if(!Rt(t))return null;let i=Tc.get(e);if(i||(i=Ex(e),i&&Tc.set(e,i)),!i)return null;const n=i.length;let r=t,s=0;for(;st,Ox=t=>"",Ax="text",Px=t=>t.length===0?"":B0(t),kx=F0;function Oc(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function Lx(t){const e=Jt(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Jt(t.named.count)||Jt(t.named.n))?Jt(t.named.count)?t.named.count:Jt(t.named.n)?t.named.n:e:e}function Mx(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Ix(t={}){const e=t.locale,i=Lx(t),n=Rt(t.pluralRules)&&bt(e)&&Vt(t.pluralRules[e])?t.pluralRules[e]:Oc,r=Rt(t.pluralRules)&&bt(e)&&Vt(t.pluralRules[e])?Oc:void 0,s=k=>k[n(i,k.length,r)],o=t.list||[],c=k=>o[k],l=t.named||{};Jt(t.pluralIndex)&&Mx(i,l);const O=k=>l[k];function _(k){const M=Vt(t.messages)?t.messages(k):Rt(t.messages)?t.messages[k]:!1;return M||(t.parent?t.parent.message(k):Ox)}const v=k=>t.modifiers?t.modifiers[k]:Tx,E=Tt(t.processor)&&Vt(t.processor.normalize)?t.processor.normalize:Px,b=Tt(t.processor)&&Vt(t.processor.interpolate)?t.processor.interpolate:kx,P=Tt(t.processor)&&bt(t.processor.type)?t.processor.type:Ax,T={list:c,named:O,plural:s,linked:(k,...M)=>{const[y,a]=M;let S="text",w="";M.length===1?Rt(y)?(w=y.modifier||w,S=y.type||S):bt(y)&&(w=y||w):M.length===2&&(bt(y)&&(w=y||w),bt(a)&&(S=a||S));const A=_(k)(T),f=S==="vnode"&&Gt(A)&&w?A[0]:A;return w?v(w)(f,S):f},message:_,type:P,interpolate:b,normalize:E,values:re({},o,l)};return T}let yr=null;function Rx(t){yr=t}function Nx(t,e,i){yr&&yr.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:i})}const Dx=jx("function:translate");function jx(t){return e=>yr&&yr.emit(t,e)}const rd=qa.__EXTEND_POINT__,Fi=Ys(rd),Fx={NOT_FOUND_KEY:rd,FALLBACK_TO_TRANSLATE:Fi(),CANNOT_FORMAT_NUMBER:Fi(),FALLBACK_TO_NUMBER_FORMAT:Fi(),CANNOT_FORMAT_DATE:Fi(),FALLBACK_TO_DATE_FORMAT:Fi(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:Fi(),__EXTEND_POINT__:Fi()},sd=St.__EXTEND_POINT__,Bi=Ys(sd),De={INVALID_ARGUMENT:sd,INVALID_DATE_ARGUMENT:Bi(),INVALID_ISO_DATE_ARGUMENT:Bi(),NOT_SUPPORT_NON_STRING_MESSAGE:Bi(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Bi(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Bi(),NOT_SUPPORT_LOCALE_TYPE:Bi(),__EXTEND_POINT__:Bi()};function Ke(t){return jn(t,null,void 0)}function Ja(t,e){return e.locale!=null?Ac(e.locale):Ac(t.locale)}let yo;function Ac(t){if(bt(t))return t;if(Vt(t)){if(t.resolvedOnce&&yo!=null)return yo;if(t.constructor.name==="Function"){const e=t();if(j0(e))throw Ke(De.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return yo=e}else throw Ke(De.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ke(De.NOT_SUPPORT_LOCALE_TYPE)}function Bx(t,e,i){return[...new Set([i,...Gt(e)?e:Rt(e)?Object.keys(e):bt(e)?[e]:[i]])]}function od(t,e,i){const n=bt(i)?i:Cn,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(n);if(!s){s=[];let o=[i];for(;Gt(o);)o=Pc(s,o,e);const c=Gt(e)||!Tt(e)?e:e.default?e.default:null;o=bt(c)?[c]:c,Gt(o)&&Pc(s,o,!1),r.__localeChainCache.set(n,s)}return s}function Pc(t,e,i){let n=!0;for(let r=0;r`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Wx(){return{upper:(t,e)=>e==="text"&&bt(t)?t.toUpperCase():e==="vnode"&&Rt(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&bt(t)?t.toLowerCase():e==="vnode"&&Rt(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&bt(t)?Lc(t):e==="vnode"&&Rt(t)&&"__v_isVNode"in t?Lc(t.children):t}}let ad;function Mc(t){ad=t}let ld;function Gx(t){ld=t}let cd;function $x(t){cd=t}let ud=null;const Xx=t=>{ud=t},Yx=()=>ud;let hd=null;const Ic=t=>{hd=t},zx=()=>hd;let Rc=0;function Kx(t={}){const e=Vt(t.onWarn)?t.onWarn:H0,i=bt(t.version)?t.version:Ux,n=bt(t.locale)||Vt(t.locale)?t.locale:Cn,r=Vt(n)?Cn:n,s=Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||bt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,o=Tt(t.messages)?t.messages:{[r]:{}},c=Tt(t.datetimeFormats)?t.datetimeFormats:{[r]:{}},l=Tt(t.numberFormats)?t.numberFormats:{[r]:{}},O=re({},t.modifiers||{},Wx()),_=t.pluralRules||{},v=Vt(t.missing)?t.missing:null,E=At(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,b=At(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,P=!!t.fallbackFormat,m=!!t.unresolving,T=Vt(t.postTranslation)?t.postTranslation:null,k=Tt(t.processor)?t.processor:null,M=At(t.warnHtmlMessage)?t.warnHtmlMessage:!0,y=!!t.escapeParameter,a=Vt(t.messageCompiler)?t.messageCompiler:ad,S=Vt(t.messageResolver)?t.messageResolver:ld||Cx,w=Vt(t.localeFallbacker)?t.localeFallbacker:cd||Bx,A=Rt(t.fallbackContext)?t.fallbackContext:void 0,f=t,u=Rt(f.__datetimeFormatters)?f.__datetimeFormatters:new Map,g=Rt(f.__numberFormatters)?f.__numberFormatters:new Map,h=Rt(f.__meta)?f.__meta:{};Rc++;const x={version:i,cid:Rc,locale:n,fallbackLocale:s,messages:o,modifiers:O,pluralRules:_,missing:v,missingWarn:E,fallbackWarn:b,fallbackFormat:P,unresolving:m,postTranslation:T,processor:k,warnHtmlMessage:M,escapeParameter:y,messageCompiler:a,messageResolver:S,localeFallbacker:w,fallbackContext:A,onWarn:e,__meta:h};return x.datetimeFormats=c,x.numberFormats=l,x.__datetimeFormatters=u,x.__numberFormatters=g,__INTLIFY_PROD_DEVTOOLS__&&Nx(x,i,h),x}function Qa(t,e,i,n,r){const{missing:s,onWarn:o}=t;if(s!==null){const c=s(t,i,e,r);return bt(c)?c:e}else return e}function Un(t,e,i){const n=t;n.__localeChainCache=new Map,t.localeFallbacker(t,i,e)}function qx(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Zx(t,e){const i=e.indexOf(t);if(i===-1)return!1;for(let n=i+1;nJx(i,t)}function Jx(t,e){const i=e.b||e.body;if((i.t||i.type)===1){const n=i,r=n.c||n.cases;return t.plural(r.reduce((s,o)=>[...s,Nc(t,o)],[]))}else return Nc(t,i)}function Nc(t,e){const i=e.s||e.static;if(i)return t.type==="text"?i:t.normalize([i]);{const n=(e.i||e.items).reduce((r,s)=>[...r,ea(t,s)],[]);return t.normalize(n)}}function ea(t,e){const i=e.t||e.type;switch(i){case 3:{const n=e;return n.v||n.value}case 9:{const n=e;return n.v||n.value}case 4:{const n=e;return t.interpolate(t.named(n.k||n.key))}case 5:{const n=e;return t.interpolate(t.list(n.i!=null?n.i:n.index))}case 6:{const n=e,r=n.m||n.modifier;return t.linked(ea(t,n.k||n.key),r?ea(t,r):void 0,t.type)}case 7:{const n=e;return n.v||n.value}case 8:{const n=e;return n.v||n.value}default:throw new Error(`unhandled node type on format message part: ${i}`)}}const fd=t=>t;let an=Object.create(null);const Sn=t=>Rt(t)&&(t.t===0||t.type===0)&&("b"in t||"body"in t);function dd(t,e={}){let i=!1;const n=e.onError||Y0;return e.onError=r=>{i=!0,n(r)},{...mx(t,e),detectError:i}}const Qx=(t,e)=>{if(!bt(t))throw Ke(De.NOT_SUPPORT_NON_STRING_MESSAGE);{At(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||fd)(t),r=an[n];if(r)return r;const{code:s,detectError:o}=dd(t,e),c=new Function(`return ${s}`)();return o?c:an[n]=c}};function tb(t,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&bt(t)){At(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||fd)(t),r=an[n];if(r)return r;const{ast:s,detectError:o}=dd(t,{...e,location:!1,jit:!0}),c=xo(s);return o?c:an[n]=c}else{const i=t.cacheKey;if(i){const n=an[i];return n||(an[i]=xo(t))}else return xo(t)}}const Dc=()=>"",Ce=t=>Vt(t);function jc(t,...e){const{fallbackFormat:i,postTranslation:n,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:c}=t,[l,O]=ia(...e),_=At(O.missingWarn)?O.missingWarn:t.missingWarn,v=At(O.fallbackWarn)?O.fallbackWarn:t.fallbackWarn,E=At(O.escapeParameter)?O.escapeParameter:t.escapeParameter,b=!!O.resolvedMessage,P=bt(O.default)||At(O.default)?At(O.default)?s?l:()=>l:O.default:i?s?l:()=>l:"",m=i||P!=="",T=Ja(t,O);E&&eb(O);let[k,M,y]=b?[l,T,c[T]||{}]:pd(t,l,T,o,v,_),a=k,S=l;if(!b&&!(bt(a)||Sn(a)||Ce(a))&&m&&(a=P,S=a),!b&&(!(bt(a)||Sn(a)||Ce(a))||!bt(M)))return r?zs:l;let w=!1;const A=()=>{w=!0},f=Ce(a)?a:gd(t,l,M,a,S,A);if(w)return a;const u=rb(t,M,y,O),g=Ix(u),h=ib(t,f,g),x=n?n(h,l):h;if(__INTLIFY_PROD_DEVTOOLS__){const d={timestamp:Date.now(),key:bt(l)?l:Ce(a)?a.key:"",locale:M||(Ce(a)?a.locale:""),format:bt(a)?a:Ce(a)?a.source:"",message:x};d.meta=re({},t.__meta,Yx()||{}),Dx(d)}return x}function eb(t){Gt(t.list)?t.list=t.list.map(e=>bt(e)?_c(e):e):Rt(t.named)&&Object.keys(t.named).forEach(e=>{bt(t.named[e])&&(t.named[e]=_c(t.named[e]))})}function pd(t,e,i,n,r,s){const{messages:o,onWarn:c,messageResolver:l,localeFallbacker:O}=t,_=O(t,n,i);let v={},E,b=null;const P="translate";for(let m=0;m<_.length&&(E=_[m],v=o[E]||{},(b=l(v,e))===null&&(b=v[e]),!(bt(b)||Sn(b)||Ce(b)));m++)if(!Zx(E,_)){const T=Qa(t,e,E,s,P);T!==e&&(b=T)}return[b,E,v]}function gd(t,e,i,n,r,s){const{messageCompiler:o,warnHtmlMessage:c}=t;if(Ce(n)){const O=n;return O.locale=O.locale||i,O.key=O.key||e,O}if(o==null){const O=()=>n;return O.locale=i,O.key=e,O}const l=o(n,nb(t,i,r,n,c,s));return l.locale=i,l.key=e,l.source=n,l}function ib(t,e,i){return e(i)}function ia(...t){const[e,i,n]=t,r={};if(!bt(e)&&!Jt(e)&&!Ce(e)&&!Sn(e))throw Ke(De.INVALID_ARGUMENT);const s=Jt(e)?String(e):(Ce(e),e);return Jt(i)?r.plural=i:bt(i)?r.default=i:Tt(i)&&!Xs(i)?r.named=i:Gt(i)&&(r.list=i),Jt(n)?r.plural=n:bt(n)?r.default=n:Tt(n)&&re(r,n),[s,r]}function nb(t,e,i,n,r,s){return{locale:e,key:i,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>I0(e,i,o)}}function rb(t,e,i,n){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:c,fallbackWarn:l,missingWarn:O,fallbackContext:_}=t,E={locale:e,modifiers:r,pluralRules:s,messages:b=>{let P=o(i,b);if(P==null&&_){const[,,m]=pd(_,b,e,c,l,O);P=o(m,b)}if(bt(P)||Sn(P)){let m=!1;const k=gd(t,b,e,P,b,()=>{m=!0});return m?Dc:k}else return Ce(P)?P:Dc}};return t.processor&&(E.processor=t.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),Jt(n.plural)&&(E.pluralIndex=n.plural),E}function Fc(t,...e){const{datetimeFormats:i,unresolving:n,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__datetimeFormatters:c}=t,[l,O,_,v]=na(...e),E=At(_.missingWarn)?_.missingWarn:t.missingWarn;At(_.fallbackWarn)?_.fallbackWarn:t.fallbackWarn;const b=!!_.part,P=Ja(t,_),m=o(t,r,P);if(!bt(l)||l==="")return new Intl.DateTimeFormat(P,v).format(O);let T={},k,M=null;const y="datetime format";for(let w=0;w{md.includes(l)?o[l]=i[l]:s[l]=i[l]}),bt(n)?s.locale=n:Tt(n)&&(o=n),Tt(r)&&(o=r),[s.key||"",c,s,o]}function Bc(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__datetimeFormatters.has(s)&&n.__datetimeFormatters.delete(s)}}function Hc(t,...e){const{numberFormats:i,unresolving:n,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:c}=t,[l,O,_,v]=ra(...e),E=At(_.missingWarn)?_.missingWarn:t.missingWarn;At(_.fallbackWarn)?_.fallbackWarn:t.fallbackWarn;const b=!!_.part,P=Ja(t,_),m=o(t,r,P);if(!bt(l)||l==="")return new Intl.NumberFormat(P,v).format(O);let T={},k,M=null;const y="number format";for(let w=0;w{vd.includes(l)?o[l]=i[l]:s[l]=i[l]}),bt(n)?s.locale=n:Tt(n)&&(o=n),Tt(r)&&(o=r),[s.key||"",c,s,o]}function Vc(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__numberFormatters.has(s)&&n.__numberFormatters.delete(s)}}vx();/*! + * vue-i18n v9.14.0 + * (c) 2024 kazuya kawaguchi + * Released under the MIT License. + */const sb="9.14.0";function ob(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(hi().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(hi().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hi().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hi().__INTLIFY_PROD_DEVTOOLS__=!1)}const yd=Fx.__EXTEND_POINT__,si=Ys(yd);si(),si(),si(),si(),si(),si(),si(),si(),si();const xd=De.__EXTEND_POINT__,ge=Ys(xd),te={UNEXPECTED_RETURN_TYPE:xd,INVALID_ARGUMENT:ge(),MUST_BE_CALL_SETUP_TOP:ge(),NOT_INSTALLED:ge(),NOT_AVAILABLE_IN_LEGACY_MODE:ge(),REQUIRED_VALUE:ge(),INVALID_VALUE:ge(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:ge(),NOT_INSTALLED_WITH_PROVIDE:ge(),UNEXPECTED_ERROR:ge(),NOT_COMPATIBLE_LEGACY_VUE_I18N:ge(),BRIDGE_SUPPORT_VUE_2_ONLY:ge(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:ge(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:ge(),__EXTEND_POINT__:ge()};function ee(t,...e){return jn(t,null,void 0)}const sa=Ii("__translateVNode"),oa=Ii("__datetimeParts"),aa=Ii("__numberParts"),bd=Ii("__setPluralRules"),_d=Ii("__injectWithOption"),la=Ii("__dispose");function xr(t){if(!Rt(t))return t;for(const e in t)if(bs(t,e))if(!e.includes("."))Rt(t[e])&&xr(t[e]);else{const i=e.split("."),n=i.length-1;let r=t,s=!1;for(let o=0;o{if("locale"in c&&"resource"in c){const{locale:l,resource:O}=c;l?(o[l]=o[l]||{},ts(O,o[l])):ts(O,o)}else bt(c)&&ts(JSON.parse(c),o)}),r==null&&s)for(const c in o)bs(o,c)&&xr(o[c]);return o}function wd(t){return t.type}function Ed(t,e,i){let n=Rt(e.messages)?e.messages:{};"__i18nGlobal"in i&&(n=Ks(t.locale.value,{messages:n,__i18n:i.__i18nGlobal}));const r=Object.keys(n);r.length&&r.forEach(s=>{t.mergeLocaleMessage(s,n[s])});{if(Rt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Rt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function Uc(t){return Ft(fi,null,t,0)}const Wc="__INTLIFY_META__",Gc=()=>[],ab=()=>!1;let $c=0;function Xc(t){return(e,i,n,r)=>t(i,n,ie()||void 0,r)}const lb=()=>{const t=ie();let e=null;return t&&(e=wd(t)[Wc])?{[Wc]:e}:null};function tl(t={},e){const{__root:i,__injectWithOption:n}=t,r=i===void 0,s=t.flatJson,o=xs?Yt:In,c=!!t.translateExistCompatible;let l=At(t.inheritLocale)?t.inheritLocale:!0;const O=o(i&&l?i.locale.value:bt(t.locale)?t.locale:Cn),_=o(i&&l?i.fallbackLocale.value:bt(t.fallbackLocale)||Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:O.value),v=o(Ks(O.value,t)),E=o(Tt(t.datetimeFormats)?t.datetimeFormats:{[O.value]:{}}),b=o(Tt(t.numberFormats)?t.numberFormats:{[O.value]:{}});let P=i?i.missingWarn:At(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,m=i?i.fallbackWarn:At(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,T=i?i.fallbackRoot:At(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,M=Vt(t.missing)?t.missing:null,y=Vt(t.missing)?Xc(t.missing):null,a=Vt(t.postTranslation)?t.postTranslation:null,S=i?i.warnHtmlMessage:At(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const A=i?i.modifiers:Tt(t.modifiers)?t.modifiers:{};let f=t.pluralRules||i&&i.pluralRules,u;u=(()=>{r&&Ic(null);const nt={version:sb,locale:O.value,fallbackLocale:_.value,messages:v.value,modifiers:A,pluralRules:f,missing:y===null?void 0:y,missingWarn:P,fallbackWarn:m,fallbackFormat:k,unresolving:!0,postTranslation:a===null?void 0:a,warnHtmlMessage:S,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};nt.datetimeFormats=E.value,nt.numberFormats=b.value,nt.__datetimeFormatters=Tt(u)?u.__datetimeFormatters:void 0,nt.__numberFormatters=Tt(u)?u.__numberFormatters:void 0;const at=Kx(nt);return r&&Ic(at),at})(),Un(u,O.value,_.value);function h(){return[O.value,_.value,v.value,E.value,b.value]}const x=$t({get:()=>O.value,set:nt=>{O.value=nt,u.locale=O.value}}),d=$t({get:()=>_.value,set:nt=>{_.value=nt,u.fallbackLocale=_.value,Un(u,O.value,nt)}}),p=$t(()=>v.value),R=$t(()=>E.value),I=$t(()=>b.value);function j(){return Vt(a)?a:null}function $(nt){a=nt,u.postTranslation=nt}function et(){return M}function it(nt){nt!==null&&(y=Xc(nt)),M=nt,u.missing=y}const H=(nt,at,ut,ft,gt,xt)=>{h();let vt;try{__INTLIFY_PROD_DEVTOOLS__,r||(u.fallbackContext=i?zx():void 0),vt=nt(u)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(u.fallbackContext=void 0)}if(ut!=="translate exists"&&Jt(vt)&&vt===zs||ut==="translate exists"&&!vt){const[dt,ht]=at();return i&&T?ft(i):gt(dt)}else{if(xt(vt))return vt;throw ee(te.UNEXPECTED_RETURN_TYPE)}};function z(...nt){return H(at=>Reflect.apply(jc,null,[at,...nt]),()=>ia(...nt),"translate",at=>Reflect.apply(at.t,at,[...nt]),at=>at,at=>bt(at))}function L(...nt){const[at,ut,ft]=nt;if(ft&&!Rt(ft))throw ee(te.INVALID_ARGUMENT);return z(at,ut,re({resolvedMessage:!0},ft||{}))}function N(...nt){return H(at=>Reflect.apply(Fc,null,[at,...nt]),()=>na(...nt),"datetime format",at=>Reflect.apply(at.d,at,[...nt]),()=>kc,at=>bt(at))}function V(...nt){return H(at=>Reflect.apply(Hc,null,[at,...nt]),()=>ra(...nt),"number format",at=>Reflect.apply(at.n,at,[...nt]),()=>kc,at=>bt(at))}function K(nt){return nt.map(at=>bt(at)||Jt(at)||At(at)?Uc(String(at)):at)}const J={normalize:K,interpolate:nt=>nt,type:"vnode"};function C(...nt){return H(at=>{let ut;const ft=at;try{ft.processor=J,ut=Reflect.apply(jc,null,[ft,...nt])}finally{ft.processor=null}return ut},()=>ia(...nt),"translate",at=>at[sa](...nt),at=>[Uc(at)],at=>Gt(at))}function U(...nt){return H(at=>Reflect.apply(Hc,null,[at,...nt]),()=>ra(...nt),"number format",at=>at[aa](...nt),Gc,at=>bt(at)||Gt(at))}function B(...nt){return H(at=>Reflect.apply(Fc,null,[at,...nt]),()=>na(...nt),"datetime format",at=>at[oa](...nt),Gc,at=>bt(at)||Gt(at))}function tt(nt){f=nt,u.pluralRules=f}function D(nt,at){return H(()=>{if(!nt)return!1;const ut=bt(at)?at:O.value,ft=st(ut),gt=u.messageResolver(ft,nt);return c?gt!=null:Sn(gt)||Ce(gt)||bt(gt)},()=>[nt],"translate exists",ut=>Reflect.apply(ut.te,ut,[nt,at]),ab,ut=>At(ut))}function F(nt){let at=null;const ut=od(u,_.value,O.value);for(let ft=0;ft{l&&(O.value=nt,u.locale=nt,Un(u,O.value,_.value))}),le(i.fallbackLocale,nt=>{l&&(_.value=nt,u.fallbackLocale=nt,Un(u,O.value,_.value))}));const rt={id:$c,locale:x,fallbackLocale:d,get inheritLocale(){return l},set inheritLocale(nt){l=nt,nt&&i&&(O.value=i.locale.value,_.value=i.fallbackLocale.value,Un(u,O.value,_.value))},get availableLocales(){return Object.keys(v.value).sort()},messages:p,get modifiers(){return A},get pluralRules(){return f||{}},get isGlobal(){return r},get missingWarn(){return P},set missingWarn(nt){P=nt,u.missingWarn=P},get fallbackWarn(){return m},set fallbackWarn(nt){m=nt,u.fallbackWarn=m},get fallbackRoot(){return T},set fallbackRoot(nt){T=nt},get fallbackFormat(){return k},set fallbackFormat(nt){k=nt,u.fallbackFormat=k},get warnHtmlMessage(){return S},set warnHtmlMessage(nt){S=nt,u.warnHtmlMessage=nt},get escapeParameter(){return w},set escapeParameter(nt){w=nt,u.escapeParameter=nt},t:z,getLocaleMessage:st,setLocaleMessage:ot,mergeLocaleMessage:lt,getPostTranslationHandler:j,setPostTranslationHandler:$,getMissingHandler:et,setMissingHandler:it,[bd]:tt};return rt.datetimeFormats=R,rt.numberFormats=I,rt.rt=L,rt.te=D,rt.tm=X,rt.d=N,rt.n=V,rt.getDateTimeFormat=ct,rt.setDateTimeFormat=q,rt.mergeDateTimeFormat=Y,rt.getNumberFormat=Z,rt.setNumberFormat=W,rt.mergeNumberFormat=Q,rt[_d]=n,rt[sa]=C,rt[oa]=B,rt[aa]=U,rt}function cb(t){const e=bt(t.locale)?t.locale:Cn,i=bt(t.fallbackLocale)||Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,n=Vt(t.missing)?t.missing:void 0,r=At(t.silentTranslationWarn)||ki(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=At(t.silentFallbackWarn)||ki(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=At(t.fallbackRoot)?t.fallbackRoot:!0,c=!!t.formatFallbackMessages,l=Tt(t.modifiers)?t.modifiers:{},O=t.pluralizationRules,_=Vt(t.postTranslation)?t.postTranslation:void 0,v=bt(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,E=!!t.escapeParameterHtml,b=At(t.sync)?t.sync:!0;let P=t.messages;if(Tt(t.sharedMessages)){const w=t.sharedMessages;P=Object.keys(w).reduce((f,u)=>{const g=f[u]||(f[u]={});return re(g,w[u]),f},P||{})}const{__i18n:m,__root:T,__injectWithOption:k}=t,M=t.datetimeFormats,y=t.numberFormats,a=t.flatJson,S=t.translateExistCompatible;return{locale:e,fallbackLocale:i,messages:P,flatJson:a,datetimeFormats:M,numberFormats:y,missing:n,missingWarn:r,fallbackWarn:s,fallbackRoot:o,fallbackFormat:c,modifiers:l,pluralRules:O,postTranslation:_,warnHtmlMessage:v,escapeParameter:E,messageResolver:t.messageResolver,inheritLocale:b,translateExistCompatible:S,__i18n:m,__root:T,__injectWithOption:k}}function ca(t={},e){{const i=tl(cb(t)),{__extender:n}=t,r={id:i.id,get locale(){return i.locale.value},set locale(s){i.locale.value=s},get fallbackLocale(){return i.fallbackLocale.value},set fallbackLocale(s){i.fallbackLocale.value=s},get messages(){return i.messages.value},get datetimeFormats(){return i.datetimeFormats.value},get numberFormats(){return i.numberFormats.value},get availableLocales(){return i.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return i.getMissingHandler()},set missing(s){i.setMissingHandler(s)},get silentTranslationWarn(){return At(i.missingWarn)?!i.missingWarn:i.missingWarn},set silentTranslationWarn(s){i.missingWarn=At(s)?!s:s},get silentFallbackWarn(){return At(i.fallbackWarn)?!i.fallbackWarn:i.fallbackWarn},set silentFallbackWarn(s){i.fallbackWarn=At(s)?!s:s},get modifiers(){return i.modifiers},get formatFallbackMessages(){return i.fallbackFormat},set formatFallbackMessages(s){i.fallbackFormat=s},get postTranslation(){return i.getPostTranslationHandler()},set postTranslation(s){i.setPostTranslationHandler(s)},get sync(){return i.inheritLocale},set sync(s){i.inheritLocale=s},get warnHtmlInMessage(){return i.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){i.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return i.escapeParameter},set escapeParameterHtml(s){i.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return i.pluralRules||{}},__composer:i,t(...s){const[o,c,l]=s,O={};let _=null,v=null;if(!bt(o))throw ee(te.INVALID_ARGUMENT);const E=o;return bt(c)?O.locale=c:Gt(c)?_=c:Tt(c)&&(v=c),Gt(l)?_=l:Tt(l)&&(v=l),Reflect.apply(i.t,i,[E,_||v||{},O])},rt(...s){return Reflect.apply(i.rt,i,[...s])},tc(...s){const[o,c,l]=s,O={plural:1};let _=null,v=null;if(!bt(o))throw ee(te.INVALID_ARGUMENT);const E=o;return bt(c)?O.locale=c:Jt(c)?O.plural=c:Gt(c)?_=c:Tt(c)&&(v=c),bt(l)?O.locale=l:Gt(l)?_=l:Tt(l)&&(v=l),Reflect.apply(i.t,i,[E,_||v||{},O])},te(s,o){return i.te(s,o)},tm(s){return i.tm(s)},getLocaleMessage(s){return i.getLocaleMessage(s)},setLocaleMessage(s,o){i.setLocaleMessage(s,o)},mergeLocaleMessage(s,o){i.mergeLocaleMessage(s,o)},d(...s){return Reflect.apply(i.d,i,[...s])},getDateTimeFormat(s){return i.getDateTimeFormat(s)},setDateTimeFormat(s,o){i.setDateTimeFormat(s,o)},mergeDateTimeFormat(s,o){i.mergeDateTimeFormat(s,o)},n(...s){return Reflect.apply(i.n,i,[...s])},getNumberFormat(s){return i.getNumberFormat(s)},setNumberFormat(s,o){i.setNumberFormat(s,o)},mergeNumberFormat(s,o){i.mergeNumberFormat(s,o)},getChoiceIndex(s,o){return-1}};return r.__extender=n,r}}const el={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function ub({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((n,r)=>[...n,...r.type===zt?r.children:[r]],[]):e.reduce((i,n)=>{const r=t[n];return r&&(i[n]=r()),i},{})}function Cd(t){return zt}const hb=Ue({name:"i18n-t",props:re({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Jt(t)||!isNaN(t)}},el),setup(t,e){const{slots:i,attrs:n}=e,r=t.i18n||il({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(i).filter(v=>v!=="_"),o={};t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=bt(t.plural)?+t.plural:t.plural);const c=ub(e,s),l=r[sa](t.keypath,c,o),O=re({},n),_=bt(t.tag)||Rt(t.tag)?t.tag:Cd();return Se(_,O,l)}}}),Yc=hb;function fb(t){return Gt(t)&&!bt(t[0])}function Sd(t,e,i,n){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let c={};t.locale&&(o.locale=t.locale),bt(t.format)?o.key=t.format:Rt(t.format)&&(bt(t.format.key)&&(o.key=t.format.key),c=Object.keys(t.format).reduce((E,b)=>i.includes(b)?re({},E,{[b]:t.format[b]}):E,{}));const l=n(t.value,o,c);let O=[o.key];Gt(l)?O=l.map((E,b)=>{const P=r[E.type],m=P?P({[E.type]:E.value,index:b,parts:l}):[E.value];return fb(m)&&(m[0].key=`${E.type}-${b}`),m}):bt(l)&&(O=[l]);const _=re({},s),v=bt(t.tag)||Rt(t.tag)?t.tag:Cd();return Se(v,_,O)}}const db=Ue({name:"i18n-n",props:re({value:{type:Number,required:!0},format:{type:[String,Object]}},el),setup(t,e){const i=t.i18n||il({useScope:t.scope,__useComponent:!0});return Sd(t,e,vd,(...n)=>i[aa](...n))}}),zc=db,pb=Ue({name:"i18n-d",props:re({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},el),setup(t,e){const i=t.i18n||il({useScope:t.scope,__useComponent:!0});return Sd(t,e,md,(...n)=>i[oa](...n))}}),Kc=pb;function gb(t,e){const i=t;if(t.mode==="composition")return i.__getInstance(e)||t.global;{const n=i.__getInstance(e);return n!=null?n.__composer:t.global.__composer}}function mb(t){const e=o=>{const{instance:c,modifiers:l,value:O}=o;if(!c||!c.$)throw ee(te.UNEXPECTED_ERROR);const _=gb(t,c.$),v=qc(O);return[Reflect.apply(_.t,_,[...Zc(v)]),_]};return{created:(o,c)=>{const[l,O]=e(c);xs&&t.global===O&&(o.__i18nWatcher=le(O.locale,()=>{c.instance&&c.instance.$forceUpdate()})),o.__composer=O,o.textContent=l},unmounted:o=>{xs&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:c})=>{if(o.__composer){const l=o.__composer,O=qc(c);o.textContent=Reflect.apply(l.t,l,[...Zc(O)])}},getSSRProps:o=>{const[c]=e(o);return{textContent:c}}}}function qc(t){if(bt(t))return{path:t};if(Tt(t)){if(!("path"in t))throw ee(te.REQUIRED_VALUE,"path");return t}else throw ee(te.INVALID_VALUE)}function Zc(t){const{path:e,locale:i,args:n,choice:r,plural:s}=t,o={},c=n||{};return bt(i)&&(o.locale=i),Jt(r)&&(o.plural=r),Jt(s)&&(o.plural=s),[e,c,o]}function vb(t,e,...i){const n=Tt(i[0])?i[0]:{},r=!!n.useI18nComponentName;(At(n.globalInstall)?n.globalInstall:!0)&&([r?"i18n":Yc.name,"I18nT"].forEach(o=>t.component(o,Yc)),[zc.name,"I18nN"].forEach(o=>t.component(o,zc)),[Kc.name,"I18nD"].forEach(o=>t.component(o,Kc))),t.directive("t",mb(e))}function yb(t,e,i){return{beforeCreate(){const n=ie();if(!n)throw ee(te.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=e,this===this.$root)this.$i18n=Jc(t,s);else{s.__injectWithOption=!0,s.__extender=i.__vueI18nExtend,this.$i18n=ca(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=Jc(t,r);else{this.$i18n=ca({__i18n:r.__i18n,__injectWithOption:!0,__extender:i.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;r.__i18nGlobal&&Ed(e,r,r),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),i.__setInstance(n,this.$i18n)},mounted(){},unmounted(){const n=ie();if(!n)throw ee(te.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),i.__deleteInstance(n),delete this.$i18n}}}function Jc(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[bd](e.pluralizationRules||t.pluralizationRules);const i=Ks(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(i).forEach(n=>t.mergeLocaleMessage(n,i[n])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(n=>t.mergeDateTimeFormat(n,e.datetimeFormats[n])),e.numberFormats&&Object.keys(e.numberFormats).forEach(n=>t.mergeNumberFormat(n,e.numberFormats[n])),t}const xb=Ii("global-vue-i18n");function bb(t={},e){const i=__VUE_I18N_LEGACY_API__&&At(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=At(t.globalInjection)?t.globalInjection:!0,r=__VUE_I18N_LEGACY_API__&&i?!!t.allowComposition:!0,s=new Map,[o,c]=_b(t,i),l=Ii("");function O(E){return s.get(E)||null}function _(E,b){s.set(E,b)}function v(E){s.delete(E)}{const E={get mode(){return __VUE_I18N_LEGACY_API__&&i?"legacy":"composition"},get allowComposition(){return r},async install(b,...P){if(b.__VUE_I18N_SYMBOL__=l,b.provide(b.__VUE_I18N_SYMBOL__,E),Tt(P[0])){const k=P[0];E.__composerExtend=k.__composerExtend,E.__vueI18nExtend=k.__vueI18nExtend}let m=null;!i&&n&&(m=kb(b,E.global)),__VUE_I18N_FULL_INSTALL__&&vb(b,E,...P),__VUE_I18N_LEGACY_API__&&i&&b.mixin(yb(c,c.__composer,E));const T=b.unmount;b.unmount=()=>{m&&m(),E.dispose(),T()}},get global(){return c},dispose(){o.stop()},__instances:s,__getInstance:O,__setInstance:_,__deleteInstance:v};return E}}function il(t={}){const e=ie();if(e==null)throw ee(te.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw ee(te.NOT_INSTALLED);const i=wb(e),n=Cb(i),r=wd(e),s=Eb(t,r);if(__VUE_I18N_LEGACY_API__&&i.mode==="legacy"&&!t.__useComponent){if(!i.allowComposition)throw ee(te.NOT_AVAILABLE_IN_LEGACY_MODE);return Ab(e,s,n,t)}if(s==="global")return Ed(n,t,r),n;if(s==="parent"){let l=Sb(i,e,t.__useComponent);return l==null&&(l=n),l}const o=i;let c=o.__getInstance(e);if(c==null){const l=re({},t);"__i18n"in r&&(l.__i18n=r.__i18n),n&&(l.__root=n),c=tl(l),o.__composerExtend&&(c[la]=o.__composerExtend(c)),Ob(o,e,c),o.__setInstance(e,c)}return c}function _b(t,e,i){const n=Vu();{const r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>ca(t)):n.run(()=>tl(t));if(r==null)throw ee(te.UNEXPECTED_ERROR);return[n,r]}}function wb(t){{const e=Oe(t.isCE?xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw ee(t.isCE?te.NOT_INSTALLED_WITH_PROVIDE:te.UNEXPECTED_ERROR);return e}}function Eb(t,e){return Xs(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Cb(t){return t.mode==="composition"?t.global:t.global.__composer}function Sb(t,e,i=!1){let n=null;const r=e.root;let s=Tb(e,i);for(;s!=null;){const o=t;if(t.mode==="composition")n=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const c=o.__getInstance(s);c!=null&&(n=c.__composer,i&&n&&!n[_d]&&(n=null))}if(n!=null||r===s)break;s=s.parent}return n}function Tb(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function Ob(t,e,i){gi(()=>{},e),Dn(()=>{const n=i;t.__deleteInstance(e);const r=n[la];r&&(r(),delete n[la])},e)}function Ab(t,e,i,n={}){const r=e==="local",s=In(null);if(r&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw ee(te.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=At(n.inheritLocale)?n.inheritLocale:!bt(n.locale),c=Yt(!r||o?i.locale.value:bt(n.locale)?n.locale:Cn),l=Yt(!r||o?i.fallbackLocale.value:bt(n.fallbackLocale)||Gt(n.fallbackLocale)||Tt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:c.value),O=Yt(Ks(c.value,n)),_=Yt(Tt(n.datetimeFormats)?n.datetimeFormats:{[c.value]:{}}),v=Yt(Tt(n.numberFormats)?n.numberFormats:{[c.value]:{}}),E=r?i.missingWarn:At(n.missingWarn)||ki(n.missingWarn)?n.missingWarn:!0,b=r?i.fallbackWarn:At(n.fallbackWarn)||ki(n.fallbackWarn)?n.fallbackWarn:!0,P=r?i.fallbackRoot:At(n.fallbackRoot)?n.fallbackRoot:!0,m=!!n.fallbackFormat,T=Vt(n.missing)?n.missing:null,k=Vt(n.postTranslation)?n.postTranslation:null,M=r?i.warnHtmlMessage:At(n.warnHtmlMessage)?n.warnHtmlMessage:!0,y=!!n.escapeParameter,a=r?i.modifiers:Tt(n.modifiers)?n.modifiers:{},S=n.pluralRules||r&&i.pluralRules;function w(){return[c.value,l.value,O.value,_.value,v.value]}const A=$t({get:()=>s.value?s.value.locale.value:c.value,set:F=>{s.value&&(s.value.locale.value=F),c.value=F}}),f=$t({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:F=>{s.value&&(s.value.fallbackLocale.value=F),l.value=F}}),u=$t(()=>s.value?s.value.messages.value:O.value),g=$t(()=>_.value),h=$t(()=>v.value);function x(){return s.value?s.value.getPostTranslationHandler():k}function d(F){s.value&&s.value.setPostTranslationHandler(F)}function p(){return s.value?s.value.getMissingHandler():T}function R(F){s.value&&s.value.setMissingHandler(F)}function I(F){return w(),F()}function j(...F){return s.value?I(()=>Reflect.apply(s.value.t,null,[...F])):I(()=>"")}function $(...F){return s.value?Reflect.apply(s.value.rt,null,[...F]):""}function et(...F){return s.value?I(()=>Reflect.apply(s.value.d,null,[...F])):I(()=>"")}function it(...F){return s.value?I(()=>Reflect.apply(s.value.n,null,[...F])):I(()=>"")}function H(F){return s.value?s.value.tm(F):{}}function z(F,X){return s.value?s.value.te(F,X):!1}function L(F){return s.value?s.value.getLocaleMessage(F):{}}function N(F,X){s.value&&(s.value.setLocaleMessage(F,X),O.value[F]=X)}function V(F,X){s.value&&s.value.mergeLocaleMessage(F,X)}function K(F){return s.value?s.value.getDateTimeFormat(F):{}}function G(F,X){s.value&&(s.value.setDateTimeFormat(F,X),_.value[F]=X)}function J(F,X){s.value&&s.value.mergeDateTimeFormat(F,X)}function C(F){return s.value?s.value.getNumberFormat(F):{}}function U(F,X){s.value&&(s.value.setNumberFormat(F,X),v.value[F]=X)}function B(F,X){s.value&&s.value.mergeNumberFormat(F,X)}const tt={get id(){return s.value?s.value.id:-1},locale:A,fallbackLocale:f,messages:u,datetimeFormats:g,numberFormats:h,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(F){s.value&&(s.value.inheritLocale=F)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(O.value)},get modifiers(){return s.value?s.value.modifiers:a},get pluralRules(){return s.value?s.value.pluralRules:S},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:E},set missingWarn(F){s.value&&(s.value.missingWarn=F)},get fallbackWarn(){return s.value?s.value.fallbackWarn:b},set fallbackWarn(F){s.value&&(s.value.missingWarn=F)},get fallbackRoot(){return s.value?s.value.fallbackRoot:P},set fallbackRoot(F){s.value&&(s.value.fallbackRoot=F)},get fallbackFormat(){return s.value?s.value.fallbackFormat:m},set fallbackFormat(F){s.value&&(s.value.fallbackFormat=F)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:M},set warnHtmlMessage(F){s.value&&(s.value.warnHtmlMessage=F)},get escapeParameter(){return s.value?s.value.escapeParameter:y},set escapeParameter(F){s.value&&(s.value.escapeParameter=F)},t:j,getPostTranslationHandler:x,setPostTranslationHandler:d,getMissingHandler:p,setMissingHandler:R,rt:$,d:et,n:it,tm:H,te:z,getLocaleMessage:L,setLocaleMessage:N,mergeLocaleMessage:V,getDateTimeFormat:K,setDateTimeFormat:G,mergeDateTimeFormat:J,getNumberFormat:C,setNumberFormat:U,mergeNumberFormat:B};function D(F){F.locale.value=c.value,F.fallbackLocale.value=l.value,Object.keys(O.value).forEach(X=>{F.mergeLocaleMessage(X,O.value[X])}),Object.keys(_.value).forEach(X=>{F.mergeDateTimeFormat(X,_.value[X])}),Object.keys(v.value).forEach(X=>{F.mergeNumberFormat(X,v.value[X])}),F.escapeParameter=y,F.fallbackFormat=m,F.fallbackRoot=P,F.fallbackWarn=b,F.missingWarn=E,F.warnHtmlMessage=M}return Ma(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw ee(te.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const F=s.value=t.proxy.$i18n.__composer;e==="global"?(c.value=F.locale.value,l.value=F.fallbackLocale.value,O.value=F.messages.value,_.value=F.datetimeFormats.value,v.value=F.numberFormats.value):r&&D(F)}),tt}const Pb=["locale","fallbackLocale","availableLocales"],Qc=["t","rt","d","n","tm","te"];function kb(t,e){const i=Object.create(null);return Pb.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw ee(te.UNEXPECTED_ERROR);const o=Dt(s.value)?{get(){return s.value.value},set(c){s.value.value=c}}:{get(){return s.get&&s.get()}};Object.defineProperty(i,r,o)}),t.config.globalProperties.$i18n=i,Qc.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw ee(te.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,s)}),()=>{delete t.config.globalProperties.$i18n,Qc.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}ob();__INTLIFY_JIT_COMPILATION__?Mc(tb):Mc(Qx);Gx(Sx);$x(od);if(__INTLIFY_PROD_DEVTOOLS__){const t=hi();t.__INTLIFY__=!0,Rx(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Lb=[{key:"chapters.title",enValue:"Chapters",enValid:"1",frValue:"Chapitres",frValid:"1"},{key:"chapters.return",enValue:"Return to top",enValid:"1",frValue:"Retournez en haut",frValid:"1"},{key:"chapters.menu",enValue:"Toggle menu",enValid:"1",frValue:"Menu bascule",frValid:"0"},{key:"chapters.menu.dropdown",enValue:"Toggle dropdown menu",enValid:"1",frValue:"Basculer le menu déroulant",frValid:"0"},{key:"chapters.untitled",enValue:"Untitled Slide",enValid:"1",frValue:"Diapositive sans titre",frValid:"0"},{key:"layer.loading",enValue:"The layer is loading...",enValid:"1",frValue:"La couche est en cours de téléchargement...",frValid:"1"},{key:"scrollguard.desc",enValue:"Use ctrl + scroll to zoom the map",enValid:"1",frValue:"Utilisez les touches Ctrl et + pour faire un zoom de la carte",frValid:"1"},{key:"story.date",enValue:"Date modified:",enValid:"1",frValue:"Date de modification:",frValid:"1"},{key:"story.error",enValue:"An error occurred while loading this Storylines product. See developer console for more information.",enValid:"1",frValue:"Une erreur est survenue pendant le chargement ce synopsis produit. Voir la console du promoteur pour obtenir de plus amples renseignements.",frValid:"1"},{key:"image.fullscreen",enValue:"Full Screen",enValid:"1",frValue:"Plein Écran",frValid:"1"},{key:"timeslider.expand",enValue:"Expand",enValid:"1",frValue:"Développer",frValid:"1"},{key:"timeslider.minimize",enValue:"Minimize",enValid:"1",frValue:"Réduire",frValid:"1"},{key:"timeslider.play",enValue:"Play",enValid:"1",frValue:"Lire",frValid:"0"},{key:"timeslider.pause",enValue:"Pause",enValid:"1",frValue:"Pause",frValid:"0"},{key:"fullscreen.activate",enValue:"Enter Fullscreen",enValid:"1",frValue:"Entrer en plein écran",frValid:"0"},{key:"fullscreen.deactivate",enValue:"Exit Fullscreen",enValid:"1",frValue:"Sortie plein écran",frValid:"0"},{key:"dynamic.back",enValue:"Back",enValid:"1",frValue:"Retour",frValid:"0"},{key:"video.transcript",enValue:"Transcript",enValid:"1",frValue:"Transcription",frValid:"0"},{key:"chart.viewFullscreen",enValue:"View in full screen",enValid:"1",frValue:"Plein Écran",frValid:"1"},{key:"chart.printChart",enValue:"Print chart",enValid:"1",frValue:"Imprimer",frValid:"1"},{key:"chart.downloadPNG",enValue:"Download PNG",enValid:"1",frValue:"Télécharger PNG",frValid:"1"},{key:"chart.downloadJPEG",enValue:"Download JPEG",enValid:"1",frValue:"Télécharger JPEG",frValid:"1"},{key:"chart.downloadPDF",enValue:"Download PDF",enValid:"1",frValue:"Télécharger PDF",frValid:"1"},{key:"chart.downloadSVG",enValue:"Download SVG",enValid:"1",frValue:"Télécharger SVG",frValid:"1"},{key:"chart.downloadCSV",enValue:"Download CSV",enValid:"1",frValue:"Télécharger CSV",frValid:"1"},{key:"chart.downloadXLS",enValue:"Download XLS",enValid:"1",frValue:"Télécharger XLS",frValid:"1"},{key:"chart.viewData",enValue:"View data table",enValid:"1",frValue:"Afficher le tableau de données",frValid:"1"}],Mb=document.documentElement.getAttribute("lang");function Ib(t){return t.reduce((e,i)=>(e.en[i.key]=i.enValue,e.fr[i.key]=i.frValue,e),{en:{},fr:{}})}const Rb=bb({legacy:!1,locale:Mb||void 0,fallbackLocale:"en",globalInjection:!0,messages:Ib(Lb)});/*! + * vue-tippy v6.4.4 + * (c) 2024 + * @license MIT + */var xe="top",Le="bottom",Me="right",be="left",nl="auto",kr=[xe,Le,Me,be],Tn="start",br="end",Nb="clippingParents",Td="viewport",Wn="popper",Db="reference",tu=kr.reduce(function(t,e){return t.concat([e+"-"+Tn,e+"-"+br])},[]),Od=[].concat(kr,[nl]).reduce(function(t,e){return t.concat([e,e+"-"+Tn,e+"-"+br])},[]),jb="beforeRead",Fb="read",Bb="afterRead",Hb="beforeMain",Vb="main",Ub="afterMain",Wb="beforeWrite",Gb="write",$b="afterWrite",Xb=[jb,Fb,Bb,Hb,Vb,Ub,Wb,Gb,$b];function ti(t){return t?(t.nodeName||"").toLowerCase():null}function We(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function On(t){var e=We(t).Element;return t instanceof e||t instanceof Element}function Pe(t){var e=We(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Ad(t){if(typeof ShadowRoot>"u")return!1;var e=We(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yb(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var n=e.styles[i]||{},r=e.attributes[i]||{},s=e.elements[i];!Pe(s)||!ti(s)||(Object.assign(s.style,n),Object.keys(r).forEach(function(o){var c=r[o];c===!1?s.removeAttribute(o):s.setAttribute(o,c===!0?"":c)}))})}function zb(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(n){var r=e.elements[n],s=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),c=o.reduce(function(l,O){return l[O]="",l},{});!Pe(r)||!ti(r)||(Object.assign(r.style,c),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var Pd={name:"applyStyles",enabled:!0,phase:"write",fn:Yb,effect:zb,requires:["computeStyles"]};function Ze(t){return t.split("-")[0]}var $i=Math.max,ws=Math.min,An=Math.round;function Pn(t,e){e===void 0&&(e=!1);var i=t.getBoundingClientRect(),n=1,r=1;if(Pe(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(n=An(i.width)/o||1),s>0&&(r=An(i.height)/s||1)}return{width:i.width/n,height:i.height/r,top:i.top/r,right:i.right/n,bottom:i.bottom/r,left:i.left/n,x:i.left/n,y:i.top/r}}function rl(t){var e=Pn(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function kd(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ad(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ei(t){return We(t).getComputedStyle(t)}function Kb(t){return["table","td","th"].indexOf(ti(t))>=0}function Ni(t){return((On(t)?t.ownerDocument:t.document)||window.document).documentElement}function qs(t){return ti(t)==="html"?t:t.assignedSlot||t.parentNode||(Ad(t)?t.host:null)||Ni(t)}function eu(t){return!Pe(t)||ei(t).position==="fixed"?null:t.offsetParent}function qb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&Pe(t)){var n=ei(t);if(n.position==="fixed")return null}for(var r=qs(t);Pe(r)&&["html","body"].indexOf(ti(r))<0;){var s=ei(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Lr(t){for(var e=We(t),i=eu(t);i&&Kb(i)&&ei(i).position==="static";)i=eu(i);return i&&(ti(i)==="html"||ti(i)==="body"&&ei(i).position==="static")?e:i||qb(t)||e}function sl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function rr(t,e,i){return $i(t,ws(e,i))}function Zb(t,e,i){var n=rr(t,e,i);return n>i?i:n}function Ld(){return{top:0,right:0,bottom:0,left:0}}function Md(t){return Object.assign({},Ld(),t)}function Id(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Jb=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Md(typeof e!="number"?e:Id(e,kr))};function Qb(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,c=Ze(i.placement),l=sl(c),O=[be,Me].indexOf(c)>=0,_=O?"height":"width";if(!(!s||!o)){var v=Jb(r.padding,i),E=rl(s),b=l==="y"?xe:be,P=l==="y"?Le:Me,m=i.rects.reference[_]+i.rects.reference[l]-o[l]-i.rects.popper[_],T=o[l]-i.rects.reference[l],k=Lr(s),M=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,y=m/2-T/2,a=v[b],S=M-E[_]-v[P],w=M/2-E[_]/2+y,A=rr(a,w,S),f=l;i.modifiersData[n]=(e={},e[f]=A,e.centerOffset=A-w,e)}}function t_(t){var e=t.state,i=t.options,n=i.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||kd(e.elements.popper,r)&&(e.elements.arrow=r))}var e_={name:"arrow",enabled:!0,phase:"main",fn:Qb,effect:t_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kn(t){return t.split("-")[1]}var i_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function n_(t){var e=t.x,i=t.y,n=window,r=n.devicePixelRatio||1;return{x:An(e*r)/r||0,y:An(i*r)/r||0}}function iu(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,c=t.position,l=t.gpuAcceleration,O=t.adaptive,_=t.roundOffsets,v=t.isFixed,E=_===!0?n_(o):typeof _=="function"?_(o):o,b=E.x,P=b===void 0?0:b,m=E.y,T=m===void 0?0:m,k=o.hasOwnProperty("x"),M=o.hasOwnProperty("y"),y=be,a=xe,S=window;if(O){var w=Lr(i),A="clientHeight",f="clientWidth";if(w===We(i)&&(w=Ni(i),ei(w).position!=="static"&&c==="absolute"&&(A="scrollHeight",f="scrollWidth")),w=w,r===xe||(r===be||r===Me)&&s===br){a=Le;var u=v&&S.visualViewport?S.visualViewport.height:w[A];T-=u-n.height,T*=l?1:-1}if(r===be||(r===xe||r===Le)&&s===br){y=Me;var g=v&&S.visualViewport?S.visualViewport.width:w[f];P-=g-n.width,P*=l?1:-1}}var h=Object.assign({position:c},O&&i_);if(l){var x;return Object.assign({},h,(x={},x[a]=M?"0":"",x[y]=k?"0":"",x.transform=(S.devicePixelRatio||1)<=1?"translate("+P+"px, "+T+"px)":"translate3d("+P+"px, "+T+"px, 0)",x))}return Object.assign({},h,(e={},e[a]=M?T+"px":"",e[y]=k?P+"px":"",e.transform="",e))}function r_(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=n===void 0?!0:n,s=i.adaptive,o=s===void 0?!0:s,c=i.roundOffsets,l=c===void 0?!0:c,O={placement:Ze(e.placement),variation:kn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,iu(Object.assign({},O,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,iu(Object.assign({},O,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var s_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:r_,data:{}},Xr={passive:!0};function o_(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=r===void 0?!0:r,o=n.resize,c=o===void 0?!0:o,l=We(e.elements.popper),O=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&O.forEach(function(_){_.addEventListener("scroll",i.update,Xr)}),c&&l.addEventListener("resize",i.update,Xr),function(){s&&O.forEach(function(_){_.removeEventListener("scroll",i.update,Xr)}),c&&l.removeEventListener("resize",i.update,Xr)}}var a_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:o_,data:{}},l_={left:"right",right:"left",bottom:"top",top:"bottom"};function es(t){return t.replace(/left|right|bottom|top/g,function(e){return l_[e]})}var c_={start:"end",end:"start"};function nu(t){return t.replace(/start|end/g,function(e){return c_[e]})}function ol(t){var e=We(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function al(t){return Pn(Ni(t)).left+ol(t).scrollLeft}function u_(t){var e=We(t),i=Ni(t),n=e.visualViewport,r=i.clientWidth,s=i.clientHeight,o=0,c=0;return n&&(r=n.width,s=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,c=n.offsetTop)),{width:r,height:s,x:o+al(t),y:c}}function h_(t){var e,i=Ni(t),n=ol(t),r=(e=t.ownerDocument)==null?void 0:e.body,s=$i(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=$i(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-n.scrollLeft+al(t),l=-n.scrollTop;return ei(r||i).direction==="rtl"&&(c+=$i(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:c,y:l}}function ll(t){var e=ei(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Rd(t){return["html","body","#document"].indexOf(ti(t))>=0?t.ownerDocument.body:Pe(t)&&ll(t)?t:Rd(qs(t))}function sr(t,e){var i;e===void 0&&(e=[]);var n=Rd(t),r=n===((i=t.ownerDocument)==null?void 0:i.body),s=We(n),o=r?[s].concat(s.visualViewport||[],ll(n)?n:[]):n,c=e.concat(o);return r?c:c.concat(sr(qs(o)))}function ua(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function f_(t){var e=Pn(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ru(t,e){return e===Td?ua(u_(t)):On(e)?f_(e):ua(h_(Ni(t)))}function d_(t){var e=sr(qs(t)),i=["absolute","fixed"].indexOf(ei(t).position)>=0,n=i&&Pe(t)?Lr(t):t;return On(n)?e.filter(function(r){return On(r)&&kd(r,n)&&ti(r)!=="body"&&(i?ei(r).position!=="static":!0)}):[]}function p_(t,e,i){var n=e==="clippingParents"?d_(t):[].concat(e),r=[].concat(n,[i]),s=r[0],o=r.reduce(function(c,l){var O=ru(t,l);return c.top=$i(O.top,c.top),c.right=ws(O.right,c.right),c.bottom=ws(O.bottom,c.bottom),c.left=$i(O.left,c.left),c},ru(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Nd(t){var e=t.reference,i=t.element,n=t.placement,r=n?Ze(n):null,s=n?kn(n):null,o=e.x+e.width/2-i.width/2,c=e.y+e.height/2-i.height/2,l;switch(r){case xe:l={x:o,y:e.y-i.height};break;case Le:l={x:o,y:e.y+e.height};break;case Me:l={x:e.x+e.width,y:c};break;case be:l={x:e.x-i.width,y:c};break;default:l={x:e.x,y:e.y}}var O=r?sl(r):null;if(O!=null){var _=O==="y"?"height":"width";switch(s){case Tn:l[O]=l[O]-(e[_]/2-i[_]/2);break;case br:l[O]=l[O]+(e[_]/2-i[_]/2);break}}return l}function _r(t,e){e===void 0&&(e={});var i=e,n=i.placement,r=n===void 0?t.placement:n,s=i.boundary,o=s===void 0?Nb:s,c=i.rootBoundary,l=c===void 0?Td:c,O=i.elementContext,_=O===void 0?Wn:O,v=i.altBoundary,E=v===void 0?!1:v,b=i.padding,P=b===void 0?0:b,m=Md(typeof P!="number"?P:Id(P,kr)),T=_===Wn?Db:Wn,k=t.rects.popper,M=t.elements[E?T:_],y=p_(On(M)?M:M.contextElement||Ni(t.elements.popper),o,l),a=Pn(t.elements.reference),S=Nd({reference:a,element:k,strategy:"absolute",placement:r}),w=ua(Object.assign({},k,S)),A=_===Wn?w:a,f={top:y.top-A.top+m.top,bottom:A.bottom-y.bottom+m.bottom,left:y.left-A.left+m.left,right:A.right-y.right+m.right},u=t.modifiersData.offset;if(_===Wn&&u){var g=u[r];Object.keys(f).forEach(function(h){var x=[Me,Le].indexOf(h)>=0?1:-1,d=[xe,Le].indexOf(h)>=0?"y":"x";f[h]+=g[d]*x})}return f}function g_(t,e){e===void 0&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,c=i.flipVariations,l=i.allowedAutoPlacements,O=l===void 0?Od:l,_=kn(n),v=_?c?tu:tu.filter(function(P){return kn(P)===_}):kr,E=v.filter(function(P){return O.indexOf(P)>=0});E.length===0&&(E=v);var b=E.reduce(function(P,m){return P[m]=_r(t,{placement:m,boundary:r,rootBoundary:s,padding:o})[Ze(m)],P},{});return Object.keys(b).sort(function(P,m){return b[P]-b[m]})}function m_(t){if(Ze(t)===nl)return[];var e=es(t);return[nu(t),e,nu(e)]}function v_(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,c=o===void 0?!0:o,l=i.fallbackPlacements,O=i.padding,_=i.boundary,v=i.rootBoundary,E=i.altBoundary,b=i.flipVariations,P=b===void 0?!0:b,m=i.allowedAutoPlacements,T=e.options.placement,k=Ze(T),M=k===T,y=l||(M||!P?[es(T)]:m_(T)),a=[T].concat(y).reduce(function(N,V){return N.concat(Ze(V)===nl?g_(e,{placement:V,boundary:_,rootBoundary:v,padding:O,flipVariations:P,allowedAutoPlacements:m}):V)},[]),S=e.rects.reference,w=e.rects.popper,A=new Map,f=!0,u=a[0],g=0;g=0,R=p?"width":"height",I=_r(e,{placement:h,boundary:_,rootBoundary:v,altBoundary:E,padding:O}),j=p?d?Me:be:d?Le:xe;S[R]>w[R]&&(j=es(j));var $=es(j),et=[];if(s&&et.push(I[x]<=0),c&&et.push(I[j]<=0,I[$]<=0),et.every(function(N){return N})){u=h,f=!1;break}A.set(h,et)}if(f)for(var it=P?3:1,H=function(V){var K=a.find(function(G){var J=A.get(G);if(J)return J.slice(0,V).every(function(C){return C})});if(K)return u=K,"break"},z=it;z>0;z--){var L=H(z);if(L==="break")break}e.placement!==u&&(e.modifiersData[n]._skip=!0,e.placement=u,e.reset=!0)}}var y_={name:"flip",enabled:!0,phase:"main",fn:v_,requiresIfExists:["offset"],data:{_skip:!1}};function su(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ou(t){return[xe,Me,Le,be].some(function(e){return t[e]>=0})}function x_(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=_r(e,{elementContext:"reference"}),c=_r(e,{altBoundary:!0}),l=su(o,n),O=su(c,r,s),_=ou(l),v=ou(O);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:O,isReferenceHidden:_,hasPopperEscaped:v},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":_,"data-popper-escaped":v})}var b_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:x_};function __(t,e,i){var n=Ze(t),r=[be,xe].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],c=s[1];return o=o||0,c=(c||0)*r,[be,Me].indexOf(n)>=0?{x:c,y:o}:{x:o,y:c}}function w_(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=r===void 0?[0,0]:r,o=Od.reduce(function(_,v){return _[v]=__(v,e.rects,s),_},{}),c=o[e.placement],l=c.x,O=c.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=O),e.modifiersData[n]=o}var E_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:w_};function C_(t){var e=t.state,i=t.name;e.modifiersData[i]=Nd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var S_={name:"popperOffsets",enabled:!0,phase:"read",fn:C_,data:{}};function T_(t){return t==="x"?"y":"x"}function O_(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,c=o===void 0?!1:o,l=i.boundary,O=i.rootBoundary,_=i.altBoundary,v=i.padding,E=i.tether,b=E===void 0?!0:E,P=i.tetherOffset,m=P===void 0?0:P,T=_r(e,{boundary:l,rootBoundary:O,padding:v,altBoundary:_}),k=Ze(e.placement),M=kn(e.placement),y=!M,a=sl(k),S=T_(a),w=e.modifiersData.popperOffsets,A=e.rects.reference,f=e.rects.popper,u=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,g=typeof u=="number"?{mainAxis:u,altAxis:u}:Object.assign({mainAxis:0,altAxis:0},u),h=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,x={x:0,y:0};if(w){if(s){var d,p=a==="y"?xe:be,R=a==="y"?Le:Me,I=a==="y"?"height":"width",j=w[a],$=j+T[p],et=j-T[R],it=b?-f[I]/2:0,H=M===Tn?A[I]:f[I],z=M===Tn?-f[I]:-A[I],L=e.elements.arrow,N=b&&L?rl(L):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ld(),K=V[p],G=V[R],J=rr(0,A[I],N[I]),C=y?A[I]/2-it-J-K-g.mainAxis:H-J-K-g.mainAxis,U=y?-A[I]/2+it+J+G+g.mainAxis:z+J+G+g.mainAxis,B=e.elements.arrow&&Lr(e.elements.arrow),tt=B?a==="y"?B.clientTop||0:B.clientLeft||0:0,D=(d=h?.[a])!=null?d:0,F=j+C-D-tt,X=j+U-D,st=rr(b?ws($,F):$,j,b?$i(et,X):et);w[a]=st,x[a]=st-j}if(c){var ot,lt=a==="x"?xe:be,ct=a==="x"?Le:Me,q=w[S],Y=S==="y"?"height":"width",Z=q+T[lt],W=q-T[ct],Q=[xe,be].indexOf(k)!==-1,rt=(ot=h?.[S])!=null?ot:0,nt=Q?Z:q-A[Y]-f[Y]-rt+g.altAxis,at=Q?q+A[Y]+f[Y]-rt-g.altAxis:W,ut=b&&Q?Zb(nt,q,at):rr(b?nt:Z,q,b?at:W);w[S]=ut,x[S]=ut-q}e.modifiersData[n]=x}}var A_={name:"preventOverflow",enabled:!0,phase:"main",fn:O_,requiresIfExists:["offset"]};function P_(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function k_(t){return t===We(t)||!Pe(t)?ol(t):P_(t)}function L_(t){var e=t.getBoundingClientRect(),i=An(e.width)/t.offsetWidth||1,n=An(e.height)/t.offsetHeight||1;return i!==1||n!==1}function M_(t,e,i){i===void 0&&(i=!1);var n=Pe(e),r=Pe(e)&&L_(e),s=Ni(e),o=Pn(t,r),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((ti(e)!=="body"||ll(s))&&(c=k_(e)),Pe(e)?(l=Pn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=al(s))),{x:o.left+c.scrollLeft-l.x,y:o.top+c.scrollTop-l.y,width:o.width,height:o.height}}function I_(t){var e=new Map,i=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function r(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(c){if(!i.has(c)){var l=e.get(c);l&&r(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||r(s)}),n}function R_(t){var e=I_(t);return Xb.reduce(function(i,n){return i.concat(e.filter(function(r){return r.phase===n}))},[])}function N_(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function D_(t){var e=t.reduce(function(i,n){var r=i[n.name];return i[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,i},{});return Object.keys(e).map(function(i){return e[i]})}var au={placement:"bottom",modifiers:[],strategy:"absolute"};function lu(){for(var t=arguments.length,e=new Array(t),i=0;i-1}function Vd(t,e){return typeof t=="function"?t.apply(void 0,e):t}function cu(t,e){if(e===0)return t;var i;return function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)}}function V_(t,e){var i=Object.assign({},t);return e.forEach(function(n){delete i[n]}),i}function U_(t){return t.split(/\s+/).filter(Boolean)}function Vi(t){return[].concat(t)}function uu(t,e){t.indexOf(e)===-1&&t.push(e)}function W_(t){return t.filter(function(e,i){return t.indexOf(e)===i})}function Ud(t){return t.split("-")[0]}function Ln(t){return[].slice.call(t)}function hu(t){return Object.keys(t).reduce(function(e,i){return t[i]!==void 0&&(e[i]=t[i]),e},{})}function Xi(){return document.createElement("div")}function Zs(t){return["Element","Fragment"].some(function(e){return cl(t,e)})}function G_(t){return cl(t,"NodeList")}function ul(t){return cl(t,"MouseEvent")}function $_(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function X_(t){return Zs(t)?[t]:G_(t)?Ln(t):Array.isArray(t)?t:Ln(document.querySelectorAll(t))}function _o(t,e){t.forEach(function(i){i&&(i.style.transitionDuration=e+"ms")})}function wr(t,e){t.forEach(function(i){i&&i.setAttribute("data-state",e)})}function Wd(t){var e,i=Vi(t),n=i[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function Y_(t,e){var i=e.clientX,n=e.clientY;return t.every(function(r){var s=r.popperRect,o=r.popperState,c=r.props,l=c.interactiveBorder,O=Ud(o.placement),_=o.modifiersData.offset;if(!_)return!0;var v=O==="bottom"?_.top.y:0,E=O==="top"?_.bottom.y:0,b=O==="right"?_.left.x:0,P=O==="left"?_.right.x:0,m=s.top-n+v>l,T=n-s.bottom-E>l,k=s.left-i+b>l,M=i-s.right-P>l;return m||T||k||M})}function wo(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[n](r,i)})}function fu(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=i.getRootNode==null||(n=i.getRootNode())==null?void 0:n.host}return!1}var ze={isTouch:!1},du=0;function z_(){ze.isTouch||(ze.isTouch=!0,window.performance&&document.addEventListener("mousemove",Gd))}function Gd(){var t=performance.now();t-du<20&&(ze.isTouch=!1,document.removeEventListener("mousemove",Gd)),du=t}function K_(){var t=document.activeElement;if($_(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function q_(){document.addEventListener("touchstart",z_,Hi),window.addEventListener("blur",K_)}var Z_=typeof window<"u"&&typeof document<"u",J_=Z_?!!window.msCrypto:!1,Q_={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},je=Object.assign({appendTo:Hd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Q_,tw),ew=Object.keys(je),iw=function(e){var i=Object.keys(e);i.forEach(function(n){je[n]=e[n]})};function $d(t){var e=t.plugins||[],i=e.reduce(function(n,r){var s=r.name,o=r.defaultValue;if(s){var c;n[s]=t[s]!==void 0?t[s]:(c=je[s])!=null?c:o}return n},{});return Object.assign({},t,i)}function nw(t,e){var i=e?Object.keys($d(Object.assign({},je,{plugins:e}))):ew,n=i.reduce(function(r,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return r;if(s==="content")r[s]=o;else try{r[s]=JSON.parse(o)}catch{r[s]=o}return r},{});return n}function pu(t,e){var i=Object.assign({},e,{content:Vd(e.content,[t])},e.ignoreAttributes?{}:nw(t,e.plugins));return i.aria=Object.assign({},je.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?e.interactive:i.aria.expanded,content:i.aria.content==="auto"?e.interactive?null:"describedby":i.aria.content},i}var rw=function(){return"innerHTML"};function ha(t,e){t[rw()]=e}function gu(t){var e=Xi();return t===!0?e.className=Fd:(e.className=Bd,Zs(t)?e.appendChild(t):ha(e,t)),e}function mu(t,e){Zs(e.content)?(ha(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ha(t,e.content):t.textContent=e.content)}function Es(t){var e=t.firstElementChild,i=Ln(e.children);return{box:e,content:i.find(function(n){return n.classList.contains(Dd)}),arrow:i.find(function(n){return n.classList.contains(Fd)||n.classList.contains(Bd)}),backdrop:i.find(function(n){return n.classList.contains(jd)})}}function Xd(t){var e=Xi(),i=Xi();i.className=H_,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Xi();n.className=Dd,n.setAttribute("data-state","hidden"),mu(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props);function r(s,o){var c=Es(e),l=c.box,O=c.content,_=c.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&mu(O,t.props),o.arrow?_?s.arrow!==o.arrow&&(l.removeChild(_),l.appendChild(gu(o.arrow))):l.appendChild(gu(o.arrow)):_&&l.removeChild(_)}return{popper:e,onUpdate:r}}Xd.$$tippy=!0;var sw=1,Yr=[],Eo=[];function ow(t,e){var i=pu(t,Object.assign({},je,$d(hu(e)))),n,r,s,o=!1,c=!1,l=!1,O=!1,_,v,E,b=[],P=cu(F,i.interactiveDebounce),m,T=sw++,k=null,M=W_(i.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},a={id:T,reference:t,popper:Xi(),popperInstance:k,props:i,state:y,plugins:M,clearDelayTimeouts:nt,setProps:at,setContent:ut,show:ft,hide:gt,hideWithInteractivity:xt,enable:Q,disable:rt,unmount:vt,destroy:dt};if(!i.render)return a;var S=i.render(a),w=S.popper,A=S.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+a.id,a.popper=w,t._tippy=a,w._tippy=a;var f=M.map(function(ht){return ht.fn(a)}),u=t.hasAttribute("aria-expanded");return B(),it(),j(),$("onCreate",[a]),i.showOnCreate&&Z(),w.addEventListener("mouseenter",function(){a.props.interactive&&a.state.isVisible&&a.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){a.props.interactive&&a.props.trigger.indexOf("mouseenter")>=0&&p().addEventListener("mousemove",P)}),a;function g(){var ht=a.props.touch;return Array.isArray(ht)?ht:[ht,0]}function h(){return g()[0]==="hold"}function x(){var ht;return!!((ht=a.props.render)!=null&&ht.$$tippy)}function d(){return m||t}function p(){var ht=d().parentNode;return ht?Wd(ht):document}function R(){return Es(w)}function I(ht){return a.state.isMounted&&!a.state.isVisible||ze.isTouch||_&&_.type==="focus"?0:bo(a.props.delay,ht?0:1,je.delay)}function j(ht){ht===void 0&&(ht=!1),w.style.pointerEvents=a.props.interactive&&!ht?"":"none",w.style.zIndex=""+a.props.zIndex}function $(ht,pt,mt){if(mt===void 0&&(mt=!0),f.forEach(function(wt){wt[ht]&&wt[ht].apply(wt,pt)}),mt){var yt;(yt=a.props)[ht].apply(yt,pt)}}function et(){var ht=a.props.aria;if(ht.content){var pt="aria-"+ht.content,mt=w.id,yt=Vi(a.props.triggerTarget||t);yt.forEach(function(wt){var kt=wt.getAttribute(pt);if(a.state.isVisible)wt.setAttribute(pt,kt?kt+" "+mt:mt);else{var Ot=kt&&kt.replace(mt,"").trim();Ot?wt.setAttribute(pt,Ot):wt.removeAttribute(pt)}})}}function it(){if(!(u||!a.props.aria.expanded)){var ht=Vi(a.props.triggerTarget||t);ht.forEach(function(pt){a.props.interactive?pt.setAttribute("aria-expanded",a.state.isVisible&&pt===d()?"true":"false"):pt.removeAttribute("aria-expanded")})}}function H(){p().removeEventListener("mousemove",P),Yr=Yr.filter(function(ht){return ht!==P})}function z(ht){if(!(ze.isTouch&&(l||ht.type==="mousedown"))){var pt=ht.composedPath&&ht.composedPath()[0]||ht.target;if(!(a.props.interactive&&fu(w,pt))){if(Vi(a.props.triggerTarget||t).some(function(mt){return fu(mt,pt)})){if(ze.isTouch||a.state.isVisible&&a.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[a,ht]);a.props.hideOnClick===!0&&(a.clearDelayTimeouts(),a.hide(),c=!0,setTimeout(function(){c=!1}),a.state.isMounted||K())}}}function L(){l=!0}function N(){l=!1}function V(){var ht=p();ht.addEventListener("mousedown",z,!0),ht.addEventListener("touchend",z,Hi),ht.addEventListener("touchstart",N,Hi),ht.addEventListener("touchmove",L,Hi)}function K(){var ht=p();ht.removeEventListener("mousedown",z,!0),ht.removeEventListener("touchend",z,Hi),ht.removeEventListener("touchstart",N,Hi),ht.removeEventListener("touchmove",L,Hi)}function G(ht,pt){C(ht,function(){!a.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&pt()})}function J(ht,pt){C(ht,pt)}function C(ht,pt){var mt=R().box;function yt(wt){wt.target===mt&&(wo(mt,"remove",yt),pt())}if(ht===0)return pt();wo(mt,"remove",v),wo(mt,"add",yt),v=yt}function U(ht,pt,mt){mt===void 0&&(mt=!1);var yt=Vi(a.props.triggerTarget||t);yt.forEach(function(wt){wt.addEventListener(ht,pt,mt),b.push({node:wt,eventType:ht,handler:pt,options:mt})})}function B(){h()&&(U("touchstart",D,{passive:!0}),U("touchend",X,{passive:!0})),U_(a.props.trigger).forEach(function(ht){if(ht!=="manual")switch(U(ht,D),ht){case"mouseenter":U("mouseleave",X);break;case"focus":U(J_?"focusout":"blur",st);break;case"focusin":U("focusout",st);break}})}function tt(){b.forEach(function(ht){var pt=ht.node,mt=ht.eventType,yt=ht.handler,wt=ht.options;pt.removeEventListener(mt,yt,wt)}),b=[]}function D(ht){var pt,mt=!1;if(!(!a.state.isEnabled||ot(ht)||c)){var yt=((pt=_)==null?void 0:pt.type)==="focus";_=ht,m=ht.currentTarget,it(),!a.state.isVisible&&ul(ht)&&Yr.forEach(function(wt){return wt(ht)}),ht.type==="click"&&(a.props.trigger.indexOf("mouseenter")<0||o)&&a.props.hideOnClick!==!1&&a.state.isVisible?mt=!0:Z(ht),ht.type==="click"&&(o=!mt),mt&&!yt&&W(ht)}}function F(ht){var pt=ht.target,mt=d().contains(pt)||w.contains(pt);if(!(ht.type==="mousemove"&&mt)){var yt=Y().concat(w).map(function(wt){var kt,Ot=wt._tippy,Xt=(kt=Ot.popperInstance)==null?void 0:kt.state;return Xt?{popperRect:wt.getBoundingClientRect(),popperState:Xt,props:i}:null}).filter(Boolean);Y_(yt,ht)&&(H(),W(ht))}}function X(ht){var pt=ot(ht)||a.props.trigger.indexOf("click")>=0&&o;if(!pt){if(a.props.interactive){a.hideWithInteractivity(ht);return}W(ht)}}function st(ht){a.props.trigger.indexOf("focusin")<0&&ht.target!==d()||a.props.interactive&&ht.relatedTarget&&w.contains(ht.relatedTarget)||W(ht)}function ot(ht){return ze.isTouch?h()!==ht.type.indexOf("touch")>=0:!1}function lt(){ct();var ht=a.props,pt=ht.popperOptions,mt=ht.placement,yt=ht.offset,wt=ht.getReferenceClientRect,kt=ht.moveTransition,Ot=x()?Es(w).arrow:null,Xt=wt?{getBoundingClientRect:wt,contextElement:wt.contextElement||d()}:t,we={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ie){var Ji=Ie.state;if(x()){var vp=R(),Qs=vp.box;["placement","reference-hidden","escaped"].forEach(function(Mr){Mr==="placement"?Qs.setAttribute("data-placement",Ji.placement):Ji.attributes.popper["data-popper-"+Mr]?Qs.setAttribute("data-"+Mr,""):Qs.removeAttribute("data-"+Mr)}),Ji.attributes.popper={}}}},It=[{name:"offset",options:{offset:yt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!kt}},we];x()&&Ot&&It.push({name:"arrow",options:{element:Ot,padding:3}}),It.push.apply(It,pt?.modifiers||[]),a.popperInstance=B_(Xt,w,Object.assign({},pt,{placement:mt,onFirstUpdate:E,modifiers:It}))}function ct(){a.popperInstance&&(a.popperInstance.destroy(),a.popperInstance=null)}function q(){var ht=a.props.appendTo,pt,mt=d();a.props.interactive&&ht===Hd||ht==="parent"?pt=mt.parentNode:pt=Vd(ht,[mt]),pt.contains(w)||pt.appendChild(w),a.state.isMounted=!0,lt()}function Y(){return Ln(w.querySelectorAll("[data-tippy-root]"))}function Z(ht){a.clearDelayTimeouts(),ht&&$("onTrigger",[a,ht]),V();var pt=I(!0),mt=g(),yt=mt[0],wt=mt[1];ze.isTouch&&yt==="hold"&&wt&&(pt=wt),pt?n=setTimeout(function(){a.show()},pt):a.show()}function W(ht){if(a.clearDelayTimeouts(),$("onUntrigger",[a,ht]),!a.state.isVisible){K();return}if(!(a.props.trigger.indexOf("mouseenter")>=0&&a.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ht.type)>=0&&o)){var pt=I(!1);pt?r=setTimeout(function(){a.state.isVisible&&a.hide()},pt):s=requestAnimationFrame(function(){a.hide()})}}function Q(){a.state.isEnabled=!0}function rt(){a.hide(),a.state.isEnabled=!1}function nt(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(s)}function at(ht){if(!a.state.isDestroyed){$("onBeforeUpdate",[a,ht]),tt();var pt=a.props,mt=pu(t,Object.assign({},pt,hu(ht),{ignoreAttributes:!0}));a.props=mt,B(),pt.interactiveDebounce!==mt.interactiveDebounce&&(H(),P=cu(F,mt.interactiveDebounce)),pt.triggerTarget&&!mt.triggerTarget?Vi(pt.triggerTarget).forEach(function(yt){yt.removeAttribute("aria-expanded")}):mt.triggerTarget&&t.removeAttribute("aria-expanded"),it(),j(),A&&A(pt,mt),a.popperInstance&&(lt(),Y().forEach(function(yt){requestAnimationFrame(yt._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[a,ht])}}function ut(ht){a.setProps({content:ht})}function ft(){var ht=a.state.isVisible,pt=a.state.isDestroyed,mt=!a.state.isEnabled,yt=ze.isTouch&&!a.props.touch,wt=bo(a.props.duration,0,je.duration);if(!(ht||pt||mt||yt)&&!d().hasAttribute("disabled")&&($("onShow",[a],!1),a.props.onShow(a)!==!1)){if(a.state.isVisible=!0,x()&&(w.style.visibility="visible"),j(),V(),a.state.isMounted||(w.style.transition="none"),x()){var kt=R(),Ot=kt.box,Xt=kt.content;_o([Ot,Xt],0)}E=function(){var It;if(!(!a.state.isVisible||O)){if(O=!0,w.offsetHeight,w.style.transition=a.props.moveTransition,x()&&a.props.animation){var ce=R(),Ie=ce.box,Ji=ce.content;_o([Ie,Ji],wt),wr([Ie,Ji],"visible")}et(),it(),uu(Eo,a),(It=a.popperInstance)==null||It.forceUpdate(),$("onMount",[a]),a.props.animation&&x()&&J(wt,function(){a.state.isShown=!0,$("onShown",[a])})}},q()}}function gt(){var ht=!a.state.isVisible,pt=a.state.isDestroyed,mt=!a.state.isEnabled,yt=bo(a.props.duration,1,je.duration);if(!(ht||pt||mt)&&($("onHide",[a],!1),a.props.onHide(a)!==!1)){if(a.state.isVisible=!1,a.state.isShown=!1,O=!1,o=!1,x()&&(w.style.visibility="hidden"),H(),K(),j(!0),x()){var wt=R(),kt=wt.box,Ot=wt.content;a.props.animation&&(_o([kt,Ot],yt),wr([kt,Ot],"hidden"))}et(),it(),a.props.animation?x()&&G(yt,a.unmount):a.unmount()}}function xt(ht){p().addEventListener("mousemove",P),uu(Yr,P),P(ht)}function vt(){a.state.isVisible&&a.hide(),a.state.isMounted&&(ct(),Y().forEach(function(ht){ht._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),Eo=Eo.filter(function(ht){return ht!==a}),a.state.isMounted=!1,$("onHidden",[a]))}function dt(){a.state.isDestroyed||(a.clearDelayTimeouts(),a.unmount(),tt(),delete t._tippy,a.state.isDestroyed=!0,$("onDestroy",[a]))}}function Et(t,e){e===void 0&&(e={});var i=je.plugins.concat(e.plugins||[]);q_();var n=Object.assign({},e,{plugins:i}),r=X_(t),s=r.reduce(function(o,c){var l=c&&ow(c,n);return l&&o.push(l),o},[]);return Zs(t)?s[0]:s}Et.defaultProps=je;Et.setDefaultProps=iw;Et.currentInput=ze;var aw=Object.assign({},Pd,{effect:function(e){var i=e.state,n={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,n.popper),i.styles=n,i.elements.arrow&&Object.assign(i.elements.arrow.style,n.arrow)}}),lw=function(e,i){var n;i===void 0&&(i={});var r=e,s=[],o=[],c,l=i.overrides,O=[],_=!1;function v(){o=r.map(function(a){return Vi(a.props.triggerTarget||a.reference)}).reduce(function(a,S){return a.concat(S)},[])}function E(){s=r.map(function(a){return a.reference})}function b(a){r.forEach(function(S){a?S.enable():S.disable()})}function P(a){return r.map(function(S){var w=S.setProps;return S.setProps=function(A){w(A),S.reference===c&&a.setProps(A)},function(){S.setProps=w}})}function m(a,S){var w=o.indexOf(S);if(S!==c){c=S;var A=(l||[]).concat("content").reduce(function(f,u){return f[u]=r[w].props[u],f},{});a.setProps(Object.assign({},A,{getReferenceClientRect:typeof A.getReferenceClientRect=="function"?A.getReferenceClientRect:function(){var f;return(f=s[w])==null?void 0:f.getBoundingClientRect()}}))}}b(!1),E(),v();var T={fn:function(){return{onDestroy:function(){b(!0)},onHidden:function(){c=null},onClickOutside:function(w){w.props.showOnCreate&&!_&&(_=!0,c=null)},onShow:function(w){w.props.showOnCreate&&!_&&(_=!0,m(w,s[0]))},onTrigger:function(w,A){m(w,A.currentTarget)}}}},k=Et(Xi(),Object.assign({},V_(i,["overrides"]),{plugins:[T].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat(((n=i.popperOptions)==null?void 0:n.modifiers)||[],[aw])})})),M=k.show;k.show=function(a){if(M(),!c&&a==null)return m(k,s[0]);if(!(c&&a==null)){if(typeof a=="number")return s[a]&&m(k,s[a]);if(r.indexOf(a)>=0){var S=a.reference;return m(k,S)}if(s.indexOf(a)>=0)return m(k,a)}},k.showNext=function(){var a=s[0];if(!c)return k.show(0);var S=s.indexOf(c);k.show(s[S+1]||a)},k.showPrevious=function(){var a=s[s.length-1];if(!c)return k.show(a);var S=s.indexOf(c),w=s[S-1]||a;k.show(w)};var y=k.setProps;return k.setProps=function(a){l=a.overrides||l,y(a)},k.setInstances=function(a){b(!0),O.forEach(function(S){return S()}),r=a,b(!1),E(),v(),O=P(k),k.setProps({triggerTarget:o})},O=P(k),k},cw={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(!((i=e.props.render)!=null&&i.$$tippy))return{};var n=Es(e.popper),r=n.box,s=n.content,o=e.props.animateFill?uw():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var l=r.style.transitionDuration,O=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(O/10)+"ms",o.style.transitionDuration=l,wr([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&wr([o],"hidden")}}}};function uw(){var t=Xi();return t.className=jd,wr([t],"hidden"),t}var fa={clientX:0,clientY:0},zr=[];function Yd(t){var e=t.clientX,i=t.clientY;fa={clientX:e,clientY:i}}function hw(t){t.addEventListener("mousemove",Yd)}function fw(t){t.removeEventListener("mousemove",Yd)}var dw={name:"followCursor",defaultValue:!1,fn:function(e){var i=e.reference,n=Wd(e.props.triggerTarget||i),r=!1,s=!1,o=!0,c=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function O(){n.addEventListener("mousemove",E)}function _(){n.removeEventListener("mousemove",E)}function v(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function E(m){var T=m.target?i.contains(m.target):!0,k=e.props.followCursor,M=m.clientX,y=m.clientY,a=i.getBoundingClientRect(),S=M-a.left,w=y-a.top;(T||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var f=i.getBoundingClientRect(),u=M,g=y;k==="initial"&&(u=f.left+S,g=f.top+w);var h=k==="horizontal"?f.top:g,x=k==="vertical"?f.right:u,d=k==="horizontal"?f.bottom:g,p=k==="vertical"?f.left:u;return{width:x-p,height:d-h,top:h,right:x,bottom:d,left:p}}})}function b(){e.props.followCursor&&(zr.push({instance:e,doc:n}),hw(n))}function P(){zr=zr.filter(function(m){return m.instance!==e}),zr.filter(function(m){return m.doc===n}).length===0&&fw(n)}return{onCreate:b,onDestroy:P,onBeforeUpdate:function(){c=e.props},onAfterUpdate:function(T,k){var M=k.followCursor;r||M!==void 0&&c.followCursor!==M&&(P(),M?(b(),e.state.isMounted&&!s&&!l()&&O()):(_(),v()))},onMount:function(){e.props.followCursor&&!s&&(o&&(E(fa),o=!1),l()||O())},onTrigger:function(T,k){ul(k)&&(fa={clientX:k.clientX,clientY:k.clientY}),s=k.type==="focus"},onHidden:function(){e.props.followCursor&&(v(),_(),o=!0)}}}};function pw(t,e){var i;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((((i=t.popperOptions)==null?void 0:i.modifiers)||[]).filter(function(n){var r=n.name;return r!==e.name}),[e])})}}var gw={name:"inlinePositioning",defaultValue:!1,fn:function(e){var i=e.reference;function n(){return!!e.props.inlinePositioning}var r,s=-1,o=!1,c=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(b){var P=b.state;n()&&(c.indexOf(P.placement)!==-1&&(c=[]),r!==P.placement&&c.indexOf(P.placement)===-1&&(c.push(P.placement),e.setProps({getReferenceClientRect:function(){return O(P.placement)}})),r=P.placement)}};function O(E){return mw(Ud(E),i.getBoundingClientRect(),Ln(i.getClientRects()),s)}function _(E){o=!0,e.setProps(E),o=!1}function v(){o||_(pw(e.props,l))}return{onCreate:v,onAfterUpdate:v,onTrigger:function(b,P){if(ul(P)){var m=Ln(e.reference.getClientRects()),T=m.find(function(M){return M.left-2<=P.clientX&&M.right+2>=P.clientX&&M.top-2<=P.clientY&&M.bottom+2>=P.clientY}),k=m.indexOf(T);s=k>-1?k:s}},onHidden:function(){s=-1}}}};function mw(t,e,i,n){if(i.length<2||t===null)return e;if(i.length===2&&n>=0&&i[0].left>i[1].right)return i[n]||e;switch(t){case"top":case"bottom":{var r=i[0],s=i[i.length-1],o=t==="top",c=r.top,l=s.bottom,O=o?r.left:s.left,_=o?r.right:s.right,v=_-O,E=l-c;return{top:c,bottom:l,left:O,right:_,width:v,height:E}}case"left":case"right":{var b=Math.min.apply(Math,i.map(function(w){return w.left})),P=Math.max.apply(Math,i.map(function(w){return w.right})),m=i.filter(function(w){return t==="left"?w.left===b:w.right===P}),T=m[0].top,k=m[m.length-1].bottom,M=b,y=P,a=y-M,S=k-T;return{top:T,bottom:k,left:M,right:y,width:a,height:S}}default:return e}}var vw={name:"sticky",defaultValue:!1,fn:function(e){var i=e.reference,n=e.popper;function r(){return e.popperInstance?e.popperInstance.state.elements.reference:i}function s(O){return e.props.sticky===!0||e.props.sticky===O}var o=null,c=null;function l(){var O=s("reference")?r().getBoundingClientRect():null,_=s("popper")?n.getBoundingClientRect():null;(O&&vu(o,O)||_&&vu(c,_))&&e.popperInstance&&e.popperInstance.update(),o=O,c=_,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function vu(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Et.setDefaultProps({render:Xd});Et.setDefaultProps({onShow:t=>{if(!t.props.content)return!1}});function zd(t,e={},i={mount:!0,appName:"Tippy"}){i=Object.assign({mount:!0,appName:"Tippy"},i);const n=ie(),r=Yt(),s=Yt({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1}),o=In();let c=null;const l=()=>c||(c=document.createDocumentFragment(),c),O=A=>{let f,u=Dt(A)?A.value:A;return Je(u)?(o.value||(o.value=bn({name:i.appName,setup:()=>()=>Dt(A)?A.value:A}),n&&Object.assign(o.value._context,n.appContext),o.value.mount(l())),f=()=>l()):typeof u=="object"?(o.value||(o.value=bn({name:i.appName,setup:()=>()=>Se(Dt(A)?A.value:A)}),n&&Object.assign(o.value._context,n.appContext),o.value.mount(l())),f=()=>l()):f=u,f},_=A=>{let f={};return Dt(A)?f=A.value||{}:qe(A)?f={...A}:f={...A},f.content&&(f.content=O(f.content)),f.triggerTarget&&(f.triggerTarget=Dt(f.triggerTarget)?f.triggerTarget.value:f.triggerTarget),(!f.plugins||!Array.isArray(f.plugins))&&(f.plugins=[]),f.plugins=f.plugins.filter(u=>u.name!=="vueTippyReactiveState"),f.plugins.push({name:"vueTippyReactiveState",fn:()=>({onCreate(){s.value.isEnabled=!0},onMount(){s.value.isMounted=!0},onShow(){s.value.isMounted=!0,s.value.isVisible=!0},onShown(){s.value.isShown=!0},onHide(){s.value.isMounted=!1,s.value.isVisible=!1},onHidden(){s.value.isShown=!1},onUnmounted(){s.value.isMounted=!1},onDestroy(){s.value.isDestroyed=!0}})}),f},v=()=>{r.value&&r.value.setProps(_(e))},E=()=>{!r.value||!e.content||r.value.setContent(O(e.content))},b=A=>{var f;(f=r.value)===null||f===void 0||f.setContent(O(A))},P=A=>{var f;(f=r.value)===null||f===void 0||f.setProps(_(A))},m=()=>{var A;r.value&&(r.value.destroy(),r.value=void 0),c=null,(A=o.value)===null||A===void 0||A.unmount(),o.value=void 0},T=()=>{var A;(A=r.value)===null||A===void 0||A.show()},k=()=>{var A;(A=r.value)===null||A===void 0||A.hide()},M=()=>{var A;(A=r.value)===null||A===void 0||A.disable(),s.value.isEnabled=!1},y=()=>{var A;(A=r.value)===null||A===void 0||A.enable(),s.value.isEnabled=!0},a=()=>{var A;(A=r.value)===null||A===void 0||A.unmount()},S=()=>{if(!t)return;let A=Dt(t)?t.value:t;typeof A=="function"&&(A=A()),A&&(r.value=Et(A,_(e)),A.$tippy=w)},w={tippy:r,refresh:v,refreshContent:E,setContent:b,setProps:P,destroy:m,hide:k,show:T,disable:M,enable:y,unmount:a,mount:S,state:s};return i.mount&&(n?n.isMounted?S():gi(S):S()),n&&Dn(()=>{m()}),Dt(e)||qe(e)?le(e,v,{immediate:!1}):Dt(e.content)&&le(e.content,E,{immediate:!1}),w}function yw(t,e){const i=Yt();return gi(()=>{const r=(Array.isArray(t)?t.map(s=>s.value):typeof t=="function"?t():t.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);i.value=lw(r,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:i}}function xw(t){return typeof t=="function"?t():Be(t)}function bw(t){var e,i;const n=xw(t);return(i=(e=n)===null||e===void 0?void 0:e.$el)!==null&&i!==void 0?i:n}const _w=Ue({props:{to:{type:[String,Function]},tag:{type:[String,Object],default:"span"},contentTag:{type:[String,Object],default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Et.defaultProps.appendTo},aria:{default:()=>Et.defaultProps.aria},delay:{default:()=>Et.defaultProps.delay},duration:{default:()=>Et.defaultProps.duration},getReferenceClientRect:{default:()=>Et.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Et.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Et.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Et.defaultProps.interactive},interactiveBorder:{default:()=>Et.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Et.defaultProps.interactiveDebounce},moveTransition:{default:()=>Et.defaultProps.moveTransition},offset:{default:()=>Et.defaultProps.offset},onAfterUpdate:{default:()=>Et.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Et.defaultProps.onBeforeUpdate},onCreate:{default:()=>Et.defaultProps.onCreate},onDestroy:{default:()=>Et.defaultProps.onDestroy},onHidden:{default:()=>Et.defaultProps.onHidden},onHide:{default:()=>Et.defaultProps.onHide},onMount:{default:()=>Et.defaultProps.onMount},onShow:{default:()=>Et.defaultProps.onShow},onShown:{default:()=>Et.defaultProps.onShown},onTrigger:{default:()=>Et.defaultProps.onTrigger},onUntrigger:{default:()=>Et.defaultProps.onUntrigger},onClickOutside:{default:()=>Et.defaultProps.onClickOutside},placement:{default:()=>Et.defaultProps.placement},plugins:{default:()=>Et.defaultProps.plugins},popperOptions:{default:()=>Et.defaultProps.popperOptions},render:{default:()=>Et.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Et.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Et.defaultProps.touch},trigger:{default:()=>Et.defaultProps.trigger},triggerTarget:{default:()=>Et.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Et.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Et.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Et.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Et.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Et.defaultProps.allowHTML},animation:{default:()=>Et.defaultProps.animation},arrow:{default:()=>Et.defaultProps.arrow},content:{default:()=>Et.defaultProps.content},inertia:{default:()=>Et.defaultProps.inertia},maxWidth:{default:()=>Et.defaultProps.maxWidth},role:{default:()=>Et.defaultProps.role},theme:{default:()=>Et.defaultProps.theme},zIndex:{default:()=>Et.defaultProps.zIndex}},emits:["state"],setup(t,{slots:e,emit:i,expose:n}){const r=Yt(),s=Yt(),o=Yt(),c=Yt(!1),l=()=>{let b={...t};for(const P of["to","tag","contentTag","contentClass"])b.hasOwnProperty(P)&&delete b[P];return b};let O=()=>bw(r);t.to&&(typeof Element<"u"&&t.to instanceof Element?O=()=>t.to:t.to==="parent"?O=()=>{let b=r.value;return b||(b=r.value=s.value.parentElement),b}:(typeof t.to=="string"||t.to instanceof String)&&(O=()=>document.querySelector(t.to)));const _=zd(O,l());let v=e.content;!v&&t.to==="parent"&&(v=e.default),gi(()=>{c.value=!0,Nn(()=>{v&&_.setContent(()=>o.value)})}),le(_.state,()=>{i("state",Be(_.state))},{immediate:!0,deep:!0}),le(()=>t,()=>{_.setProps(l()),v&&_.setContent(()=>o.value)},{deep:!0});let E=qi({elem:r,contentElem:o,mounted:c,..._});return n(E),()=>{const b=(typeof t.contentTag=="string",t.contentTag),P=v?Se(b,{ref:o,style:{display:c.value?"inherit":"none"},class:t.contentClass},v(E)):null;if(t.to==="parent"){const k=[];if(!r.value){const M=Se("span",{ref:s,"data-v-tippy":"",style:{display:"none"}});k.push(M)}return P&&k.push(P),k}const m=e.default?e.default(E):[];if(!t.tag){const k=Se(m[0],{ref:r,"data-v-tippy":""});return P?[k,P]:k}const T=(typeof t.tag=="string",t.tag);return Se(T,{ref:r,"data-v-tippy":""},P?[m,P]:m)}}}),ww=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let da={};Object.keys(Et.defaultProps).forEach(t=>{ww.includes(t)?da[t]={type:Boolean,default:function(){return Et.defaultProps[t]}}:da[t]={default:function(){return Et.defaultProps[t]}}});const Ew=Ue({props:da,setup(t){const e=Yt([]),{singleton:i}=yw(e,t);return{instances:e,singleton:i}},mounted(){var t;const i=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(i).map(n=>n._tippy).filter(Boolean),(t=this.singleton)===null||t===void 0||t.setInstances(this.instances)},render(){let t=this.$slots.default?this.$slots.default():[];return Se(()=>t)}}),Cw={mounted(t,e,i){const n=typeof e.value=="string"?{content:e.value}:e.value||{},r=Object.keys(e.modifiers||{}),s=r.find(c=>c!=="arrow"),o=r.findIndex(c=>c==="arrow")!==-1;s&&(n.placement=n.placement||s),o&&(n.arrow=n.arrow!==void 0?n.arrow:!0),i.props&&i.props.onTippyShow&&(n.onShow=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShow(...c)}),i.props&&i.props.onTippyShown&&(n.onShown=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShown(...c)}),i.props&&i.props.onTippyHidden&&(n.onHidden=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHidden(...c)}),i.props&&i.props.onTippyHide&&(n.onHide=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHide(...c)}),i.props&&i.props.onTippyMount&&(n.onMount=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyMount(...c)}),t.getAttribute("title")&&!n.content&&(n.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!n.content&&(n.content=t.getAttribute("content")),zd(t,n)},unmounted(t){t.$tippy?t.$tippy.destroy():t._tippy&&t._tippy.destroy()},updated(t,e){const i=typeof e.value=="string"?{content:e.value}:e.value||{};t.getAttribute("title")&&!i.content&&(i.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!i.content&&(i.content=t.getAttribute("content")),t.$tippy?t.$tippy.setProps(i||{}):t._tippy&&t._tippy.setProps(i||{})}},Sw={install(t,e={}){Et.setDefaultProps(e.defaultProps||{}),t.directive(e.directive||"tippy",Cw),t.component(e.component||"tippy",_w),t.component(e.componentSingleton||"tippy-singleton",Ew)}},Tw=Et.setDefaultProps;Tw({ignoreAttributes:!0,plugins:[vw,gw,dw,cw]});var Kd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ow(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),i}var Zd={exports:{}},Co={exports:{}},yu;function Aw(){return yu||(yu=1,function(t){(function(e,i){t.exports?(i.default=i,t.exports=e.document?i(e):i):(e.Highcharts&&e.Highcharts.error(16,!0),e.Highcharts=i(e))})(typeof window<"u"?window:Kd,function(e){function i(r,s,o,c){r.hasOwnProperty(s)||(r[s]=c.apply(null,o))}var n={};return i(n,"Core/Globals.js",[],function(){var r=typeof e<"u"?e:typeof window<"u"?window:{},s;return function(o){o.SVG_NS="http://www.w3.org/2000/svg",o.product="Highcharts",o.version="9.3.3",o.win=r,o.doc=o.win.document,o.svg=o.doc&&o.doc.createElementNS&&!!o.doc.createElementNS(o.SVG_NS,"svg").createSVGRect,o.userAgent=o.win.navigator&&o.win.navigator.userAgent||"",o.isChrome=o.userAgent.indexOf("Chrome")!==-1,o.isFirefox=o.userAgent.indexOf("Firefox")!==-1,o.isMS=/(edge|msie|trident)/i.test(o.userAgent)&&!o.win.opera,o.isSafari=!o.isChrome&&o.userAgent.indexOf("Safari")!==-1,o.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(o.userAgent),o.isWebKit=o.userAgent.indexOf("AppleWebKit")!==-1,o.deg2rad=2*Math.PI/360,o.hasBidiBug=o.isFirefox&&4>parseInt(o.userAgent.split("Firefox/")[1],10),o.hasTouch=!!o.win.TouchEvent,o.marginNames=["plotTop","marginRight","marginBottom","plotLeft"],o.noop=function(){},o.supportsPassiveEvents=function(){var c=!1;if(!o.isMS){var l=Object.defineProperty({},"passive",{get:function(){c=!0}});o.win.addEventListener&&o.win.removeEventListener&&(o.win.addEventListener("testPassive",o.noop,l),o.win.removeEventListener("testPassive",o.noop,l))}return c}(),o.charts=[],o.dateFormats={},o.seriesTypes={},o.symbolSizes={},o.chartCount=0}(s||(s={})),s}),i(n,"Core/Utilities.js",[n["Core/Globals.js"]],function(r){function s(p,R,I,j){var $=R?"Highcharts error":"Highcharts warning";p===32&&(p=$+": Deprecated member");var et=b(p),it=et?$+" #"+p+": www.highcharts.com/errors/"+p+"/":p.toString();if(typeof j<"u"){var H="";et&&(it+="?"),S(j,function(z,L){H+=` + - `+L+": "+z,et&&(it+=encodeURI(L)+"="+encodeURI(z))}),it+=H}A(r,"displayError",{chart:I,code:p,message:it,params:j},function(){if(R)throw Error(it);g.console&&s.messages.indexOf(it)===-1&&console.warn(it)}),s.messages.push(it)}function o(p,R){var I={};return S(p,function(j,$){_(p[$],!0)&&!p.nodeType&&R[$]?(j=o(p[$],R[$]),Object.keys(j).length&&(I[$]=j)):(_(p[$])||p[$]!==R[$])&&(I[$]=p[$])}),I}function c(p,R){return parseInt(p,R||10)}function l(p){return typeof p=="string"}function O(p){return p=Object.prototype.toString.call(p),p==="[object Array]"||p==="[object Array Iterator]"}function _(p,R){return!!p&&typeof p=="object"&&(!R||!O(p))}function v(p){return _(p)&&typeof p.nodeType=="number"}function E(p){var R=p&&p.constructor;return!(!_(p,!0)||v(p)||!R||!R.name||R.name==="Object")}function b(p){return typeof p=="number"&&!isNaN(p)&&1/0>p&&-1/0=R-1&&(R=Math.floor(I)),Math.max(0,R-(j(p,"padding-left",!0)||0)-(j(p,"padding-right",!0)||0));if(R==="height")return Math.max(0,Math.min(p.offsetHeight,p.scrollHeight)-(j(p,"padding-top",!0)||0)-(j(p,"padding-bottom",!0)||0));if(g.getComputedStyle||s(27,!0),p=g.getComputedStyle(p,void 0)){var $=p.getPropertyValue(R);k(I,R!=="opacity")&&($=c($))}return $}function S(p,R,I){for(var j in p)Object.hasOwnProperty.call(p,j)&&R.call(I||p[j],p[j],j,p)}function w(p,R,I){function j(H,z){var L=p.removeEventListener||r.removeEventListenerPolyfill;L&&L.call(p,H,z,!1)}function $(H){var z;if(p.nodeName){if(R){var L={};L[R]=!0}else L=H;S(L,function(N,V){if(H[V])for(z=H[V].length;z--;)j(V,H[V][z].fn)})}}var et=typeof p=="function"&&p.prototype||p;if(Object.hasOwnProperty.call(et,"hcEvents")){var it=et.hcEvents;R?(et=it[R]||[],I?(it[R]=et.filter(function(H){return I!==H.fn}),j(R,I)):($(it),it[R]=[])):($(it),delete et.hcEvents)}}function A(p,R,I,j){if(I=I||{},u.createEvent&&(p.dispatchEvent||p.fireEvent&&p!==r)){var $=u.createEvent("Events");$.initEvent(R,!0,!0),I=T($,I),p.dispatchEvent?p.dispatchEvent(I):p.fireEvent(R,I)}else if(p.hcEvents){I.target||T(I,{preventDefault:function(){I.defaultPrevented=!0},target:p,type:R}),$=[];for(var et=p,it=!1;et.hcEvents;)Object.hasOwnProperty.call(et,"hcEvents")&&et.hcEvents[R]&&($.length&&(it=!0),$.unshift.apply($,et.hcEvents[R])),et=Object.getPrototypeOf(et);it&&$.sort(function(H,z){return H.order-z.order}),$.forEach(function(H){H.fn.call(p,I)===!1&&I.preventDefault()})}j&&!I.defaultPrevented&&j.call(p,I)}var f=r.charts,u=r.doc,g=r.win;(s||(s={})).messages=[],Math.easeInOutSine=function(p){return-.5*(Math.cos(Math.PI*p)-1)};var h=Array.prototype.find?function(p,R){return p.find(R)}:function(p,R){var I,j=p.length;for(I=0;II&&(I=p[R]);return I},arrayMin:function(p){for(var R=p.length,I=p[0];R--;)p[R]R?p"u"||I==="__proto__"||(R=R[I],!P(R)||typeof R=="function"||typeof R.nodeType=="number"||R===g))return}return R},getStyle:a,inArray:function(p,R,I){return s(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),R.indexOf(p,I)},isArray:O,isClass:E,isDOMElement:v,isFunction:function(p){return typeof p=="function"},isNumber:b,isObject:_,isString:l,keys:function(p){return s(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(p)},merge:function(){var p,R=arguments,I={},j=function(et,it){return typeof et!="object"&&(et={}),S(it,function(H,z){z!=="__proto__"&&z!=="constructor"&&(!_(H,!0)||E(H)||v(H)?et[z]=it[z]:et[z]=j(et[z]||{},H))}),et};R[0]===!0&&(I=R[1],R=Array.prototype.slice.call(R,2));var $=R.length;for(p=0;p<$;p++)I=j(I,R[p]);return I},normalizeTickInterval:function(p,R,I,j,$){var et=p;I=k(I,1);var it=p/I;for(R||(R=$?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],j===!1&&(I===1?R=R.filter(function(H){return H%1===0}):.1>=I&&(R=[1/I]))),j=0;j=p||!$&&it<=(R[j]+(R[j+1]||R[j]))/2));j++);return et=y(et*I,-Math.round(Math.log(.001)/Math.LN10))},objectEach:S,offset:function(p){var R=u.documentElement;return p=p.parentElement||p.parentNode?p.getBoundingClientRect():{top:0,left:0,width:0,height:0},{top:p.top+(g.pageYOffset||R.scrollTop)-(R.clientTop||0),left:p.left+(g.pageXOffset||R.scrollLeft)-(R.clientLeft||0),width:p.width,height:p.height}},pad:function(p,R,I){return Array((R||2)+1-String(p).replace("-","").length).join(I||"0")+p},pick:k,pInt:c,relativeLength:function(p,R,I){return/%$/.test(p)?R*parseFloat(p)/100+(I||0):parseFloat(p)},removeEvent:w,splat:function(p){return O(p)?p:[p]},stableSort:function(p,R){var I=p.length,j,$;for($=0;$>16,(b&65280)>>8,b&255,1]:E===4&&(v=[(b&3840)>>4|(b&3840)>>8,(b&240)>>4|b&240,(b&15)<<4|b&15,1])}if(!v)for(b=O.parsers.length;b--&&!v;){var P=O.parsers[b];(E=P.regex.exec(_))&&(v=P.parse(E))}}v&&(this.rgba=v)},O.prototype.get=function(_){var v=this.input,E=this.rgba;if(typeof v=="object"&&typeof this.stops<"u"){var b=c(v);return b.stops=[].slice.call(b.stops),this.stops.forEach(function(P,m){b.stops[m]=[b.stops[m][0],P.get(_)]}),b}return E&&o(E[0])?_==="rgb"||!_&&E[3]===1?"rgb("+E[0]+","+E[1]+","+E[2]+")":_==="a"?""+E[3]:"rgba("+E.join(",")+")":v},O.prototype.brighten=function(_){var v=this.rgba;if(this.stops)this.stops.forEach(function(b){b.brighten(_)});else if(o(_)&&_!==0)for(var E=0;3>E;E++)v[E]+=l(255*_),0>v[E]&&(v[E]=0),255u?"AM":"PM",P:12>u?"am":"pm",S:b(f.getSeconds()),L:b(Math.floor(S%1e3),3)},r.dateFormats),E(f,function(j,$){for(;a.indexOf("%"+$)!==-1;)a=a.replace("%"+$,typeof j=="function"?j.call(A,S):j)}),w?a.substr(0,1).toUpperCase()+a.substr(1):a},y.prototype.resolveDTLFormat=function(a){return _(a,!0)?a:(a=m(a),{main:a[0],from:a[1],to:a[2]})},y.prototype.getTimeTicks=function(a,S,w,A){var f=this,u=[],g={},h=new f.Date(S),x=a.unitRange,d=a.count||1,p;if(A=P(A,1),c(S)){if(f.set("Milliseconds",h,x>=T.second?0:d*Math.floor(f.get("Milliseconds",h)/d)),x>=T.second&&f.set("Seconds",h,x>=T.minute?0:d*Math.floor(f.get("Seconds",h)/d)),x>=T.minute&&f.set("Minutes",h,x>=T.hour?0:d*Math.floor(f.get("Minutes",h)/d)),x>=T.hour&&f.set("Hours",h,x>=T.day?0:d*Math.floor(f.get("Hours",h)/d)),x>=T.day&&f.set("Date",h,x>=T.month?1:Math.max(1,d*Math.floor(f.get("Date",h)/d))),x>=T.month){f.set("Month",h,x>=T.year?0:d*Math.floor(f.get("Month",h)/d));var R=f.get("FullYear",h)}x>=T.year&&f.set("FullYear",h,R-R%d),x===T.week&&(R=f.get("Day",h),f.set("Date",h,f.get("Date",h)-R+A+(R4*T.month||f.getTimezoneOffset(S)!==f.getTimezoneOffset(w)),S=h.getTime(),h=1;Su.length&&u.forEach(function($){$%18e5===0&&f.dateFormat("%H%M%S%L",$)==="000000000"&&(g[$]="day")})}return u.info=O(a,{higherRanks:g,totalRange:x*d}),u},y.prototype.getDateFormat=function(a,S,w,A){var f=this.dateFormat("%m-%d %H:%M:%S.%L",S),u={millisecond:15,second:12,minute:9,hour:6,day:3},g="millisecond";for(h in T){if(a===T.week&&+this.dateFormat("%w",S)===w&&f.substr(6)==="00:00:00.000"){var h="week";break}if(T[h]>a){h=g;break}if(u[h]&&f.substr(u[h])!=="01-01 00:00:00.000".substr(u[h]))break;h!=="week"&&(g=h)}if(h)var x=this.resolveDTLFormat(A[h]).main;return x},y}(),s}),i(n,"Core/DefaultOptions.js",[n["Core/Chart/ChartDefaults.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Color/Palettes.js"],n["Core/Time.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){s=s.parse;var _=O.merge,v={colors:c.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:r,title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:o.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:o.isTouchDevice?25:10,headerFormat:'{point.key}
',pointFormat:' {series.name}: {point.y}
',backgroundColor:s("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};v.chart.styledMode=!1;var E=new l(_(v.global,v.time));return r={defaultOptions:v,defaultTime:E,getOptions:function(){return v},setOptions:function(b){return _(!0,v,b),(b.time||b.global)&&(o.time?o.time.update(_(v.global,v.time,b.global,b.time)):o.time=E),v}},r}),i(n,"Core/Animation/Fx.js",[n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.parse,l=s.win,O=o.isNumber,_=o.objectEach;return function(){function v(E,b,P){this.pos=NaN,this.options=b,this.elem=E,this.prop=P}return v.prototype.dSetter=function(){var E=this.paths,b=E&&E[0];E=E&&E[1];var P=this.now||0,m=[];if(P!==1&&b&&E)if(b.length===E.length&&1>P)for(var T=0;T=k+this.startTime){this.now=this.end,this.pos=1,this.update();var y=M[this.prop]=!0;_(M,function(a){a!==!0&&(y=!1)}),y&&T&&T.call(m),E=!1}else this.pos=P.easing((b-this.startTime)/k),this.now=this.start+(this.end-this.start)*this.pos,this.update(),E=!0;return E},v.prototype.initPath=function(E,b,P){function m(f,u){for(;f.length"u"&&(b=[])}if(b.length&&O(S)){var A=P.length+S*a;w?(m(b,P),T(P,b)):(m(P,b),T(b,P))}return[b,P]},v.prototype.fillSetter=function(){v.prototype.strokeSetter.apply(this,arguments)},v.prototype.strokeSetter=function(){this.elem.attr(this.prop,c(this.start).tweenTo(c(this.end),this.pos),void 0,!0)},v.timers=[],v}()}),i(n,"Core/Animation/AnimationUtilities.js",[n["Core/Animation/Fx.js"],n["Core/Utilities.js"]],function(r,s){function o(T){return E(T)?b({duration:500,defer:0},T):{duration:T?500:0,defer:0}}function c(T,k){for(var M=r.timers.length;M--;)r.timers[M].elem!==T||k&&k!==r.timers[M].prop||(r.timers[M].stopped=!0)}var l=s.defined,O=s.getStyle,_=s.isArray,v=s.isNumber,E=s.isObject,b=s.merge,P=s.objectEach,m=s.pick;return{animate:function(T,k,M){var y,a="",S,w;if(!E(M)){var A=arguments;M={duration:A[2],easing:A[3],complete:A[4]}}v(M.duration)||(M.duration=400),M.easing=typeof M.easing=="function"?M.easing:Math[M.easing]||Math.easeInOutSine,M.curAnim=b(k),P(k,function(f,u){c(T,u),w=new r(T,M,u),S=void 0,u==="d"&&_(k.d)?(w.paths=w.initPath(T,T.pathArray,k.d),w.toD=k.d,y=0,S=1):T.attr?y=T.attr(u):(y=parseFloat(O(T,u))||0,u!=="opacity"&&(a="px")),S||(S=f),typeof S=="string"&&S.match("px")&&(S=S.replace(/px/g,"")),w.run(y,S,a)})},animObject:o,getDeferredAnimation:function(T,k,M){var y=o(k),a=0,S=0;return(M?[M]:T.series).forEach(function(w){w=o(w.options.animation),a=k&&l(k.defer)?y.defer:Math.max(a,w.duration+w.defer),S=Math.min(y.duration,w.duration)}),T.renderer.forExport&&(a=0),{defer:Math.max(0,a-S),duration:Math.min(a,S)}},setAnimation:function(T,k){k.renderer.globalAnimation=m(T,k.options.chart.animation,!0)},stop:c}}),i(n,"Core/Renderer/HTML/AST.js",[n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s){var o=r.SVG_NS,c=s.attr,l=s.createElement,O=s.error,_=s.isFunction,v=s.isString,E=s.objectEach,b=s.splat,P=(s=r.win.trustedTypes)&&_(s.createPolicy)&&s.createPolicy("highcharts",{createHTML:function(k){return k}}),m=P?P.createHTML(""):"";try{var T=!!new DOMParser().parseFromString(m,"text/html")}catch{T=!1}return _=function(){function k(M){this.nodes=typeof M=="string"?this.parseMarkup(M):M}return k.filterUserAttributes=function(M){return E(M,function(y,a){var S=!0;k.allowedAttributes.indexOf(a)===-1&&(S=!1),["background","dynsrc","href","lowsrc","src"].indexOf(a)!==-1&&(S=v(y)&&k.allowedReferences.some(function(w){return y.indexOf(w)===0})),S||(O("Highcharts warning: Invalid attribute '"+a+"' in config"),delete M[a])}),M},k.setElementHTML=function(M,y){M.innerHTML=k.emptyHTML,y&&new k(y).addToDOM(M)},k.prototype.addToDOM=function(M){function y(a,S){var w;return b(a).forEach(function(A){var f=A.tagName,u=A.textContent?r.doc.createTextNode(A.textContent):void 0;if(f)if(f==="#text")var g=u;else if(k.allowedTags.indexOf(f)!==-1){f=r.doc.createElementNS(f==="svg"?o:S.namespaceURI||o,f);var h=A.attributes||{};E(A,function(x,d){d!=="tagName"&&d!=="attributes"&&d!=="children"&&d!=="textContent"&&(h[d]=x)}),c(f,k.filterUserAttributes(h)),u&&f.appendChild(u),y(A.children||[],f),g=f}else O("Highcharts warning: Invalid tagName "+f+" in config");g&&S.appendChild(g),w=g}),w}return y(this.nodes,M)},k.prototype.parseMarkup=function(M){var y=[];if(M=M.trim(),T)M=new DOMParser().parseFromString(P?P.createHTML(M):M,"text/html");else{var a=l("div");a.innerHTML=M,M={body:a}}var S=function(w,A){var f=w.nodeName.toLowerCase(),u={tagName:f};if(f==="#text"&&(u.textContent=w.textContent||""),f=w.attributes){var g={};[].forEach.call(f,function(x){g[x.name]=x.value}),u.attributes=g}if(w.childNodes.length){var h=[];[].forEach.call(w.childNodes,function(x){S(x,h)}),h.length&&(u.children=h)}A.push(u)};return[].forEach.call(M.body.childNodes,function(w){return S(w,y)}),y},k.allowedAttributes="aria-controls aria-describedby aria-expanded aria-haspopup aria-hidden aria-label aria-labelledby aria-live aria-pressed aria-readonly aria-roledescription aria-selected class clip-path color colspan cx cy d dx dy disabled fill height href id in markerHeight markerWidth offset opacity orient padding paddingLeft paddingRight patternUnits r refX refY role scope slope src startOffset stdDeviation stroke stroke-linecap stroke-width style tableValues result rowspan summary target tabindex text-align textAnchor textLength title type valign width x x1 x2 y y1 y2 zIndex".split(" "),k.allowedReferences="https:// http:// mailto: / ../ ./ #".split(" "),k.allowedTags="a abbr b br button caption circle clipPath code dd defs div dl dt em feComponentTransfer feFuncA feFuncB feFuncG feFuncR feGaussianBlur feOffset feMerge feMergeNode filter h1 h2 h3 h4 h5 h6 hr i img li linearGradient marker ol p path pattern pre rect small span stop strong style sub sup svg table text thead tbody tspan td th tr u ul #text".split(" "),k.emptyHTML=m,k}(),_}),i(n,"Core/FormatUtilities.js",[n["Core/DefaultOptions.js"],n["Core/Utilities.js"]],function(r,s){function o(b,P,m,T){b=+b||0,P=+P;var k=c.lang,M=(b.toString().split(".")[1]||"").split("e")[0].length,y=b.toString().split("e"),a=P;if(P===-1)P=Math.min(M,20);else if(!_(P))P=2;else if(P&&y[1]&&0>y[1]){var S=P+ +y[1];0<=S?(y[0]=(+y[0]).toExponential(S).split("e")[0],P=S):(y[0]=y[0].split(".")[0]||0,b=20>P?(y[0]*Math.pow(10,y[1])).toFixed(P):0,y[1]=0)}S=(Math.abs(y[1]?y[0]:b)+Math.pow(10,-Math.max(P,M)-1)).toFixed(P),M=String(E(S));var w=3b?"-":"")+(w?M.substr(0,w)+T:""),b=0>+y[1]&&!a?"0":b+M.substr(w).replace(/(\d{3})(?=\d)/g,"$1"+T),P&&(b+=m+S.slice(-P)),y[1]&&+b!=0&&(b+="e"+y[1]),b}var c=r.defaultOptions,l=r.defaultTime,O=s.getNestedProperty,_=s.isNumber,v=s.pick,E=s.pInt;return{dateFormat:function(b,P,m){return l.dateFormat(b,P,m)},format:function(b,P,m){var T="{",k=!1,M=/f$/,y=/\.([0-9])/,a=c.lang,S=m&&m.time||l;m=m&&m.numberFormatter||o;for(var w=[];b;){var A=b.indexOf(T);if(A===-1)break;var f=b.slice(0,A);if(k){if(f=f.split(":"),T=O(f.shift()||"",P),f.length&&typeof T=="number")if(f=f.join(":"),M.test(f)){var u=parseInt((f.match(y)||["","-1"])[1],10);T!==null&&(T=m(T,u,a.decimalPoint,-1m){for(c(v,T),S=M=0;S<=m;)S+=v[M].size,M++;a=v.splice(M-1,v.length)}for(c(v,k),v=v.map(function(w){return{size:w.size,targets:[w.target],align:o(w.align,.5)}});y;){for(M=v.length;M--;)m=v[M],T=(Math.min.apply(0,m.targets)+Math.max.apply(0,m.targets))/2,m.pos=s(T-m.size*m.align,0,E-m.size);for(M=v.length,y=!1;M--;)0v[M].pos&&(v[M-1].size+=v[M].size,v[M-1].targets=v[M-1].targets.concat(v[M].targets),v[M-1].align=.5,v[M-1].pos+v[M-1].size>E&&(v[M-1].pos=E-v[M-1].size),v.splice(M,1),y=!0)}return P.push.apply(P,a),M=0,v.some(function(w){var A=0;return(w.targets||[]).some(function(){return P[M].pos=w.pos+A,typeof b<"u"&&Math.abs(P[M].pos-P[M].target)>b?(P.slice(0,M+1).forEach(function(f){return delete f.pos}),P.reducedLen=(P.reducedLen||E)-.1*E,P.reducedLen>.1*E&&_(P,E,b),!0):(A+=P[M].size,M++,!1)})}),c(P,k),P}O.distribute=_}(l||(l={})),l}),i(n,"Core/Renderer/SVG/SVGElement.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Renderer/HTML/AST.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o,c,l){var O=r.animate,_=r.animObject,v=r.stop,E=c.deg2rad,b=c.doc,P=c.noop,m=c.svg,T=c.SVG_NS,k=c.win,M=l.addEvent,y=l.attr,a=l.createElement,S=l.css,w=l.defined,A=l.erase,f=l.extend,u=l.fireEvent,g=l.isArray,h=l.isFunction,x=l.isNumber,d=l.isString,p=l.merge,R=l.objectEach,I=l.pick,j=l.pInt,$=l.syncTimeout,et=l.uniqueKey;return r=function(){function it(){this.element=void 0,this.onEvents={},this.opacity=1,this.renderer=void 0,this.SVG_NS=T,this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" ")}return it.prototype._defaultGetter=function(H){return H=I(this[H+"Value"],this[H],this.element?this.element.getAttribute(H):null,0),/^[\-0-9\.]+$/.test(H)&&(H=parseFloat(H)),H},it.prototype._defaultSetter=function(H,z,L){L.setAttribute(z,H)},it.prototype.add=function(H){var z=this.renderer,L=this.element;if(H&&(this.parentGroup=H),this.parentInverted=H&&H.inverted,typeof this.textStr<"u"&&this.element.nodeName==="text"&&z.buildText(this),this.added=!0,!H||H.handleZ||this.zIndex)var N=this.zIndexSetter();return N||(H?H.element:z.box).appendChild(L),this.onAdd&&this.onAdd(),this},it.prototype.addClass=function(H,z){var L=z?"":this.attr("class")||"";return H=(H||"").split(/ /g).reduce(function(N,V){return L.indexOf(V)===-1&&N.push(V),N},L?[L]:[]).join(" "),H!==L&&this.attr("class",H),this},it.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},it.prototype.align=function(H,z,L){var N={},V=this.renderer,K=V.alignedObjects,G,J,C;H?(this.alignOptions=H,this.alignByTranslate=z,(!L||d(L))&&(this.alignTo=G=L||"renderer",A(K,this),K.push(this),L=void 0)):(H=this.alignOptions,z=this.alignByTranslate,G=this.alignTo),L=I(L,V[G],G==="scrollablePlotBox"?V.plotBox:void 0,V),G=H.align;var U=H.verticalAlign;return V=(L.x||0)+(H.x||0),K=(L.y||0)+(H.y||0),G==="right"?J=1:G==="center"&&(J=2),J&&(V+=(L.width-(H.width||0))/J),N[z?"translateX":"x"]=Math.round(V),U==="bottom"?C=1:U==="middle"&&(C=2),C&&(K+=(L.height-(H.height||0))/C),N[z?"translateY":"y"]=Math.round(K),this[this.placed?"animate":"attr"](N),this.placed=!0,this.alignAttr=N,this},it.prototype.alignSetter=function(H){var z={left:"start",center:"middle",right:"end"};z[H]&&(this.alignValue=H,this.element.setAttribute("text-anchor",z[H]))},it.prototype.animate=function(H,z,L){var N=this,V=_(I(z,this.renderer.globalAnimation,!0));return z=V.defer,I(b.hidden,b.msHidden,b.webkitHidden,!1)&&(V.duration=0),V.duration!==0?(L&&(V.complete=L),$(function(){N.element&&O(N,H,V)},z)):(this.attr(H,void 0,L),R(H,function(K,G){V.step&&V.step.call(this,K,{prop:G,pos:1,elem:this})},this)),this},it.prototype.applyTextOutline=function(H){var z=this.element;H.indexOf("contrast")!==-1&&(H=H.replace(/contrast/g,this.renderer.getContrast(z.style.fill)));var L=H.split(" ");if(H=L[L.length-1],(L=L[0])&&L!=="none"&&c.svg){this.fakeTS=!0,this.ySetter=this.xSetter,L=L.replace(/(^[\d\.]+)(.*?)$/g,function(K,G,J){return 2*Number(G)+J}),this.removeTextOutline();var N=b.createElementNS(T,"tspan");y(N,{class:"highcharts-text-outline",fill:H,stroke:H,"stroke-width":L,"stroke-linejoin":"round"}),[].forEach.call(z.childNodes,function(K){var G=K.cloneNode(!0);G.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach(function(J){return G.removeAttribute(J)}),N.appendChild(G)});var V=b.createElementNS(T,"tspan");V.textContent="​",["x","y"].forEach(function(K){var G=z.getAttribute(K);G&&V.setAttribute(K,G)}),N.appendChild(V),z.insertBefore(N,z.firstChild)}},it.prototype.attr=function(H,z,L,N){var V=this.element,K=this.symbolCustomAttribs,G,J=this,C,U;if(typeof H=="string"&&typeof z<"u"){var B=H;H={},H[B]=z}return typeof H=="string"?J=(this[H+"Getter"]||this._defaultGetter).call(this,H,V):(R(H,function(tt,D){C=!1,N||v(this,D),this.symbolName&&K.indexOf(D)!==-1&&(G||(this.symbolAttr(H),G=!0),C=!0),!this.rotation||D!=="x"&&D!=="y"||(this.doTransform=!0),C||(U=this[D+"Setter"]||this._defaultSetter,U.call(this,tt,D,V),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(D)&&this.updateShadows(D,tt,U))},this),this.afterSetters()),L&&L.call(this),J},it.prototype.clip=function(H){return this.attr("clip-path",H?"url("+this.renderer.url+"#"+H.id+")":"none")},it.prototype.crisp=function(H,z){z=z||H.strokeWidth||0;var L=Math.round(z)%2/2;return H.x=Math.floor(H.x||this.x||0)+L,H.y=Math.floor(H.y||this.y||0)+L,H.width=Math.floor((H.width||this.width||0)-2*L),H.height=Math.floor((H.height||this.height||0)-2*L),w(H.strokeWidth)&&(H.strokeWidth=z),H},it.prototype.complexColor=function(H,z,L){var N=this.renderer,V,K,G,J,C,U,B,tt,D,F,X=[],st;u(this.renderer,"complexColor",{args:arguments},function(){if(H.radialGradient?K="radialGradient":H.linearGradient&&(K="linearGradient"),K){if(G=H[K],C=N.gradients,U=H.stops,D=L.radialReference,g(G)&&(H[K]=G={x1:G[0],y1:G[1],x2:G[2],y2:G[3],gradientUnits:"userSpaceOnUse"}),K==="radialGradient"&&D&&!w(G.gradientUnits)&&(J=G,G=p(G,N.getRadialAttr(D,J),{gradientUnits:"userSpaceOnUse"})),R(G,function(lt,ct){ct!=="id"&&X.push(ct,lt)}),R(U,function(lt){X.push(lt)}),X=X.join(","),C[X])F=C[X].attr("id");else{G.id=F=et();var ot=C[X]=N.createElement(K).attr(G).add(N.defs);ot.radAttr=J,ot.stops=[],U.forEach(function(lt){lt[1].indexOf("rgba")===0?(V=o.parse(lt[1]),B=V.get("rgb"),tt=V.get("a")):(B=lt[1],tt=1),lt=N.createElement("stop").attr({offset:lt[0],"stop-color":B,"stop-opacity":tt}).add(ot),ot.stops.push(lt)})}st="url("+N.url+"#"+F+")",L.setAttribute(z,st),L.gradient=X,H.toString=function(){return st}}})},it.prototype.css=function(H){var z=this.styles,L={},N=this.element,V=["textOutline","textOverflow","width"],K="",G=!z;if(H&&H.color&&(H.fill=H.color),z&&R(H,function(U,B){z&&z[B]!==U&&(L[B]=U,G=!0)}),G){if(z&&(H=f(z,L)),H){if(H.width===null||H.width==="auto")delete this.textWidth;else if(N.nodeName.toLowerCase()==="text"&&H.width)var J=this.textWidth=j(H.width)}if(this.styles=H,J&&!m&&this.renderer.forExport&&delete H.width,N.namespaceURI===this.SVG_NS){var C=function(U,B){return"-"+B.toLowerCase()};R(H,function(U,B){V.indexOf(B)===-1&&(K+=B.replace(/([A-Z])/g,C)+":"+U+";")}),K&&y(N,"style",K)}else S(N,H);this.added&&(this.element.nodeName==="text"&&this.renderer.buildText(this),H&&H.textOutline&&this.applyTextOutline(H.textOutline))}return this},it.prototype.dashstyleSetter=function(H){var z=this["stroke-width"];if(z==="inherit"&&(z=1),H=H&&H.toLowerCase()){var L=H.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(H=L.length;H--;)L[H]=""+j(L[H])*I(z,NaN);H=L.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",H)}},it.prototype.destroy=function(){var H=this,z=H.element||{},L=H.renderer,N=z.ownerSVGElement,V=L.isSVG&&z.nodeName==="SPAN"&&H.parentGroup||void 0;if(z.onclick=z.onmouseout=z.onmouseover=z.onmousemove=z.point=null,v(H),H.clipPath&&N){var K=H.clipPath;[].forEach.call(N.querySelectorAll("[clip-path],[CLIP-PATH]"),function(G){-1B.width)&&(B={width:0,height:0})}else B=this.htmlGetBBox();if(L.isSVG&&(H=B.width,L=B.height,C&&(B.height=L={"11px,17":14,"13px,20":16}[(U||"")+","+Math.round(L)]||L),z&&(C=z*E,B.width=Math.abs(L*Math.sin(C))+Math.abs(H*Math.cos(C)),B.height=Math.abs(L*Math.cos(C))+Math.abs(H*Math.sin(C)))),tt&&(K===""||0]*>/g,"").replace(/</g,"<").replace(/>/g,">")},it.prototype.toFront=function(){var H=this.element;return H.parentNode.appendChild(H),this},it.prototype.translate=function(H,z){return this.attr({translateX:H,translateY:z})},it.prototype.updateShadows=function(H,z,L){var N=this.shadows;if(N)for(var V=N.length;V--;)L.call(N[V],H==="height"?Math.max(z-(N[V].cutHeight||0),0):H==="d"?this.d:z,H,N[V])},it.prototype.updateTransform=function(){var H=this.scaleX,z=this.scaleY,L=this.inverted,N=this.rotation,V=this.matrix,K=this.element,G=this.translateX||0,J=this.translateY||0;L&&(G+=this.width,J+=this.height),G=["translate("+G+","+J+")"],w(V)&&G.push("matrix("+V.join(",")+")"),L?G.push("rotate(90) scale(-1,1)"):N&&G.push("rotate("+N+" "+I(this.rotationOriginX,K.getAttribute("x"),0)+" "+I(this.rotationOriginY,K.getAttribute("y")||0)+")"),(w(H)||w(z))&&G.push("scale("+I(H,1)+" "+I(z,1)+")"),G.length&&K.setAttribute("transform",G.join(" "))},it.prototype.visibilitySetter=function(H,z,L){H==="inherit"?L.removeAttribute(z):this[z]!==H&&L.setAttribute(z,H),this[z]=H},it.prototype.xGetter=function(H){return this.element.nodeName==="circle"&&(H==="x"?H="cx":H==="y"&&(H="cy")),this._defaultGetter(H)},it.prototype.zIndexSetter=function(H,z){var L=this.renderer,N=this.parentGroup,V=(N||L).element||L.box,K=this.element;L=V===L.box;var G=!1,J=this.added,C;if(w(H)?(K.setAttribute("data-z-index",H),H=+H,this[z]===H&&(J=!1)):w(this[z])&&K.removeAttribute("data-z-index"),this[z]=H,J){for((H=this.zIndex)&&N&&(N.handleZ=!0),z=V.childNodes,C=z.length-1;0<=C&&!G;C--){N=z[C],J=N.getAttribute("data-z-index");var U=!w(J);N!==K&&(0>H&&U&&!L&&!C?(V.insertBefore(K,z[C]),G=!0):(j(J)<=H||U&&(!w(H)||0<=H))&&(V.insertBefore(K,z[C+1]||null),G=!0))}G||(V.insertBefore(K,z[L?3:0]||null),G=!0)}return G},it}(),r.prototype["stroke-widthSetter"]=r.prototype.strokeSetter,r.prototype.yGetter=r.prototype.xGetter,r.prototype.matrixSetter=r.prototype.rotationOriginXSetter=r.prototype.rotationOriginYSetter=r.prototype.rotationSetter=r.prototype.scaleXSetter=r.prototype.scaleYSetter=r.prototype.translateXSetter=r.prototype.translateYSetter=r.prototype.verticalAlignSetter=function(it,H){this[H]=it,this.doTransform=!0},r}),i(n,"Core/Renderer/RendererRegistry.js",[n["Core/Globals.js"]],function(r){var s;return function(o){o.rendererTypes={};var c;o.getRendererType=function(l){return l===void 0&&(l=c),o.rendererTypes[l]||o.rendererTypes[c]},o.registerRendererType=function(l,O,_){o.rendererTypes[l]=O,(!c||_)&&(c=l,r.Renderer=O)}}(s||(s={})),s}),i(n,"Core/Renderer/SVG/SVGLabel.js",[n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s){var o=this&&this.__extends||function(){var b=function(P,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,k){T.__proto__=k}||function(T,k){for(var M in k)k.hasOwnProperty(M)&&(T[M]=k[M])},b(P,m)};return function(P,m){function T(){this.constructor=P}b(P,m),P.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}}(),c=s.defined,l=s.extend,O=s.isNumber,_=s.merge,v=s.pick,E=s.removeEvent;return function(b){function P(m,T,k,M,y,a,S,w,A,f){var u=b.call(this)||this;u.paddingLeftSetter=u.paddingSetter,u.paddingRightSetter=u.paddingSetter,u.init(m,"g"),u.textStr=T,u.x=k,u.y=M,u.anchorX=a,u.anchorY=S,u.baseline=A,u.className=f,u.addClass(f==="button"?"highcharts-no-tooltip":"highcharts-label"),f&&u.addClass("highcharts-"+f),u.text=m.text(void 0,0,0,w).attr({zIndex:1});var g;return typeof y=="string"&&((g=/^url\((.*?)\)$/.test(y))||u.renderer.symbols[y])&&(u.symbolKey=y),u.bBox=P.emptyBBox,u.padding=3,u.baselineOffset=0,u.needsBox=m.styledMode||g,u.deferredAttr={},u.alignFactor=0,u}return o(P,b),P.prototype.alignSetter=function(m){m={left:0,center:.5,right:1}[m],m!==this.alignFactor&&(this.alignFactor=m,this.bBox&&O(this.xSetting)&&this.attr({x:this.xSetting}))},P.prototype.anchorXSetter=function(m,T){this.anchorX=m,this.boxAttr(T,Math.round(m)-this.getCrispAdjust()-this.xSetting)},P.prototype.anchorYSetter=function(m,T){this.anchorY=m,this.boxAttr(T,m-this.ySetting)},P.prototype.boxAttr=function(m,T){this.box?this.box.attr(m,T):this.deferredAttr[m]=T},P.prototype.css=function(m){if(m){var T={};m=_(m),P.textProps.forEach(function(M){typeof m[M]<"u"&&(T[M]=m[M],delete m[M])}),this.text.css(T);var k="width"in T;"fontSize"in T||"fontWeight"in T?this.updateTextPadding():k&&this.updateBoxSize()}return r.prototype.css.call(this,m)},P.prototype.destroy=function(){E(this.element,"mouseenter"),E(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),r.prototype.destroy.call(this)},P.prototype.fillSetter=function(m,T){m&&(this.needsBox=!0),this.fill=m,this.boxAttr(T,m)},P.prototype.getBBox=function(){this.textStr&&this.bBox.width===0&&this.bBox.height===0&&this.updateBoxSize();var m=this.padding,T=v(this.paddingLeft,m);return{width:this.width,height:this.height,x:this.bBox.x-T,y:this.bBox.y-m}},P.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},P.prototype.heightSetter=function(m){this.heightSetting=m},P.prototype.onAdd=function(){var m=this.textStr;this.text.add(this),this.attr({text:c(m)?m:"",x:this.x,y:this.y}),this.box&&c(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},P.prototype.paddingSetter=function(m,T){O(m)?m!==this[T]&&(this[T]=m,this.updateTextPadding()):this[T]=void 0},P.prototype.rSetter=function(m,T){this.boxAttr(T,m)},P.prototype.shadow=function(m){return m&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(m)),this},P.prototype.strokeSetter=function(m,T){this.stroke=m,this.boxAttr(T,m)},P.prototype["stroke-widthSetter"]=function(m,T){m&&(this.needsBox=!0),this["stroke-width"]=m,this.boxAttr(T,m)},P.prototype["text-alignSetter"]=function(m){this.textAlign=m},P.prototype.textSetter=function(m){typeof m<"u"&&this.text.attr({text:m}),this.updateTextPadding()},P.prototype.updateBoxSize=function(){var m=this.text.element.style,T={},k=this.padding,M=this.bBox=O(this.widthSetting)&&O(this.heightSetting)&&!this.textAlign||!c(this.text.textStr)?P.emptyBBox:this.text.getBBox();this.width=this.getPaddedWidth(),this.height=(this.heightSetting||M.height||0)+2*k,m=this.renderer.fontMetrics(m&&m.fontSize,this.text),this.baselineOffset=k+Math.min((this.text.firstLineMetrics||m).b,M.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-m.h)/2),this.needsBox&&(this.box||(k=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),k.addClass((this.className==="button"?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),k.add(this)),k=this.getCrispAdjust(),T.x=k,T.y=(this.baseline?-this.baselineOffset:0)+k,T.width=Math.round(this.width),T.height=Math.round(this.height),this.box.attr(l(T,this.deferredAttr)),this.deferredAttr={})},P.prototype.updateTextPadding=function(){var m=this.text;this.updateBoxSize();var T=this.baseline?0:this.baselineOffset,k=v(this.paddingLeft,this.padding);c(this.widthSetting)&&this.bBox&&(this.textAlign==="center"||this.textAlign==="right")&&(k+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),(k!==m.x||T!==m.y)&&(m.attr("x",k),m.hasBoxWidthChanged&&(this.bBox=m.getBBox(!0)),typeof T<"u"&&m.attr("y",T)),m.x=k,m.y=T},P.prototype.widthSetter=function(m){this.widthSetting=O(m)?m:void 0},P.prototype.getPaddedWidth=function(){var m=this.padding,T=v(this.paddingLeft,m);return m=v(this.paddingRight,m),(this.widthSetting||this.bBox.width||0)+T+m},P.prototype.xSetter=function(m){this.x=m,this.alignFactor&&(m-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(m),this.attr("translateX",this.xSetting)},P.prototype.ySetter=function(m){this.ySetting=this.y=Math.round(m),this.attr("translateY",this.ySetting)},P.emptyBBox={width:0,height:0,x:0,y:0},P.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),P}(r)}),i(n,"Core/Renderer/SVG/Symbols.js",[n["Core/Utilities.js"]],function(r){function s(v,E,b,P,m){var T=[];if(m){var k=m.start||0,M=_(m.r,b);b=_(m.r,P||b);var y=(m.end||0)-.001;P=m.innerR;var a=_(m.open,.001>Math.abs((m.end||0)-k-2*Math.PI)),S=Math.cos(k),w=Math.sin(k),A=Math.cos(y),f=Math.sin(y);k=_(m.longArc,.001>y-k-Math.PI?0:1),T.push(["M",v+M*S,E+b*w],["A",M,b,0,k,_(m.clockwise,1),v+M*A,E+b*f]),l(P)&&T.push(a?["M",v+P*A,E+P*f]:["L",v+P*A,E+P*f],["A",P,P,0,k,l(m.clockwise)?1-m.clockwise:0,v+P*S,E+P*w]),a||T.push(["Z"])}return T}function o(v,E,b,P,m){return m&&m.r?c(v,E,b,P,m):[["M",v,E],["L",v+b,E],["L",v+b,E+P],["L",v,E+P],["Z"]]}function c(v,E,b,P,m){return m=m&&m.r||0,[["M",v+m,E],["L",v+b-m,E],["C",v+b,E,v+b,E,v+b,E+m],["L",v+b,E+P-m],["C",v+b,E+P,v+b,E+P,v+b-m,E+P],["L",v+m,E+P],["C",v,E+P,v,E+P,v,E+P-m],["L",v,E+m],["C",v,E,v,E,v+m,E]]}var l=r.defined,O=r.isNumber,_=r.pick;return{arc:s,callout:function(v,E,b,P,m){var T=Math.min(m&&m.r||0,b,P),k=T+6,M=m&&m.anchorX;m=m&&m.anchorY||0;var y=c(v,E,b,P,{r:T});return O(M)&&(v+M>=b?m>E+k&&m=v+M?m>E+k&&mP&&M>v+k&&Mm&&M>v+k&&M/g,w=[M,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,this.fontSize,this.width].join();if(w!==m.textCache){for(m.textCache=w,delete m.actualWidth,w=a.length;w--;)T.removeChild(a[w]);y||this.ellipsis||this.width||M.indexOf(" ")!==-1&&(!this.noWrap||S.test(M))?M!==""&&(k&&k.appendChild(T),M=new r(M),this.modifyTree(M.nodes),M.addToDOM(m.element),this.modifyDOM(),this.ellipsis&&(T.textContent||"").indexOf("…")!==-1&&m.attr("title",this.unescapeEntities(m.textStr||"",["<",">"])),k&&k.removeChild(T)):T.appendChild(c.createTextNode(this.unescapeEntities(M))),v(this.textOutline)&&m.applyTextOutline&&m.applyTextOutline(this.textOutline)}},P.prototype.modifyDOM=function(){var m=this,T=this.svgElement,k=_(T.element,"x");T.firstLineMetrics=void 0;for(var M;(M=T.element.firstChild)&&/^[\s\u200B]*$/.test(M.textContent||" ");)T.element.removeChild(M);[].forEach.call(T.element.querySelectorAll("tspan.highcharts-br"),function(w,A){w.nextSibling&&w.previousSibling&&(A===0&&w.previousSibling.nodeType===1&&(T.firstLineMetrics=T.renderer.fontMetrics(void 0,w.previousSibling)),_(w,{dy:m.getLineHeight(w.nextSibling),x:k}))});var y=this.width||0;if(y){var a=function(w,A){var f=w.textContent||"",u=f.replace(/([^\^])-/g,"$1- ").split(" "),g=!m.noWrap&&(1"u")if(j.getSubStringLength)try{f[I]=M+j.getSubStringLength(0,k?I+1:I)}catch{}else w.getSpanWidth&&(m.textContent=a(T||k,R),f[I]=M+w.getSpanWidth(S,m));return f[I]};S.rotation=0;var p=d(m.textContent.length);if(M+p>y){for(;u<=g;)h=Math.ceil((u+g)/2),k&&(x=a(k,h)),p=d(h,x&&x.length-1),u===g?u=g+1:p>y?g=h-1:u=h;g===0?m.textContent="":T&&g===T.length-1||(m.textContent=x||a(T||k,h))}k&&k.splice(0,h),S.actualWidth=p,S.rotation=A},P.prototype.unescapeEntities=function(m,T){return E(this.renderer.escapes,function(k,M){T&&T.indexOf(k)!==-1||(m=m.toString().replace(new RegExp(k,"g"),M))}),m},P}()}),i(n,"Core/Renderer/SVG/SVGRenderer.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Renderer/RendererRegistry.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGLabel.js"],n["Core/Renderer/SVG/Symbols.js"],n["Core/Renderer/SVG/TextBuilder.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E){var b=o.charts,P=o.deg2rad,m=o.doc,T=o.isFirefox,k=o.isMS,M=o.isWebKit,y=o.noop,a=o.SVG_NS,S=o.symbolSizes,w=o.win,A=E.addEvent,f=E.attr,u=E.createElement,g=E.css,h=E.defined,x=E.destroyObjectProperties,d=E.extend,p=E.isArray,R=E.isNumber,I=E.isObject,j=E.isString,$=E.merge,et=E.pick,it=E.pInt,H=E.uniqueKey,z;return o=function(){function L(N,V,K,G,J,C,U){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(N,V,K,G,J,C,U)}return L.prototype.init=function(N,V,K,G,J,C,U){var B=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}),tt=B.element;U||B.css(this.getStyle(G)),N.appendChild(tt),f(N,"dir","ltr"),N.innerHTML.indexOf("xmlns")===-1&&f(tt,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=tt,this.boxWrapper=B,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement("desc").add().element.appendChild(m.createTextNode("Created with Highcharts 9.3.3")),this.defs=this.createElement("defs").add(),this.allowHTML=C,this.forExport=J,this.styledMode=U,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(V,K,!1);var D;T&&N.getBoundingClientRect&&(V=function(){g(N,{left:0,top:0}),D=N.getBoundingClientRect(),g(N,{left:Math.ceil(D.left)-D.left+"px",top:Math.ceil(D.top)-D.top+"px"})},V(),this.unSubPixelFix=A(w,"resize",V))},L.prototype.definition=function(N){return new r([N]).addToDOM(this.defs.element)},L.prototype.getReferenceURL=function(){if((T||M)&&m.getElementsByTagName("base").length){if(!h(z)){var N=H();N=new r([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:N},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme",width:8,height:8,"clip-path":"url(#"+N+")",fill:"rgba(0,0,0,0.001)"}}]}]).addToDOM(m.body),g(N,{position:"fixed",top:0,left:0,zIndex:9e5});var V=m.elementFromPoint(6,6);z=(V&&V.id)==="hitme",m.body.removeChild(N)}if(z)return w.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20")}return""},L.prototype.getStyle=function(N){return this.style=d({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},N)},L.prototype.setStyle=function(N){this.boxWrapper.css(this.getStyle(N))},L.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},L.prototype.destroy=function(){var N=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),x(this.gradients||{}),this.gradients=null,N&&(this.defs=N.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},L.prototype.createElement=function(N){var V=new this.Element;return V.init(this,N),V},L.prototype.getRadialAttr=function(N,V){return{cx:N[0]-N[2]/2+(V.cx||0)*N[2],cy:N[1]-N[2]/2+(V.cy||0)*N[2],r:(V.r||0)*N[2]}},L.prototype.buildText=function(N){new v(N).buildSVG()},L.prototype.getContrast=function(N){return N=s.parse(N).rgba,N[0]*=1,N[1]*=1.2,N[2]*=.5,459"u"?{}:{x:N,y:V,r:K},V=this.createElement("circle"),V.xSetter=V.ySetter=function(G,J,C){C.setAttribute("c"+J,G)},V.attr(N)},L.prototype.arc=function(N,V,K,G,J,C){return I(N)?(G=N,V=G.y,K=G.r,N=G.x):G={innerR:G,start:J,end:C},N=this.symbol("arc",N,V,K,K,G),N.r=K,N},L.prototype.rect=function(N,V,K,G,J,C){J=I(N)?N.r:J;var U=this.createElement("rect");return N=I(N)?N:typeof N>"u"?{}:{x:N,y:V,width:Math.max(K,0),height:Math.max(G,0)},this.styledMode||(typeof C<"u"&&(N["stroke-width"]=C,N=U.crisp(N)),N.fill="none"),J&&(N.r=J),U.rSetter=function(B,tt,D){U.r=B,f(D,{rx:B,ry:B})},U.rGetter=function(){return U.r||0},U.attr(N)},L.prototype.setSize=function(N,V,K){this.width=N,this.height=V,this.boxWrapper.animate({width:N,height:V},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:et(K,!0)?void 0:0}),this.alignElements()},L.prototype.g=function(N){var V=this.createElement("g");return N?V.attr({class:"highcharts-"+N}):V},L.prototype.image=function(N,V,K,G,J,C){var U={preserveAspectRatio:"none"},B=function(D,F){D.setAttributeNS?D.setAttributeNS("http://www.w3.org/1999/xlink","href",F):D.setAttribute("hc-svg-href",F)};R(V)&&(U.x=V),R(K)&&(U.y=K),R(G)&&(U.width=G),R(J)&&(U.height=J);var tt=this.createElement("image").attr(U);return V=function(D){B(tt.element,N),C.call(tt,D)},C?(B(tt.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),K=new w.Image,A(K,"load",V),K.src=N,K.complete&&V({})):B(tt.element,N),tt},L.prototype.symbol=function(N,V,K,G,J,C){var U=this,B=/^url\((.*?)\)$/,tt=B.test(N),D=!tt&&(this.symbols[N]?N:"circle"),F=D&&this.symbols[D],X;if(F){typeof V=="number"&&(X=F.call(this.symbols,Math.round(V||0),Math.round(K||0),G||0,J||0,C));var st=this.path(X);U.styledMode||st.attr("fill","none"),d(st,{symbolName:D||void 0,x:V,y:K,width:G,height:J}),C&&d(st,C)}else if(tt){var ot=N.match(B)[1],lt=st=this.image(ot);lt.imgwidth=et(S[ot]&&S[ot].width,C&&C.width),lt.imgheight=et(S[ot]&&S[ot].height,C&&C.height);var ct=function(q){return q.attr({width:q.width,height:q.height})};["width","height"].forEach(function(q){lt[q+"Setter"]=function(Y,Z){var W=this["img"+Z];this[Z]=Y,h(W)&&(C&&C.backgroundSize==="within"&&this.width&&this.height&&(W=Math.round(W*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(Z,W),this.alignByTranslate||(Y=((this[Z]||0)-W)/2,this.attr(Z==="width"?{translateX:Y}:{translateY:Y})))}}),h(V)&<.attr({x:V,y:K}),lt.isImg=!0,h(lt.imgwidth)&&h(lt.imgheight)?ct(lt):(lt.attr({width:0,height:0}),u("img",{onload:function(){var q=b[U.chartIndex];this.width===0&&(g(this,{position:"absolute",top:"-999em"}),m.body.appendChild(this)),S[ot]={width:this.width,height:this.height},lt.imgwidth=this.width,lt.imgheight=this.height,lt.element&&ct(lt),this.parentNode&&this.parentNode.removeChild(this),U.imgCount--,!U.imgCount&&q&&!q.hasLoaded&&q.onload()},src:ot}),this.imgCount++)}return st},L.prototype.clipRect=function(N,V,K,G){var J=H()+"-",C=this.createElement("clipPath").attr({id:J}).add(this.defs);return N=this.rect(N,V,K,G,0).add(C),N.id=J,N.clipPath=C,N.count=0,N},L.prototype.text=function(N,V,K,G){var J={};return G&&(this.allowHTML||!this.forExport)?this.html(N,V,K):(J.x=Math.round(V||0),K&&(J.y=Math.round(K)),h(N)&&(J.text=N),N=this.createElement("text").attr(J),(!G||this.forExport&&!this.allowHTML)&&(N.xSetter=function(C,U,B){for(var tt=B.getElementsByTagName("tspan"),D=B.getAttribute(U),F=0,X;FN?N+3:Math.round(1.2*N),{h:V,b:Math.round(.8*V),f:N}},L.prototype.rotCorr=function(N,V,K){var G=N;return V&&K&&(G=Math.max(G*Math.cos(V*P),4)),{x:-N/3*Math.sin(V*P),y:G}},L.prototype.pathToSegments=function(N){for(var V=[],K=[],G={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},J=0;J":">","'":"'",'"':"""},symbols:_,draw:y}),c.registerRendererType("svg",o,!0),o}),i(n,"Core/Renderer/HTML/HTMLElement.js",[n["Core/Globals.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s,o){var c=this&&this.__extends||function(){var k=function(M,y){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,S){a.__proto__=S}||function(a,S){for(var w in S)S.hasOwnProperty(w)&&(a[w]=S[w])},k(M,y)};return function(M,y){function a(){this.constructor=M}k(M,y),M.prototype=y===null?Object.create(y):(a.prototype=y.prototype,new a)}}(),l=r.isFirefox,O=r.isMS,_=r.isWebKit,v=r.win,E=o.css,b=o.defined,P=o.extend,m=o.pick,T=o.pInt;return function(k){function M(){return k!==null&&k.apply(this,arguments)||this}return c(M,k),M.compose=function(y){if(M.composedClasses.indexOf(y)===-1){M.composedClasses.push(y);var a=M.prototype,S=y.prototype;S.getSpanCorrection=a.getSpanCorrection,S.htmlCss=a.htmlCss,S.htmlGetBBox=a.htmlGetBBox,S.htmlUpdateTransform=a.htmlUpdateTransform,S.setSpanRotation=a.setSpanRotation}return y},M.prototype.getSpanCorrection=function(y,a,S){this.xCorr=-y*S,this.yCorr=-a},M.prototype.htmlCss=function(y){var a=this.element.tagName==="SPAN"&&y&&"width"in y,S=m(a&&y.width,void 0);if(a){delete y.width,this.textWidth=S;var w=!0}return y&&y.textOverflow==="ellipsis"&&(y.whiteSpace="nowrap",y.overflow="hidden"),this.styles=P(this.styles,y),E(this.element,y),w&&this.htmlUpdateTransform(),this},M.prototype.htmlGetBBox=function(){var y=this.element;return{x:y.offsetLeft,y:y.offsetTop,width:y.offsetWidth,height:y.offsetHeight}},M.prototype.htmlUpdateTransform=function(){if(this.added){var y=this.renderer,a=this.element,S=this.translateX||0,w=this.translateY||0,A=this.x||0,f=this.y||0,u=this.textAlign||"left",g={left:0,center:.5,right:1}[u],h=this.styles;if(h=h&&h.whiteSpace,E(a,{marginLeft:S,marginTop:w}),!y.styledMode&&this.shadows&&this.shadows.forEach(function(j){E(j,{marginLeft:S+1,marginTop:w+1})}),this.inverted&&[].forEach.call(a.childNodes,function(j){y.invertChild(j,a)}),a.tagName==="SPAN"){var x=this.rotation,d=this.textWidth&&T(this.textWidth),p=[x,u,a.innerHTML,this.textWidth,this.textAlign].join(),R=void 0;if(R=!1,d!==this.oldTextWidth){if(this.textPxLength)var I=this.textPxLength;else E(a,{width:"",whiteSpace:h||"nowrap"}),I=a.offsetWidth;(d>this.oldTextWidth||I>d)&&(/[ \-]/.test(a.textContent||a.innerText)||a.style.textOverflow==="ellipsis")&&(E(a,{width:I>d||x?d+"px":"auto",display:"block",whiteSpace:h||"normal"}),this.oldTextWidth=d,R=!0)}this.hasBoxWidthChanged=R,p!==this.cTT&&(R=y.fontMetrics(a.style.fontSize,a).b,!b(x)||x===(this.oldRotation||0)&&u===this.oldAlign||this.setSpanRotation(x,g,R),this.getSpanCorrection(!b(x)&&this.textPxLength||a.offsetWidth,R,g,x,u)),E(a,{left:A+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"}),this.cTT=p,this.oldRotation=x,this.oldAlign=u}}else this.alignOnAdd=!0},M.prototype.setSpanRotation=function(y,a,S){var w={},A=O&&!/Edge/.test(v.navigator.userAgent)?"-ms-transform":_?"-webkit-transform":l?"MozTransform":v.opera?"-o-transform":void 0;A&&(w[A]=w.transform="rotate("+y+"deg)",w[A+(l?"Origin":"-origin")]=w.transformOrigin=100*a+"% "+S+"px",E(this.element,w))},M.composedClasses=[],M}(s)}),i(n,"Core/Renderer/HTML/HTMLRenderer.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGRenderer.js"],n["Core/Utilities.js"]],function(r,s,o,c){var l=this&&this.__extends||function(){var b=function(P,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,k){T.__proto__=k}||function(T,k){for(var M in k)k.hasOwnProperty(M)&&(T[M]=k[M])},b(P,m)};return function(P,m){function T(){this.constructor=P}b(P,m),P.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}}(),O=c.attr,_=c.createElement,v=c.extend,E=c.pick;return function(b){function P(){return b!==null&&b.apply(this,arguments)||this}return l(P,b),P.compose=function(m){return P.composedClasses.indexOf(m)===-1&&(P.composedClasses.push(m),m.prototype.html=P.prototype.html),m},P.prototype.html=function(m,T,k){var M=this.createElement("span"),y=M.element,a=M.renderer,S=a.isSVG,w=function(A,f){["opacity","visibility"].forEach(function(u){A[u+"Setter"]=function(g,h,x){var d=A.div?A.div.style:f;s.prototype[u+"Setter"].call(this,g,h,x),d&&(d[h]=g)}}),A.addedSetters=!0};return M.textSetter=function(A){A!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,r.setElementHTML(this.element,E(A,"")),this.textStr=A,M.doTransform=!0)},S&&w(M,M.element.style),M.xSetter=M.ySetter=M.alignSetter=M.rotationSetter=function(A,f){f==="align"?M.alignValue=M.textAlign=A:M[f]=A,M.doTransform=!0},M.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},M.attr({text:m,x:Math.round(T),y:Math.round(k)}).css({position:"absolute"}),a.styledMode||M.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),y.style.whiteSpace="nowrap",M.css=M.htmlCss,S&&(M.add=function(A){var f=a.box.parentNode,u=[];if(this.parentGroup=A){var g=A.div;if(!g){for(;A;)u.push(A),A=A.parentGroup;u.reverse().forEach(function(h){function x(I,j){h[j]=I,j==="translateX"?R.left=I+"px":R.top=I+"px",h.doTransform=!0}var d=O(h.element,"class"),p=h.styles||{};g=h.div=h.div||_("div",d?{className:d}:void 0,{position:"absolute",left:(h.translateX||0)+"px",top:(h.translateY||0)+"px",display:h.display,opacity:h.opacity,cursor:p.cursor,pointerEvents:p.pointerEvents,visibility:h.visibility},g||f);var R=g.style;v(h,{classSetter:function(I){return function(j){this.element.setAttribute("class",j),I.className=j}}(g),on:function(){return u[0].div&&M.on.apply({element:u[0].div,onEvents:h.onEvents},arguments),h},translateXSetter:x,translateYSetter:x}),h.addedSetters||w(h)})}}else g=f;return g.appendChild(y),M.added=!0,M.alignOnAdd&&M.htmlUpdateTransform(),M}),M},P.composedClasses=[],P}(o)}),i(n,"Core/Axis/AxisDefaults.js",[],function(){var r;return function(s){s.defaultXAxisOptions={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotation:void 0,autoRotationLimit:80,distance:void 0,enabled:!0,indentation:10,overflow:"justify",padding:5,reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,x:0,zIndex:7,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minPadding:.01,offset:void 0,opposite:!1,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",rotation:0,useHTML:!1,x:0,y:0,style:{color:"#666666"}},type:"linear",uniqueNames:!0,visible:!0,minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",gridLineWidth:void 0,tickColor:"#ccd6eb"},s.defaultYAxisOptions={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var o=this.axis.chart.numberFormatter;return o(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},s.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}},s.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}},s.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},s.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}}}(r||(r={})),r}),i(n,"Core/Foundation.js",[n["Core/Utilities.js"]],function(r){var s=r.addEvent,o=r.isFunction,c=r.objectEach,l=r.removeEvent,O;return function(_){_.registerEventOptions=function(v,E){v.eventOptions=v.eventOptions||{},c(E.events,function(b,P){v.eventOptions[P]!==b&&(v.eventOptions[P]&&(l(v,P,v.eventOptions[P]),delete v.eventOptions[P]),o(b)&&(v.eventOptions[P]=b,s(v,P,b)))})}}(O||(O={})),O}),i(n,"Core/Axis/Tick.js",[n["Core/FormatUtilities.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o){var c=s.deg2rad,l=o.clamp,O=o.correctFloat,_=o.defined,v=o.destroyObjectProperties,E=o.extend,b=o.fireEvent,P=o.isNumber,m=o.merge,T=o.objectEach,k=o.pick;return s=function(){function M(y,a,S,w,A){this.isNewLabel=this.isNew=!0,this.axis=y,this.pos=a,this.type=S||"",this.parameters=A||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,b(this,"init"),S||w||this.addLabel()}return M.prototype.addLabel=function(){var y=this,a=y.axis,S=a.options,w=a.chart,A=a.categories,f=a.logarithmic,u=a.names,g=y.pos,h=k(y.options&&y.options.labels,S.labels),x=a.tickPositions,d=g===x[0],p=g===x[x.length-1],R=(!h.step||h.step===1)&&a.tickInterval===1;x=x.info;var I=y.label,j;if(A=this.parameters.category||(A?k(A[g],u[g],g):g),f&&P(A)&&(A=O(f.lin2log(A))),a.dateTime)if(x)var $=w.time.resolveDTLFormat(S.dateTimeLabelFormats[!S.grid&&x.higherRanks[g]||x.unitName]),et=$.main;else P(A)&&(et=a.dateTime.getXDateFormat(A,S.dateTimeLabelFormats||{}));y.isFirst=d,y.isLast=p;var it={axis:a,chart:w,dateTimeLabelFormat:et,isFirst:d,isLast:p,pos:g,tick:y,tickPositionInfo:x,value:A};b(this,"labelFormat",it);var H=function(L){return h.formatter?h.formatter.call(L,L):h.format?(L.text=a.defaultLabelFormatter.call(L),r.format(h.format,L,w)):a.defaultLabelFormatter.call(L,L)};S=H.call(it,it);var z=$&&$.list;y.shortenLabel=z?function(){for(j=0;jh&&w-x*df&&($=Math.round((A-w)/Math.cos(h*c))):(A=w+(1-x)*d,w-x*df&&(I=f-y.x+I*x,j=-1),I=Math.min(p,I),II||a.autoRotation&&(g.styles||{}).width)&&($=I)),$&&(this.shortenLabel?this.shortenLabel():(R.width=Math.floor($)+"px",(S.style||{}).textOverflow||(R.textOverflow="ellipsis"),g.css(R)))},M.prototype.moveLabel=function(y,a){var S=this,w=S.label,A=S.axis,f=A.reversed,u=!1;if(w&&w.textStr===y?(S.movedLabel=w,u=!0,delete S.label):T(A.ticks,function(h){u||h.isNew||h===S||!h.label||h.label.textStr!==y||(S.movedLabel=h.label,u=!0,h.labelPos=S.movedLabel.xy,delete h.label)}),!u&&(S.labelPos||w)){var g=S.labelPos||w.xy;w=A.horiz?f?0:A.width+A.left:g.x,A=A.horiz?g.y:f?A.width+A.left:0,S.movedLabel=S.createLabel({x:w,y:A},y,a),S.movedLabel&&S.movedLabel.attr({opacity:0})}},M.prototype.render=function(y,a,S){var w=this.axis,A=w.horiz,f=this.pos,u=k(this.tickmarkOffset,w.tickmarkOffset);f=this.getPosition(A,f,u,a),u=f.x;var g=f.y;w=A&&u===w.pos+w.len||!A&&g===w.pos?-1:1,A=k(S,this.label&&this.label.newOpacity,1),S=k(S,1),this.isActive=!0,this.renderGridLine(a,S,w),this.renderMark(f,S,w),this.renderLabel(f,a,A,y),this.isNew=!1,b(this,"afterRender")},M.prototype.renderGridLine=function(y,a,S){var w=this.axis,A=w.options,f={},u=this.pos,g=this.type,h=k(this.tickmarkOffset,w.tickmarkOffset),x=w.chart.renderer,d=this.gridLine,p=A.gridLineWidth,R=A.gridLineColor,I=A.gridLineDashStyle;this.type==="minor"&&(p=A.minorGridLineWidth,R=A.minorGridLineColor,I=A.minorGridLineDashStyle),d||(w.chart.styledMode||(f.stroke=R,f["stroke-width"]=p||0,f.dashstyle=I),g||(f.zIndex=1),y&&(a=0),this.gridLine=d=x.path().attr(f).addClass("highcharts-"+(g?g+"-":"")+"grid-line").add(w.gridGroup)),d&&(S=w.getPlotLinePath({value:u+h,lineWidth:d.strokeWidth()*S,force:"pass",old:y}))&&d[y||this.isNew?"attr":"animate"]({d:S,opacity:a})},M.prototype.renderMark=function(y,a,S){var w=this.axis,A=w.options,f=w.chart.renderer,u=this.type,g=w.tickSize(u?u+"Tick":"tick"),h=y.x;y=y.y;var x=k(A[u!=="minor"?"tickWidth":"minorTickWidth"],!u&&w.isXAxis?1:0);A=A[u!=="minor"?"tickColor":"minorTickColor"];var d=this.mark,p=!d;g&&(w.opposite&&(g[0]=-g[0]),d||(this.mark=d=f.path().addClass("highcharts-"+(u?u+"-":"")+"tick").add(w.axisGroup),w.chart.styledMode||d.attr({stroke:A,"stroke-width":x})),d[p?"attr":"animate"]({d:this.getMarkPath(h,y,g[0],d.strokeWidth()*S,w.horiz,f),opacity:a}))},M.prototype.renderLabel=function(y,a,S,w){var A=this.axis,f=A.horiz,u=A.options,g=this.label,h=u.labels,x=h.step;A=k(this.tickmarkOffset,A.tickmarkOffset);var d=y.x;y=y.y;var p=!0;g&&P(d)&&(g.xy=y=this.getLabelPosition(d,y,g,f,h,A,w,x),this.isFirst&&!this.isLast&&!u.showFirstLabel||this.isLast&&!this.isFirst&&!u.showLastLabel?p=!1:!f||h.step||h.rotation||a||S===0||this.handleOverflow(y),x&&w%x&&(p=!1),p&&P(y.y)?(y.opacity=S,g[this.isNewLabel?"attr":"animate"](y),this.isNewLabel=!1):(g.attr("y",-9999),this.isNewLabel=!0))},M.prototype.replaceMovedLabel=function(){var y=this.label,a=this.axis,S=a.reversed;if(y&&!this.isNew){var w=a.horiz?S?a.left:a.width+a.left:y.xy.x;S=a.horiz?y.xy.y:S?a.width+a.top:a.top,y.animate({x:w,y:S,opacity:0},void 0,y.destroy),delete this.label}a.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},M}(),s}),i(n,"Core/Axis/Axis.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/AxisDefaults.js"],n["Core/Color/Color.js"],n["Core/DefaultOptions.js"],n["Core/Foundation.js"],n["Core/Globals.js"],n["Core/Axis/Tick.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v){var E=r.animObject,b=c.defaultOptions,P=l.registerEventOptions,m=O.deg2rad,T=v.arrayMax,k=v.arrayMin,M=v.clamp,y=v.correctFloat,a=v.defined,S=v.destroyObjectProperties,w=v.erase,A=v.error,f=v.extend,u=v.fireEvent,g=v.getMagnitude,h=v.isArray,x=v.isNumber,d=v.isString,p=v.merge,R=v.normalizeTickInterval,I=v.objectEach,j=v.pick,$=v.relativeLength,et=v.removeEvent,it=v.splat,H=v.syncTimeout;return r=function(){function z(L,N){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.eventOptions=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(L,N)}return z.prototype.init=function(L,N){var V=N.isX;this.chart=L,this.horiz=L.inverted&&!this.isZAxis?!V:V,this.isXAxis=V,this.coll=this.coll||(V?"xAxis":"yAxis"),u(this,"init",{userOptions:N}),this.opposite=j(N.opposite,this.opposite),this.side=j(N.side,this.side,this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(N);var K=this.options,G=K.labels,J=K.type;this.userOptions=N,this.minPixelPadding=0,this.reversed=j(K.reversed,this.reversed),this.visible=K.visible,this.zoomEnabled=K.zoomEnabled,this.hasNames=J==="category"||K.categories===!0,this.categories=K.categories||this.hasNames,this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=a(K.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=K.minRange||K.maxZoom,this.range=K.range,this.offset=K.offset||0,this.min=this.max=null,N=j(K.crosshair,it(L.options.tooltip.crosshairs)[V?0:1]),this.crosshair=N===!0?{}:N,L.axes.indexOf(this)===-1&&(V?L.axes.splice(L.xAxis.length,0,this):L.axes.push(this),L[this.coll].push(this)),this.series=this.series||[],L.inverted&&!this.isZAxis&&V&&typeof this.reversed>"u"&&(this.reversed=!0),this.labelRotation=x(G.rotation)?G.rotation:void 0,P(this,K),u(this,"afterInit")},z.prototype.setOptions=function(L){this.options=p(s.defaultXAxisOptions,this.coll==="yAxis"&&s.defaultYAxisOptions,[s.defaultTopAxisOptions,s.defaultRightAxisOptions,s.defaultBottomAxisOptions,s.defaultLeftAxisOptions][this.side],p(b[this.coll],L)),u(this,"afterSetOptions",{userOptions:L})},z.prototype.defaultLabelFormatter=function(L){var N=this.axis;L=this.chart.numberFormatter;var V=x(this.value)?this.value:NaN,K=N.chart.time,G=this.dateTimeLabelFormat,J=b.lang,C=J.numericSymbols;J=J.numericSymbolMagnitude||1e3;var U=N.logarithmic?Math.abs(V):N.tickInterval,B=C&&C.length;if(N.categories)var tt=""+this.value;else if(G)tt=K.dateFormat(G,V);else if(B&&1e3<=U)for(;B--&&typeof tt>"u";)N=Math.pow(J,B+1),U>=N&&10*V%N===0&&C[B]!==null&&V!==0&&(tt=L(V/N,-1)+C[B]);return typeof tt>"u"&&(tt=1e4<=Math.abs(V)?L(V,-1):L(V,-1,void 0,"")),tt},z.prototype.getSeriesExtremes=function(){var L=this,N=L.chart,V;u(this,"getSeriesExtremes",null,function(){L.hasVisibleSeries=!1,L.dataMin=L.dataMax=L.threshold=null,L.softThreshold=!L.isXAxis,L.stacking&&L.stacking.buildStacks(),L.series.forEach(function(K){if(K.visible||!N.options.chart.ignoreHiddenSeries){var G=K.options,J=G.threshold;if(L.hasVisibleSeries=!0,L.positiveValuesOnly&&0>=J&&(J=null),L.isXAxis){if(G=K.xData,G.length){G=L.logarithmic?G.filter(L.validatePositiveValue):G,V=K.getXExtremes(G);var C=V.min,U=V.max;x(C)||C instanceof Date||(G=G.filter(x),V=K.getXExtremes(G),C=V.min,U=V.max),G.length&&(L.dataMin=Math.min(j(L.dataMin,C),C),L.dataMax=Math.max(j(L.dataMax,U),U))}}else K=K.applyExtremes(),x(K.dataMin)&&(C=K.dataMin,L.dataMin=Math.min(j(L.dataMin,C),C)),x(K.dataMax)&&(U=K.dataMax,L.dataMax=Math.max(j(L.dataMax,U),U)),a(J)&&(L.threshold=J),(!G.softThreshold||L.positiveValuesOnly)&&(L.softThreshold=!1)}})}),u(this,"afterGetSeriesExtremes")},z.prototype.translate=function(L,N,V,K,G,J){var C=this.linkedParent||this,U=K&&C.old?C.old.min:C.min,B=C.minPixelPadding;G=(C.isOrdinal||C.brokenAxis&&C.brokenAxis.hasBreaks||C.logarithmic&&G)&&C.lin2val;var tt=1,D=0;return K=K&&C.old?C.old.transA:C.transA,K||(K=C.transA),V&&(tt*=-1,D=C.len),C.reversed&&(tt*=-1,D-=tt*(C.sector||C.len)),N?(L=(L*tt+D-B)/K+U,G&&(L=C.lin2val(L))):(G&&(L=C.val2lin(L)),L=x(U)?tt*(L-U)*K+D+tt*B+(x(J)?K*J:0):void 0),L},z.prototype.toPixels=function(L,N){return this.translate(L,!1,!this.horiz,null,!0)+(N?0:this.pos)},z.prototype.toValue=function(L,N){return this.translate(L-(N?0:this.pos),!0,!this.horiz,null,!0)},z.prototype.getPlotLinePath=function(L){function N(Z,W,Q){return(st!=="pass"&&ZQ)&&(st?Z=M(Z,W,Q):Y=!0),Z}var V=this,K=V.chart,G=V.left,J=V.top,C=L.old,U=L.value,B=L.lineWidth,tt=C&&K.oldChartHeight||K.chartHeight,D=C&&K.oldChartWidth||K.chartWidth,F=V.transB,X=L.translatedValue,st=L.force,ot,lt,ct,q,Y;return L={value:U,lineWidth:B,old:C,force:st,acrossPanes:L.acrossPanes,translatedValue:X},u(this,"getPlotLinePath",L,function(Z){X=j(X,V.translate(U,null,null,C)),X=M(X,-1e5,1e5),ot=ct=Math.round(X+F),lt=q=Math.round(tt-X-F),x(X)?V.horiz?(lt=J,q=tt-V.bottom,ot=ct=N(ot,G,G+V.width)):(ot=G,ct=D-V.right,lt=q=N(lt,J,J+V.height)):(Y=!0,st=!1),Z.path=Y&&!st?null:K.renderer.crispLine([["M",ot,lt],["L",ct,q]],B||1)}),L.path},z.prototype.getLinearTickPositions=function(L,N,V){var K=y(Math.floor(N/L)*L);V=y(Math.ceil(V/L)*L);var G=[],J;if(y(K+L)===K&&(J=20),this.single)return[N];for(N=K;N<=V&&(G.push(N),N=y(N+L,J),N!==C);)var C=N;return G},z.prototype.getMinorTickInterval=function(){var L=this.options;return L.minorTicks===!0?j(L.minorTickInterval,"auto"):L.minorTicks===!1?null:L.minorTickInterval},z.prototype.getMinorTickPositions=function(){var L=this.options,N=this.tickPositions,V=this.minorTickInterval,K=this.pointRangePadding||0,G=this.min-K;K=this.max+K;var J=K-G,C=[];if(J&&J/V"u"&&!N&&(a(L.min)||a(L.max)||a(L.floor)||a(L.ceiling)?this.minRange=null:(this.series.forEach(function(X){if(U=X.xData,B=X.xIncrement?1:U.length-1,1=this.minRange,D=this.minRange,F=(D-K+V)/2;F=[V-F,j(L.min,V-F)],tt&&(F[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),V=T(F),K=[V+D,j(L.max,V+D)],tt&&(K[2]=N?N.log2lin(this.dataMax):this.dataMax),K=k(K),K-V=X)lt=X,D=0;else if(this.dataMax<=X){var ct=X;tt=0}}this.min=j(st,lt,this.dataMin),this.max=j(ot,ct,this.dataMax)}if(V&&(this.positiveValuesOnly&&!L&&0>=Math.min(this.min,j(this.dataMin,this.min))&&A(10,1,N),this.min=y(V.log2lin(this.min),16),this.max=y(V.log2lin(this.max),16)),this.range&&a(this.max)&&(this.userMin=this.min=st=Math.max(this.dataMin,this.minFromRange()),this.userMax=ot=this.max,this.range=null),u(this,"foundExtremes"),this.beforePadding&&this.beforePadding(),this.adjustForMinRange(),!(U||this.axisPointRange||this.stacking&&this.stacking.usePercentage||J)&&a(this.min)&&a(this.max)&&(N=this.max-this.min)&&(!a(st)&&D&&(this.min-=N*D),!a(ot)&&tt&&(this.max+=N*tt)),x(this.userMin)||(x(K.softMin)&&K.softMinthis.max&&(this.max=ot=K.softMax),x(K.ceiling)&&(this.max=Math.min(this.max,K.ceiling))),B&&a(this.dataMin)&&(X=X||0,!a(st)&&this.min=X?this.min=this.options.minRange?Math.min(X,this.max-this.minRange):X:!a(ot)&&this.max>X&&this.dataMax<=X&&(this.max=this.options.minRange?Math.max(X,this.min+this.minRange):X)),x(this.min)&&x(this.max)&&!this.chart.polar&&this.min>this.max&&(a(this.options.min)?this.max=this.min:a(this.options.max)&&(this.min=this.max)),this.tickInterval=this.min===this.max||typeof this.min>"u"||typeof this.max>"u"?1:J&&this.linkedParent&&!F&&C===this.linkedParent.options.tickPixelInterval?F=this.linkedParent.tickInterval:j(F,this.tickAmount?(this.max-this.min)/Math.max(this.tickAmount-1,1):void 0,U?1:(this.max-this.min)*C/Math.max(this.len,C)),G&&!L){var q=this.min!==(this.old&&this.old.min)||this.max!==(this.old&&this.old.max);this.series.forEach(function(Y){Y.forceCrop=Y.forceCropping&&Y.forceCropping(),Y.processData(q)}),u(this,"postProcessData",{hasExtemesChanged:q})}this.setAxisTranslation(),u(this,"initialAxisTranslation"),this.pointRange&&!F&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval)),L=j(K.minTickInterval,this.dateTime&&!this.series.some(function(Y){return Y.noSharedTooltip})?this.closestPointRange:0),!F&&this.tickIntervalthis.tickInterval||this.tickAmount!==void 0),!!this.tickAmount)),this.tickAmount||(this.tickInterval=this.unsquish()),this.setTickPositions()},z.prototype.setTickPositions=function(){var L=this.options,N=L.tickPositions,V=this.getMinorTickInterval(),K=this.hasVerticalPanning(),G=this.coll==="colorAxis",J=(G||!K)&&L.startOnTick;K=(G||!K)&&L.endOnTick,G=L.tickPositioner,this.tickmarkOffset=this.categories&&L.tickmarkPlacement==="between"&&this.tickInterval===1?.5:0,this.minorTickInterval=V==="auto"&&this.tickInterval?this.tickInterval/5:V,this.single=this.min===this.max&&a(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||L.allowDecimals!==!1),this.tickPositions=V=N&&N.slice(),!V&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?V=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,L.units),this.min,this.max,L.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(V=[this.min,this.max],A(19,!1,this.chart)),V.length>this.len&&(V=[V[0],V.pop()],V[0]===V[1]&&(V.length=1)),this.tickPositions=V,G&&(G=G.apply(this,[this.min,this.max])))&&(this.tickPositions=V=G),this.paddedTicks=V.slice(0),this.trimTicks(V,J,K),this.isLinked||(this.single&&2>V.length&&!this.categories&&!this.series.some(function(C){return C.is("heatmap")&&C.options.pointPlacement==="between"})&&(this.min-=.5,this.max+=.5),N||G||this.adjustTickAmount()),u(this,"afterSetTickPositions")},z.prototype.trimTicks=function(L,N,V){var K=L[0],G=L[L.length-1],J=!this.isOrdinal&&this.minPointOffset||0;if(u(this,"trimTicks"),!this.isLinked){if(N&&K!==-1/0)this.min=K;else for(;this.min-J>L[0];)L.shift();if(V)this.max=G;else for(;this.max+JV&&(this.finalTickAmt=V,V=5),this.tickAmount=V},z.prototype.adjustTickAmount=function(){var L=this.options,N=this.tickInterval,V=this.tickPositions,K=this.tickAmount,G=this.finalTickAmt,J=V&&V.length,C=j(this.threshold,this.softThreshold?0:null);if(this.hasData()&&x(this.min)&&x(this.max)){if(JK&&(this.tickInterval*=2,this.setTickPositions());if(a(G)){for(N=L=V.length;N--;)(G===3&&N%2===1||2>=G&&0U&&(tt=U)),a(G)&&(DU&&(D=U))),V.displayBtn=typeof tt<"u"||typeof D<"u",V.setExtremes(tt,D,!1,void 0,{trigger:"zoom"})),B.zoomed=!0}),L.zoomed},z.prototype.setAxisSize=function(){var L=this.chart,N=this.options,V=N.offsets||[0,0,0,0],K=this.horiz,G=this.width=Math.round($(j(N.width,L.plotWidth-V[3]+V[1]),L.plotWidth)),J=this.height=Math.round($(j(N.height,L.plotHeight-V[0]+V[2]),L.plotHeight)),C=this.top=Math.round($(j(N.top,L.plotTop+V[0]),L.plotHeight,L.plotTop));N=this.left=Math.round($(j(N.left,L.plotLeft+V[3]),L.plotWidth,L.plotLeft)),this.bottom=L.chartHeight-J-C,this.right=L.chartWidth-G-N,this.len=Math.max(K?G:J,0),this.pos=K?N:C},z.prototype.getExtremes=function(){var L=this.logarithmic;return{min:L?y(L.lin2log(this.min)):this.min,max:L?y(L.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},z.prototype.getThreshold=function(L){var N=this.logarithmic,V=N?N.lin2log(this.min):this.min;return N=N?N.lin2log(this.max):this.max,L===null||L===-1/0?L=V:L===1/0?L=N:V>L?L=V:NN?V.align="right":195N&&(V.align="left")}),L.align},z.prototype.tickSize=function(L){var N=this.options,V=j(N[L==="tick"?"tickWidth":"minorTickWidth"],L==="tick"&&this.isXAxis&&!this.categories?1:0),K=N[L==="tick"?"tickLength":"minorTickLength"];if(V&&K){N[L+"Position"]==="inside"&&(K=-K);var G=[K,V]}return L={tickSize:G},u(this,"afterTickSize",L),L.tickSize},z.prototype.labelMetrics=function(){var L=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize,this.ticks[L]&&this.ticks[L].label)},z.prototype.unsquish=function(){var L=this.options.labels,N=this.horiz,V=this.tickInterval,K=this.len/(((this.categories?1:0)+this.max-this.min)/V),G=L.rotation,J=this.labelMetrics(),C=Math.max(this.max-this.min,0),U=function(st){var ot=st/(K||1);return ot=1C&&st!==1/0&&K!==1/0&&C&&(ot=Math.ceil(C/V)),y(ot*V)},B=V,tt,D,F=Number.MAX_VALUE;if(N){if(!L.staggerLines&&!L.step)if(x(G))var X=[G];else K=st){D=U(Math.abs(J.h/Math.sin(m*st)));var ot=D+Math.abs(st/360);otK.step)return K.rotation?0:(this.staggerLines||1)*this.len/G;if(!V){if(L=K.style.width,L!==void 0)return parseInt(String(L),10);if(J)return J-N.spacing[3]}return .33*N.chartWidth},z.prototype.renderUnsquish=function(){var L=this.chart,N=L.renderer,V=this.tickPositions,K=this.ticks,G=this.options.labels,J=G.style,C=this.horiz,U=this.getSlotWidth(),B=Math.max(1,Math.round(U-2*G.padding)),tt={},D=this.labelMetrics(),F=J.textOverflow,X=0;if(d(G.rotation)||(tt.rotation=G.rotation||0),V.forEach(function(ct){ct=K[ct],ct.movedLabel&&ct.replaceMovedLabel(),ct&&ct.label&&ct.label.textPxLength>X&&(X=ct.label.textPxLength)}),this.maxLabelLength=X,this.autoRotation)X>B&&X>D.h?tt.rotation=this.labelRotation:this.labelRotation=0;else if(U){var st=B;if(!F){var ot="clip";for(B=V.length;!C&&B--;){var lt=V[B];(lt=K[lt].label)&&(lt.styles&<.styles.textOverflow==="ellipsis"?lt.css({textOverflow:"clip"}):lt.textPxLength>U&<.css({width:U+"px"}),lt.getBBox().height>this.len/V.length-(D.h-D.f)&&(lt.specificTextOverflow="ellipsis"))}}}tt.rotation&&(st=X>.5*L.chartHeight?.33*L.chartHeight:X,F||(ot="ellipsis")),(this.labelAlign=G.align||this.autoLabelAlign(this.labelRotation))&&(tt.align=this.labelAlign),V.forEach(function(ct){var q=(ct=K[ct])&&ct.label,Y=J.width,Z={};q&&(q.attr(tt),ct.shortenLabel?ct.shortenLabel():st&&!Y&&J.whiteSpace!=="nowrap"&&(st=this.min&&L<=this.max||this.grid&&this.grid.isColumn)&&(K[L]||(K[L]=new _(this,L)),V&&K[L].isNew&&K[L].render(N,!0,-1),K[L].render(N))},z.prototype.render=function(){var L=this,N=L.chart,V=L.logarithmic,K=L.options,G=L.isLinked,J=L.tickPositions,C=L.axisTitle,U=L.ticks,B=L.minorTicks,tt=L.alternateBands,D=K.stackLabels,F=K.alternateGridColor,X=L.tickmarkOffset,st=L.axisLine,ot=L.showAxis,lt=E(N.renderer.globalAnimation),ct,q;if(L.labelEdge.length=0,L.overlap=!1,[U,B,tt].forEach(function(Z){I(Z,function(W){W.isActive=!1})}),L.hasData()||G){var Y=L.chart.hasRendered&&L.old&&x(L.old.min);L.minorTickInterval&&!L.categories&&L.getMinorTickPositions().forEach(function(Z){L.renderMinorTick(Z,Y)}),J.length&&(J.forEach(function(Z,W){L.renderTick(Z,W,Y)}),X&&(L.min===0||L.single)&&(U[-1]||(U[-1]=new _(L,-1,null,!0)),U[-1].render(-1))),F&&J.forEach(function(Z,W){q=typeof J[W+1]<"u"?J[W+1]+X:L.max-X,W%2===0&&Zk&&(!y||w<=M)&&typeof w<"u"&&A.push(w),w>M&&(g=!0),w=x}}}else k=this.lin2log(k),M=this.lin2log(M),T=y?a.getMinorTickInterval():w.tickInterval,T=l(T==="auto"?null:T,this.minorAutoInterval,w.tickPixelInterval/(y?5:1)*(M-k)/((y?S/a.tickPositions.length:S)||1)),T=c(T,void 0,o(T)),A=a.getLinearTickPositions(T,k,M).map(this.log2lin),y||(this.minorAutoInterval=T/5);return y||(a.tickInterval=T),A},m.prototype.lin2log=function(T){return Math.pow(10,T)},m.prototype.log2lin=function(T){return Math.log(T)/Math.LN10},m}();_.Additions=P}(O||(O={})),O}),i(n,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[n["Core/Utilities.js"]],function(r){var s=r.erase,o=r.extend,c=r.isNumber,l;return function(O){var _=[],v;O.compose=function(b,P){return v||(v=b),_.indexOf(P)===-1&&(_.push(P),o(P.prototype,E.prototype)),P};var E=function(){function b(){}return b.prototype.getPlotBandPath=function(P,m,T){T===void 0&&(T=this.options);var k=this.getPlotLinePath({value:m,force:!0,acrossPanes:T.acrossPanes}),M=[],y=this.horiz;if(m=!c(this.min)||!c(this.max)||Pthis.max&&m>this.max,P=this.getPlotLinePath({value:P,force:!0,acrossPanes:T.acrossPanes}),T=1,P&&k){if(m){var a=P.toString()===k.toString();T=0}for(m=0;m"u"&&(x=p.normalize(x)),p=[x.chartX-j,x.chartY-I]):h[0].tooltipPos?p=h[0].tooltipPos:(h.forEach(function(z){$=z.series.yAxis,et=z.series.xAxis,it+=z.plotX||0,H+=z.plotLow?(z.plotLow+(z.plotHigh||0))/2:z.plotY||0,et&&$&&(R?(it+=I+d.plotHeight-et.len-et.pos,H+=j+d.plotWidth-$.len-$.pos):(it+=et.pos-j,H+=$.pos-I))}),it/=h.length,H/=h.length,p=[R?d.plotWidth-H:it,R?d.plotHeight-it:H],this.shared&&1Z-j?Z:Z-j);else if(Y)I[B]=Math.max(st,X+j+D>tt?X:X+j);else return!1},J=function(B,tt,D,F,X){var st;return Xtt-R?st=!1:I[B]=Xtt-F/2?tt-F-2:X-D/2,st},C=function(B){var tt=L;L=N,N=tt,V=B},U=function(){G.apply(0,L)!==!1?J.apply(0,N)!==!1||V||(C(!0),U()):V?I.x=I.y=0:(C(!0),U())};return(p.inverted||1Z})&&(h=h.map(function(Y){var Z=d(Y.anchorX,Y.anchorY,Y.point.isHeader,Y.boxWidth,!1);return k(Y,{target:Z.y,x:Z.x})})),p.cleanSplit(),v(h,lt);var ct=X,q=X;h.forEach(function(Y){var Z=Y.x,W=Y.boxWidth;Y=Y.isHeader,Y||(p.outside&&X+Zq&&(q=X+Z))}),h.forEach(function(Y){var Z=Y.x,W=Y.anchorX,Q=Y.pos,rt=Y.point.isHeader;if(Q={visibility:typeof Q>"u"?"hidden":"inherit",x:Z,y:Q+st,anchorX:W,anchorY:Y.anchorY},p.outside&&Zd[0]?Math.max(Math.abs(d[0]),R.width-d[0]):Math.max(Math.abs(d[0]),R.width),p.height=0>d[1]?Math.max(Math.abs(d[1]),R.height-Math.abs(d[1])):Math.max(Math.abs(d[1]),R.height),this.tracker?this.tracker.attr(p):(this.tracker=x.renderer.rect(p).addClass("highcharts-tracker").add(x),h.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},g.prototype.styledModeFormat=function(h){return h.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},g.prototype.tooltipFooterHeaderFormatter=function(h,x){var d=h.series,p=d.tooltipOptions,R=d.xAxis,I=R&&R.dateTime;R={isFooter:x,labelConfig:h};var j=p.xDateFormat,$=p[x?"footerFormat":"headerFormat"];return M(this,"headerFormatter",R,function(et){I&&!j&&a(h.key)&&(j=I.getXDateFormat(h.key,p.dateTimeLabelFormats)),I&&j&&(h.point&&h.point.tooltipDateKeys||["key"]).forEach(function(it){$=$.replace("{point."+it+"}","{point."+it+":"+j+"}")}),d.chart.styledMode&&($=this.styledModeFormat($)),et.text=O($,{point:h,series:d},this.chart)}),R.text},g.prototype.update=function(h){this.destroy(),w(!0,this.chart.options.tooltip.userOptions,h),this.init(this.chart,w(!0,this.options,h))},g.prototype.updatePosition=function(h){var x=this.chart,d=this.options,p=x.pointer,R=this.getLabel();p=p.getChartPosition();var I=(d.positioner||this.getPosition).call(this,R.width,R.height,h),j=h.plotX+x.plotLeft;h=h.plotY+x.plotTop,this.outside&&(d=d.borderWidth+2*this.distance,this.renderer.setSize(R.width+d,R.height+d,!1),(p.scaleX!==1||p.scaleY!==1)&&(P(this.container,{transform:"scale("+p.scaleX+", "+p.scaleY+")"}),j*=p.scaleX,h*=p.scaleY),j+=p.left-I.x,h+=p.top-I.y),this.move(Math.round(I.x),Math.round(I.y||0),j,h)},g}(),r}),i(n,"Core/Series/Point.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Animation/AnimationUtilities.js"],n["Core/DefaultOptions.js"],n["Core/FormatUtilities.js"],n["Core/Utilities.js"]],function(r,s,o,c,l){var O=s.animObject,_=o.defaultOptions,v=c.format,E=l.addEvent,b=l.defined,P=l.erase,m=l.extend,T=l.fireEvent,k=l.getNestedProperty,M=l.isArray,y=l.isFunction,a=l.isNumber,S=l.isObject,w=l.merge,A=l.objectEach,f=l.pick,u=l.syncTimeout,g=l.removeEvent,h=l.uniqueKey;return s=function(){function x(){this.colorIndex=this.category=void 0,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.series=void 0,this.visible=!0,this.x=void 0}return x.prototype.animateBeforeDestroy=function(){var d=this,p={x:d.startXPos,opacity:0},R=d.getGraphicalProps();R.singular.forEach(function(I){d[I]=d[I].animate(I==="dataLabel"?{x:d[I].startXPos,y:d[I].startYPos,opacity:0}:p)}),R.plural.forEach(function(I){d[I].forEach(function(j){j.element&&j.animate(m({x:d.startXPos},j.startYPos?{x:j.startXPos,y:j.startYPos}:{}))})})},x.prototype.applyOptions=function(d,p){var R=this.series,I=R.options.pointValKey||R.pointValKey;return d=x.prototype.optionsToObject.call(this,d),m(this,d),this.options=this.options?m(this.options,d):d,d.group&&delete this.group,d.dataLabels&&delete this.dataLabels,I&&(this.y=x.prototype.getNestedProperty.call(this,I)),this.formatPrefix=(this.isNull=f(this.isValid&&!this.isValid(),this.x===null||!a(this.y)))?"null":"point",this.selected&&(this.state="select"),"name"in this&&typeof p>"u"&&R.xAxis&&R.xAxis.hasNames&&(this.x=R.xAxis.nameToX(this)),typeof this.x>"u"&&R?this.x=typeof p>"u"?R.autoIncrement():p:a(d.x)&&R.options.relativeXValue&&(this.x=R.autoIncrement(d.x)),this},x.prototype.destroy=function(){function d(){(p.graphic||p.dataLabel||p.dataLabels)&&(g(p),p.destroyElements());for(et in p)p[et]=null}var p=this,R=p.series,I=R.chart;R=R.options.dataSorting;var j=I.hoverPoints,$=O(p.series.chart.renderer.globalAnimation),et;p.legendItem&&I.legend.destroyItem(p),j&&(p.setState(),P(j,p),j.length||(I.hoverPoints=null)),p===I.hoverPoint&&p.onMouseOut(),R&&R.enabled?(this.animateBeforeDestroy(),u(d,$.duration)):d(),I.pointCount--},x.prototype.destroyElements=function(d){var p=this;d=p.getGraphicalProps(d),d.singular.forEach(function(R){p[R]=p[R].destroy()}),d.plural.forEach(function(R){p[R].forEach(function(I){I.element&&I.destroy()}),delete p[R]})},x.prototype.firePointEvent=function(d,p,R){var I=this,j=this.series.options;(j.point.events[d]||I.options&&I.options.events&&I.options.events[d])&&I.importEvents(),d==="click"&&j.allowPointSelect&&(R=function($){I.select&&I.select(null,$.ctrlKey||$.metaKey||$.shiftKey)}),T(I,d,p,R)},x.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(typeof this.colorIndex<"u"?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},x.prototype.getGraphicalProps=function(d){var p=this,R=[],I={singular:[],plural:[]},j;for(d=d||{graphic:1,dataLabel:1},d.graphic&&R.push("graphic","upperGraphic","shadowGroup"),d.dataLabel&&R.push("dataLabel","dataLabelUpper","connector"),j=R.length;j--;){var $=R[j];p[$]&&I.singular.push($)}return["dataLabel","connector"].forEach(function(et){var it=et+"s";d[et]&&p[it]&&I.plural.push(it)}),I},x.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},x.prototype.getNestedProperty=function(d){if(d)return d.indexOf("custom.")===0?k(d,this.options):this[d]},x.prototype.getZone=function(){var d=this.series,p=d.zones;d=d.zoneAxis||"y";var R,I=0;for(R=p[I];this[d]>=R.value;)R=p[++I];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=R&&R.color&&!this.options.color?R.color:this.nonZonedColor,R},x.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},x.prototype.init=function(d,p,R){return this.series=d,this.applyOptions(p,R),this.id=b(this.id)?this.id:h(),this.resolveColor(),d.chart.pointCount++,T(this,"afterInit"),this},x.prototype.optionsToObject=function(d){var p=this.series,R=p.options.keys,I=R||p.pointArrayMap||["y"],j=I.length,$={},et=0,it=0;if(a(d)||d===null)$[I[0]]=d;else if(M(d))for(!R&&d.length>j&&(p=typeof d[0],p==="string"?$.name=d[0]:p==="number"&&($.x=d[0]),et++);it"u"||(0p+I&&(z=p+I),LR+j&&(L=R+j),this.hasDragged=Math.sqrt(Math.pow($-z,2)+Math.pow(et-L,2)),10R.options.findNearestPointBy.indexOf("y");if(R=R.searchPoint(h,I),(I=y(R,!0)&&R.series)&&!(I=!y(p,!0))){I=p.distX-R.distX;var j=p.dist-R.dist,$=(R.series.group&&R.series.group.zIndex)-(p.series.group&&p.series.group.zIndex);I=0<(I!==0&&g?I:j!==0?j:$!==0?$:p.series.index>R.series.index?-1:1)}I&&(p=R)}),p},f.prototype.getChartCoordinatesFromPoint=function(u,g){var h=u.series,x=h.xAxis;h=h.yAxis;var d=u.shapeArgs;if(x&&h){var p=w(u.clientX,u.plotX),R=u.plotY||0;return u.isNode&&d&&M(d.x)&&M(d.y)&&(p=d.x,R=d.y),g?{chartX:h.len+h.pos-R,chartY:x.len+x.pos-p}:{chartX:p+x.pos,chartY:R+h.pos}}if(d&&d.x&&d.y)return{chartX:d.x,chartY:d.y}},f.prototype.getChartPosition=function(){if(this.chartPosition)return this.chartPosition;var u=this.chart.container,g=S(u);this.chartPosition={left:g.left,top:g.top,scaleX:1,scaleY:1};var h=u.offsetWidth;return u=u.offsetHeight,2"u"||g)&&(this.zoomOption(u),g&&u.preventDefault&&u.preventDefault(),this.dragStart(u))},f.prototype.onContainerMouseLeave=function(u){var g=O[w(f.hoverChartIndex,-1)],h=this.chart.tooltip;h&&h.shouldStickOnContact()&&this.inClass(u.relatedTarget,"highcharts-tooltip-container")||(u=this.normalize(u),g&&(u.relatedTarget||u.toElement)&&(g.pointer.reset(),g.pointer.chartPosition=void 0),h&&!h.isHidden&&this.reset())},f.prototype.onContainerMouseEnter=function(u){delete this.chartPosition},f.prototype.onContainerMouseMove=function(u){var g=this.chart;u=this.normalize(u),this.setHoverChartIndex(),u.preventDefault||(u.returnValue=!1),(g.mouseIsDown==="mousedown"||this.touchSelect(u))&&this.drag(u),g.openMenu||!this.inClass(u.target,"highcharts-tracker")&&!g.isInsidePlot(u.chartX-g.plotLeft,u.chartY-g.plotTop,{visiblePlotOnly:!0})||(this.inClass(u.target,"highcharts-no-tooltip")?this.reset(!1,0):this.runPointActions(u))},f.prototype.onDocumentTouchEnd=function(u){var g=O[w(f.hoverChartIndex,-1)];g&&g.pointer.drop(u)},f.prototype.onContainerTouchMove=function(u){this.touchSelect(u)?this.onContainerMouseMove(u):this.touch(u)},f.prototype.onContainerTouchStart=function(u){this.touchSelect(u)?this.onContainerMouseDown(u):(this.zoomOption(u),this.touch(u,!0))},f.prototype.onDocumentMouseMove=function(u){var g=this.chart,h=this.chartPosition;u=this.normalize(u,h);var x=g.tooltip;!h||x&&x.isStickyOnContact()||g.isInsidePlot(u.chartX-g.plotLeft,u.chartY-g.plotTop,{visiblePlotOnly:!0})||this.inClass(u.target,"highcharts-tracker")||this.reset()},f.prototype.onDocumentMouseUp=function(u){var g=O[w(f.hoverChartIndex,-1)];g&&g.pointer.drop(u)},f.prototype.pinch=function(u){var g=this,h=g.chart,x=g.pinchDown,d=u.touches||[],p=d.length,R=g.lastValidTouch,I=g.hasZoom,j={},$=p===1&&(g.inClass(u.target,"highcharts-tracker")&&h.runTrackerClick||g.runChartClick),et={},it=g.selectionMarker;1N.max&&(h=N.max-J,D=!0);D?(B-=.8*(B-R[$][0]),typeof tt=="number"&&(tt-=.8*(tt-R[$][1])),g()):R[$]=[B,tt],L||(p[$]=C-z,p[H]=J),p=L?1/U:U,d[H]=J,d[$]=h,x[L?u?"scaleY":"scaleX":"scale"+et]=U,x["translate"+et]=p*z+(B-p*K)},f.prototype.reset=function(u,g){var h=this.chart,x=h.hoverSeries,d=h.hoverPoint,p=h.hoverPoints,R=h.tooltip,I=R&&R.shared?p:d;u&&I&&A(I).forEach(function(j){j.series.isCartesian&&typeof j.plotX>"u"&&(u=!1)}),u?R&&I&&A(I).length&&(R.refresh(I),R.shared&&p?p.forEach(function(j){j.setState(j.state,!0),j.series.isCartesian&&(j.series.xAxis.crosshair&&j.series.xAxis.drawCrosshair(null,j),j.series.yAxis.crosshair&&j.series.yAxis.drawCrosshair(null,j))}):d&&(d.setState(d.state,!0),h.axes.forEach(function(j){j.crosshair&&d.series[j.coll]===j&&j.drawCrosshair(null,d)}))):(d&&d.onMouseOut(),p&&p.forEach(function(j){j.setState()}),x&&x.onMouseOut(),R&&R.hide(g),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),h.axes.forEach(function(j){j.hideCrosshair()}),this.hoverX=h.hoverPoints=h.hoverPoint=null)},f.prototype.runPointActions=function(u,g){var h=this.chart,x=h.tooltip&&h.tooltip.options.enabled?h.tooltip:void 0,d=x?x.shared:!1,p=g||h.hoverPoint,R=p&&p.series||h.hoverSeries;g=this.getHoverData(p,R,h.series,(!u||u.type!=="touchmove")&&(!!g||R&&R.directTouch&&this.isDirectTouch),d,u),p=g.hoverPoint,R=g.hoverSeries;var I=g.hoverPoints;if(g=R&&R.tooltipOptions.followPointer&&!R.tooltipOptions.split,d=d&&R&&!R.noSharedTooltip,p&&(p!==h.hoverPoint||x&&x.isHidden)){if((h.hoverPoints||[]).forEach(function(j){I.indexOf(j)===-1&&j.setState()}),h.hoverSeries!==R&&R.onMouseOver(),this.applyInactiveState(I),(I||[]).forEach(function(j){j.setState("hover")}),h.hoverPoint&&h.hoverPoint.firePointEvent("mouseOut"),!p.series)return;h.hoverPoints=I,h.hoverPoint=p,p.firePointEvent("mouseOver"),x&&x.refresh(d?I:p,u)}else g&&x&&!x.isHidden&&(p=x.getAnchor([{}],u),h.isInsidePlot(p[0],p[1],{visiblePlotOnly:!0})&&x.updatePosition({plotX:p[0],plotY:p[1]}));this.unDocMouseMove||(this.unDocMouseMove=v(h.container.ownerDocument,"mousemove",function(j){var $=O[f.hoverChartIndex];$&&$.pointer.onDocumentMouseMove(j)}),this.eventsToUnbind.push(this.unDocMouseMove)),h.axes.forEach(function(j){var $=w((j.crosshair||{}).snap,!0),et;$&&((et=h.hoverPoint)&&et.series[j.coll]===j||(et=T(I,function(it){return it.series[j.coll]===j}))),et||!$?j.drawCrosshair(u,et):j.hideCrosshair()})},f.prototype.scaleGroups=function(u,g){var h=this.chart;h.series.forEach(function(x){var d=u||x.getPlotBox();x.group&&(x.xAxis&&x.xAxis.zoomEnabled||h.mapView)&&(x.group.attr(d),x.markerGroup&&(x.markerGroup.attr(d),x.markerGroup.clip(g?h.clipRect:null)),x.dataLabelsGroup&&x.dataLabelsGroup.attr(d))}),h.clipRect.attr(g||h.clipBox)},f.prototype.setDOMEvents=function(){var u=this,g=this.chart.container,h=g.ownerDocument;g.onmousedown=this.onContainerMouseDown.bind(this),g.onmousemove=this.onContainerMouseMove.bind(this),g.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(v(g,"mouseenter",this.onContainerMouseEnter.bind(this))),this.eventsToUnbind.push(v(g,"mouseleave",this.onContainerMouseLeave.bind(this))),f.unbindDocumentMouseUp||(f.unbindDocumentMouseUp=v(h,"mouseup",this.onDocumentMouseUp.bind(this)));for(var x=this.chart.renderTo.parentElement;x&&x.tagName!=="BODY";)this.eventsToUnbind.push(v(x,"scroll",function(){delete u.chartPosition})),x=x.parentElement;s.hasTouch&&(this.eventsToUnbind.push(v(g,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1})),this.eventsToUnbind.push(v(g,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),f.unbindDocumentTouchEnd||(f.unbindDocumentTouchEnd=v(h,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))},f.prototype.setHoverChartIndex=function(){var u=this.chart,g=s.charts[w(f.hoverChartIndex,-1)];g&&g!==u&&g.pointer.onContainerMouseLeave({relatedTarget:!0}),g&&g.mouseIsDown||(f.hoverChartIndex=u.index)},f.prototype.touch=function(u,g){var h=this.chart;if(this.setHoverChartIndex(),u.touches.length===1)if(u=this.normalize(u),h.isInsidePlot(u.chartX-h.plotLeft,u.chartY-h.plotTop,{visiblePlotOnly:!0})&&!h.openMenu){if(g&&this.runPointActions(u),u.type==="touchmove"){g=this.pinchDown;var x=g[0]?4<=Math.sqrt(Math.pow(g[0].chartX-u.chartX,2)+Math.pow(g[0].chartY-u.chartY,2)):!1}w(x,!0)&&this.pinch(u)}else g&&this.reset();else u.touches.length===2&&this.pinch(u)},f.prototype.touchSelect=function(u){return!(!this.chart.options.chart.zoomBySingleTouch||!u.touches||u.touches.length!==1)},f.prototype.zoomOption=function(u){var g=this.chart,h=g.options.chart;g=g.inverted;var x=h.zoomType||"";/touch/.test(u.type)&&(x=w(h.pinchType,x)),this.zoomX=u=/x/.test(x),this.zoomY=h=/y/.test(x),this.zoomHor=u&&!g||h&&g,this.zoomVert=h&&!g||u&&g,this.hasZoom=u||h},f}(),r}),i(n,"Core/MSPointer.js",[n["Core/Globals.js"],n["Core/Pointer.js"],n["Core/Utilities.js"]],function(r,s,o){function c(){var a=[];return a.item=function(S){return this[S]},T(M,function(S){a.push({pageX:S.pageX,pageY:S.pageY,target:S.target})}),a}function l(a,S,w,A){var f=_[s.hoverChartIndex||NaN];a.pointerType!=="touch"&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!f||(f=f.pointer,A(a),f[S]({type:w,target:a.currentTarget,preventDefault:E,touches:c()}))}var O=this&&this.__extends||function(){var a=function(S,w){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,f){A.__proto__=f}||function(A,f){for(var u in f)f.hasOwnProperty(u)&&(A[u]=f[u])},a(S,w)};return function(S,w){function A(){this.constructor=S}a(S,w),S.prototype=w===null?Object.create(w):(A.prototype=w.prototype,new A)}}(),_=r.charts,v=r.doc,E=r.noop,b=r.win,P=o.addEvent,m=o.css,T=o.objectEach,k=o.removeEvent,M={},y=!!b.PointerEvent;return function(a){function S(){return a!==null&&a.apply(this,arguments)||this}return O(S,a),S.isRequired=function(){return!(r.hasTouch||!b.PointerEvent&&!b.MSPointerEvent)},S.prototype.batchMSEvents=function(w){w(this.chart.container,y?"pointerdown":"MSPointerDown",this.onContainerPointerDown),w(this.chart.container,y?"pointermove":"MSPointerMove",this.onContainerPointerMove),w(v,y?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},S.prototype.destroy=function(){this.batchMSEvents(k),a.prototype.destroy.call(this)},S.prototype.init=function(w,A){a.prototype.init.call(this,w,A),this.hasZoom&&m(w.container,{"-ms-touch-action":"none","touch-action":"none"})},S.prototype.onContainerPointerDown=function(w){l(w,"onContainerTouchStart","touchstart",function(A){M[A.pointerId]={pageX:A.pageX,pageY:A.pageY,target:A.currentTarget}})},S.prototype.onContainerPointerMove=function(w){l(w,"onContainerTouchMove","touchmove",function(A){M[A.pointerId]={pageX:A.pageX,pageY:A.pageY},M[A.pointerId].target||(M[A.pointerId].target=A.currentTarget)})},S.prototype.onDocumentPointerUp=function(w){l(w,"onDocumentTouchEnd","touchend",function(A){delete M[A.pointerId]})},S.prototype.setDOMEvents=function(){a.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(P)},S}(s)}),i(n,"Core/Legend/Legend.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/FormatUtilities.js"],n["Core/Globals.js"],n["Core/Series/Point.js"],n["Core/Renderer/RendererUtilities.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){var _=r.animObject,v=r.setAnimation,E=s.format;r=o.isFirefox;var b=o.marginNames;o=o.win;var P=l.distribute,m=O.addEvent,T=O.createElement,k=O.css,M=O.defined,y=O.discardElement,a=O.find,S=O.fireEvent,w=O.isNumber,A=O.merge,f=O.pick,u=O.relativeLength,g=O.stableSort,h=O.syncTimeout;return l=O.wrap,O=function(){function x(d,p){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=d,this.init(d,p)}return x.prototype.init=function(d,p){this.chart=d,this.setOptions(p),p.enabled&&(this.render(),m(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=m(this.chart,"render",function(){this.legend.proximatePositions(),this.legend.positionItems()}):this.unchartrender&&this.unchartrender())},x.prototype.setOptions=function(d){var p=f(d.padding,8);this.options=d,this.chart.styledMode||(this.itemStyle=d.itemStyle,this.itemHiddenStyle=A(this.itemStyle,d.itemHiddenStyle)),this.itemMarginTop=d.itemMarginTop||0,this.itemMarginBottom=d.itemMarginBottom||0,this.padding=p,this.initialItemY=p-5,this.symbolWidth=f(d.symbolWidth,16),this.pages=[],this.proximate=d.layout==="proximate"&&!this.chart.inverted,this.baseline=void 0},x.prototype.update=function(d,p){var R=this.chart;this.setOptions(A(!0,this.options,d)),this.destroy(),R.isDirtyLegend=R.isDirtyBox=!0,f(p,!0)&&R.redraw(),S(this,"afterUpdate")},x.prototype.colorizeItem=function(d,p){if(d.legendGroup[p?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var R=this.options,I=d.legendItem,j=d.legendLine,$=d.legendSymbol,et=this.itemHiddenStyle.color;R=p?R.itemStyle.color:et;var it=p&&d.color||et,H=d.options&&d.options.marker,z={fill:it};I&&I.css({fill:R,color:R}),j&&j.attr({stroke:it}),$&&(H&&$.isMarker&&(z=d.pointAttribs(),p||(z.stroke=z.fill=et)),$.attr(z))}S(this,"afterColorizeItem",{item:d,visible:p})},x.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},x.prototype.positionItem=function(d){var p=this,R=this.options,I=R.symbolPadding,j=!R.rtl,$=d._legendItemPos;R=$[0],$=$[1];var et=d.checkbox,it=d.legendGroup;it&&it.element&&(I={translateX:j?R:this.legendWidth-R-2*I-4,translateY:$},j=function(){S(p,"afterPositionItem",{item:d})},M(it.translateY)?it.animate(I,void 0,j):(it.attr(I),j())),et&&(et.x=R,et.y=$)},x.prototype.destroyItem=function(d){var p=d.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(R){d[R]&&(d[R]=d[R].destroy())}),p&&y(d.checkbox)},x.prototype.destroy=function(){function d(p){this[p]&&(this[p]=this[p].destroy())}this.getAllItems().forEach(function(p){["legendItem","legendGroup"].forEach(d,p)}),"clipRect up down pager nav box title group".split(" ").forEach(d,this),this.display=null},x.prototype.positionCheckboxes=function(){var d=this.group&&this.group.alignAttr,p=this.clipHeight||this.legendHeight,R=this.titleHeight;if(d){var I=d.translateY;this.allItems.forEach(function(j){var $=j.checkbox;if($){var et=I+R+$.y+(this.scrollOffset||0)+3;k($,{left:d.translateX+j.checkboxOffset+$.x-20+"px",top:et+"px",display:this.proximate||et>I-6&&et1.5*R?p.height:R))},x.prototype.layoutItem=function(d){var p=this.options,R=this.padding,I=p.layout==="horizontal",j=d.itemHeight,$=this.itemMarginBottom,et=this.itemMarginTop,it=I?f(p.itemDistance,20):0,H=this.maxLegendWidth;p=p.alignColumns&&this.totalItemWidth>H?this.maxItemWidth:d.itemWidth,I&&this.itemX-R+p>H&&(this.itemX=R,this.lastLineHeight&&(this.itemY+=et+this.lastLineHeight+$),this.lastLineHeight=0),this.lastItemY=et+this.itemY+$,this.lastLineHeight=Math.max(j,this.lastLineHeight),d._legendItemPos=[this.itemX,this.itemY],I?this.itemX+=p:(this.itemY+=et+j+$,this.lastLineHeight=j),this.offsetWidth=this.widthOption||Math.max((I?this.itemX-R-(d.checkbox?0:it):p)+R,this.offsetWidth)},x.prototype.getAllItems=function(){var d=[];return this.chart.series.forEach(function(p){var R=p&&p.options;p&&f(R.showInLegend,M(R.linkedTo)?!1:void 0,!0)&&(d=d.concat(p.legendItems||(R.legendType==="point"?p.data:p)))}),S(this,"afterGetAllItems",{allItems:d}),d},x.prototype.getAlignment=function(){var d=this.options;return this.proximate?d.align.charAt(0)+"tv":d.floating?"":d.align.charAt(0)+d.verticalAlign.charAt(0)+d.layout.charAt(0)},x.prototype.adjustMargins=function(d,p){var R=this.chart,I=this.options,j=this.getAlignment();j&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function($,et){$.test(j)&&!M(d[et])&&(R[b[et]]=Math.max(R[b[et]],R.legend[(et+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][et]*I[et%2?"x":"y"]+f(I.margin,12)+p[et]+(R.titleOffset[et]||0)))})},x.prototype.proximatePositions=function(){var d=this.chart,p=[],R=this.options.align==="left";this.allItems.forEach(function(I){var j,$=R;if(I.yAxis){I.xAxis.options.reversed&&($=!$),I.points&&(j=a($?I.points:I.points.slice(0).reverse(),function(it){return w(it.plotY)})),$=this.itemMarginTop+I.legendItem.getBBox().height+this.itemMarginBottom;var et=I.yAxis.top-d.plotTop;I.visible?(j=j?j.plotY:I.yAxis.height,j+=et-.3*$):j=et+I.yAxis.height,p.push({target:j,size:$,item:I})}},this),P(p,d.plotHeight).forEach(function(I){I.item._legendItemPos&&(I.item._legendItemPos[1]=d.plotTop-d.spacing[0]+I.pos)})},x.prototype.render=function(){var d=this.chart,p=d.renderer,R=this.options,I=this.padding,j=this.getAllItems(),$=this.group,et=this.box;this.itemX=I,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=u(R.width,d.spacingBox.width-I);var it=d.spacingBox.width-2*I-R.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(it/=2),this.maxLegendWidth=this.widthOption||it,$||(this.group=$=p.g("legend").addClass(R.className||"").attr({zIndex:7}).add(),this.contentGroup=p.g().attr({zIndex:1}).add($),this.scrollGroup=p.g().add(this.contentGroup)),this.renderTitle(),g(j,function(z,L){return(z.options&&z.options.legendIndex||0)-(L.options&&L.options.legendIndex||0)}),R.reversed&&j.reverse(),this.allItems=j,this.display=it=!!j.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,j.forEach(this.renderItem,this),j.forEach(this.layoutItem,this),j=(this.widthOption||this.offsetWidth)+I;var H=this.lastItemY+this.lastLineHeight+this.titleHeight;H=this.handleOverflow(H),H+=I,et||(this.box=et=p.rect().addClass("highcharts-legend-box").attr({r:R.borderRadius}).add($),et.isNew=!0),d.styledMode||et.attr({stroke:R.borderColor,"stroke-width":R.borderWidth||0,fill:R.backgroundColor||"none"}).shadow(R.shadow),0$&&z.enabled!==!1?(this.clipHeight=C=Math.max($-20-this.titleHeight-it,0),this.currentPage=f(this.currentPage,1),this.fullHeight=d,K.forEach(function(D,F){var X=D._legendItemPos[1],st=Math.round(D.legendItem.getBBox().height),ot=V.length;(!ot||X-V[ot-1]>C&&(U||X)!==V[ot-1])&&(V.push(U||X),ot++),D.pageIx=ot-1,U&&(K[F-1].pageIx=ot-1),F===K.length-1&&X+st-V[ot-1]>C&&st<=C&&(V.push(X),D.pageIx=ot),X!==U&&(U=X)}),tt||(tt=p.clipRect=I.clipRect(0,it,9999,0),p.contentGroup.clip(tt)),G(C),B||(this.nav=B=I.g().attr({zIndex:1}).add(this.group),this.up=I.symbol("triangle",0,0,N,N).add(B),J("upTracker").on("click",function(){p.scroll(-1,L)}),this.pager=I.text("",15,10).addClass("highcharts-legend-navigation"),R.styledMode||this.pager.css(z.style),this.pager.add(B),this.down=I.symbol("triangle-down",0,0,N,N).add(B),J("downTracker").on("click",function(){p.scroll(1,L)})),p.scroll(0),d=$):B&&(G(),this.nav=B.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),d},x.prototype.scroll=function(d,p){var R=this,I=this.chart,j=this.pages,$=j.length,et=this.clipHeight,it=this.options.navigation,H=this.pager,z=this.padding,L=this.currentPage+d;L>$&&(L=$),0=Math.max(xt+ut,ht.pos)&><=Math.min(xt+ut+at.width,ht.pos+ht.len)||(W.isInsidePlot=!1)}return!rt.ignoreY&&W.isInsidePlot&&(nt=dt&&(nt?dt.xAxis:dt.yAxis)||{pos:ft,len:1/0},rt=rt.paneCoordinates?nt.pos+Q:ft+Q,rt>=Math.max(vt+ft,nt.pos)&&rt<=Math.min(vt+ft+at.height,nt.pos+nt.len)||(W.isInsidePlot=!1)),G(this,"afterIsInsidePlot",W),W.isInsidePlot},Z.prototype.redraw=function(W){G(this,"beforeRedraw");var Q=this.hasCartesianSeries?this.axes:this.colorAxis||[],rt=this.series,nt=this.pointer,at=this.legend,ut=this.userOptions.legend,ft=this.renderer,gt=ft.isHidden(),xt=[],vt=this.isDirtyBox,dt=this.isDirtyLegend;for(this.setResponsive&&this.setResponsive(!1),S(this.hasRendered?W:!1,this),gt&&this.temporaryDisplay(),this.layOutTitles(),W=rt.length;W--;){var ht=rt[W];if(ht.options.stacking||ht.options.centerInCategory){var pt=!0;if(ht.isDirty){var mt=!0;break}}}if(mt)for(W=rt.length;W--;)ht=rt[W],ht.options.stacking&&(ht.isDirty=!0);rt.forEach(function(yt){yt.isDirty&&(yt.options.legendType==="point"?(typeof yt.updateTotals=="function"&&yt.updateTotals(),dt=!0):ut&&(ut.labelFormatter||ut.labelFormat)&&(dt=!0)),yt.isDirtyData&&G(yt,"updatedData")}),dt&&at&&at.options.enabled&&(at.render(),this.isDirtyLegend=!1),pt&&this.getStacks(),Q.forEach(function(yt){yt.updateNames(),yt.setScale()}),this.getMargins(),Q.forEach(function(yt){yt.isDirty&&(vt=!0)}),Q.forEach(function(yt){var wt=yt.min+","+yt.max;yt.extKey!==wt&&(yt.extKey=wt,xt.push(function(){G(yt,"afterSetExtremes",V(yt.eventArgs,yt.getExtremes())),delete yt.eventArgs})),(vt||pt)&&yt.redraw()}),vt&&this.drawChartBox(),G(this,"predraw"),rt.forEach(function(yt){(vt||yt.isDirty)&&yt.visible&&yt.redraw(),yt.isDirtyData=!1}),nt&&nt.reset(!0),ft.draw(),G(this,"redraw"),G(this,"render"),gt&&this.temporaryDisplay(!0),xt.forEach(function(yt){yt.call()})},Z.prototype.get=function(W){function Q(ut){return ut.id===W||ut.options&&ut.options.id===W}for(var rt=this.series,nt=K(this.axes,Q)||K(this.series,Q),at=0;!nt&&at=vt&&nt<=dt||ht||!H(nt))&&(pt=!0),rt[ht?"zoomX":"zoomY"]&&pt&&(ut=xt.zoom(gt.min,gt.max),xt.displayBtn&&(at=!0))});var ft=Q.resetZoomButton;at&&!ft?Q.showResetZoom():!at&&B(ft)&&(Q.resetZoomButton=ft.destroy()),ut&&Q.redraw(X(Q.options.chart.animation,W&&W.animation,100>Q.pointCount))},Z.prototype.pan=function(W,Q){var rt=this,nt=rt.hoverPoints;Q=typeof Q=="object"?Q:{enabled:Q,type:"x"};var at=rt.options.chart,ut=rt.options.mapNavigation&&rt.options.mapNavigation.enabled;at&&at.panning&&(at.panning=Q);var ft=Q.type,gt;G(this,"pan",{originalEvent:W},function(){nt&&nt.forEach(function(dt){dt.setState()});var xt=rt.xAxis;ft==="xy"?xt=xt.concat(rt.yAxis):ft==="y"&&(xt=rt.yAxis);var vt={};xt.forEach(function(dt){if(dt.options.panningEnabled&&!dt.options.isInternal){var ht=dt.horiz,pt=W[ht?"chartX":"chartY"];ht=ht?"mouseDownX":"mouseDownY";var mt=rt[ht],yt=dt.minPointOffset||0,wt=dt.reversed&&!rt.inverted||!dt.reversed&&rt.inverted?-1:1,kt=dt.getExtremes(),Ot=dt.toValue(mt-pt,!0)+yt*wt,Xt=dt.toValue(mt+dt.len-pt,!0)-(yt*wt||dt.isXAxis&&dt.pointRangePadding||0),we=Xt=wt&&Ot<=Xt&&(dt.setExtremes(mt,Ot,!1,!1,{trigger:"pan"}),rt.resetZoomButton||ut||mt===wt||Ot===Xt||!ft.match("y")||(rt.showResetZoom(),dt.displayBtn=!1),gt=!0),vt[ht]=pt)}}),F(vt,function(dt,ht){rt[ht]=dt}),gt&&rt.redraw(!1),it(rt.container,{cursor:"move"})})},Z}(),V(r.prototype,{callbacks:[],collectionsWithInit:{xAxis:[r.prototype.addAxis,[!0]],yAxis:[r.prototype.addAxis,[!1]],series:[r.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")}),r}),i(n,"Core/Legend/LegendSymbol.js",[n["Core/Utilities.js"]],function(r){var s=r.merge,o=r.pick,c;return function(l){l.drawLineMarker=function(O){var _=this.options,v=O.symbolWidth,E=O.symbolHeight,b=E/2,P=this.chart.renderer,m=this.legendGroup;O=O.baseline-Math.round(.3*O.fontMetrics.b);var T={},k=_.marker;this.chart.styledMode||(T={"stroke-width":_.lineWidth||0},_.dashStyle&&(T.dashstyle=_.dashStyle)),this.legendLine=P.path([["M",0,O],["L",v,O]]).addClass("highcharts-graph").attr(T).add(m),k&&k.enabled!==!1&&v&&(_=Math.min(o(k.radius,b),b),this.symbol.indexOf("url")===0&&(k=s(k,{width:E,height:E}),_=0),this.legendSymbol=v=P.symbol(this.symbol,v/2-_,O-_,2*_,2*_,k).addClass("highcharts-point").add(m),v.isMarker=!0)},l.drawRectangle=function(O,_){var v=O.symbolHeight,E=O.options.squareSymbol;_.legendSymbol=this.chart.renderer.rect(E?(O.symbolWidth-v)/2:0,O.baseline-v+1,E?v:O.symbolWidth,v,o(O.options.symbolRadius,v/2)).addClass("highcharts-point").attr({zIndex:3}).add(_.legendGroup)}}(c||(c={})),c}),i(n,"Core/Series/SeriesDefaults.js",[],function(){return{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var r=this.series.chart.numberFormatter;return typeof this.y!="number"?"":r(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}}),i(n,"Core/Series/Series.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/DefaultOptions.js"],n["Core/Foundation.js"],n["Core/Globals.js"],n["Core/Legend/LegendSymbol.js"],n["Core/Series/Point.js"],n["Core/Series/SeriesDefaults.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E,b){var P=r.animObject,m=r.setAnimation,T=s.defaultOptions,k=o.registerEventOptions,M=c.hasTouch,y=c.svg,a=c.win,S=v.seriesTypes,w=b.addEvent,A=b.arrayMax,f=b.arrayMin,u=b.clamp,g=b.cleanRecursively,h=b.correctFloat,x=b.defined,d=b.erase,p=b.error,R=b.extend,I=b.find,j=b.fireEvent,$=b.getNestedProperty,et=b.isArray,it=b.isNumber,H=b.isString,z=b.merge,L=b.objectEach,N=b.pick,V=b.removeEvent,K=b.splat,G=b.syncTimeout;return r=function(){function J(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}return J.prototype.init=function(C,U){j(this,"init",{options:U});var B=this,tt=C.series;this.eventsToUnbind=[],B.chart=C,B.options=B.setOptions(U),U=B.options,B.linkedSeries=[],B.bindAxes(),R(B,{name:U.name,state:"",visible:U.visible!==!1,selected:U.selected===!0}),k(this,U);var D=U.events;(D&&D.click||U.point&&U.point.events&&U.point.events.click||U.allowPointSelect)&&(C.runTrackerClick=!0),B.getColor(),B.getSymbol(),B.parallelArrays.forEach(function(X){B[X+"Data"]||(B[X+"Data"]=[])}),B.isCartesian&&(C.hasCartesianSeries=!0);var F;tt.length&&(F=tt[tt.length-1]),B._i=N(F&&F._i,-1)+1,B.opacity=B.options.opacity,C.orderSeries(this.insert(tt)),U.dataSorting&&U.dataSorting.enabled?B.setDataSortingOptions():B.points||B.data||B.setData(U.data,!1),j(this,"afterInit")},J.prototype.is=function(C){return S[C]&&this instanceof S[C]},J.prototype.insert=function(C){var U=this.options.index,B;if(it(U)){for(B=C.length;B--;)if(U>=N(C[B].options.index,C[B]._i)){C.splice(B+1,0,this);break}B===-1&&C.unshift(this),B+=1}else C.push(this);return N(B,C.length-1)},J.prototype.bindAxes=function(){var C=this,U=C.options,B=C.chart,tt;j(this,"bindAxes",null,function(){(C.axisTypes||[]).forEach(function(D){var F=0;B[D].forEach(function(X){tt=X.options,(U[D]===F&&!tt.isInternal||typeof U[D]<"u"&&U[D]===tt.id||typeof U[D]>"u"&&tt.index===0)&&(C.insert(X.series),C[D]=X,X.isDirty=!0),tt.isInternal||F++}),C[D]||C.optionalAxis===D||p(18,!0,B)})}),j(this,"afterBindAxes")},J.prototype.updateParallelArrays=function(C,U){var B=C.series,tt=arguments,D=it(U)?function(F){var X=F==="y"&&B.toYData?B.toYData(C):C[F];B[F+"Data"][U]=X}:function(F){Array.prototype[U].apply(B[F+"Data"],Array.prototype.slice.call(tt,2))};B.parallelArrays.forEach(D)},J.prototype.hasData=function(){return this.visible&&typeof this.dataMax<"u"&&typeof this.dataMin<"u"||this.visible&&this.yData&&0"u"&&it(tt)&&(ot=this.xData.indexOf(tt,U)),ot!==-1&&typeof ot<"u"&&this.cropped&&(ot=ot>=this.cropStart?ot-this.cropStart:ot),!st&&it(ot)&&D[ot]&&D[ot].touched&&(ot=void 0),ot},J.prototype.updateData=function(C,U){var B=this.options,tt=B.dataSorting,D=this.points,F=[],X=this.requireSorting,st=C.length===D.length,ot,lt,ct,q=!0;if(this.xIncrement=null,C.forEach(function(Y,Z){var W=x(Y)&&this.pointClass.prototype.optionsToObject.call({series:this},Y)||{},Q=W.x;W.id||it(Q)?(W=this.findPointIndex(W,ct),W===-1||typeof W>"u"?F.push(Y):D[W]&&Y!==B.data[W]?(D[W].update(Y,!1,null,!1),D[W].touched=!0,X&&(ct=W+1)):D[W]&&(D[W].touched=!0),(!st||Z!==W||tt&&tt.enabled||this.hasDerivedData)&&(ot=!0)):F.push(Y)},this),ot)for(C=D.length;C--;)(lt=D[C])&&!lt.touched&<.remove&<.remove(!1,U);else!st||tt&&tt.enabled?q=!1:(C.forEach(function(Y,Z){Y!==D[Z].y&&D[Z].update&&D[Z].update(Y,!1,null,!1)}),F.length=0);return D.forEach(function(Y){Y&&(Y.touched=!1)}),q?(F.forEach(function(Y){this.addPoint(Y,!1,null,null,!1)},this),this.xIncrement===null&&this.xData&&this.xData.length&&(this.xIncrement=A(this.xData),this.autoIncrement()),!0):!1},J.prototype.setData=function(C,U,B,tt){var D=this,F=D.points,X=F&&F.length||0,st=D.options,ot=D.chart,lt=st.dataSorting,ct=D.xAxis,q=st.turboThreshold,Y=this.xData,Z=this.yData,W=D.pointArrayMap;W=W&&W.length;var Q=st.keys,rt,nt=0,at=1,ut=null;C=C||[];var ft=C.length;if(U=N(U,!0),lt&<.enabled&&(C=this.sortData(C)),tt!==!1&&ft&&X&&!D.cropped&&!D.hasGroupedData&&D.visible&&!D.isSeriesBoosting&&(rt=this.updateData(C,B)),!rt){if(D.xIncrement=null,D.colorCounter=0,this.parallelArrays.forEach(function(gt){D[gt+"Data"].length=0}),q&&ft>q)if(ut=D.getFirstValidPoint(C),it(ut))for(B=0;BD?1:0}).forEach(function(D,F){D.x=F},this),U.linkedSeries&&U.linkedSeries.forEach(function(D){var F=D.options,X=F.data;F.dataSorting&&F.dataSorting.enabled||!X||(X.forEach(function(st,ot){X[ot]=tt(D,st),C[ot]&&(X[ot].x=C[ot].x,X[ot].index=ot)}),D.setData(X,!1))}),C},J.prototype.getProcessedData=function(C){var U=this.xAxis,B=this.options,tt=B.cropThreshold,D=C||this.getExtremesFromAll||B.getExtremesFromAll,F=this.isCartesian;C=U&&U.val2lin,B=!(!U||!U.logarithmic);var X=0,st=this.xData,ot=this.yData,lt=this.requireSorting,ct=!1,q=st.length;if(U){ct=U.getExtremes();var Y=ct.min,Z=ct.max;ct=U.categories&&!U.names.length}if(F&&this.sorted&&!D&&(!tt||q>tt||this.forceCrop)){if(st[q-1]Z)st=[],ot=[];else if(this.yData&&(st[0]Z)){var W=this.cropData(this.xData,this.yData,Y,Z);st=W.xData,ot=W.yData,X=W.start,W=!0}}for(tt=st.length||1;--tt;)if(U=B?C(st[tt])-C(st[tt-1]):st[tt]-st[tt-1],0"u"||UU&<&&!ct&&(p(15,!1,this.chart),lt=!1);return{xData:st,yData:ot,cropped:W,cropStart:X,closestPointRange:Q}},J.prototype.processData=function(C){var U=this.xAxis;if(this.isCartesian&&!this.isDirty&&!U.isDirty&&!this.yAxis.isDirty&&!C)return!1;C=this.getProcessedData(),this.cropped=C.cropped,this.cropStart=C.cropStart,this.processedXData=C.xData,this.processedYData=C.yData,this.closestPointRange=this.basePointRange=C.closestPointRange,j(this,"afterProcessData")},J.prototype.cropData=function(C,U,B,tt,D){var F=C.length,X,st=0,ot=F;for(D=N(D,this.cropShoulder),X=0;X=B){st=Math.max(0,X-D);break}for(B=X;Btt){ot=B+D;break}return{xData:C.slice(st,ot),yData:U.slice(st,ot),start:st,end:ot}},J.prototype.generatePoints=function(){var C=this.options,U=C.data,B=this.processedXData,tt=this.processedYData,D=this.pointClass,F=B.length,X=this.cropStart||0,st=this.hasGroupedData,ot=C.keys,lt=[];C=C.dataGrouping&&C.dataGrouping.groupAll?X:0;var ct,q,Y=this.data;if(!Y&&!st){var Z=[];Z.length=U.length,Y=this.data=Z}for(ot&&st&&(this.options.keys=!1),q=0;q"u"||(Y[Z]=W=new D().init(this,U[Z],B[q]));W&&(W.index=st?C+q:Z,lt[q]=W)}if(this.options.keys=ot,Y&&(F!==(ct=Y.length)||st))for(q=0;q=ot&&(D[st-X]||Z)<=lt,W&&Z)if(W=Y.length)for(;W--;)it(Y[W])&&(F[ct++]=Y[W]);else F[ct++]=Y}return C={activeYData:F,dataMin:f(F),dataMax:A(F)},j(this,"afterGetExtremes",{dataExtremes:C}),C},J.prototype.applyExtremes=function(){var C=this.getExtremes();return this.dataMin=C.dataMin,this.dataMax=C.dataMax,C},J.prototype.getFirstValidPoint=function(C){for(var U=C.length,B=0,tt=null;tt===null&&B=gt&&(gt=null),rt.total=rt.stackTotal=at.total,rt.percentage=at.total&&rt.y/at.total*100,rt.stackY=ft,this.irregularWidths||at.setOffset(this.pointXOffset||0,this.barW||0)),rt.yBottom=x(gt)?u(F.translate(gt,0,1,0,1),-1e5,1e5):null,this.dataModify&&(ft=this.dataModify.modifyValue(ft,Z)),rt.plotY=void 0,it(ft)&&(at=F.translate(ft,!1,!0,!1,!0),typeof at<"u"&&(rt.plotY=u(at,-1e5,1e5))),rt.isInside=this.isPointInside(rt),rt.clientX=lt?h(B.translate(nt,0,0,0,1,ot)):W,rt.negative=rt[Y]<(C[Y+"Threshold"]||ct||0),rt.category=tt&&typeof tt[rt.x]<"u"?tt[rt.x]:rt.x,!rt.isNull&&rt.visible!==!1){typeof dt<"u"&&(Q=Math.min(Q,Math.abs(W-dt)));var dt=W}rt.zone=this.zones.length?rt.getZone():void 0,!rt.graphic&&this.group&&D&&(rt.isNew=!0)}this.closestPointRangePx=Q,j(this,"afterTranslate")},J.prototype.getValidPoints=function(C,U,B){var tt=this.chart;return(C||this.points||[]).filter(function(D){return U&&!tt.isInsidePlot(D.plotX,D.plotY,{inverted:tt.inverted})?!1:D.visible!==!1&&(B||!D.isNull)})},J.prototype.getClipBox=function(){var C=this.chart,U=this.xAxis,B=this.yAxis,tt=z(C.clipBox);return U&&U.len!==C.plotSizeX&&(tt.width=U.len),B&&B.len!==C.plotSizeY&&(tt.height=B.len),tt},J.prototype.getSharedClipKey=function(){return this.sharedClipKey=(this.options.xAxis||0)+","+(this.options.yAxis||0)},J.prototype.setClip=function(){var C=this.chart,U=this.group,B=this.markerGroup,tt=C.sharedClips;C=C.renderer;var D=this.getClipBox(),F=this.getSharedClipKey(),X=tt[F];X?X.animate(D):tt[F]=X=C.clipRect(D),U&&U.clip(this.options.clip===!1?void 0:X),B&&B.clip()},J.prototype.animate=function(C){var U=this.chart,B=this.group,tt=this.markerGroup,D=U.inverted,F=P(this.options.animation),X=[this.getSharedClipKey(),F.duration,F.easing,F.defer].join(),st=U.sharedClips[X],ot=U.sharedClips[X+"m"];if(C&&B)F=this.getClipBox(),st?st.attr("height",F.height):(F.width=0,D&&(F.x=U.plotHeight),st=U.renderer.clipRect(F),U.sharedClips[X]=st,ot=U.renderer.clipRect({x:D?(U.plotSizeX||0)+99:-99,y:D?-U.plotLeft:-U.plotTop,width:99,height:D?U.chartWidth:U.chartHeight}),U.sharedClips[X+"m"]=ot),B.clip(st),tt&&tt.clip(ot);else if(st&&!st.hasClass("highcharts-animating")){U=this.getClipBox();var lt=F.step;tt&&tt.element.childNodes.length&&(F.step=function(ct,q){lt&<.apply(q,arguments),ot&&ot.element&&ot.attr(q.prop,q.prop==="width"?ct+99:ct)}),st.addClass("highcharts-animating").animate(U,F)}},J.prototype.afterAnimate=function(){var C=this;this.setClip(),L(this.chart.sharedClips,function(U,B,tt){U&&!C.chart.container.querySelector('[clip-path="url(#'+U.id+')"]')&&(U.destroy(),delete tt[B])}),this.finishedAnimating=!0,j(this,"afterAnimate")},J.prototype.drawPoints=function(){var C=this.points,U=this.chart,B=this.options.marker,tt=this[this.specialGroup]||this.markerGroup,D=this.xAxis,F=N(B.enabled,!D||D.isRadial?!0:null,this.closestPointRangePx>=B.enabledThreshold*B.radius),X,st;if(B.enabled!==!1||this._hasPointMarkers)for(X=0;X"u"||ct.enabled)&&!ot.isNull&&ot.visible!==!1){var Y=N(ct.symbol,this.symbol,"rect"),Z=this.markerAttribs(ot,ot.selected&&"select");this.enabledDataSorting&&(ot.startXPos=D.reversed?-(Z.width||0):D.width);var W=ot.isInside!==!1;st?st[W?"show":"hide"](W).animate(Z):W&&(0<(Z.width||0)||ot.hasImage)&&(ot.graphic=st=U.renderer.symbol(Y,Z.x,Z.y,Z.width,Z.height,q?ct:B).add(tt),this.enabledDataSorting&&U.hasRendered&&(st.attr({x:ot.startXPos}),lt="animate")),st&<==="animate"&&st[W?"show":"hide"](W).animate(Z),st&&!U.styledMode&&st[lt](this.pointAttribs(ot,ot.selected&&"select")),st&&st.addClass(ot.getClassName(),!0)}else st&&(ot.graphic=st.destroy())}},J.prototype.markerAttribs=function(C,U){var B=this.options,tt=B.marker,D=C.marker||{},F=D.symbol||tt.symbol,X=N(D.radius,tt.radius);return U&&(tt=tt.states[U],U=D.states&&D.states[U],X=N(U&&U.radius,tt&&tt.radius,X+(tt&&tt.radiusPlus||0))),C.hasImage=F&&F.indexOf("url")===0,C.hasImage&&(X=0),C={x:B.crisp?Math.floor(C.plotX-X):C.plotX-X,y:C.plotY-X},X&&(C.width=C.height=2*X),C},J.prototype.pointAttribs=function(C,U){var B=this.options.marker,tt=C&&C.options,D=tt&&tt.marker||{},F=tt&&tt.color,X=C&&C.color,st=C&&C.zone&&C.zone.color,ot=this.color;return C=N(D.lineWidth,B.lineWidth),tt=1,ot=F||st||X||ot,F=D.fillColor||B.fillColor||ot,X=D.lineColor||B.lineColor||ot,U=U||"normal",B=B.states[U]||{},U=D.states&&D.states[U]||{},C=N(U.lineWidth,B.lineWidth,C+N(U.lineWidthPlus,B.lineWidthPlus,0)),F=U.fillColor||B.fillColor||F,X=U.lineColor||B.lineColor||X,tt=N(U.opacity,B.opacity,tt),{stroke:X,"stroke-width":C,fill:F,opacity:tt}},J.prototype.destroy=function(C){var U=this,B=U.chart,tt=/AppleWebKit\/533/.test(a.navigator.userAgent),D=U.data||[],F,X,st,ot;for(j(U,"destroy"),this.removeEvents(C),(U.axisTypes||[]).forEach(function(lt){(ot=U[lt])&&ot.series&&(d(ot.series,U),ot.isDirty=ot.forceRedraw=!0)}),U.legendItem&&U.chart.legend.destroyItem(U),X=D.length;X--;)(st=D[X])&&st.destroy&&st.destroy();U.clips&&U.clips.forEach(function(lt){return lt.destroy()}),b.clearTimeout(U.animationTimeout),L(U,function(lt,ct){lt instanceof E&&!lt.survive&&(F=tt&&ct==="group"?"hide":"destroy",lt[F]())}),B.hoverSeries===U&&(B.hoverSeries=void 0),d(B.series,U),B.orderSeries(),L(U,function(lt,ct){C&&ct==="hcEvents"||delete U[ct]})},J.prototype.applyZones=function(){var C=this,U=this.chart,B=U.renderer,tt=this.zones,D=this.clips||[],F=this.graph,X=this.area,st=Math.max(U.chartWidth,U.chartHeight),ot=this[(this.zoneAxis||"y")+"Axis"],lt=U.inverted,ct,q,Y,Z,W,Q,rt,nt,at=!1;if(tt.length&&(F||X)&&ot&&typeof ot.min<"u"){var ut=ot.reversed,ft=ot.horiz;F&&!this.showLine&&F.hide(),X&&X.hide();var gt=ot.getExtremes();tt.forEach(function(xt,vt){ct=ut?ft?U.plotWidth:0:ft?0:ot.toPixels(gt.min)||0,ct=u(N(q,ct),0,st),q=u(Math.round(ot.toPixels(N(xt.value,gt.max),!0)||0),0,st),at&&(ct=q=ot.toPixels(gt.max)),Z=Math.abs(ct-q),W=Math.min(ct,q),Q=Math.max(ct,q),ot.isXAxis?(Y={x:lt?Q:W,y:0,width:Z,height:st},ft||(Y.x=U.plotHeight-Y.x)):(Y={x:0,y:lt?Q:W,width:st,height:Z},ft&&(Y.y=U.plotWidth-Y.y)),lt&&B.isVML&&(Y=ot.isXAxis?{x:0,y:ut?W:Q,height:Y.width,width:U.chartWidth}:{x:Y.y-U.plotLeft-U.spacingBox.x,y:0,width:Y.height,height:U.chartHeight}),D[vt]?D[vt].animate(Y):D[vt]=B.clipRect(Y),rt=C["zone-area-"+vt],nt=C["zone-graph-"+vt],F&&nt&&nt.clip(D[vt]),X&&rt&&rt.clip(D[vt]),at=xt.value>gt.max,C.resetZones&&q===0&&(q=void 0)}),this.clips=D}else C.visible&&(F&&F.show(!0),X&&X.show(!0))},J.prototype.invertGroups=function(C){function U(){["group","markerGroup"].forEach(function(D){B[D]&&(tt.renderer.isVML&&B[D].attr({width:B.yAxis.len,height:B.xAxis.len}),B[D].width=B.yAxis.len,B[D].height=B.xAxis.len,B[D].invert(B.isRadialSeries?!1:C))})}var B=this,tt=B.chart;B.xAxis&&(B.eventsToUnbind.push(w(tt,"resize",U)),U(),B.invertGroups=U)},J.prototype.plotGroup=function(C,U,B,tt,D){var F=this[C],X=!F;return B={visibility:B,zIndex:tt||.1},typeof this.opacity>"u"||this.chart.styledMode||this.state==="inactive"||(B.opacity=this.opacity),X&&(this[C]=F=this.chart.renderer.g().add(D)),F.addClass("highcharts-"+U+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(x(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(F.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),F.attr(B)[X?"attr":"animate"](this.getPlotBox()),F},J.prototype.getPlotBox=function(){var C=this.chart,U=this.xAxis,B=this.yAxis;return C.inverted&&(U=B,B=this.xAxis),{translateX:U?U.left:C.plotLeft,translateY:B?B.top:C.plotTop,scaleX:1,scaleY:1}},J.prototype.removeEvents=function(C){C||V(this),this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(U){U()}),this.eventsToUnbind.length=0)},J.prototype.render=function(){var C=this,U=C.chart,B=C.options,tt=P(B.animation),D=C.visible?"inherit":"hidden",F=B.zIndex,X=C.hasRendered,st=U.seriesGroup,ot=U.inverted;U=!C.finishedAnimating&&U.renderer.isSVG?tt.duration:0,j(this,"render");var lt=C.plotGroup("group","series",D,F,st);C.markerGroup=C.plotGroup("markerGroup","markers",D,F,st),B.clip!==!1&&C.setClip(),C.animate&&U&&C.animate(!0),lt.inverted=N(C.invertible,C.isCartesian)?ot:!1,C.drawGraph&&(C.drawGraph(),C.applyZones()),C.visible&&C.drawPoints(),C.drawDataLabels&&C.drawDataLabels(),C.redrawPoints&&C.redrawPoints(),C.drawTracker&&C.options.enableMouseTracking!==!1&&C.drawTracker(),C.invertGroups(ot),C.animate&&U&&C.animate(),X||(U&&tt.defer&&(U+=tt.defer),C.animationTimeout=G(function(){C.afterAnimate()},U||0)),C.isDirty=!1,C.hasRendered=!0,j(C,"afterRender")},J.prototype.redraw=function(){var C=this.chart,U=this.isDirty||this.isDirtyData,B=this.group,tt=this.xAxis,D=this.yAxis;B&&(C.inverted&&B.attr({width:C.plotWidth,height:C.plotHeight}),B.animate({translateX:N(tt&&tt.left,C.plotLeft),translateY:N(D&&D.top,C.plotTop)})),this.translate(),this.render(),U&&delete this.kdTree},J.prototype.searchPoint=function(C,U){var B=this.xAxis,tt=this.yAxis,D=this.chart.inverted;return this.searchKDTree({clientX:D?B.len-C.chartY+B.pos:C.chartX-B.pos,plotY:D?tt.len-C.chartX+tt.pos:C.chartY-tt.pos},U,C)},J.prototype.buildKDTree=function(C){function U(D,F,X){var st=D&&D.length;if(st){var ot=B.kdAxisArray[F%X];return D.sort(function(lt,ct){return lt[ot]-ct[ot]}),st=Math.floor(st/2),{point:D[st],left:U(D.slice(0,st),F+1,X),right:U(D.slice(st+1),F+1,X)}}}this.buildingKdTree=!0;var B=this,tt=-1Z?"left":"right",Q=0>Z?"right":"left",lt[rt]&&(rt=tt(ot,lt[rt],ct+1,q),W=rt[st]Z;)W--;this.updateParallelArrays(Y,"splice",W,0,0),this.updateParallelArrays(Y,W),ot&&Y.name&&(ot[Z]=Y.name),lt.splice(W,0,C),q&&(this.data.splice(W,0,null),this.processData()),F.legendType==="point"&&this.generatePoints(),B&&(X[0]&&X[0].remove?X[0].remove(!1):(X.shift(),this.updateParallelArrays(Y,"shift"),lt.shift())),D!==!1&&j(this,"addPoint",{point:Y}),this.isDirtyData=this.isDirty=!0,U&&st.redraw(tt)},J.prototype.removePoint=function(C,U,B){var tt=this,D=tt.data,F=D[C],X=tt.points,st=tt.chart,ot=function(){X&&X.length===D.length&&X.splice(C,1),D.splice(C,1),tt.options.data.splice(C,1),tt.updateParallelArrays(F||{series:tt},"splice",C,1),F&&F.destroy(),tt.isDirty=!0,tt.isDirtyData=!0,U&&st.redraw()};m(B,st),U=N(U,!0),F?F.firePointEvent("remove",null,ot):ot()},J.prototype.remove=function(C,U,B,tt){function D(){F.destroy(tt),X.isDirtyLegend=X.isDirtyBox=!0,X.linkSeries(),N(C,!0)&&X.redraw(U)}var F=this,X=F.chart;B!==!1?j(F,"remove",null,D):D()},J.prototype.update=function(C,U){C=g(C,this.userOptions),j(this,"update",{options:C});var B=this,tt=B.chart,D=B.userOptions,F=B.initialType||B.type,X=tt.options.plotOptions,st=S[F].prototype,ot=B.finishedAnimating&&{animation:!1},lt={},ct,q=["eventOptions","navigatorSeries","baseSeries"],Y=C.type||D.type||tt.options.chart.type,Z=!(this.hasDerivedData||Y&&Y!==this.type||typeof C.pointStart<"u"||typeof C.pointInterval<"u"||typeof C.relativeXValue<"u"||B.hasOptionChanged("dataGrouping")||B.hasOptionChanged("pointStart")||B.hasOptionChanged("pointInterval")||B.hasOptionChanged("pointIntervalUnit")||B.hasOptionChanged("keys"));if(Y=Y||F,Z&&(q.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","clips","nodes","layout","mapMap","mapData","minY","maxY","minX","maxX"),C.visible!==!1&&q.push("area","graph"),B.parallelArrays.forEach(function(Q){q.push(Q+"Data")}),C.data&&(C.dataSorting&&R(B.options.dataSorting,C.dataSorting),this.setData(C.data,!1))),C=z(D,ot,{index:typeof D.index>"u"?B.index:D.index,pointStart:N(X&&X.series&&X.series.pointStart,D.pointStart,B.xData[0])},!Z&&{data:B.options.data},C),Z&&C.data&&(C.data=B.options.data),q=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(q),q.forEach(function(Q){q[Q]=B[Q],delete B[Q]}),X=!1,S[Y]){if(X=Y!==B.type,B.remove(!1,!1,!1,!0),X)if(Object.setPrototypeOf)Object.setPrototypeOf(B,S[Y].prototype);else{ot=Object.hasOwnProperty.call(B,"hcEvents")&&B.hcEvents;for(ct in st)B[ct]=void 0;R(B,S[Y].prototype),ot?B.hcEvents=ot:delete B.hcEvents}}else p(17,!0,tt,{missingModuleFor:Y});if(q.forEach(function(Q){B[Q]=q[Q]}),B.init(tt,C),Z&&this.points){var W=B.options;W.visible===!1?(lt.graphic=1,lt.dataLabel=1):B._hasPointLabels||(C=W.marker,st=W.dataLabels,!C||C.enabled!==!1&&(D.marker&&D.marker.symbol)===C.symbol||(lt.graphic=1),st&&st.enabled===!1&&(lt.dataLabel=1)),this.points.forEach(function(Q){Q&&Q.series&&(Q.resolveColor(),Object.keys(lt).length&&Q.destroyElements(lt),W.showInLegend===!1&&Q.legendItem&&tt.legend.destroyItem(Q))},this)}B.initialType=F,tt.linkSeries(),X&&B.linkedSeries.length&&(B.isDirtyData=!0),j(this,"afterUpdate"),N(U,!0)&&tt.redraw(Z?void 0:!1)},J.prototype.setName=function(C){this.name=this.options.name=this.userOptions.name=C,this.chart.isDirtyLegend=!0},J.prototype.hasOptionChanged=function(C){var U=this.options[C],B=this.chart.options.plotOptions,tt=this.userOptions[C];return tt?U!==tt:U!==N(B&&B[this.type]&&B[this.type][C],B&&B.series&&B.series[C],U)},J.prototype.onMouseOver=function(){var C=this.chart,U=C.hoverSeries;C.pointer.setHoverChartIndex(),U&&U!==this&&U.onMouseOut(),this.options.events.mouseOver&&j(this,"mouseOver"),this.setState("hover"),C.hoverSeries=this},J.prototype.onMouseOut=function(){var C=this.options,U=this.chart,B=U.tooltip,tt=U.hoverPoint;U.hoverSeries=null,tt&&tt.onMouseOut(),this&&C.events.mouseOut&&j(this,"mouseOut"),!B||this.stickyTracking||B.shared&&!this.noSharedTooltip||B.hide(),U.series.forEach(function(D){D.setState("",!0)})},J.prototype.setState=function(C,U){var B=this,tt=B.options,D=B.graph,F=tt.inactiveOtherPoints,X=tt.states,st=N(X[C||"normal"]&&X[C||"normal"].animation,B.chart.options.chart.animation),ot=tt.lineWidth,lt=0,ct=tt.opacity;if(C=C||"",B.state!==C&&([B.group,B.markerGroup,B.dataLabelsGroup].forEach(function(q){q&&(B.state&&q.removeClass("highcharts-series-"+B.state),C&&q.addClass("highcharts-series-"+C))}),B.state=C,!B.chart.styledMode)){if(X[C]&&X[C].enabled===!1)return;if(C&&(ot=X[C].lineWidth||ot+(X[C].lineWidthPlus||0),ct=N(X[C].opacity,ct)),D&&!D.dashstyle)for(tt={"stroke-width":ot},D.animate(tt,st);B["zone-graph-"+lt];)B["zone-graph-"+lt].animate(tt,st),lt+=1;F||[B.group,B.markerGroup,B.dataLabelsGroup,B.labelBySeries].forEach(function(q){q&&q.animate({opacity:ct},st)})}U&&F&&B.points&&B.setAllPointsToState(C||void 0)},J.prototype.setAllPointsToState=function(C){this.points.forEach(function(U){U.setState&&U.setState(C)})},J.prototype.setVisible=function(C,U){var B=this,tt=B.chart,D=B.legendItem,F=tt.options.chart.ignoreHiddenSeries,X=B.visible,st=(B.visible=C=B.options.visible=B.userOptions.visible=typeof C>"u"?!X:C)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(ot){B[ot]&&B[ot][st]()}),(tt.hoverSeries===B||(tt.hoverPoint&&tt.hoverPoint.series)===B)&&B.onMouseOut(),D&&tt.legend.colorizeItem(B,C),B.isDirty=!0,B.options.stacking&&tt.series.forEach(function(ot){ot.options.stacking&&ot.visible&&(ot.isDirty=!0)}),B.linkedSeries.forEach(function(ot){ot.setVisible(C,!1)}),F&&(tt.isDirtyBox=!0),j(B,st),U!==!1&&tt.redraw()},J.prototype.show=function(){this.setVisible(!0)},J.prototype.hide=function(){this.setVisible(!1)},J.prototype.select=function(C){this.selected=C=this.options.selected=typeof C>"u"?!this.selected:C,this.checkbox&&(this.checkbox.checked=C),j(this,C?"select":"unselect")},J.prototype.shouldShowTooltip=function(C,U,B){return B===void 0&&(B={}),B.series=this,B.visiblePlotOnly=!0,this.chart.isInsidePlot(C,U,B)},J.defaultOptions=_,J}(),R(r.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,drawLegendSymbol:l.drawLineMarker,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:O,requireSorting:!0,sorted:!0}),v.series=r,r}),i(n,"Extensions/ScrollablePlotArea.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/Axis.js"],n["Core/Chart/Chart.js"],n["Core/Series/Series.js"],n["Core/Renderer/RendererRegistry.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){var _=r.stop,v=O.addEvent,E=O.createElement,b=O.merge,P=O.pick;v(o,"afterSetChartSize",function(m){var T=this.options.chart.scrollablePlotArea,k=T&&T.minWidth;if(T=T&&T.minHeight,!this.renderer.forExport){if(k){if(this.scrollablePixelsX=k=Math.max(0,k-this.chartWidth)){this.scrollablePlotBox=this.renderer.scrollablePlotBox=b(this.plotBox),this.plotBox.width=this.plotWidth+=k,this.inverted?this.clipBox.height+=k:this.clipBox.width+=k;var M={1:{name:"right",value:k}}}}else T&&(this.scrollablePixelsY=k=Math.max(0,T-this.chartHeight))&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=b(this.plotBox),this.plotBox.height=this.plotHeight+=k,this.inverted?this.clipBox.width+=k:this.clipBox.height+=k,M={2:{name:"bottom",value:k}});M&&!m.skipAxes&&this.axes.forEach(function(y){M[y.side]?y.getPlotLinePath=function(){var a=M[y.side].name,S=this[a];this[a]=S-M[y.side].value;var w=s.prototype.getPlotLinePath.apply(this,arguments);return this[a]=S,w}:(y.setAxisSize(),y.setAxisTranslation())})}}),v(o,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()}),o.prototype.setUpScrolling=function(){var m=this,T={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(T.overflowX="auto"),this.scrollablePixelsY&&(T.overflowY="auto"),this.scrollingParent=E("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=E("div",{className:"highcharts-scrolling"},T,this.scrollingParent),v(this.scrollingContainer,"scroll",function(){m.pointer&&delete m.pointer.chartPosition}),this.innerContainer=E("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},o.prototype.moveFixedElements=function(){var m=this.container,T=this.fixedRenderer,k=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-drillup-button .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),M;this.scrollablePixelsX&&!this.inverted?M=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?M=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(M=".highcharts-yaxis"),M&&k.push(M+":not(.highcharts-radial-axis)",M+"-labels:not(.highcharts-radial-axis-labels)"),k.forEach(function(y){[].forEach.call(m.querySelectorAll(y),function(a){(a.namespaceURI===T.SVG_NS?T.box:T.box.parentNode).appendChild(a),a.style.pointerEvents="auto"})})},o.prototype.applyFixed=function(){var m=!this.fixedDiv,T=this.options.chart,k=T.scrollablePlotArea,M=l.getRendererType();m?(this.fixedDiv=E("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(T.style&&T.style.zIndex||0)+2,top:0},null,!0),this.scrollingContainer&&this.scrollingContainer.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=T=new M(this.fixedDiv,this.chartWidth,this.chartHeight,this.options.chart.style),this.scrollableMask=T.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":P(k.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),v(this,"afterShowResetZoom",this.moveFixedElements),v(this,"afterDrilldown",this.moveFixedElements),v(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),(this.scrollableDirty||m)&&(this.scrollableDirty=!1,this.moveFixedElements()),T=this.chartWidth+(this.scrollablePixelsX||0),M=this.chartHeight+(this.scrollablePixelsY||0),_(this.container),this.container.style.width=T+"px",this.container.style.height=M+"px",this.renderer.boxWrapper.attr({width:T,height:M,viewBox:[0,0,T,M].join(" ")}),this.chartBackground.attr({width:T,height:M}),this.scrollingContainer.style.height=this.chartHeight+"px",m&&(k.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*k.scrollPositionX),k.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*k.scrollPositionY)),M=this.axisOffset,m=this.plotTop-M[0]-1,k=this.plotLeft-M[3]-1,T=this.plotTop+this.plotHeight+M[2]+1,M=this.plotLeft+this.plotWidth+M[1]+1;var y=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),a=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);m=this.scrollablePixelsX?[["M",0,m],["L",this.plotLeft-1,m],["L",this.plotLeft-1,T],["L",0,T],["Z"],["M",y,m],["L",this.chartWidth,m],["L",this.chartWidth,T],["L",y,T],["Z"]]:this.scrollablePixelsY?[["M",k,0],["L",k,this.plotTop-1],["L",M,this.plotTop-1],["L",M,0],["Z"],["M",k,a],["L",k,this.chartHeight],["L",M,this.chartHeight],["L",M,a],["Z"]]:[["M",0,0]],this.redrawTrigger!=="adjustHeight"&&this.scrollableMask.attr({d:m})},v(s,"afterInit",function(){this.chart.scrollableDirty=!0}),v(c,"show",function(){this.chart.scrollableDirty=!0})}),i(n,"Core/Axis/StackingAxis.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/Axis.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.getDeferredAnimation,l=o.addEvent,O=o.destroyObjectProperties,_=o.fireEvent,v=o.isNumber,E=o.objectEach,b;return function(P){function m(){var y=this.stacking;if(y){var a=y.stacks;E(a,function(S,w){O(S),a[w]=null}),y&&y.stackTotalGroup&&y.stackTotalGroup.destroy()}}function T(){this.stacking||(this.stacking=new M(this))}var k=[];P.compose=function(y){return k.indexOf(y)===-1&&(k.push(y),l(y,"init",T),l(y,"destroy",m)),y};var M=function(){function y(a){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=a}return y.prototype.buildStacks=function(){var a=this.axis,S=a.series,w=a.options.reversedStacks,A=S.length,f;if(!a.isXAxis){for(this.usePercentage=!1,f=A;f--;){var u=S[w?f:A-f-1];u.setStackedPoints(),u.setGroupedPoints()}for(f=0;fM&&b.shadow)),a&&(a.startX=P.xMap,a.isArea=P.isArea)})},v.prototype.getGraphPath=function(E,b,P){var m=this,T=m.options,k=[],M=[],y,a=T.step;E=E||m.points;var S=E.reversed;return S&&E.reverse(),(a={right:1,center:2}[a]||a&&3)&&S&&(a=4-a),E=this.getValidPoints(E,!1,!(T.connectNulls&&!b&&!P)),E.forEach(function(w,A){var f=w.plotX,u=w.plotY,g=E[A-1];(w.leftCliff||g&&g.rightCliff)&&!P&&(y=!0),w.isNull&&!l(b)&&0E&&S>T?(S=Math.max(E,T),w=2*T-S):SP&&w>T?(w=Math.max(P,T),S=2*T-w):w"u"&&(I[j]=$++);var V=I[j]}else N.grouping!==!1&&(V=$++);z.columnIndex=V}});var et=Math.min(Math.abs(d.transA)*(d.ordinal&&d.ordinal.slope||x.pointRange||d.closestPointRange||d.tickInterval||1),d.len),it=et*x.groupPadding,H=(et-2*it)/($||1);return x=Math.min(x.maxPointWidth||d.len,A(x.pointWidth,H*(1-2*x.pointPadding))),h.columnMetrics={width:x,offset:(H-x)/2+(it+((h.columnIndex||0)+(R?1:0))*H-et/2)*(R?-1:1),paddedWidth:H,columnCount:$},h.columnMetrics},g.prototype.crispCol=function(h,x,d,p){var R=this.chart,I=this.borderWidth,j=-(I%2?.5:0);return I=I%2?.5:1,R.inverted&&R.renderer.isVML&&(I+=1),this.options.crisp&&(d=Math.round(h+d)+j,h=Math.round(h)+j,d-=h),p=Math.round(x+p)+I,j=.5>=Math.abs(x)&&.5h.closestPointRange*h.xAxis.transA;p=h.borderWidth=A(d.borderWidth,p?0:1);var R=h.xAxis,I=h.yAxis,j=d.threshold,$=h.translatedThreshold=I.getThreshold(j),et=A(d.minPointLength,5),it=h.getColumnMetrics(),H=it.width,z=h.pointXOffset=it.offset,L=h.dataMin,N=h.dataMax,V=h.barW=Math.max(H,1+2*p);x.inverted&&($-=.5),d.pointPadding&&(V=Math.ceil(V)),l.prototype.translate.apply(h),h.points.forEach(function(K){var G=A(K.yBottom,$),J=999+Math.abs(G),C=K.plotX||0;J=m(K.plotY,-J,I.len+J);var U=Math.min(J,G),B=Math.max(J,G)-U,tt=H,D=C+z,F=V;et&&Math.abs(B)et?G-et:$-(C?et:0)),k(K.options.pointWidth)&&(tt=F=Math.ceil(K.options.pointWidth),D-=Math.round((tt-H)/2)),d.centerInCategory&&(D=h.adjustForMissingColumns(D,tt,K,it)),K.barX=D,K.pointWidth=tt,K.tooltipPos=x.inverted?[m(I.len+I.pos-x.plotLeft-J,I.pos-x.plotLeft,I.len+I.pos-x.plotLeft),R.len+R.pos-x.plotTop-D-F/2,B]:[R.left-x.plotLeft+D+F/2,m(J+I.pos-x.plotTop,I.pos-x.plotTop,I.len+I.pos-x.plotTop),B],K.shapeType=h.pointClass.prototype.shapeType||"rect",K.shapeArgs=h.crispCol.apply(h,K.isNull?[D,$,F,0]:[D,U,F,B])})},g.prototype.drawGraph=function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},g.prototype.pointAttribs=function(h,x){var d=this.options,p=this.pointAttrToOptions||{},R=p.stroke||"borderColor",I=p["stroke-width"]||"borderWidth",j=h&&h.color||this.color,$=h&&h[R]||d[R]||j;p=h&&h.options.dashStyle||d.dashStyle;var et=h&&h[I]||d[I]||this[I]||0,it=A(h&&h.opacity,d.opacity,1);if(h&&this.zones.length){var H=h.getZone();j=h.options.color||H&&(H.color||h.nonZonedColor)||this.color,H&&($=H.borderColor||$,p=H.dashStyle||p,et=H.borderWidth||et)}return x&&h&&(h=w(d.states[x],h.options.states&&h.options.states[x]||{}),x=h.brightness,j=h.color||typeof x<"u"&&b(j).brighten(h.brightness).get()||j,$=h[R]||$,et=h[I]||et,p=h.dashStyle||p,it=A(h.opacity,it)),R={fill:j,stroke:$,"stroke-width":et,opacity:it},p&&(R.dashstyle=p),R},g.prototype.drawPoints=function(){var h=this,x=this.chart,d=h.options,p=x.renderer,R=d.animationLimit||250,I;h.points.forEach(function(j){var $=j.graphic,et=!!$,it=$&&x.pointCountV,L==="left"?et.y-=V?H.height:0:L==="center"?(et.x-=H.width/2,et.y-=H.height/2):L==="right"&&(et.x-=H.width,et.y-=V?0:H.height),h.placed=!0,h.alignAttr=et):(V(d),h.align(x,void 0,d),et=h.alignAttr),K&&0<=d.height?this.justifyDataLabel(h,x,et,H,d,p):m(x.crop,!0)&&(G=I.isInsidePlot(et.x,et.y,{paneCoordinates:!0,series:R})&&I.isInsidePlot(et.x+H.width,et.y+H.height,{paneCoordinates:!0,series:R})),x.shape&&!z&&h[p?"attr":"animate"]({anchorX:j?I.plotWidth-g.plotY:g.plotX,anchorY:j?I.plotHeight-g.plotX:g.plotY})}p&&$&&(h.placed=!1),G||$&&!K||(h.hide(!0),h.placed=!1)}function a(g,h){var x=h.filter;return x?(h=x.operator,g=g[x.property],x=x.value,h===">"&&g>x||h==="<"&&g="&&g>=x||h==="<="&&g<=x||h==="=="&&g==x||h==="==="&&g===x):!0}function S(){var g=this,h=g.chart,x=g.options,d=g.points,p=g.hasRendered||0,R=h.renderer,I=x.dataLabels,j,$=I.animation;if($=I.defer?c(h,$,g):{defer:0,duration:0},I=A(A(h.options.plotOptions&&h.options.plotOptions.series&&h.options.plotOptions.series.dataLabels,h.options.plotOptions&&h.options.plotOptions[g.type]&&h.options.plotOptions[g.type].dataLabels),I),v(this,"drawDataLabels"),E(I)||I.enabled||g._hasPointLabels){var et=g.plotGroup("dataLabelsGroup","data-labels",p?"inherit":"hidden",I.zIndex||6);et.attr({opacity:+p}),!p&&(p=g.dataLabelsGroup)&&(g.visible&&et.show(!0),p[x.animation?"animate":"attr"]({opacity:1},$)),d.forEach(function(it){j=T(A(I,it.dlOptions||it.options&&it.options.dataLabels)),j.forEach(function(H,z){var L=H.enabled&&(!it.isNull||it.dataLabelOnNull)&&a(it,H),N=it.connectors?it.connectors[z]:it.connector,V=it.dataLabels?it.dataLabels[z]:it.dataLabel,K=m(H.distance,it.labelDistance),G=!V;if(L){var J=it.getLabelConfig(),C=m(H[it.formatPrefix+"Format"],H.format);J=O(C)?l(C,J,h):(H[it.formatPrefix+"Formatter"]||H.formatter).call(J,H),C=H.style;var U=H.rotation;h.styledMode||(C.color=m(H.color,C.color,g.color,"#000000"),C.color==="contrast"?(it.contrastColor=R.getContrast(it.color||g.color),C.color=!O(K)&&H.inside||0>K||x.stacking?it.contrastColor:"#000000"):delete it.contrastColor,x.cursor&&(C.cursor=x.cursor));var B={r:H.borderRadius||0,rotation:U,padding:H.padding,zIndex:1};h.styledMode||(B.fill=H.backgroundColor,B.stroke=H.borderColor,B["stroke-width"]=H.borderWidth),P(B,function(tt,D){typeof tt>"u"&&delete B[D]})}!V||L&&O(J)&&!!V.div==!!H.useHTML||(it.dataLabel=V=it.dataLabel&&it.dataLabel.destroy(),it.dataLabels&&(it.dataLabels.length===1?delete it.dataLabels:delete it.dataLabels[z]),z||delete it.dataLabel,N&&(it.connector=it.connector.destroy(),it.connectors&&(it.connectors.length===1?delete it.connectors:delete it.connectors[z]))),L&&O(J)&&(V?B.text=J:(it.dataLabels=it.dataLabels||[],V=it.dataLabels[z]=U?R.text(J,0,-9999,H.useHTML).addClass("highcharts-data-label"):R.label(J,0,-9999,H.shape,null,null,H.useHTML,null,"data-label"),z||(it.dataLabel=V),V.addClass(" highcharts-data-label-color-"+it.colorIndex+" "+(H.className||"")+(H.useHTML?" highcharts-tracker":""))),V.options=H,V.attr(B),h.styledMode||V.css(C).shadow(H.shadow),V.added||V.add(et),H.textPath&&!H.useHTML&&(V.setTextPath(it.getDataLabelPath&&it.getDataLabelPath(V)||it.graphic,H.textPath),it.dataLabelPath&&!H.textPath.enabled&&(it.dataLabelPath=it.dataLabelPath.destroy())),g.alignDataLabel(it,V,H,null,G))})})}v(this,"afterDrawDataLabels")}function w(g,h,x,d,p,R){var I=this.chart,j=h.align,$=h.verticalAlign,et=g.box?0:g.padding||0,it=h.x;it=it===void 0?0:it;var H=h.y;H=H===void 0?0:H;var z=(x.x||0)+et;if(0>z){j==="right"&&0<=it?(h.align="left",h.inside=!0):it-=z;var L=!0}return z=(x.x||0)+d.width-et,z>I.plotWidth&&(j==="left"&&0>=it?(h.align="right",h.inside=!0):it+=I.plotWidth-z,L=!0),z=x.y+et,0>z&&($==="bottom"&&0<=H?(h.verticalAlign="top",h.inside=!0):H-=z,L=!0),z=(x.y||0)+d.height-et,z>I.plotHeight&&($==="top"&&0>=H?(h.verticalAlign="bottom",h.inside=!0):H+=I.plotHeight-z,L=!0),L&&(h.x=it,h.y=H,g.placed=!R,g.align(h,void 0,p)),L}function A(g,h){var x=[],d;if(E(g)&&!E(h))x=g.map(function(p){return b(p,h)});else if(E(h)&&!E(g))x=h.map(function(p){return b(g,p)});else if(E(g)||E(h))for(d=Math.max(g.length,h.length);d--;)x[d]=b(g[d],h[d]);else x=b(g,h);return x}function f(g,h,x,d,p){var R=this.chart,I=R.inverted,j=this.xAxis,$=j.reversed,et=I?h.height/2:h.width/2;g=(g=g.pointWidth)?g/2:0,h.startXPos=I?p.x:$?-et-g:j.width-et+g,h.startYPos=I?$?this.yAxis.height-et+g:-et-g:p.y,d?h.visibility==="hidden"&&(h.show(),h.attr({opacity:0}).animate({opacity:1})):h.attr({opacity:1}).animate({opacity:0},void 0,h.hide),R.hasRendered&&(x&&h.attr({x:h.startXPos,y:h.startYPos}),h.placed=!0)}var u=[];M.compose=function(g){if(u.indexOf(g)===-1){var h=g.prototype;u.push(g),h.alignDataLabel=y,h.drawDataLabels=S,h.justifyDataLabel=w,h.setDataLabelStartPos=f}}}(k||(k={})),k}),i(n,"Series/Column/ColumnDataLabel.js",[n["Core/Series/DataLabel.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Utilities.js"]],function(r,s,o){var c=s.series,l=o.merge,O=o.pick,_;return function(v){function E(P,m,T,k,M){var y=this.chart.inverted,a=P.series,S=(a.xAxis?a.xAxis.len:this.chart.plotSizeX)||0;a=(a.yAxis?a.yAxis.len:this.chart.plotSizeY)||0;var w=P.dlBox||P.shapeArgs,A=O(P.below,P.plotY>O(this.translatedThreshold,a)),f=O(T.inside,!!this.options.stacking);w&&(k=l(w),0>k.y&&(k.height+=k.y,k.y=0),w=k.y+k.height-a,0 {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}}),b}(s),_(c.prototype,{drawTracker:r.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1}),O(c,"afterTranslate",function(){this.applyJitter()}),o.registerSeriesType("scatter",c),c}),i(n,"Series/CenteredUtilities.js",[n["Core/Globals.js"],n["Core/Series/Series.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.deg2rad,l=o.isNumber,O=o.pick,_=o.relativeLength,v;return function(E){E.getCenter=function(){var b=this.options,P=this.chart,m=2*(b.slicedOffset||0),T=P.plotWidth-2*m,k=P.plotHeight-2*m,M=b.center,y=Math.min(T,k),a=b.size,S=b.innerSize||0;for(typeof a=="string"&&(a=parseFloat(a)),typeof S=="string"&&(S=parseFloat(S)),b=[O(M[0],"50%"),O(M[1],"50%"),O(a&&0>a?void 0:b.size,"100%"),O(S&&0>S?void 0:b.innerSize||0,"0%")],!P.angular||this instanceof s||(b[3]=0),M=0;4>M;++M)a=b[M],P=2>M||M===2&&/%$/.test(a),b[M]=_(a,[T,k,y,b[2]][M])+(P?m:0);return b[3]>b[2]&&(b[3]=b[2]),b},E.getStartAndEndRadians=function(b,P){return b=l(b)?b:0,P=l(P)&&P>b&&360>P-b?P:b+360,{start:c*(b+-90),end:c*(P+-90)}}}(v||(v={})),v}),i(n,"Series/Pie/PiePoint.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Series/Point.js"],n["Core/Utilities.js"]],function(r,s,o){var c=this&&this.__extends||function(){var P=function(m,T){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,M){k.__proto__=M}||function(k,M){for(var y in M)M.hasOwnProperty(y)&&(k[y]=M[y])},P(m,T)};return function(m,T){function k(){this.constructor=m}P(m,T),m.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}}(),l=r.setAnimation,O=o.addEvent,_=o.defined;r=o.extend;var v=o.isNumber,E=o.pick,b=o.relativeLength;return s=function(P){function m(){var T=P!==null&&P.apply(this,arguments)||this;return T.labelDistance=void 0,T.options=void 0,T.series=void 0,T}return c(m,P),m.prototype.getConnectorPath=function(){var T=this.labelPosition,k=this.series.options.dataLabels,M=this.connectorShapes,y=k.connectorShape;return M[y]&&(y=M[y]),y.call(this,{x:T.final.x,y:T.final.y,alignment:T.alignment},T.connectorPosition,k)},m.prototype.getTranslate=function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},m.prototype.haloPath=function(T){var k=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(k.x,k.y,k.r+T,k.r+T,{innerR:k.r-1,start:k.start,end:k.end})},m.prototype.init=function(){var T=this;P.prototype.init.apply(this,arguments),this.name=E(this.name,"Slice");var k=function(M){T.slice(M.type==="select")};return O(this,"select",k),O(this,"unselect",k),this},m.prototype.isValid=function(){return v(this.y)&&0<=this.y},m.prototype.setVisible=function(T,k){var M=this,y=this.series,a=y.chart,S=y.options.ignoreHiddenPoint;k=E(k,S),T!==this.visible&&(this.visible=this.options.visible=T=typeof T>"u"?!this.visible:T,y.options.data[y.data.indexOf(this)]=this.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(w){M[w]&&M[w][T?"show":"hide"](T)}),this.legendItem&&a.legend.colorizeItem(this,T),T||this.state!=="hover"||this.setState(""),S&&(y.isDirty=!0),k&&a.redraw())},m.prototype.slice=function(T,k,M){var y=this.series;l(M,y.chart),E(k,!0),this.sliced=this.options.sliced=_(T)?T:!this.sliced,y.options.data[y.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},m}(s),r(s.prototype,{connectorShapes:{fixedOffset:function(P,m,T){var k=m.breakAt;return m=m.touchingSliceAt,[["M",P.x,P.y],T.softConnector?["C",P.x+(P.alignment==="left"?-5:5),P.y,2*k.x-m.x,2*k.y-m.y,k.x,k.y]:["L",k.x,k.y],["L",m.x,m.y]]},straight:function(P,m){return m=m.touchingSliceAt,[["M",P.x,P.y],["L",m.x,m.y]]},crookedLine:function(P,m,T){m=m.touchingSliceAt;var k=this.series,M=k.center[0],y=k.chart.plotWidth,a=k.chart.plotLeft;k=P.alignment;var S=this.shapeArgs.r;return T=b(T.crookDistance,1),y=k==="left"?M+S+(y+a-M-S)*(1-T):a+(M-S)*T,T=["L",y,P.y],M=!0,(k==="left"?y>P.x||ym.x)&&(M=!1),P=[["M",P.x,P.y]],M&&P.push(T),P.push(["L",m.x,m.y]),P}}}),s}),i(n,"Series/Pie/PieSeries.js",[n["Series/CenteredUtilities.js"],n["Series/Column/ColumnSeries.js"],n["Core/Globals.js"],n["Core/Legend/LegendSymbol.js"],n["Series/Pie/PiePoint.js"],n["Core/Series/Series.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Renderer/SVG/Symbols.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E){var b=this&&this.__extends||function(){var S=function(w,A){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var g in u)u.hasOwnProperty(g)&&(f[g]=u[g])},S(w,A)};return function(w,A){function f(){this.constructor=w}S(w,A),w.prototype=A===null?Object.create(A):(f.prototype=A.prototype,new f)}}(),P=r.getStartAndEndRadians;o=o.noop;var m=E.clamp,T=E.extend,k=E.fireEvent,M=E.merge,y=E.pick,a=E.relativeLength;return E=function(S){function w(){var A=S!==null&&S.apply(this,arguments)||this;return A.center=void 0,A.data=void 0,A.maxLabelDistance=void 0,A.options=void 0,A.points=void 0,A}return b(w,S),w.prototype.animate=function(A){var f=this,u=f.points,g=f.startAngleRad;A||u.forEach(function(h){var x=h.graphic,d=h.shapeArgs;x&&d&&(x.attr({r:y(h.startR,f.center&&f.center[3]/2),start:g,end:g}),x.animate({r:d.r,start:d.start,end:d.end},f.options.animation))})},w.prototype.drawEmpty=function(){var A=this.startAngleRad,f=this.endAngleRad,u=this.options;if(this.total===0&&this.center){var g=this.center[0],h=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(g,h,this.center[1]/2,0,A,f).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:v.arc(g,h,this.center[2]/2,0,{start:A,end:f,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":u.borderWidth,fill:u.fillColor||"none",stroke:u.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},w.prototype.drawPoints=function(){var A=this.chart.renderer;this.points.forEach(function(f){f.graphic&&f.hasNewShapeType()&&(f.graphic=f.graphic.destroy()),f.graphic||(f.graphic=A[f.shapeType](f.shapeArgs).add(f.series.group),f.delayedRendering=!0)})},w.prototype.generatePoints=function(){S.prototype.generatePoints.call(this),this.updateTotals()},w.prototype.getX=function(A,f,u){var g=this.center,h=this.radii?this.radii[u.index]||0:g[2]/2;return A=Math.asin(m((A-g[1])/(h+u.labelDistance),-1,1)),g[0]+(f?-1:1)*Math.cos(A)*(h+u.labelDistance)+(01.5*Math.PI?it-=2*Math.PI:it<-Math.PI/2&&(it+=2*Math.PI),$.slicedTranslation={translateX:Math.round(Math.cos(it)*u),translateY:Math.round(Math.sin(it)*u)},H=Math.cos(it)*A[2]/2;var z=Math.sin(it)*A[2]/2;$.tooltipPos=[A[0]+.7*H,A[1]+.7*z],$.half=it<-Math.PI/2||it>Math.PI/2?1:0,$.angle=it,et=Math.min(g,$.labelDistance/5),$.labelPosition={natural:{x:A[0]+H+Math.cos(it)*$.labelDistance,y:A[1]+z+Math.sin(it)*$.labelDistance},final:{},alignment:0>$.labelDistance?"center":$.half?"right":"left",connectorPosition:{breakAt:{x:A[0]+H+Math.cos(it)*et,y:A[1]+z+Math.sin(it)*et},touchingSliceAt:{x:A[0]+H,y:A[1]+z}}}}k(this,"afterTranslate")},w.prototype.updateTotals=function(){var A=this.points,f=A.length,u=this.options.ignoreHiddenPoint,g,h=0;for(g=0;gj&&(st.dataLabel.css({width:Math.round(.7*j)+"px"}),st.dataLabel.shortened=!0)):(st.dataLabel=st.dataLabel.destroy(),st.dataLabels&&st.dataLabels.length===1&&delete st.dataLabels))}),H.forEach(function(st,ot){var lt=st.length,ct=[],q;if(lt){if(u.sortByAngle(st,ot-.5),0"u"?D="hidden":(U=N.distributeBox.size,tt=L.radialDistributionY(N))),delete N.positionIndex,x.justify)B=L.justify(N,et,$);else switch(x.alignTo){case"connectors":B=L.alignToConnectors(st,ot,p,I);break;case"plotEdges":B=L.alignToPlotEdges(G,ot,p,I);break;default:B=L.radialDistributionX(u,N,tt,Y)}G._attr={visibility:D,align:C.alignment},X=N.options.dataLabels||{},G._pos={x:B+T(X.x,x.x)+({left:d,right:-d}[C.alignment]||0),y:tt+T(X.y,x.y)-10},C.final.x=B,C.final.y=tt,T(x.crop,!0)&&(J=G.getBBox().width,Y=null,B-Jp-d&&ot===0&&(Y=Math.round(B+J-p+d),z[1]=Math.max(Y,z[1])),0>tt-U/2?z[0]=Math.max(Math.round(-tt+U/2),z[0]):tt+U/2>R&&(z[2]=Math.max(Math.round(tt+U/2-R),z[2])),G.sideOverflow=Y)}}}),E(z)===0||this.verifyDataLabelOverflow(z))&&(this.placeDataLabels(),this.points.forEach(function(st){if(X=m(x,st.options.dataLabels),V=T(X.connectorWidth,1)){var ot;K=st.connector,(G=st.dataLabel)&&G._pos&&st.visible&&0g.bottom-2?x:h,g.half,g)},justify:function(u,g,h){return h[0]+(u.half?-1:1)*(g+u.labelDistance)},alignToPlotEdges:function(u,g,h,x){return u=u.getBBox().width,g?u+x:h-u-x},alignToConnectors:function(u,g,h,x){var d=0,p;return u.forEach(function(R){p=R.dataLabel.getBBox().width,p>d&&(d=p)}),g?d+x:h-d-x}};y.compose=function(u){r.compose(v),A.indexOf(u)===-1&&(A.push(u),u=u.prototype,u.dataLabelPositioners=f,u.alignDataLabel=O,u.drawDataLabels=a,u.placeDataLabels=S,u.verifyDataLabelOverflow=w)}}(M||(M={})),M}),i(n,"Extensions/OverlappingDataLabels.js",[n["Core/Chart/Chart.js"],n["Core/Utilities.js"]],function(r,s){function o(b,P){var m=!1;if(b){var T=b.newOpacity;b.oldOpacity!==T&&(b.alignAttr&&b.placed?(b[T?"removeClass":"addClass"]("highcharts-data-label-hidden"),m=!0,b.alignAttr.opacity=T,b[b.isOld?"animate":"attr"](b.alignAttr,null,function(){P.styledMode||b.css({pointerEvents:T?"auto":"none"})}),l(P,"afterHideOverlappingLabel")):b.attr({opacity:T})),b.isOld=!0}return m}var c=s.addEvent,l=s.fireEvent,O=s.isArray,_=s.isNumber,v=s.objectEach,E=s.pick;c(r,"render",function(){var b=this,P=[];(this.labelCollectors||[]).forEach(function(m){P=P.concat(m())}),(this.yAxis||[]).forEach(function(m){m.stacking&&m.options.stackLabels&&!m.options.stackLabels.allowOverlap&&v(m.stacking.stacks,function(T){v(T,function(k){k.label&&k.label.visibility!=="hidden"&&P.push(k.label)})})}),(this.series||[]).forEach(function(m){var T=m.options.dataLabels;m.visible&&(T.enabled!==!1||m._hasPointLabels)&&(T=function(k){return k.forEach(function(M){M.visible&&(O(M.dataLabels)?M.dataLabels:M.dataLabel?[M.dataLabel]:[]).forEach(function(y){var a=y.options;y.labelrank=E(a.labelrank,M.labelrank,M.shapeArgs&&M.shapeArgs.height),a.allowOverlap?(y.oldOpacity=y.opacity,y.newOpacity=1,o(y,b)):P.push(y)})})},T(m.nodes||[]),T(m.points))}),this.hideOverlappingLabels(P)}),r.prototype.hideOverlappingLabels=function(b){var P=this,m=b.length,T=P.renderer,k,M,y,a=!1,S=function(f){var u,g=f.box?0:f.padding||0,h=u=0,x;if(f&&(!f.alignAttr||f.placed)){var d=f.alignAttr||{x:f.attr("x"),y:f.attr("y")},p=f.parentGroup;f.width||(u=f.getBBox(),f.width=u.width,f.height=u.height,u=T.fontMetrics(null,f.element).h);var R=f.width-2*g;return(x={left:"0",center:"0.5",right:"1"}[f.alignValue])?h=+x*R:_(f.x)&&Math.round(f.x)!==f.translateX&&(h=f.x-f.translateX),{x:d.x+(p.translateX||0)+g-(h||0),y:d.y+(p.translateY||0)+g-u,width:f.width-2*g,height:f.height-2*g}}};for(M=0;M=w.x+w.width||A.x+A.width<=w.x||A.y>=w.y+w.height||A.y+A.height<=w.y||((S.labelrank"u"?null:f[d]})}var S=this,w={};return a(y,this.options,w,0),w},M.prototype.matchResponsiveRule=function(y,a){var S=y.condition;(S.callback||function(){return this.chartWidth<=v(S.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=v(S.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=v(S.minWidth,0)&&this.chartHeight>=v(S.minHeight,0)}).call(this)&&a.push(y._id)},M.prototype.setResponsive=function(y,a){var S=this,w=this.options.responsive,A=this.currentResponsive,f=[];!a&&w&&w.rules&&w.rules.forEach(function(u){typeof u._id>"u"&&(u._id=b()),S.matchResponsiveRule(u,f)},this),a=O.apply(void 0,f.map(function(u){return o((w||{}).rules||[],function(g){return g._id===u})}).map(function(u){return u&&u.chartOptions})),a.isResponsiveOptions=!0,f=f.toString()||void 0,f!==(A&&A.ruleIds)&&(A&&this.update(A.undoOptions,y,!0),f?(A=this.currentOptions(a),A.isResponsiveOptions=!0,this.currentResponsive={ruleIds:f,mergedOptions:a,undoOptions:A},this.update(a,y,!0)):this.currentResponsive=void 0)},M}()}(P||(P={})),P}),i(n,"masters/highcharts.src.js",[n["Core/Globals.js"],n["Core/Utilities.js"],n["Core/DefaultOptions.js"],n["Core/Animation/Fx.js"],n["Core/Animation/AnimationUtilities.js"],n["Core/Renderer/HTML/AST.js"],n["Core/FormatUtilities.js"],n["Core/Renderer/RendererUtilities.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGRenderer.js"],n["Core/Renderer/HTML/HTMLElement.js"],n["Core/Renderer/HTML/HTMLRenderer.js"],n["Core/Axis/Axis.js"],n["Core/Axis/DateTimeAxis.js"],n["Core/Axis/LogarithmicAxis.js"],n["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],n["Core/Axis/Tick.js"],n["Core/Tooltip.js"],n["Core/Series/Point.js"],n["Core/Pointer.js"],n["Core/MSPointer.js"],n["Core/Legend/Legend.js"],n["Core/Chart/Chart.js"],n["Core/Series/Series.js"],n["Core/Series/SeriesRegistry.js"],n["Series/Column/ColumnSeries.js"],n["Series/Column/ColumnDataLabel.js"],n["Series/Pie/PieSeries.js"],n["Series/Pie/PieDataLabel.js"],n["Core/Series/DataLabel.js"],n["Core/Responsive.js"],n["Core/Color/Color.js"],n["Core/Time.js"]],function(r,s,o,c,l,O,_,v,E,b,P,m,T,k,M,y,a,S,w,A,f,u,g,h,x,d,p,R,I,j,$,et,it){return r.animate=l.animate,r.animObject=l.animObject,r.getDeferredAnimation=l.getDeferredAnimation,r.setAnimation=l.setAnimation,r.stop=l.stop,r.timers=c.timers,r.AST=O,r.Axis=T,r.Chart=g,r.chart=g.chart,r.Fx=c,r.Legend=u,r.PlotLineOrBand=y,r.Point=w,r.Pointer=f.isRequired()?f:A,r.Series=h,r.SVGElement=E,r.SVGRenderer=b,r.Tick=a,r.Time=it,r.Tooltip=S,r.Color=et,r.color=et.parse,m.compose(b),P.compose(E),r.defaultOptions=o.defaultOptions,r.getOptions=o.getOptions,r.time=o.defaultTime,r.setOptions=o.setOptions,r.dateFormat=_.dateFormat,r.format=_.format,r.numberFormat=_.numberFormat,r.addEvent=s.addEvent,r.arrayMax=s.arrayMax,r.arrayMin=s.arrayMin,r.attr=s.attr,r.clearTimeout=s.clearTimeout,r.correctFloat=s.correctFloat,r.createElement=s.createElement,r.css=s.css,r.defined=s.defined,r.destroyObjectProperties=s.destroyObjectProperties,r.discardElement=s.discardElement,r.distribute=v.distribute,r.erase=s.erase,r.error=s.error,r.extend=s.extend,r.extendClass=s.extendClass,r.find=s.find,r.fireEvent=s.fireEvent,r.getMagnitude=s.getMagnitude,r.getStyle=s.getStyle,r.inArray=s.inArray,r.isArray=s.isArray,r.isClass=s.isClass,r.isDOMElement=s.isDOMElement,r.isFunction=s.isFunction,r.isNumber=s.isNumber,r.isObject=s.isObject,r.isString=s.isString,r.keys=s.keys,r.merge=s.merge,r.normalizeTickInterval=s.normalizeTickInterval,r.objectEach=s.objectEach,r.offset=s.offset,r.pad=s.pad,r.pick=s.pick,r.pInt=s.pInt,r.relativeLength=s.relativeLength,r.removeEvent=s.removeEvent,r.seriesType=x.seriesType,r.splat=s.splat,r.stableSort=s.stableSort,r.syncTimeout=s.syncTimeout,r.timeUnits=s.timeUnits,r.uniqueKey=s.uniqueKey,r.useSerialIds=s.useSerialIds,r.wrap=s.wrap,p.compose(d),j.compose(h),k.compose(T),M.compose(T),I.compose(R),y.compose(T),$.compose(g),r}),n["masters/highcharts.src.js"]._modules=n,n["masters/highcharts.src.js"]})}(Co)),Co.exports}const Pw=Ow(ny);(function(t,e){(function(i,n){t.exports=n(Aw(),Pw)})(window,function(i,n){return s=[function(c,l){c.exports=i},function(c,l){c.exports=n},function(c,_,O){O.r(_),O.d(_,"Chart",function(){return S}),O.d(_,"default",function(){return w});var _=O(0),v=O.n(_);function E(A,f){return function u(g,h,x){function d(p,R){!v.a.isObject(p,!x)||v.a.isClass(p)||v.a.isDOMElement(p)?g[R]=h[R]:g[R]=u(g[R]||v.a.isArray(p)?[]:{},p,x)}return v.a.isArray(h)?h.forEach(d):v.a.objectEach(h,d),g}({},A,f)}var b=O(1);function P(A){return(P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(A)}function m(A){return function(f){if(Array.isArray(f))return T(f)}(A)||function(f){if(typeof Symbol<"u"&&f[Symbol.iterator]!=null||f["@@iterator"]!=null)return Array.from(f)}(A)||function(f,u){var g;if(f)return typeof f=="string"?T(f,u):(g=(g=Object.prototype.toString.call(f).slice(8,-1))==="Object"&&f.constructor?f.constructor.name:g)==="Map"||g==="Set"?Array.from(f):g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?T(f,u):void 0}(A)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function T(A,f){(f==null||f>A.length)&&(f=A.length);for(var u=0,g=new Array(f);u',props:{constructorType:{type:String,default:"chart"},options:{type:Object,required:!0},callback:Function,updateArgs:{type:Array,default:function(){return[!0,!0]}},highcharts:{type:Object},deepCopyOnUpdate:{type:Boolean,default:!0}}},a=function(A,f){return f.split(".")[0]<3?M(M({},y),{},{render:function(u){return u("div",{ref:"chart"})},beforeDestroy:function(){this.chart&&this.chart.destroy()},watch:{options:{handler:function(u){var g;(g=this.chart).update.apply(g,[E(u,this.deepCopyOnUpdate)].concat(m(this.updateArgs)))},deep:!0}},mounted:function(){var u=this.highcharts||A;this.options&&u[this.constructorType]?this.chart=u[this.constructorType](this.$refs.chart,E(this.options,!0),this.callback||null):this.options?console.warn("'".concat(this.constructorType,"' constructor-type is incorrect. Sometimes this error is caused by the fact, that the corresponding module wasn't imported.")):console.warn('The "options" parameter was not passed.')}}):M(M({},y),{},{render:function(){return Object(b.h)("div",{ref:"chartContainer"})},setup:function(u){var g=Object(b.ref)(null),h=Object(b.shallowRef)({});return Object(b.onMounted)(function(){var x=u.highcharts||A;u.options&&x[u.constructorType]?h.value=x[u.constructorType](g.value,E(u.options,!0),u.callback||null):u.options?console.warn("'".concat(u.constructorType,"' constructor-type is incorrect. Sometimes this error is caused by the fact, that the corresponding module wasn't imported.")):console.warn('The "options" parameter was not passed.')}),Object(b.watch)(function(){return u.options},function(x,d){var p;(p=h.value).update.apply(p,[E(x,u.deepCopyOnUpdate)].concat(m(u.updateArgs)))},{deep:!0}),Object(b.onBeforeUnmount)(function(){h.value&&h.value.destroy()}),{chart:h,chartContainer:g,props:u}}})},S=a(v.a,b.version||O.n(b).a.version);function w(A){var f=1=this._config.preview;if(s)n.postMessage({results:d,workerId:l.WORKER_ID,finished:R});else if(A(this._config.chunk)&&!g){if(this._config.chunk(d,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);d=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(d.data),this._completeResults.errors=this._completeResults.errors.concat(d.errors),this._completeResults.meta=d.meta),this._completed||!R||!A(this._config.complete)||d&&d.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),R||d&&d.meta.paused||this._nextChunk(),d}this._halted=!0},this._sendError=function(u){A(this._config.error)?this._config.error(u):s&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:u,finished:!1})}}function v(f){var u;(f=f||{}).chunkSize||(f.chunkSize=l.RemoteChunkSize),_.call(this,f),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(g){this._input=g,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(u=new XMLHttpRequest,this._config.withCredentials&&(u.withCredentials=this._config.withCredentials),r||(u.onload=w(this._chunkLoaded,this),u.onerror=w(this._chunkError,this)),u.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var g=this._config.downloadRequestHeaders;for(var h in g)u.setRequestHeader(h,g[h])}if(this._config.chunkSize){var x=this._start+this._config.chunkSize-1;u.setRequestHeader("Range","bytes="+this._start+"-"+x)}try{u.send(this._config.downloadRequestBody)}catch(d){this._chunkError(d.message)}r&&u.status===0&&this._chunkError()}},this._chunkLoaded=function(){u.readyState===4&&(u.status<200||400<=u.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:u.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(g){var h=g.getResponseHeader("Content-Range");return h===null?-1:parseInt(h.substring(h.lastIndexOf("/")+1))}(u),this.parseChunk(u.responseText)))},this._chunkError=function(g){var h=u.statusText||g;this._sendError(new Error(h))}}function E(f){var u,g;(f=f||{}).chunkSize||(f.chunkSize=l.LocalChunkSize),_.call(this,f);var h=typeof FileReader<"u";this.stream=function(x){this._input=x,g=x.slice||x.webkitSlice||x.mozSlice,h?((u=new FileReader).onload=w(this._chunkLoaded,this),u.onerror=w(this._chunkError,this)):u=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(x.target.result)},this._chunkError=function(){this._sendError(u.error)}}function b(f){var u;_.call(this,f=f||{}),this.stream=function(g){return u=g,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var g,h=this._config.chunkSize;return h?(g=u.substring(0,h),u=u.substring(h)):(g=u,u=""),this._finished=!u,this.parseChunk(g)}}}function P(f){_.call(this,f=f||{});var u=[],g=!0,h=!1;this.pause=function(){_.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){_.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(x){this._input=x,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){h&&u.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),u.length?this.parseChunk(u.shift()):g=!0},this._streamData=w(function(x){try{u.push(typeof x=="string"?x:x.toString(this._config.encoding)),g&&(g=!1,this._checkIsFinished(),this.parseChunk(u.shift()))}catch(d){this._streamError(d)}},this),this._streamError=w(function(x){this._streamCleanUp(),this._sendError(x)},this),this._streamEnd=w(function(){this._streamCleanUp(),h=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(f){var u,g,h,x=Math.pow(2,53),d=-x,p=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,R=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,I=this,j=0,$=0,et=!1,it=!1,H=[],z={data:[],errors:[],meta:{}};if(A(f.step)){var L=f.step;f.step=function(C){if(z=C,K())V();else{if(V(),z.data.length===0)return;j+=C.data.length,f.preview&&j>f.preview?g.abort():(z.data=z.data[0],L(z,I))}}}function N(C){return f.skipEmptyLines==="greedy"?C.join("").trim()==="":C.length===1&&C[0].length===0}function V(){return z&&h&&(J("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),h=!1),f.skipEmptyLines&&(z.data=z.data.filter(function(C){return!N(C)})),K()&&function(){if(!z)return;function C(B,tt){A(f.transformHeader)&&(B=f.transformHeader(B,tt)),H.push(B)}if(Array.isArray(z.data[0])){for(var U=0;K()&&U=H.length?"__parsed_extra":H[D]),f.transform&&(st=f.transform(st,X)),st=G(X,st),X==="__parsed_extra"?(F[X]=F[X]||[],F[X].push(st)):F[X]=st}return f.header&&(D>H.length?J("FieldMismatch","TooManyFields","Too many fields: expected "+H.length+" fields but parsed "+D,$+tt):D=lt.length/2?`\r +`:"\r"}(C,tt)),h=!1,f.delimiter)A(f.delimiter)&&(f.delimiter=f.delimiter(C),z.meta.delimiter=f.delimiter);else{var D=function(X,st,ot,lt,ct){var q,Y,Z,W;ct=ct||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Q=0;Q=p)return vt(!0)}else for(rt=j,j++;;){if((rt=et.indexOf(u,rt+1))===-1)return H||J.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:G.length,index:j}),gt();if(rt===z-1)return gt(et.substring(j,rt).replace(Q,u));if(u!==I||et[rt+1]!==I){if(u===I||rt===0||et[rt-1]!==I){Z!==-1&&Z=p)return vt(!0);break}J.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:G.length,index:j}),rt++}}else rt++}return gt();function ut(ht){G.push(ht),U=j}function ft(ht){var pt=0;if(ht!==-1){var mt=et.substring(rt+1,ht);mt&&mt.trim()===""&&(pt=mt.length)}return pt}function gt(ht){return H||(ht===void 0&&(ht=et.substring(j)),C.push(ht),j=z,ut(C),K&&dt()),vt()}function xt(ht){j=ht,ut(C),C=[],W=et.indexOf(h,j)}function vt(ht){return{data:G,errors:J,meta:{delimiter:g,linebreak:h,aborted:$,truncated:!!ht,cursor:U+(it||0)}}}function dt(){d(vt()),G=[],J=[]}},this.abort=function(){$=!0},this.getCharIndex=function(){return j}}function M(f){var u=f.data,g=o[u.workerId],h=!1;if(u.error)g.userError(u.error,u.file);else if(u.results&&u.results.data){var x={abort:function(){h=!0,y(u.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:a,resume:a};if(A(g.userStep)){for(var d=0;d{try{const i=new Blob([t],{type:"text/csv"}),n=URL.createObjectURL(i),r=document.createElement("a");r.id=`csv-${parseInt(Math.random().toString().slice(2,16))}`,r.href=n,document.body.appendChild(r);const s=document.getElementById(r.id);return s.style.visibility="hidden",s.download=`${e}.csv`,s.click(),setTimeout(()=>{document.body.removeChild(r)},1),!0}catch{return!1}},Nw=t=>t.map(e=>JSON.stringify(e)).reduce((e,i)=>(e.find(n=>n===i)||e.push(i),e),[]).map(e=>JSON.parse(e)),Dw={install(t,e){const i={download:Rw,dedupe:Nw},n=Object.entries(Iw).reduce((s,[o,c])=>(s[o]=c,s),{}),r=Object.assign(n,i);"config"in t&&"globalProperties"in t.config?t.config.globalProperties.$papa=r:t.prototype.$papa=r}};var jw=Object.defineProperty,Fw=Object.defineProperties,Bw=Object.getOwnPropertyDescriptors,Cs=Object.getOwnPropertySymbols,tp=Object.prototype.hasOwnProperty,ep=Object.prototype.propertyIsEnumerable,xu=(t,e,i)=>e in t?jw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ip=function(t){return t},Hw=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},bu=Math.max,Vw=function(t,e,i){return e=bu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,s=bu(n.length-e,0),o=Array(s);++r0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(mE),xE=ip,bE=Vw,_E=yE,wE=function(t,e){return _E(bE(t,e,xE),t+"")},op=function(t,e){return t===e||t!=t&&e!=e},ap=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991},EE=sp,CE=ap,lp=function(t){return t!=null&&CE(t.length)&&!EE(t)},SE=/^(?:0|[1-9]\d*)$/,cp=function(t,e){var i=typeof t;return!!(e=e??9007199254740991)&&(i=="number"||i!="symbol"&&SE.test(t))&&t>-1&&t%1==0&&t2?e[2]:void 0;for(r&&h1(e[0],e[1],r)&&(n=1);++it.pageOnly||!oi.isEnabled),s=$t(()=>(r.value||t.teleport)&&n.isFullscreen?{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}:void 0);function o(){e("change",n.isFullscreen),e("update:modelValue",n.isFullscreen),e("update:fullscreen",n.isFullscreen)}function c(){oi.isFullscreen||oi.off("change",c),n.isFullscreen=oi.isFullscreen,o()}function l(E){E.key==="Escape"&&_()}function O(){r.value?(n.isFullscreen=!0,o(),document.removeEventListener("keyup",l),document.addEventListener("keyup",l)):(oi.off("change",c),oi.on("change",c),oi.request(t.teleport?document.body:i.value))}function _(){n.isFullscreen&&(r.value?(n.isFullscreen=!1,o(),document.removeEventListener("keyup",l)):oi.exit())}return le(()=>t.fullscreen,E=>{E!==n.isFullscreen&&(E?O():_())}),le(()=>t.modelValue,E=>{E!==n.isFullscreen&&(E?O():_())}),v=((E,b)=>{for(var P in b||(b={}))tp.call(b,P)&&xu(E,P,b[P]);if(Cs)for(var P of Cs(b))ep.call(b,P)&&xu(E,P,b[P]);return E})({wrapper:i,wrapperStyle:s},ah(n)),Fw(v,Bw({toggle:function(E){E===void 0?n.isFullscreen?_():O():E?O():_()},request:O,exit:_,shadeClick:function(E){E.target===i.value&&t.exitOnClickWrapper&&_()}}));var v}});pp.render=function(t,e,i,n,r,s){return Ai(),mn(yh,{to:"body",disabled:!t.teleport||!t.fullscreen},[Ft("div",Wa({ref:"wrapper"},t.$attrs,{style:t.wrapperStyle,class:{[t.fullscreenClass]:t.isFullscreen},onClick:e[1]||(e[1]=o=>t.shadeClick(o))}),[Ih(t.$slots,"default")],16)],8,["disabled"])};const g1=typeof window<"u"&&window!==null;(function(){if(g1&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0})();const m1=Object.prototype.propertyIsEnumerable,Mu=Object.getOwnPropertySymbols;function is(t){return typeof t=="function"||toString.call(t)==="[object Object]"}function v1(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"}function y1(t,...e){if(!is(t))throw new TypeError("expected the first argument to be an object");if(e.length===0||typeof Symbol!="function"||typeof Mu!="function")return t;for(const i of e){const n=Mu(i);for(const r of n)m1.call(i,r)&&(t[r]=i[r])}return t}function pl(t,...e){let i=0;var n;for((typeof(n=t)=="object"?n===null:typeof n!="function")&&(t=e[i++]),t||(t={});i{n.key==="Escape"&&(document.removeEventListener("keyup",i),this.exit())};return this.isFullscreen=!0,this.element=t,document.removeEventListener("keyup",i),document.addEventListener("keyup",i),this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()}{const i=()=>{Ge.isFullscreen||(Ge.off("change",i),Ru(this)),this.isFullscreen=Ge.isFullscreen,this.options.teleport?this.element=t||null:this.element=Ge.element,this.options.callback&&this.options.callback(Ge.isFullscreen)};return Ge.on("change",i),Ge.request(this.options.teleport?document.body:t)}},exit(){return this.isFullscreen?this.options.pageOnly?(Ru(this),this.isFullscreen=!1,this.element=null,this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()):Ge.exit():Promise.resolve()}},x1=(t,e,i)=>{const n=()=>{let r;const s={teleport:e.modifiers.teleport,pageOnly:e.modifiers.pageOnly};if(e.value)if(typeof e.value=="string")r=e.value;else{const o=e.value,{target:c}=o,l=((O,_)=>{var v={};for(var E in O)tp.call(O,E)&&_.indexOf(E)<0&&(v[E]=O[E]);if(O!=null&&Cs)for(var E of Cs(O))_.indexOf(E)<0&&ep.call(O,E)&&(v[E]=O[E]);return v})(o,["target"]);r=c,pl(s,l)}typeof r=="string"&&(r=document.querySelector(r)),mp.toggle(r,s)};t._onClickFullScreen&&t.removeEventListener("click",t._onClickFullScreen),t.addEventListener("click",n),t._onClickFullScreen=n};var b1={install(t,{name:e="fullscreen"}={}){t.config.globalProperties[`$${e}`]=mp,t.component(e,p1(pp,{name:e})),t.directive(e,x1)}};const Ts=bn(Ey);Ts.use(M0).use(Rb).use(Lw,{tagName:"charts"}).use(Sw,{directive:"tippy",component:"tippy"}).use(Dw).use(b1);Ts.provide("$papa",Ts.config.globalProperties.$papa);Ts.mount("#app");export{Ow as A,qd as B,km as C,qg as D,Va as E,zt as F,Sr as G,bn as H,Se as I,Sw as J,Rb as K,Be as L,mp as M,ie as N,Qv as O,$g as P,w1 as Q,Ma as R,Qn as S,yv as T,Nn as U,Dn as V,Qe as W,Oe as X,Aw as Y,Ev as Z,po as _,Zg as a,lf as b,Kd as c,Ue as d,Ha as e,Km as f,mn as g,Aa as h,Ih as i,Yt as j,$t as k,le as l,gi as m,Tr as n,Ai as o,zm as p,Jg as q,Lh as r,Ft as s,Bu as t,il as u,Cf as v,Ag as w,by as x,Vs as y,qi as z}; diff --git a/custom-toc-separator/assets/main-lj2zzr_L.js b/custom-toc-separator/assets/main-lj2zzr_L.js deleted file mode 100644 index ac282fb0..00000000 --- a/custom-toc-separator/assets/main-lj2zzr_L.js +++ /dev/null @@ -1,74 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-OUarUCIt.js","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -function yp(t,e){for(var i=0;in[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();/** -* @vue/shared v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function Os(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const Pt={},ln=[],Te=()=>{},xp=()=>!1,Er=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),va=t=>t.startsWith("onUpdate:"),Bt=Object.assign,ya=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},bp=Object.prototype.hasOwnProperty,Mt=(t,e)=>bp.call(t,e),_t=Array.isArray,cn=t=>Mn(t)==="[object Map]",Ki=t=>Mn(t)==="[object Set]",gl=t=>Mn(t)==="[object Date]",_p=t=>Mn(t)==="[object RegExp]",Ct=t=>typeof t=="function",Ut=t=>typeof t=="string",He=t=>typeof t=="symbol",jt=t=>t!==null&&typeof t=="object",xa=t=>(jt(t)||Ct(t))&&Ct(t.then)&&Ct(t.catch),Nu=Object.prototype.toString,Mn=t=>Nu.call(t),wp=t=>Mn(t).slice(8,-1),As=t=>Mn(t)==="[object Object]",ba=t=>Ut(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,un=Os(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ps=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},Ep=/-(\w)/g,ne=Ps(t=>t.replace(Ep,(e,i)=>i?i.toUpperCase():"")),Cp=/\B([A-Z])/g,ye=Ps(t=>t.replace(Cp,"-$1").toLowerCase()),Cr=Ps(t=>t.charAt(0).toUpperCase()+t.slice(1)),zn=Ps(t=>t?`on${Cr(t)}`:""),de=(t,e)=>!Object.is(t,e),hn=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},ns=t=>{const e=parseFloat(t);return isNaN(e)?t:e},rs=t=>{const e=Ut(t)?Number(t):NaN;return isNaN(e)?t:e};let ml;const ks=()=>ml||(ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Sp="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",Tp=Os(Sp);function Sr(t){if(_t(t)){const e={};for(let i=0;i{if(i){const n=i.split(Ap);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Tr(t){let e="";if(Ut(t))e=t;else if(_t(t))for(let i=0;iTi(i,e))}const Fu=t=>!!(t&&t.__v_isRef===!0),Bu=t=>Ut(t)?t:t==null?"":_t(t)||jt(t)&&(t.toString===Nu||!Ct(t.toString))?Fu(t)?Bu(t.value):JSON.stringify(t,Hu,2):String(t),Hu=(t,e)=>Fu(e)?Hu(t,e.value):cn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[n,r],s)=>(i[to(n,s)+" =>"]=r,i),{})}:Ki(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>to(i))}:He(e)?to(e):jt(e)&&!_t(e)&&!As(e)?String(e):e,to=(t,e="")=>{var i;return He(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** -* @vue/reactivity v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let fe;class _a{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=fe,!e&&fe&&(this.index=(fe.scopes||(fe.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes)for(e=0,i=this.scopes.length;e0)return;if(qn){let e=qn;for(qn=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Kn;){let e=Kn;for(Kn=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=i}}if(t)throw t}function $u(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Xu(t){let e,i=t.depsTail,n=i;for(;n;){const r=n.prevDep;n.version===-1?(n===i&&(i=r),Ca(n),Dp(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}t.deps=e,t.depsTail=i}function ko(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Yu(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Yu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===ar))return;t.globalVersion=ar;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!ko(t)){t.flags&=-3;return}const i=Ht,n=Fe;Ht=t,Fe=!0;try{$u(t);const r=t.fn(t._value);(e.version===0||de(r,t._value))&&(t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Ht=i,Fe=n,Xu(t),t.flags&=-3}}function Ca(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let s=i.computed.deps;s;s=s.nextDep)Ca(s,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function Dp(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}function jp(t,e){t.effect instanceof or&&(t=t.effect.fn);const i=new or(t);e&&Bt(i,e);try{i.run()}catch(r){throw i.stop(),r}const n=i.run.bind(i);return n.effect=i,n}function Fp(t){t.effect.stop()}let Fe=!0;const zu=[];function Li(){zu.push(Fe),Fe=!1}function Mi(){const t=zu.pop();Fe=t===void 0?!0:t}function vl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=Ht;Ht=void 0;try{e()}finally{Ht=i}}}let ar=0;class Bp{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ms{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Ht||!Fe||Ht===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==Ht)i=this.activeLink=new Bp(Ht,this),Ht.deps?(i.prevDep=Ht.depsTail,Ht.depsTail.nextDep=i,Ht.depsTail=i):Ht.deps=Ht.depsTail=i,Ku(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=Ht.depsTail,i.nextDep=void 0,Ht.depsTail.nextDep=i,Ht.depsTail=i,Ht.deps===i&&(Ht.deps=n)}return i}trigger(e){this.version++,ar++,this.notify(e)}notify(e){wa();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{Ea()}}}function Ku(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)Ku(n)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const ss=new WeakMap,Ui=Symbol(""),Lo=Symbol(""),lr=Symbol("");function se(t,e,i){if(Fe&&Ht){let n=ss.get(t);n||ss.set(t,n=new Map);let r=n.get(i);r||(n.set(i,r=new Ms),r.map=n,r.key=i),r.track()}}function li(t,e,i,n,r,s){const o=ss.get(t);if(!o){ar++;return}const c=l=>{l&&l.trigger()};if(wa(),e==="clear")o.forEach(c);else{const l=_t(t),O=l&&ba(i);if(l&&i==="length"){const _=Number(n);o.forEach((v,E)=>{(E==="length"||E===lr||!He(E)&&E>=_)&&c(v)})}else switch((i!==void 0||o.has(void 0))&&c(o.get(i)),O&&c(o.get(lr)),e){case"add":l?O&&c(o.get("length")):(c(o.get(Ui)),cn(t)&&c(o.get(Lo)));break;case"delete":l||(c(o.get(Ui)),cn(t)&&c(o.get(Lo)));break;case"set":cn(t)&&c(o.get(Ui));break}}Ea()}function Hp(t,e){const i=ss.get(t);return i&&i.get(e)}function Qi(t){const e=Lt(t);return e===t?e:(se(e,"iterate",lr),_e(t)?e:e.map(oe))}function Is(t){return se(t=Lt(t),"iterate",lr),t}const Vp={__proto__:null,[Symbol.iterator](){return io(this,Symbol.iterator,oe)},concat(...t){return Qi(this).concat(...t.map(e=>_t(e)?Qi(e):e))},entries(){return io(this,"entries",t=>(t[1]=oe(t[1]),t))},every(t,e){return ii(this,"every",t,e,void 0,arguments)},filter(t,e){return ii(this,"filter",t,e,i=>i.map(oe),arguments)},find(t,e){return ii(this,"find",t,e,oe,arguments)},findIndex(t,e){return ii(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return ii(this,"findLast",t,e,oe,arguments)},findLastIndex(t,e){return ii(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return ii(this,"forEach",t,e,void 0,arguments)},includes(...t){return no(this,"includes",t)},indexOf(...t){return no(this,"indexOf",t)},join(t){return Qi(this).join(t)},lastIndexOf(...t){return no(this,"lastIndexOf",t)},map(t,e){return ii(this,"map",t,e,void 0,arguments)},pop(){return Fn(this,"pop")},push(...t){return Fn(this,"push",t)},reduce(t,...e){return yl(this,"reduce",t,e)},reduceRight(t,...e){return yl(this,"reduceRight",t,e)},shift(){return Fn(this,"shift")},some(t,e){return ii(this,"some",t,e,void 0,arguments)},splice(...t){return Fn(this,"splice",t)},toReversed(){return Qi(this).toReversed()},toSorted(t){return Qi(this).toSorted(t)},toSpliced(...t){return Qi(this).toSpliced(...t)},unshift(...t){return Fn(this,"unshift",t)},values(){return io(this,"values",oe)}};function io(t,e,i){const n=Is(t),r=n[e]();return n!==t&&!_e(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=i(s.value)),s}),r}const Up=Array.prototype;function ii(t,e,i,n,r,s){const o=Is(t),c=o!==t&&!_e(t),l=o[e];if(l!==Up[e]){const v=l.apply(t,s);return c?oe(v):v}let O=i;o!==t&&(c?O=function(v,E){return i.call(this,oe(v),E,t)}:i.length>2&&(O=function(v,E){return i.call(this,v,E,t)}));const _=l.call(o,O,n);return c&&r?r(_):_}function yl(t,e,i,n){const r=Is(t);let s=i;return r!==t&&(_e(t)?i.length>3&&(s=function(o,c,l){return i.call(this,o,c,l,t)}):s=function(o,c,l){return i.call(this,o,oe(c),l,t)}),r[e](s,...n)}function no(t,e,i){const n=Lt(t);se(n,"iterate",lr);const r=n[e](...i);return(r===-1||r===!1)&&Ds(i[0])?(i[0]=Lt(i[0]),n[e](...i)):r}function Fn(t,e,i=[]){Li(),wa();const n=Lt(t)[e].apply(t,i);return Ea(),Mi(),n}const Wp=Os("__proto__,__v_isRef,__isVue"),qu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(He));function Gp(t){He(t)||(t=String(t));const e=Lt(this);return se(e,"has",t),e.hasOwnProperty(t)}class Zu{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,n){if(i==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(i==="__v_isReactive")return!r;if(i==="__v_isReadonly")return r;if(i==="__v_isShallow")return s;if(i==="__v_raw")return n===(r?s?nh:ih:s?eh:th).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=_t(e);if(!r){let l;if(o&&(l=Vp[i]))return l;if(i==="hasOwnProperty")return Gp}const c=Reflect.get(e,i,Dt(e)?e:n);return(He(i)?qu.has(i):Wp(i))||(r||se(e,"get",i),s)?c:Dt(c)?o&&ba(i)?c:c.value:jt(c)?r?Ta(c):qi(c):c}}class Ju extends Zu{constructor(e=!1){super(!1,e)}set(e,i,n,r){let s=e[i];if(!this._isShallow){const l=Oi(s);if(!_e(n)&&!Oi(n)&&(s=Lt(s),n=Lt(n)),!_t(e)&&Dt(s)&&!Dt(n))return l?!1:(s.value=n,!0)}const o=_t(e)&&ba(i)?Number(i)t,Ir=t=>Reflect.getPrototypeOf(t);function Kp(t,e,i){return function(...n){const r=this.__v_raw,s=Lt(r),o=cn(s),c=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,O=r[t](...n),_=i?Mo:e?Io:oe;return!e&&se(s,"iterate",l?Lo:Ui),{next(){const{value:v,done:E}=O.next();return E?{value:v,done:E}:{value:c?[_(v[0]),_(v[1])]:_(v),done:E}},[Symbol.iterator](){return this}}}}function Rr(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function qp(t,e){const i={get(r){const s=this.__v_raw,o=Lt(s),c=Lt(r);t||(de(r,c)&&se(o,"get",r),se(o,"get",c));const{has:l}=Ir(o),O=e?Mo:t?Io:oe;if(l.call(o,r))return O(s.get(r));if(l.call(o,c))return O(s.get(c));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&se(Lt(r),"iterate",Ui),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=Lt(s),c=Lt(r);return t||(de(r,c)&&se(o,"has",r),se(o,"has",c)),r===c?s.has(r):s.has(r)||s.has(c)},forEach(r,s){const o=this,c=o.__v_raw,l=Lt(c),O=e?Mo:t?Io:oe;return!t&&se(l,"iterate",Ui),c.forEach((_,v)=>r.call(s,O(_),O(v),o))}};return Bt(i,t?{add:Rr("add"),set:Rr("set"),delete:Rr("delete"),clear:Rr("clear")}:{add(r){!e&&!_e(r)&&!Oi(r)&&(r=Lt(r));const s=Lt(this);return Ir(s).has.call(s,r)||(s.add(r),li(s,"add",r,r)),this},set(r,s){!e&&!_e(s)&&!Oi(s)&&(s=Lt(s));const o=Lt(this),{has:c,get:l}=Ir(o);let O=c.call(o,r);O||(r=Lt(r),O=c.call(o,r));const _=l.call(o,r);return o.set(r,s),O?de(s,_)&&li(o,"set",r,s):li(o,"add",r,s),this},delete(r){const s=Lt(this),{has:o,get:c}=Ir(s);let l=o.call(s,r);l||(r=Lt(r),l=o.call(s,r)),c&&c.call(s,r);const O=s.delete(r);return l&&li(s,"delete",r,void 0),O},clear(){const r=Lt(this),s=r.size!==0,o=r.clear();return s&&li(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=Kp(r,t,e)}),i}function Rs(t,e){const i=qp(t,e);return(n,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(Mt(i,r)&&r in n?i:n,r,s)}const Zp={get:Rs(!1,!1)},Jp={get:Rs(!1,!0)},Qp={get:Rs(!0,!1)},tg={get:Rs(!0,!0)},th=new WeakMap,eh=new WeakMap,ih=new WeakMap,nh=new WeakMap;function eg(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ig(t){return t.__v_skip||!Object.isExtensible(t)?0:eg(wp(t))}function qi(t){return Oi(t)?t:Ns(t,!1,$p,Zp,th)}function Sa(t){return Ns(t,!1,Yp,Jp,eh)}function Ta(t){return Ns(t,!0,Xp,Qp,ih)}function ng(t){return Ns(t,!0,zp,tg,nh)}function Ns(t,e,i,n,r){if(!jt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=r.get(t);if(s)return s;const o=ig(t);if(o===0)return t;const c=new Proxy(t,o===2?n:i);return r.set(t,c),c}function qe(t){return Oi(t)?qe(t.__v_raw):!!(t&&t.__v_isReactive)}function Oi(t){return!!(t&&t.__v_isReadonly)}function _e(t){return!!(t&&t.__v_isShallow)}function Ds(t){return t?!!t.__v_raw:!1}function Lt(t){const e=t&&t.__v_raw;return e?Lt(e):t}function rh(t){return!Mt(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const oe=t=>jt(t)?qi(t):t,Io=t=>jt(t)?Ta(t):t;function Dt(t){return t?t.__v_isRef===!0:!1}function Yt(t){return sh(t,!1)}function In(t){return sh(t,!0)}function sh(t,e){return Dt(t)?t:new rg(t,e)}class rg{constructor(e,i){this.dep=new Ms,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Lt(e),this._value=i?e:oe(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,n=this.__v_isShallow||_e(e)||Oi(e);e=n?e:Lt(e),de(e,i)&&(this._rawValue=e,this._value=n?e:oe(e),this.dep.trigger())}}function sg(t){t.dep&&t.dep.trigger()}function Be(t){return Dt(t)?t.value:t}function og(t){return Ct(t)?t():Be(t)}const ag={get:(t,e,i)=>e==="__v_raw"?t:Be(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return Dt(r)&&!Dt(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function cr(t){return qe(t)?t:new Proxy(t,ag)}class lg{constructor(e){this.__v_isRef=!0,this._value=void 0;const i=this.dep=new Ms,{get:n,set:r}=e(i.track.bind(i),i.trigger.bind(i));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function oh(t){return new lg(t)}function ah(t){const e=_t(t)?new Array(t.length):{};for(const i in t)e[i]=lh(t,i);return e}class cg{constructor(e,i,n){this._object=e,this._key=i,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Hp(Lt(this._object),this._key)}}class ug{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function hg(t,e,i){return Dt(t)?t:Ct(t)?new ug(t):jt(t)&&arguments.length>1?lh(t,e,i):Yt(t)}function lh(t,e,i){const n=t[e];return Dt(n)?n:new cg(t,e,i)}class fg{constructor(e,i,n){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Ms(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ar-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ht!==this)return Gu(this,!0),!0}get value(){const e=this.dep.track();return Yu(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function dg(t,e,i=!1){let n,r;return Ct(t)?n=t:(n=t.get,r=t.set),new fg(n,r,i)}const pg={GET:"get",HAS:"has",ITERATE:"iterate"},gg={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Nr={},os=new WeakMap;let bi;function mg(){return bi}function ch(t,e=!1,i=bi){if(i){let n=os.get(i);n||os.set(i,n=[]),n.push(t)}}function vg(t,e,i=Pt){const{immediate:n,deep:r,once:s,scheduler:o,augmentJob:c,call:l}=i,O=a=>r?a:_e(a)||r===!1||r===0?ci(a,1):ci(a);let _,v,E,b,P=!1,m=!1;if(Dt(t)?(v=()=>t.value,P=_e(t)):qe(t)?(v=()=>O(t),P=!0):_t(t)?(m=!0,P=t.some(a=>qe(a)||_e(a)),v=()=>t.map(a=>{if(Dt(a))return a.value;if(qe(a))return O(a);if(Ct(a))return l?l(a,2):a()})):Ct(t)?e?v=l?()=>l(t,2):t:v=()=>{if(E){Li();try{E()}finally{Mi()}}const a=bi;bi=_;try{return l?l(t,3,[b]):t(b)}finally{bi=a}}:v=Te,e&&r){const a=v,S=r===!0?1/0:r;v=()=>ci(a(),S)}const T=Uu(),k=()=>{_.stop(),T&&T.active&&ya(T.effects,_)};if(s&&e){const a=e;e=(...S)=>{a(...S),k()}}let M=m?new Array(t.length).fill(Nr):Nr;const y=a=>{if(!(!(_.flags&1)||!_.dirty&&!a))if(e){const S=_.run();if(r||P||(m?S.some((w,A)=>de(w,M[A])):de(S,M))){E&&E();const w=bi;bi=_;try{const A=[S,M===Nr?void 0:m&&M[0]===Nr?[]:M,b];l?l(e,3,A):e(...A),M=S}finally{bi=w}}}else _.run()};return c&&c(y),_=new or(v),_.scheduler=o?()=>o(y,!1):y,b=a=>ch(a,!1,_),E=_.onStop=()=>{const a=os.get(_);if(a){if(l)l(a,4);else for(const S of a)S();os.delete(_)}},e?n?y(!0):M=_.run():o?o(y.bind(null,!0),!0):_.run(),k.pause=_.pause.bind(_),k.resume=_.resume.bind(_),k.stop=k,k}function ci(t,e=1/0,i){if(e<=0||!jt(t)||t.__v_skip||(i=i||new Set,i.has(t)))return t;if(i.add(t),e--,Dt(t))ci(t.value,e,i);else if(_t(t))for(let n=0;n{ci(n,e,i)});else if(As(t)){for(const n in t)ci(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&ci(t[n],e,i)}return t}/** -* @vue/runtime-core v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const uh=[];function yg(t){uh.push(t)}function xg(){uh.pop()}function bg(t,e){}const _g={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},wg={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Rn(t,e,i,n){try{return n?t(...n):t()}catch(r){Zi(r,e,i)}}function ke(t,e,i,n){if(Ct(t)){const r=Rn(t,e,i,n);return r&&xa(r)&&r.catch(s=>{Zi(s,e,i)}),r}if(_t(t)){const r=[];for(let s=0;s>>1,r=pe[n],s=hr(r);s=hr(i)?pe.push(t):pe.splice(Cg(e),0,t),t.flags|=1,fh()}}function fh(){as||(as=hh.then(dh))}function ur(t){_t(t)?fn.push(...t):_i&&t.id===-1?_i.splice(en+1,0,t):t.flags&1||(fn.push(t),t.flags|=1),fh()}function xl(t,e,i=Xe+1){for(;ihr(i)-hr(n));if(fn.length=0,_i){_i.push(...e);return}for(_i=e,en=0;en<_i.length;en++){const i=_i[en];i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2}_i=null,en=0}}const hr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function dh(t){try{for(Xe=0;Xenn.emit(r,...s)),Dr=[]):typeof window<"u"&&window.HTMLElement&&!((n=(i=window.navigator)==null?void 0:i.userAgent)!=null&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{ph(s,e)}),setTimeout(()=>{nn||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Dr=[])},3e3)):Dr=[]}let Qt=null,js=null;function fr(t){const e=Qt;return Qt=t,js=t&&t.type.__scopeId||null,e}function Sg(t){js=t}function Tg(){js=null}const Og=t=>Aa;function Aa(t,e=Qt,i){if(!e||t._n)return t;const n=(...r)=>{n._d&&Vo(-1);const s=fr(e);let o;try{o=t(...r)}finally{fr(s),n._d&&Vo(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Ag(t,e){if(Qt===null)return t;const i=Pr(Qt),n=t.dirs||(t.dirs=[]);for(let r=0;rt.__isTeleport,Zn=t=>t&&(t.disabled||t.disabled===""),bl=t=>t&&(t.defer||t.defer===""),_l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,wl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Ro=(t,e)=>{const i=t&&t.to;return Ut(i)?e?e(i):null:i},vh={name:"Teleport",__isTeleport:!0,process(t,e,i,n,r,s,o,c,l,O){const{mc:_,pc:v,pbc:E,o:{insert:b,querySelector:P,createText:m,createComment:T}}=O,k=Zn(e.props);let{shapeFlag:M,children:y,dynamicChildren:a}=e;if(t==null){const S=e.el=m(""),w=e.anchor=m("");b(S,i,n),b(w,i,n);const A=(u,g)=>{M&16&&(r&&r.isCE&&(r.ce._teleportTarget=u),_(y,u,g,r,s,o,c,l))},f=()=>{const u=e.target=Ro(e.props,P),g=xh(u,e,m,b);u&&(o!=="svg"&&_l(u)?o="svg":o!=="mathml"&&wl(u)&&(o="mathml"),k||(A(u,g),qr(e,!1)))};k&&(A(i,w),qr(e,!0)),bl(e.props)?qt(()=>{f(),e.el.__isMounted=!0},s):f()}else{if(bl(e.props)&&!t.el.__isMounted){qt(()=>{vh.process(t,e,i,n,r,s,o,c,l,O),delete t.el.__isMounted},s);return}e.el=t.el,e.targetStart=t.targetStart;const S=e.anchor=t.anchor,w=e.target=t.target,A=e.targetAnchor=t.targetAnchor,f=Zn(t.props),u=f?i:w,g=f?S:A;if(o==="svg"||_l(w)?o="svg":(o==="mathml"||wl(w))&&(o="mathml"),a?(E(t.dynamicChildren,a,u,r,s,o,c),Ba(t,e,!0)):l||v(t,e,u,g,r,s,o,c,!1),k)f?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):jr(e,i,S,O,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const h=e.target=Ro(e.props,P);h&&jr(e,h,null,O,0)}else f&&jr(e,w,A,O,1);qr(e,k)}},remove(t,e,i,{um:n,o:{remove:r}},s){const{shapeFlag:o,children:c,anchor:l,targetStart:O,targetAnchor:_,target:v,props:E}=t;if(v&&(r(O),r(_)),s&&r(l),o&16){const b=s||!Zn(E);for(let P=0;P{t.isMounted=!0}),Vs(()=>{t.isUnmounting=!0}),t}const Ee=[Function,Array],ka={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},bh=t=>{const e=t.subTree;return e.component?bh(e.component):e},kg={name:"BaseTransition",props:ka,setup(t,{slots:e}){const i=ie(),n=Pa();return()=>{const r=e.default&&Fs(e.default(),!0);if(!r||!r.length)return;const s=_h(r),o=Lt(t),{mode:c}=o;if(n.isLeaving)return ro(s);const l=El(s);if(!l)return ro(s);let O=gn(l,o,n,i,v=>O=v);l.type!==Kt&&di(l,O);let _=i.subTree&&El(i.subTree);if(_&&_.type!==Kt&&!Ne(l,_)&&bh(i).type!==Kt){let v=gn(_,o,n,i);if(di(_,v),c==="out-in"&&l.type!==Kt)return n.isLeaving=!0,v.afterLeave=()=>{n.isLeaving=!1,i.job.flags&8||i.update(),delete v.afterLeave,_=void 0},ro(s);c==="in-out"&&l.type!==Kt?v.delayLeave=(E,b,P)=>{const m=Eh(n,_);m[String(_.key)]=_,E[wi]=()=>{b(),E[wi]=void 0,delete O.delayedLeave,_=void 0},O.delayedLeave=()=>{P(),delete O.delayedLeave,_=void 0}}:_=void 0}else _&&(_=void 0);return s}}};function _h(t){let e=t[0];if(t.length>1){for(const i of t)if(i.type!==Kt){e=i;break}}return e}const wh=kg;function Eh(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function gn(t,e,i,n,r){const{appear:s,mode:o,persisted:c=!1,onBeforeEnter:l,onEnter:O,onAfterEnter:_,onEnterCancelled:v,onBeforeLeave:E,onLeave:b,onAfterLeave:P,onLeaveCancelled:m,onBeforeAppear:T,onAppear:k,onAfterAppear:M,onAppearCancelled:y}=e,a=String(t.key),S=Eh(i,t),w=(u,g)=>{u&&ke(u,n,9,g)},A=(u,g)=>{const h=g[1];w(u,g),_t(u)?u.every(x=>x.length<=1)&&h():u.length<=1&&h()},f={mode:o,persisted:c,beforeEnter(u){let g=l;if(!i.isMounted)if(s)g=T||l;else return;u[wi]&&u[wi](!0);const h=S[a];h&&Ne(t,h)&&h.el[wi]&&h.el[wi](),w(g,[u])},enter(u){let g=O,h=_,x=v;if(!i.isMounted)if(s)g=k||O,h=M||_,x=y||v;else return;let d=!1;const p=u[Fr]=R=>{d||(d=!0,R?w(x,[u]):w(h,[u]),f.delayedLeave&&f.delayedLeave(),u[Fr]=void 0)};g?A(g,[u,p]):p()},leave(u,g){const h=String(t.key);if(u[Fr]&&u[Fr](!0),i.isUnmounting)return g();w(E,[u]);let x=!1;const d=u[wi]=p=>{x||(x=!0,g(),p?w(m,[u]):w(P,[u]),u[wi]=void 0,S[h]===t&&delete S[h])};S[h]=t,b?A(b,[u,d]):d()},clone(u){const g=gn(u,e,i,n,r);return r&&r(g),g}};return f}function ro(t){if(Or(t))return t=Qe(t),t.children=null,t}function El(t){if(!Or(t))return mh(t.type)&&t.children?_h(t.children):t;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&Ct(i.default))return i.default()}}function di(t,e){t.shapeFlag&6&&t.component?(t.transition=e,di(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Fs(t,e=!1,i){let n=[],r=0;for(let s=0;s1)for(let s=0;si.value,set:s=>i.value=s})}return i}function dr(t,e,i,n,r=!1){if(_t(t)){t.forEach((P,m)=>dr(P,e&&(_t(e)?e[m]:e),i,n,r));return}if(Si(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&dr(t,e,i,n.component.subTree);return}const s=n.shapeFlag&4?Pr(n.component):n.el,o=r?null:s,{i:c,r:l}=t,O=e&&e.r,_=c.refs===Pt?c.refs={}:c.refs,v=c.setupState,E=Lt(v),b=v===Pt?()=>!1:P=>Mt(E,P);if(O!=null&&O!==l&&(Ut(O)?(_[O]=null,b(O)&&(v[O]=null)):Dt(O)&&(O.value=null)),Ct(l))Rn(l,c,12,[o,_]);else{const P=Ut(l),m=Dt(l);if(P||m){const T=()=>{if(t.f){const k=P?b(l)?v[l]:_[l]:l.value;r?_t(k)&&ya(k,s):_t(k)?k.includes(s)||k.push(s):P?(_[l]=[s],b(l)&&(v[l]=_[l])):(l.value=[s],t.k&&(_[t.k]=l.value))}else P?(_[l]=o,b(l)&&(v[l]=o)):m&&(l.value=o,t.k&&(_[t.k]=o))};o?(T.id=-1,qt(T,i)):T()}}}let Cl=!1;const tn=()=>{Cl||(console.error("Hydration completed but contains mismatches."),Cl=!0)},Ig=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",Rg=t=>t.namespaceURI.includes("MathML"),Br=t=>{if(t.nodeType===1){if(Ig(t))return"svg";if(Rg(t))return"mathml"}},on=t=>t.nodeType===8;function Ng(t){const{mt:e,p:i,o:{patchProp:n,createText:r,nextSibling:s,parentNode:o,remove:c,insert:l,createComment:O}}=t,_=(y,a)=>{if(!a.hasChildNodes()){i(null,y,a),ls(),a._vnode=y;return}v(a.firstChild,y,null,null,null),ls(),a._vnode=y},v=(y,a,S,w,A,f=!1)=>{f=f||!!a.dynamicChildren;const u=on(y)&&y.data==="[",g=()=>m(y,a,S,w,A,u),{type:h,ref:x,shapeFlag:d,patchFlag:p}=a;let R=y.nodeType;a.el=y,p===-2&&(f=!1,a.dynamicChildren=null);let I=null;switch(h){case fi:R!==3?a.children===""?(l(a.el=r(""),o(y),y),I=y):I=g():(y.data!==a.children&&(tn(),y.data=a.children),I=s(y));break;case Kt:M(y)?(I=s(y),k(a.el=y.content.firstChild,y,S)):R!==8||u?I=g():I=s(y);break;case Gi:if(u&&(y=s(y),R=y.nodeType),R===1||R===3){I=y;const j=!a.children.length;for(let $=0;${f=f||!!a.dynamicChildren;const{type:u,props:g,patchFlag:h,shapeFlag:x,dirs:d,transition:p}=a,R=u==="input"||u==="option";if(R||h!==-1){d&&Ye(a,null,S,"created");let I=!1;if(M(y)){I=Kh(null,p)&&S&&S.vnode.props&&S.vnode.props.appear;const $=y.content.firstChild;I&&p.beforeEnter($),k($,y,S),a.el=y=$}if(x&16&&!(g&&(g.innerHTML||g.textContent))){let $=b(y.firstChild,a,y,S,w,A,f);for(;$;){Hr(y,1)||tn();const et=$;$=$.nextSibling,c(et)}}else if(x&8){let $=a.children;$[0]===` -`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&($=$.slice(1)),y.textContent!==$&&(Hr(y,0)||tn(),y.textContent=a.children)}if(g){if(R||!f||h&48){const $=y.tagName.includes("-");for(const et in g)(R&&(et.endsWith("value")||et==="indeterminate")||Er(et)&&!un(et)||et[0]==="."||$)&&n(y,et,null,g[et],void 0,S)}else if(g.onClick)n(y,"onClick",null,g.onClick,void 0,S);else if(h&4&&qe(g.style))for(const $ in g.style)g.style[$]}let j;(j=g&&g.onVnodeBeforeMount)&&me(j,S,a),d&&Ye(a,null,S,"beforeMount"),((j=g&&g.onVnodeMounted)||d||I)&&sf(()=>{j&&me(j,S,a),I&&p.enter(y),d&&Ye(a,null,S,"mounted")},w)}return y.nextSibling},b=(y,a,S,w,A,f,u)=>{u=u||!!a.dynamicChildren;const g=a.children,h=g.length;for(let x=0;x{const{slotScopeIds:u}=a;u&&(A=A?A.concat(u):u);const g=o(y),h=b(s(y),a,g,S,w,A,f);return h&&on(h)&&h.data==="]"?s(a.anchor=h):(tn(),l(a.anchor=O("]"),g,h),h)},m=(y,a,S,w,A,f)=>{if(Hr(y.parentElement,1)||tn(),a.el=null,f){const h=T(y);for(;;){const x=s(y);if(x&&x!==h)c(x);else break}}const u=s(y),g=o(y);return c(y),i(null,a,g,u,S,w,Br(g),A),S&&(S.vnode.el=a.el,Ws(S,a.el)),u},T=(y,a="[",S="]")=>{let w=0;for(;y;)if(y=s(y),y&&on(y)&&(y.data===a&&w++,y.data===S)){if(w===0)return s(y);w--}return y},k=(y,a,S)=>{const w=a.parentNode;w&&w.replaceChild(y,a);let A=S;for(;A;)A.vnode.el===a&&(A.vnode.el=A.subTree.el=y),A=A.parent},M=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[_,v]}const Sl="data-allow-mismatch",Dg={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Hr(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(Sl);)t=t.parentElement;const i=t&&t.getAttribute(Sl);if(i==null)return!1;if(i==="")return!0;{const n=i.split(",");return e===0&&n.includes("children")?!0:i.split(",").includes(Dg[e])}}const jg=ks().requestIdleCallback||(t=>setTimeout(t,1)),Fg=ks().cancelIdleCallback||(t=>clearTimeout(t)),Bg=(t=1e4)=>e=>{const i=jg(e,{timeout:t});return()=>Fg(i)};function Hg(t){const{top:e,left:i,bottom:n,right:r}=t.getBoundingClientRect(),{innerHeight:s,innerWidth:o}=window;return(e>0&&e0&&n0&&i0&&r(e,i)=>{const n=new IntersectionObserver(r=>{for(const s of r)if(s.isIntersecting){n.disconnect(),e();break}},t);return i(r=>{if(r instanceof Element){if(Hg(r))return e(),n.disconnect(),!1;n.observe(r)}}),()=>n.disconnect()},Ug=t=>e=>{if(t){const i=matchMedia(t);if(i.matches)e();else return i.addEventListener("change",e,{once:!0}),()=>i.removeEventListener("change",e)}},Wg=(t=[])=>(e,i)=>{Ut(t)&&(t=[t]);let n=!1;const r=o=>{n||(n=!0,s(),e(),o.target.dispatchEvent(new o.constructor(o.type,o)))},s=()=>{i(o=>{for(const c of t)o.removeEventListener(c,r)})};return i(o=>{for(const c of t)o.addEventListener(c,r,{once:!0})}),s};function Gg(t,e){if(on(t)&&t.data==="["){let i=1,n=t.nextSibling;for(;n;){if(n.nodeType===1){if(e(n)===!1)break}else if(on(n))if(n.data==="]"){if(--i===0)break}else n.data==="["&&i++;n=n.nextSibling}}else e(t)}const Si=t=>!!t.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function $g(t){Ct(t)&&(t={loader:t});const{loader:e,loadingComponent:i,errorComponent:n,delay:r=200,hydrate:s,timeout:o,suspensible:c=!0,onError:l}=t;let O=null,_,v=0;const E=()=>(v++,O=null,b()),b=()=>{let P;return O||(P=O=e().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),l)return new Promise((T,k)=>{l(m,()=>T(E()),()=>k(m),v+1)});throw m}).then(m=>P!==O&&O?O:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),_=m,m)))};return Ue({name:"AsyncComponentWrapper",__asyncLoader:b,__asyncHydrate(P,m,T){const k=s?()=>{const M=s(T,y=>Gg(P,y));M&&(m.bum||(m.bum=[])).push(M)}:T;_?k():b().then(()=>!m.isUnmounted&&k())},get __asyncResolved(){return _},setup(){const P=Zt;if(La(P),_)return()=>so(_,P);const m=y=>{O=null,Zi(y,P,13,!n)};if(c&&P.suspense||vn)return b().then(y=>()=>so(y,P)).catch(y=>(m(y),()=>n?Ft(n,{error:y}):null));const T=Yt(!1),k=Yt(),M=Yt(!!r);return r&&setTimeout(()=>{M.value=!1},r),o!=null&&setTimeout(()=>{if(!T.value&&!k.value){const y=new Error(`Async component timed out after ${o}ms.`);m(y),k.value=y}},o),b().then(()=>{T.value=!0,P.parent&&Or(P.parent.vnode)&&P.parent.update()}).catch(y=>{m(y),k.value=y}),()=>{if(T.value&&_)return so(_,P);if(k.value&&n)return Ft(n,{error:k.value});if(i&&!M.value)return Ft(i)}}})}function so(t,e){const{ref:i,props:n,children:r,ce:s}=e.vnode,o=Ft(t,n,r);return o.ref=i,o.ce=s,delete e.vnode.ce,o}const Or=t=>t.type.__isKeepAlive,Xg={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const i=ie(),n=i.ctx;if(!n.renderer)return()=>{const M=e.default&&e.default();return M&&M.length===1?M[0]:M};const r=new Map,s=new Set;let o=null;const c=i.suspense,{renderer:{p:l,m:O,um:_,o:{createElement:v}}}=n,E=v("div");n.activate=(M,y,a,S,w)=>{const A=M.component;O(M,y,a,0,c),l(A.vnode,M,y,a,A,c,S,M.slotScopeIds,w),qt(()=>{A.isDeactivated=!1,A.a&&hn(A.a);const f=M.props&&M.props.onVnodeMounted;f&&me(f,A.parent,M)},c)},n.deactivate=M=>{const y=M.component;us(y.m),us(y.a),O(M,E,null,1,c),qt(()=>{y.da&&hn(y.da);const a=M.props&&M.props.onVnodeUnmounted;a&&me(a,y.parent,M),y.isDeactivated=!0},c)};function b(M){oo(M),_(M,i,c,!0)}function P(M){r.forEach((y,a)=>{const S=Xo(y.type);S&&!M(S)&&m(a)})}function m(M){const y=r.get(M);y&&(!o||!Ne(y,o))?b(y):o&&oo(o),r.delete(M),s.delete(M)}le(()=>[t.include,t.exclude],([M,y])=>{M&&P(a=>Xn(M,a)),y&&P(a=>!Xn(y,a))},{flush:"post",deep:!0});let T=null;const k=()=>{T!=null&&(hs(i.subTree.type)?qt(()=>{r.set(T,Vr(i.subTree))},i.subTree.suspense):r.set(T,Vr(i.subTree)))};return gi(k),Hs(k),Vs(()=>{r.forEach(M=>{const{subTree:y,suspense:a}=i,S=Vr(y);if(M.type===S.type&&M.key===S.key){oo(S);const w=S.component.da;w&&qt(w,a);return}b(M)})}),()=>{if(T=null,!e.default)return o=null;const M=e.default(),y=M[0];if(M.length>1)return o=null,M;if(!Je(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return o=null,y;let a=Vr(y);if(a.type===Kt)return o=null,a;const S=a.type,w=Xo(Si(a)?a.type.__asyncResolved||{}:S),{include:A,exclude:f,max:u}=t;if(A&&(!w||!Xn(A,w))||f&&w&&Xn(f,w))return a.shapeFlag&=-257,o=a,y;const g=a.key==null?S:a.key,h=r.get(g);return a.el&&(a=Qe(a),y.shapeFlag&128&&(y.ssContent=a)),T=g,h?(a.el=h.el,a.component=h.component,a.transition&&di(a,a.transition),a.shapeFlag|=512,s.delete(g),s.add(g)):(s.add(g),u&&s.size>parseInt(u,10)&&m(s.values().next().value)),a.shapeFlag|=256,o=a,hs(y.type)?y:a}}},Yg=Xg;function Xn(t,e){return _t(t)?t.some(i=>Xn(i,e)):Ut(t)?t.split(",").includes(e):_p(t)?(t.lastIndex=0,t.test(e)):!1}function Ch(t,e){Th(t,"a",e)}function Sh(t,e){Th(t,"da",e)}function Th(t,e,i=Zt){const n=t.__wdc||(t.__wdc=()=>{let r=i;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(Bs(e,n,i),i){let r=i.parent;for(;r&&r.parent;)Or(r.parent.vnode)&&zg(n,e,i,r),r=r.parent}}function zg(t,e,i,n){const r=Bs(e,t,n,!0);Dn(()=>{ya(n[e],r)},i)}function oo(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function Vr(t){return t.shapeFlag&128?t.ssContent:t}function Bs(t,e,i=Zt,n=!1){if(i){const r=i[t]||(i[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Li();const c=zi(i),l=ke(e,i,t,o);return c(),Mi(),l});return n?r.unshift(s):r.push(s),s}}const pi=t=>(e,i=Zt)=>{(!vn||t==="sp")&&Bs(t,(...n)=>e(...n),i)},Ma=pi("bm"),gi=pi("m"),Ia=pi("bu"),Hs=pi("u"),Vs=pi("bum"),Dn=pi("um"),Oh=pi("sp"),Ah=pi("rtg"),Ph=pi("rtc");function kh(t,e=Zt){Bs("ec",t,e)}const Ra="components",Kg="directives";function Lh(t,e){return Na(Ra,t,!0,e)||t}const Mh=Symbol.for("v-ndc");function qg(t){return Ut(t)?Na(Ra,t,!1)||t:t||Mh}function Zg(t){return Na(Kg,t)}function Na(t,e,i=!0,n=!1){const r=Qt||Zt;if(r){const s=r.type;if(t===Ra){const c=Xo(s,!1);if(c&&(c===e||c===ne(e)||c===Cr(ne(e))))return s}const o=Tl(r[t]||s[t],e)||Tl(r.appContext[t],e);return!o&&n?s:o}}function Tl(t,e){return t&&(t[e]||t[ne(e)]||t[Cr(ne(e))])}function Jg(t,e,i,n){let r;const s=i&&i[n],o=_t(t);if(o||Ut(t)){const c=o&&qe(t);let l=!1;c&&(l=!_e(t),t=Is(t)),r=new Array(t.length);for(let O=0,_=t.length;O<_;O++)r[O]=e(l?oe(t[O]):t[O],O,void 0,s&&s[O])}else if(typeof t=="number"){r=new Array(t);for(let c=0;ce(c,l,void 0,s&&s[l]));else{const c=Object.keys(t);r=new Array(c.length);for(let l=0,O=c.length;l{const s=n.fn(...r);return s&&(s.key=n.key),s}:n.fn)}return t}function Ih(t,e,i={},n,r){if(Qt.ce||Qt.parent&&Si(Qt.parent)&&Qt.parent.ce)return e!=="default"&&(i.name=e),Ai(),mn(zt,null,[Ft("slot",i,n&&n())],64);let s=t[e];s&&s._c&&(s._d=!1),Ai();const o=s&&Da(s(i)),c=i.key||o&&o.key,l=mn(zt,{key:(c&&!He(c)?c:`_${e}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&t._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Da(t){return t.some(e=>Je(e)?!(e.type===Kt||e.type===zt&&!Da(e.children)):!0)?t:null}function tm(t,e){const i={};for(const n in t)i[e&&/[A-Z]/.test(n)?`on:${n}`:zn(n)]=t[n];return i}const No=t=>t?ff(t)?Pr(t):No(t.parent):null,Jn=Bt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>No(t.parent),$root:t=>No(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>ja(t),$forceUpdate:t=>t.f||(t.f=()=>{Oa(t.update)}),$nextTick:t=>t.n||(t.n=Nn.bind(t.proxy)),$watch:t=>Mm.bind(t)}),ao=(t,e)=>t!==Pt&&!t.__isScriptSetup&&Mt(t,e),Do={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:n,data:r,props:s,accessCache:o,type:c,appContext:l}=t;let O;if(e[0]!=="$"){const b=o[e];if(b!==void 0)switch(b){case 1:return n[e];case 2:return r[e];case 4:return i[e];case 3:return s[e]}else{if(ao(n,e))return o[e]=1,n[e];if(r!==Pt&&Mt(r,e))return o[e]=2,r[e];if((O=t.propsOptions[0])&&Mt(O,e))return o[e]=3,s[e];if(i!==Pt&&Mt(i,e))return o[e]=4,i[e];jo&&(o[e]=0)}}const _=Jn[e];let v,E;if(_)return e==="$attrs"&&se(t.attrs,"get",""),_(t);if((v=c.__cssModules)&&(v=v[e]))return v;if(i!==Pt&&Mt(i,e))return o[e]=4,i[e];if(E=l.config.globalProperties,Mt(E,e))return E[e]},set({_:t},e,i){const{data:n,setupState:r,ctx:s}=t;return ao(r,e)?(r[e]=i,!0):n!==Pt&&Mt(n,e)?(n[e]=i,!0):Mt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:r,propsOptions:s}},o){let c;return!!i[o]||t!==Pt&&Mt(t,o)||ao(e,o)||(c=s[0])&&Mt(c,o)||Mt(n,o)||Mt(Jn,o)||Mt(r.config.globalProperties,o)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Mt(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}},em=Bt({},Do,{get(t,e){if(e!==Symbol.unscopables)return Do.get(t,e,t)},has(t,e){return e[0]!=="_"&&!Tp(e)}});function im(){return null}function nm(){return null}function rm(t){}function sm(t){}function om(){return null}function am(){}function lm(t,e){return null}function cm(){return Rh().slots}function um(){return Rh().attrs}function Rh(){const t=ie();return t.setupContext||(t.setupContext=gf(t))}function pr(t){return _t(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}function hm(t,e){const i=pr(t);for(const n in e){if(n.startsWith("__skip"))continue;let r=i[n];r?_t(r)||Ct(r)?r=i[n]={type:r,default:e[n]}:r.default=e[n]:r===null&&(r=i[n]={default:e[n]}),r&&e[`__skip_${n}`]&&(r.skipFactory=!0)}return i}function fm(t,e){return!t||!e?t||e:_t(t)&&_t(e)?t.concat(e):Bt({},pr(t),pr(e))}function dm(t,e){const i={};for(const n in t)e.includes(n)||Object.defineProperty(i,n,{enumerable:!0,get:()=>t[n]});return i}function pm(t){const e=ie();let i=t();return Wo(),xa(i)&&(i=i.catch(n=>{throw zi(e),n})),[i,()=>zi(e)]}let jo=!0;function gm(t){const e=ja(t),i=t.proxy,n=t.ctx;jo=!1,e.beforeCreate&&Ol(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:c,provide:l,inject:O,created:_,beforeMount:v,mounted:E,beforeUpdate:b,updated:P,activated:m,deactivated:T,beforeDestroy:k,beforeUnmount:M,destroyed:y,unmounted:a,render:S,renderTracked:w,renderTriggered:A,errorCaptured:f,serverPrefetch:u,expose:g,inheritAttrs:h,components:x,directives:d,filters:p}=e;if(O&&mm(O,n,null),o)for(const j in o){const $=o[j];Ct($)&&(n[j]=$.bind(i))}if(r){const j=r.call(i,i);jt(j)&&(t.data=qi(j))}if(jo=!0,s)for(const j in s){const $=s[j],et=Ct($)?$.bind(i,i):Ct($.get)?$.get.bind(i,i):Te,it=!Ct($)&&Ct($.set)?$.set.bind(i):Te,H=$t({get:et,set:it});Object.defineProperty(n,j,{enumerable:!0,configurable:!0,get:()=>H.value,set:z=>H.value=z})}if(c)for(const j in c)Nh(c[j],n,i,j);if(l){const j=Ct(l)?l.call(i):l;Reflect.ownKeys(j).forEach($=>{Qn($,j[$])})}_&&Ol(_,t,"c");function I(j,$){_t($)?$.forEach(et=>j(et.bind(i))):$&&j($.bind(i))}if(I(Ma,v),I(gi,E),I(Ia,b),I(Hs,P),I(Ch,m),I(Sh,T),I(kh,f),I(Ph,w),I(Ah,A),I(Vs,M),I(Dn,a),I(Oh,u),_t(g))if(g.length){const j=t.exposed||(t.exposed={});g.forEach($=>{Object.defineProperty(j,$,{get:()=>i[$],set:et=>i[$]=et})})}else t.exposed||(t.exposed={});S&&t.render===Te&&(t.render=S),h!=null&&(t.inheritAttrs=h),x&&(t.components=x),d&&(t.directives=d),u&&La(t)}function mm(t,e,i=Te){_t(t)&&(t=Fo(t));for(const n in t){const r=t[n];let s;jt(r)?"default"in r?s=Oe(r.from||n,r.default,!0):s=Oe(r.from||n):s=Oe(r),Dt(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function Ol(t,e,i){ke(_t(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,i)}function Nh(t,e,i,n){let r=n.includes(".")?tf(i,n):()=>i[n];if(Ut(t)){const s=e[t];Ct(s)&&le(r,s)}else if(Ct(t))le(r,t.bind(i));else if(jt(t))if(_t(t))t.forEach(s=>Nh(s,e,i,n));else{const s=Ct(t.handler)?t.handler.bind(i):e[t.handler];Ct(s)&&le(r,s,t)}}function ja(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,c=s.get(e);let l;return c?l=c:!r.length&&!i&&!n?l=e:(l={},r.length&&r.forEach(O=>cs(l,O,o,!0)),cs(l,e,o)),jt(e)&&s.set(e,l),l}function cs(t,e,i,n=!1){const{mixins:r,extends:s}=e;s&&cs(t,s,i,!0),r&&r.forEach(o=>cs(t,o,i,!0));for(const o in e)if(!(n&&o==="expose")){const c=vm[o]||i&&i[o];t[o]=c?c(t[o],e[o]):e[o]}return t}const vm={data:Al,props:Pl,emits:Pl,methods:Yn,computed:Yn,beforeCreate:ue,created:ue,beforeMount:ue,mounted:ue,beforeUpdate:ue,updated:ue,beforeDestroy:ue,beforeUnmount:ue,destroyed:ue,unmounted:ue,activated:ue,deactivated:ue,errorCaptured:ue,serverPrefetch:ue,components:Yn,directives:Yn,watch:xm,provide:Al,inject:ym};function Al(t,e){return e?t?function(){return Bt(Ct(t)?t.call(this,this):t,Ct(e)?e.call(this,this):e)}:e:t}function ym(t,e){return Yn(Fo(t),Fo(e))}function Fo(t){if(_t(t)){const e={};for(let i=0;i1)return i&&Ct(e)?e.call(n&&n.proxy):e}}function wm(){return!!(Zt||Qt||Wi)}const jh={},Fh=()=>Object.create(jh),Bh=t=>Object.getPrototypeOf(t)===jh;function Em(t,e,i,n=!1){const r={},s=Fh();t.propsDefaults=Object.create(null),Hh(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);i?t.props=n?r:Sa(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function Cm(t,e,i,n){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,c=Lt(r),[l]=t.propsOptions;let O=!1;if((n||o>0)&&!(o&16)){if(o&8){const _=t.vnode.dynamicProps;for(let v=0;v<_.length;v++){let E=_[v];if(Us(t.emitsOptions,E))continue;const b=e[E];if(l)if(Mt(s,E))b!==s[E]&&(s[E]=b,O=!0);else{const P=ne(E);r[P]=Bo(l,c,P,b,t,!1)}else b!==s[E]&&(s[E]=b,O=!0)}}}else{Hh(t,e,r,s)&&(O=!0);let _;for(const v in c)(!e||!Mt(e,v)&&((_=ye(v))===v||!Mt(e,_)))&&(l?i&&(i[v]!==void 0||i[_]!==void 0)&&(r[v]=Bo(l,c,v,void 0,t,!0)):delete r[v]);if(s!==c)for(const v in s)(!e||!Mt(e,v))&&(delete s[v],O=!0)}O&&li(t.attrs,"set","")}function Hh(t,e,i,n){const[r,s]=t.propsOptions;let o=!1,c;if(e)for(let l in e){if(un(l))continue;const O=e[l];let _;r&&Mt(r,_=ne(l))?!s||!s.includes(_)?i[_]=O:(c||(c={}))[_]=O:Us(t.emitsOptions,l)||(!(l in n)||O!==n[l])&&(n[l]=O,o=!0)}if(s){const l=Lt(i),O=c||Pt;for(let _=0;_{l=!0;const[E,b]=Vh(v,e,!0);Bt(o,E),b&&c.push(...b)};!i&&e.mixins.length&&e.mixins.forEach(_),t.extends&&_(t.extends),t.mixins&&t.mixins.forEach(_)}if(!s&&!l)return jt(t)&&n.set(t,ln),ln;if(_t(s))for(let _=0;_t[0]==="_"||t==="$stable",Fa=t=>_t(t)?t.map(ve):[ve(t)],Tm=(t,e,i)=>{if(e._n)return e;const n=Aa((...r)=>Fa(e(...r)),i);return n._c=!1,n},Wh=(t,e,i)=>{const n=t._ctx;for(const r in t){if(Uh(r))continue;const s=t[r];if(Ct(s))e[r]=Tm(r,s,n);else if(s!=null){const o=Fa(s);e[r]=()=>o}}},Gh=(t,e)=>{const i=Fa(e);t.slots.default=()=>i},$h=(t,e,i)=>{for(const n in e)(i||n!=="_")&&(t[n]=e[n])},Om=(t,e,i)=>{const n=t.slots=Fh();if(t.vnode.shapeFlag&32){const r=e._;r?($h(n,e,i),i&&Du(n,"_",r,!0)):Wh(e,n)}else e&&Gh(t,e)},Am=(t,e,i)=>{const{vnode:n,slots:r}=t;let s=!0,o=Pt;if(n.shapeFlag&32){const c=e._;c?i&&c===1?s=!1:$h(r,e,i):(s=!e.$stable,Wh(e,r)),o=e}else e&&(Gh(t,e),o={default:1});if(s)for(const c in r)!Uh(c)&&o[c]==null&&delete r[c]},qt=sf;function Xh(t){return zh(t)}function Yh(t){return zh(t,Ng)}function zh(t,e){const i=ks();i.__VUE__=!0;const{insert:n,remove:r,patchProp:s,createElement:o,createText:c,createComment:l,setText:O,setElementText:_,parentNode:v,nextSibling:E,setScopeId:b=Te,insertStaticContent:P}=t,m=(D,F,X,st=null,ot=null,lt=null,ct=void 0,q=null,Y=!!F.dynamicChildren)=>{if(D===F)return;D&&!Ne(D,F)&&(st=G(D),z(D,ot,lt,!0),D=null),F.patchFlag===-2&&(Y=!1,F.dynamicChildren=null);const{type:Z,ref:W,shapeFlag:Q}=F;switch(Z){case fi:T(D,F,X,st);break;case Kt:k(D,F,X,st);break;case Gi:D==null&&M(F,X,st,ct);break;case zt:x(D,F,X,st,ot,lt,ct,q,Y);break;default:Q&1?S(D,F,X,st,ot,lt,ct,q,Y):Q&6?d(D,F,X,st,ot,lt,ct,q,Y):(Q&64||Q&128)&&Z.process(D,F,X,st,ot,lt,ct,q,Y,U)}W!=null&&ot&&dr(W,D&&D.ref,lt,F||D,!F)},T=(D,F,X,st)=>{if(D==null)n(F.el=c(F.children),X,st);else{const ot=F.el=D.el;F.children!==D.children&&O(ot,F.children)}},k=(D,F,X,st)=>{D==null?n(F.el=l(F.children||""),X,st):F.el=D.el},M=(D,F,X,st)=>{[D.el,D.anchor]=P(D.children,F,X,st,D.el,D.anchor)},y=({el:D,anchor:F},X,st)=>{let ot;for(;D&&D!==F;)ot=E(D),n(D,X,st),D=ot;n(F,X,st)},a=({el:D,anchor:F})=>{let X;for(;D&&D!==F;)X=E(D),r(D),D=X;r(F)},S=(D,F,X,st,ot,lt,ct,q,Y)=>{F.type==="svg"?ct="svg":F.type==="math"&&(ct="mathml"),D==null?w(F,X,st,ot,lt,ct,q,Y):u(D,F,ot,lt,ct,q,Y)},w=(D,F,X,st,ot,lt,ct,q)=>{let Y,Z;const{props:W,shapeFlag:Q,transition:rt,dirs:nt}=D;if(Y=D.el=o(D.type,lt,W&&W.is,W),Q&8?_(Y,D.children):Q&16&&f(D.children,Y,null,st,ot,lo(D,lt),ct,q),nt&&Ye(D,null,st,"created"),A(Y,D,D.scopeId,ct,st),W){for(const ut in W)ut!=="value"&&!un(ut)&&s(Y,ut,null,W[ut],lt,st);"value"in W&&s(Y,"value",null,W.value,lt),(Z=W.onVnodeBeforeMount)&&me(Z,st,D)}nt&&Ye(D,null,st,"beforeMount");const at=Kh(ot,rt);at&&rt.beforeEnter(Y),n(Y,F,X),((Z=W&&W.onVnodeMounted)||at||nt)&&qt(()=>{Z&&me(Z,st,D),at&&rt.enter(Y),nt&&Ye(D,null,st,"mounted")},ot)},A=(D,F,X,st,ot)=>{if(X&&b(D,X),st)for(let lt=0;lt{for(let Z=Y;Z{const q=F.el=D.el;let{patchFlag:Y,dynamicChildren:Z,dirs:W}=F;Y|=D.patchFlag&16;const Q=D.props||Pt,rt=F.props||Pt;let nt;if(X&&Di(X,!1),(nt=rt.onVnodeBeforeUpdate)&&me(nt,X,F,D),W&&Ye(F,D,X,"beforeUpdate"),X&&Di(X,!0),(Q.innerHTML&&rt.innerHTML==null||Q.textContent&&rt.textContent==null)&&_(q,""),Z?g(D.dynamicChildren,Z,q,X,st,lo(F,ot),lt):ct||$(D,F,q,null,X,st,lo(F,ot),lt,!1),Y>0){if(Y&16)h(q,Q,rt,X,ot);else if(Y&2&&Q.class!==rt.class&&s(q,"class",null,rt.class,ot),Y&4&&s(q,"style",Q.style,rt.style,ot),Y&8){const at=F.dynamicProps;for(let ut=0;ut{nt&&me(nt,X,F,D),W&&Ye(F,D,X,"updated")},st)},g=(D,F,X,st,ot,lt,ct)=>{for(let q=0;q{if(F!==X){if(F!==Pt)for(const lt in F)!un(lt)&&!(lt in X)&&s(D,lt,F[lt],null,ot,st);for(const lt in X){if(un(lt))continue;const ct=X[lt],q=F[lt];ct!==q&<!=="value"&&s(D,lt,q,ct,ot,st)}"value"in X&&s(D,"value",F.value,X.value,ot)}},x=(D,F,X,st,ot,lt,ct,q,Y)=>{const Z=F.el=D?D.el:c(""),W=F.anchor=D?D.anchor:c("");let{patchFlag:Q,dynamicChildren:rt,slotScopeIds:nt}=F;nt&&(q=q?q.concat(nt):nt),D==null?(n(Z,X,st),n(W,X,st),f(F.children||[],X,W,ot,lt,ct,q,Y)):Q>0&&Q&64&&rt&&D.dynamicChildren?(g(D.dynamicChildren,rt,X,ot,lt,ct,q),(F.key!=null||ot&&F===ot.subTree)&&Ba(D,F,!0)):$(D,F,X,W,ot,lt,ct,q,Y)},d=(D,F,X,st,ot,lt,ct,q,Y)=>{F.slotScopeIds=q,D==null?F.shapeFlag&512?ot.ctx.activate(F,X,st,ct,Y):p(F,X,st,ot,lt,ct,Y):R(D,F,Y)},p=(D,F,X,st,ot,lt,ct)=>{const q=D.component=hf(D,st,ot);if(Or(D)&&(q.ctx.renderer=U),df(q,!1,ct),q.asyncDep){if(ot&&ot.registerDep(q,I,ct),!D.el){const Y=q.subTree=Ft(Kt);k(null,Y,F,X)}}else I(q,D,F,X,ot,lt,ct)},R=(D,F,X)=>{const st=F.component=D.component;if(Fm(D,F,X))if(st.asyncDep&&!st.asyncResolved){j(st,F,X);return}else st.next=F,st.update();else F.el=D.el,st.vnode=F},I=(D,F,X,st,ot,lt,ct)=>{const q=()=>{if(D.isMounted){let{next:Q,bu:rt,u:nt,parent:at,vnode:ut}=D;{const dt=qh(D);if(dt){Q&&(Q.el=ut.el,j(D,Q,ct)),dt.asyncDep.then(()=>{D.isUnmounted||q()});return}}let ft=Q,gt;Di(D,!1),Q?(Q.el=ut.el,j(D,Q,ct)):Q=ut,rt&&hn(rt),(gt=Q.props&&Q.props.onVnodeBeforeUpdate)&&me(gt,at,Q,ut),Di(D,!0);const xt=Zr(D),vt=D.subTree;D.subTree=xt,m(vt,xt,v(vt.el),G(vt),D,ot,lt),Q.el=xt.el,ft===null&&Ws(D,xt.el),nt&&qt(nt,ot),(gt=Q.props&&Q.props.onVnodeUpdated)&&qt(()=>me(gt,at,Q,ut),ot)}else{let Q;const{el:rt,props:nt}=F,{bm:at,m:ut,parent:ft,root:gt,type:xt}=D,vt=Si(F);if(Di(D,!1),at&&hn(at),!vt&&(Q=nt&&nt.onVnodeBeforeMount)&&me(Q,ft,F),Di(D,!0),rt&&tt){const dt=()=>{D.subTree=Zr(D),tt(rt,D.subTree,D,ot,null)};vt&&xt.__asyncHydrate?xt.__asyncHydrate(rt,D,dt):dt()}else{gt.ce&>.ce._injectChildStyle(xt);const dt=D.subTree=Zr(D);m(null,dt,X,st,D,ot,lt),F.el=dt.el}if(ut&&qt(ut,ot),!vt&&(Q=nt&&nt.onVnodeMounted)){const dt=F;qt(()=>me(Q,ft,dt),ot)}(F.shapeFlag&256||ft&&Si(ft.vnode)&&ft.vnode.shapeFlag&256)&&D.a&&qt(D.a,ot),D.isMounted=!0,F=X=st=null}};D.scope.on();const Y=D.effect=new or(q);D.scope.off();const Z=D.update=Y.run.bind(Y),W=D.job=Y.runIfDirty.bind(Y);W.i=D,W.id=D.uid,Y.scheduler=()=>Oa(W),Di(D,!0),Z()},j=(D,F,X)=>{F.component=D;const st=D.vnode.props;D.vnode=F,D.next=null,Cm(D,F.props,st,X),Am(D,F.children,X),Li(),xl(D),Mi()},$=(D,F,X,st,ot,lt,ct,q,Y=!1)=>{const Z=D&&D.children,W=D?D.shapeFlag:0,Q=F.children,{patchFlag:rt,shapeFlag:nt}=F;if(rt>0){if(rt&128){it(Z,Q,X,st,ot,lt,ct,q,Y);return}else if(rt&256){et(Z,Q,X,st,ot,lt,ct,q,Y);return}}nt&8?(W&16&&K(Z,ot,lt),Q!==Z&&_(X,Q)):W&16?nt&16?it(Z,Q,X,st,ot,lt,ct,q,Y):K(Z,ot,lt,!0):(W&8&&_(X,""),nt&16&&f(Q,X,st,ot,lt,ct,q,Y))},et=(D,F,X,st,ot,lt,ct,q,Y)=>{D=D||ln,F=F||ln;const Z=D.length,W=F.length,Q=Math.min(Z,W);let rt;for(rt=0;rtW?K(D,ot,lt,!0,!1,Q):f(F,X,st,ot,lt,ct,q,Y,Q)},it=(D,F,X,st,ot,lt,ct,q,Y)=>{let Z=0;const W=F.length;let Q=D.length-1,rt=W-1;for(;Z<=Q&&Z<=rt;){const nt=D[Z],at=F[Z]=Y?Ei(F[Z]):ve(F[Z]);if(Ne(nt,at))m(nt,at,X,null,ot,lt,ct,q,Y);else break;Z++}for(;Z<=Q&&Z<=rt;){const nt=D[Q],at=F[rt]=Y?Ei(F[rt]):ve(F[rt]);if(Ne(nt,at))m(nt,at,X,null,ot,lt,ct,q,Y);else break;Q--,rt--}if(Z>Q){if(Z<=rt){const nt=rt+1,at=ntrt)for(;Z<=Q;)z(D[Z],ot,lt,!0),Z++;else{const nt=Z,at=Z,ut=new Map;for(Z=at;Z<=rt;Z++){const mt=F[Z]=Y?Ei(F[Z]):ve(F[Z]);mt.key!=null&&ut.set(mt.key,Z)}let ft,gt=0;const xt=rt-at+1;let vt=!1,dt=0;const ht=new Array(xt);for(Z=0;Z=xt){z(mt,ot,lt,!0);continue}let yt;if(mt.key!=null)yt=ut.get(mt.key);else for(ft=at;ft<=rt;ft++)if(ht[ft-at]===0&&Ne(mt,F[ft])){yt=ft;break}yt===void 0?z(mt,ot,lt,!0):(ht[yt-at]=Z+1,yt>=dt?dt=yt:vt=!0,m(mt,F[yt],X,null,ot,lt,ct,q,Y),gt++)}const pt=vt?Pm(ht):ln;for(ft=pt.length-1,Z=xt-1;Z>=0;Z--){const mt=at+Z,yt=F[mt],wt=mt+1{const{el:lt,type:ct,transition:q,children:Y,shapeFlag:Z}=D;if(Z&6){H(D.component.subTree,F,X,st);return}if(Z&128){D.suspense.move(F,X,st);return}if(Z&64){ct.move(D,F,X,U);return}if(ct===zt){n(lt,F,X);for(let Q=0;Qq.enter(lt),ot);else{const{leave:Q,delayLeave:rt,afterLeave:nt}=q,at=()=>n(lt,F,X),ut=()=>{Q(lt,()=>{at(),nt&&nt()})};rt?rt(lt,at,ut):ut()}else n(lt,F,X)},z=(D,F,X,st=!1,ot=!1)=>{const{type:lt,props:ct,ref:q,children:Y,dynamicChildren:Z,shapeFlag:W,patchFlag:Q,dirs:rt,cacheIndex:nt}=D;if(Q===-2&&(ot=!1),q!=null&&dr(q,null,X,D,!0),nt!=null&&(F.renderCache[nt]=void 0),W&256){F.ctx.deactivate(D);return}const at=W&1&&rt,ut=!Si(D);let ft;if(ut&&(ft=ct&&ct.onVnodeBeforeUnmount)&&me(ft,F,D),W&6)V(D.component,X,st);else{if(W&128){D.suspense.unmount(X,st);return}at&&Ye(D,null,F,"beforeUnmount"),W&64?D.type.remove(D,F,X,U,st):Z&&!Z.hasOnce&&(lt!==zt||Q>0&&Q&64)?K(Z,F,X,!1,!0):(lt===zt&&Q&384||!ot&&W&16)&&K(Y,F,X),st&&L(D)}(ut&&(ft=ct&&ct.onVnodeUnmounted)||at)&&qt(()=>{ft&&me(ft,F,D),at&&Ye(D,null,F,"unmounted")},X)},L=D=>{const{type:F,el:X,anchor:st,transition:ot}=D;if(F===zt){N(X,st);return}if(F===Gi){a(D);return}const lt=()=>{r(X),ot&&!ot.persisted&&ot.afterLeave&&ot.afterLeave()};if(D.shapeFlag&1&&ot&&!ot.persisted){const{leave:ct,delayLeave:q}=ot,Y=()=>ct(X,lt);q?q(D.el,lt,Y):Y()}else lt()},N=(D,F)=>{let X;for(;D!==F;)X=E(D),r(D),D=X;r(F)},V=(D,F,X)=>{const{bum:st,scope:ot,job:lt,subTree:ct,um:q,m:Y,a:Z}=D;us(Y),us(Z),st&&hn(st),ot.stop(),lt&&(lt.flags|=8,z(ct,D,F,X)),q&&qt(q,F),qt(()=>{D.isUnmounted=!0},F),F&&F.pendingBranch&&!F.isUnmounted&&D.asyncDep&&!D.asyncResolved&&D.suspenseId===F.pendingId&&(F.deps--,F.deps===0&&F.resolve())},K=(D,F,X,st=!1,ot=!1,lt=0)=>{for(let ct=lt;ct{if(D.shapeFlag&6)return G(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const F=E(D.anchor||D.el),X=F&&F[gh];return X?E(X):F};let J=!1;const C=(D,F,X)=>{D==null?F._vnode&&z(F._vnode,null,null,!0):m(F._vnode||null,D,F,null,null,null,X),F._vnode=D,J||(J=!0,xl(),ls(),J=!1)},U={p:m,um:z,m:H,r:L,mt:p,mc:f,pc:$,pbc:g,n:G,o:t};let B,tt;return e&&([B,tt]=e(U)),{render:C,hydrate:B,createApp:_m(C,B)}}function lo({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function Di({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Kh(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ba(t,e,i=!1){const n=t.children,r=e.children;if(_t(n)&&_t(r))for(let s=0;s>1,t[i[c]]0&&(e[n]=i[s-1]),i[s]=n)}}for(s=i.length,o=i[s-1];s-- >0;)i[s]=o,o=e[o];return i}function qh(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:qh(e)}function us(t){if(t)for(let e=0;eOe(Zh);function km(t,e){return Ar(t,null,e)}function Lm(t,e){return Ar(t,null,{flush:"post"})}function Qh(t,e){return Ar(t,null,{flush:"sync"})}function le(t,e,i){return Ar(t,e,i)}function Ar(t,e,i=Pt){const{immediate:n,deep:r,flush:s,once:o}=i,c=Bt({},i),l=e&&n||!e&&s!=="post";let O;if(vn){if(s==="sync"){const b=Jh();O=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=Te,b.resume=Te,b.pause=Te,b}}const _=Zt;c.call=(b,P,m)=>ke(b,_,P,m);let v=!1;s==="post"?c.scheduler=b=>{qt(b,_&&_.suspense)}:s!=="sync"&&(v=!0,c.scheduler=(b,P)=>{P?b():Oa(b)}),c.augmentJob=b=>{e&&(b.flags|=4),v&&(b.flags|=2,_&&(b.id=_.uid,b.i=_))};const E=vg(t,e,c);return vn&&(O?O.push(E):l&&E()),E}function Mm(t,e,i){const n=this.proxy,r=Ut(t)?t.includes(".")?tf(n,t):()=>n[t]:t.bind(n,n);let s;Ct(e)?s=e:(s=e.handler,i=e);const o=zi(this),c=Ar(r,s.bind(n),i);return o(),c}function tf(t,e){const i=e.split(".");return()=>{let n=t;for(let r=0;r{let _,v=Pt,E;return Qh(()=>{const b=t[r];de(_,b)&&(_=b,O())}),{get(){return l(),i.get?i.get(_):_},set(b){const P=i.set?i.set(b):b;if(!de(P,_)&&!(v!==Pt&&de(b,v)))return;const m=n.vnode.props;m&&(e in m||r in m||s in m)&&(`onUpdate:${e}`in m||`onUpdate:${r}`in m||`onUpdate:${s}`in m)||(_=b,O()),n.emit(`update:${e}`,P),de(b,P)&&de(b,v)&&!de(P,E)&&O(),v=b,E=P}}});return c[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||Pt:c,done:!1}:{done:!0}}}},c}const ef=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${ne(e)}Modifiers`]||t[`${ye(e)}Modifiers`];function Rm(t,e,...i){if(t.isUnmounted)return;const n=t.vnode.props||Pt;let r=i;const s=e.startsWith("update:"),o=s&&ef(n,e.slice(7));o&&(o.trim&&(r=i.map(_=>Ut(_)?_.trim():_)),o.number&&(r=i.map(ns)));let c,l=n[c=zn(e)]||n[c=zn(ne(e))];!l&&s&&(l=n[c=zn(ye(e))]),l&&ke(l,t,6,r);const O=n[c+"Once"];if(O){if(!t.emitted)t.emitted={};else if(t.emitted[c])return;t.emitted[c]=!0,ke(O,t,6,r)}}function nf(t,e,i=!1){const n=e.emitsCache,r=n.get(t);if(r!==void 0)return r;const s=t.emits;let o={},c=!1;if(!Ct(t)){const l=O=>{const _=nf(O,e,!0);_&&(c=!0,Bt(o,_))};!i&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!c?(jt(t)&&n.set(t,null),null):(_t(s)?s.forEach(l=>o[l]=null):Bt(o,s),jt(t)&&n.set(t,o),o)}function Us(t,e){return!t||!Er(e)?!1:(e=e.slice(2).replace(/Once$/,""),Mt(t,e[0].toLowerCase()+e.slice(1))||Mt(t,ye(e))||Mt(t,e))}function Zr(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[s],slots:o,attrs:c,emit:l,render:O,renderCache:_,props:v,data:E,setupState:b,ctx:P,inheritAttrs:m}=t,T=fr(t);let k,M;try{if(i.shapeFlag&4){const a=r||n,S=a;k=ve(O.call(S,a,_,v,b,E,P)),M=c}else{const a=e;k=ve(a.length>1?a(v,{attrs:c,slots:o,emit:l}):a(v,null)),M=e.props?c:Dm(c)}}catch(a){tr.length=0,Zi(a,t,1),k=Ft(Kt)}let y=k;if(M&&m!==!1){const a=Object.keys(M),{shapeFlag:S}=y;a.length&&S&7&&(s&&a.some(va)&&(M=jm(M,s)),y=Qe(y,M,!1,!0))}return i.dirs&&(y=Qe(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(i.dirs):i.dirs),i.transition&&di(y,i.transition),k=y,fr(T),k}function Nm(t,e=!0){let i;for(let n=0;n{let e;for(const i in t)(i==="class"||i==="style"||Er(i))&&((e||(e={}))[i]=t[i]);return e},jm=(t,e)=>{const i={};for(const n in t)(!va(n)||!(n.slice(9)in e))&&(i[n]=t[n]);return i};function Fm(t,e,i){const{props:n,children:r,component:s}=t,{props:o,children:c,patchFlag:l}=e,O=s.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return n?Ll(n,o,O):!!o;if(l&8){const _=e.dynamicProps;for(let v=0;v<_.length;v++){const E=_[v];if(o[E]!==n[E]&&!Us(O,E))return!0}}}else return(r||c)&&(!c||!c.$stable)?!0:n===o?!1:n?o?Ll(n,o,O):!0:!!o;return!1}function Ll(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;rt.__isSuspense;let Ho=0;const Bm={name:"Suspense",__isSuspense:!0,process(t,e,i,n,r,s,o,c,l,O){if(t==null)Vm(e,i,n,r,s,o,c,l,O);else{if(s&&s.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}Um(t,e,i,n,r,o,c,l,O)}},hydrate:Wm,normalize:Gm},Hm=Bm;function gr(t,e){const i=t.props&&t.props[e];Ct(i)&&i()}function Vm(t,e,i,n,r,s,o,c,l){const{p:O,o:{createElement:_}}=l,v=_("div"),E=t.suspense=rf(t,r,n,e,v,i,s,o,c,l);O(null,E.pendingBranch=t.ssContent,v,null,n,E,s,o),E.deps>0?(gr(t,"onPending"),gr(t,"onFallback"),O(null,t.ssFallback,e,i,n,null,s,o),dn(E,t.ssFallback)):E.resolve(!1,!0)}function Um(t,e,i,n,r,s,o,c,{p:l,um:O,o:{createElement:_}}){const v=e.suspense=t.suspense;v.vnode=e,e.el=t.el;const E=e.ssContent,b=e.ssFallback,{activeBranch:P,pendingBranch:m,isInFallback:T,isHydrating:k}=v;if(m)v.pendingBranch=E,Ne(E,m)?(l(m,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0?v.resolve():T&&(k||(l(P,b,i,n,r,null,s,o,c),dn(v,b)))):(v.pendingId=Ho++,k?(v.isHydrating=!1,v.activeBranch=m):O(m,r,v),v.deps=0,v.effects.length=0,v.hiddenContainer=_("div"),T?(l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0?v.resolve():(l(P,b,i,n,r,null,s,o,c),dn(v,b))):P&&Ne(E,P)?(l(P,E,i,n,r,v,s,o,c),v.resolve(!0)):(l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0&&v.resolve()));else if(P&&Ne(E,P))l(P,E,i,n,r,v,s,o,c),dn(v,E);else if(gr(e,"onPending"),v.pendingBranch=E,E.shapeFlag&512?v.pendingId=E.component.suspenseId:v.pendingId=Ho++,l(null,E,v.hiddenContainer,null,r,v,s,o,c),v.deps<=0)v.resolve();else{const{timeout:M,pendingId:y}=v;M>0?setTimeout(()=>{v.pendingId===y&&v.fallback(b)},M):M===0&&v.fallback(b)}}function rf(t,e,i,n,r,s,o,c,l,O,_=!1){const{p:v,m:E,um:b,n:P,o:{parentNode:m,remove:T}}=O;let k;const M=$m(t);M&&e&&e.pendingBranch&&(k=e.pendingId,e.deps++);const y=t.props?rs(t.props.timeout):void 0,a=s,S={vnode:t,parent:e,parentComponent:i,namespace:o,container:n,hiddenContainer:r,deps:0,pendingId:Ho++,timeout:typeof y=="number"?y:-1,activeBranch:null,pendingBranch:null,isInFallback:!_,isHydrating:_,isUnmounted:!1,effects:[],resolve(w=!1,A=!1){const{vnode:f,activeBranch:u,pendingBranch:g,pendingId:h,effects:x,parentComponent:d,container:p}=S;let R=!1;S.isHydrating?S.isHydrating=!1:w||(R=u&&g.transition&&g.transition.mode==="out-in",R&&(u.transition.afterLeave=()=>{h===S.pendingId&&(E(g,p,s===a?P(u):s,0),ur(x))}),u&&(m(u.el)===p&&(s=P(u)),b(u,d,S,!0)),R||E(g,p,s,0)),dn(S,g),S.pendingBranch=null,S.isInFallback=!1;let I=S.parent,j=!1;for(;I;){if(I.pendingBranch){I.effects.push(...x),j=!0;break}I=I.parent}!j&&!R&&ur(x),S.effects=[],M&&e&&e.pendingBranch&&k===e.pendingId&&(e.deps--,e.deps===0&&!A&&e.resolve()),gr(f,"onResolve")},fallback(w){if(!S.pendingBranch)return;const{vnode:A,activeBranch:f,parentComponent:u,container:g,namespace:h}=S;gr(A,"onFallback");const x=P(f),d=()=>{S.isInFallback&&(v(null,w,g,x,u,null,h,c,l),dn(S,w))},p=w.transition&&w.transition.mode==="out-in";p&&(f.transition.afterLeave=d),S.isInFallback=!0,b(f,u,null,!0),p||d()},move(w,A,f){S.activeBranch&&E(S.activeBranch,w,A,f),S.container=w},next(){return S.activeBranch&&P(S.activeBranch)},registerDep(w,A,f){const u=!!S.pendingBranch;u&&S.deps++;const g=w.vnode.el;w.asyncDep.catch(h=>{Zi(h,w,0)}).then(h=>{if(w.isUnmounted||S.isUnmounted||S.pendingId!==w.suspenseId)return;w.asyncResolved=!0;const{vnode:x}=w;Go(w,h,!1),g&&(x.el=g);const d=!g&&w.subTree.el;A(w,x,m(g||w.subTree.el),g?null:P(w.subTree),S,o,f),d&&T(d),Ws(w,x.el),u&&--S.deps===0&&S.resolve()})},unmount(w,A){S.isUnmounted=!0,S.activeBranch&&b(S.activeBranch,i,w,A),S.pendingBranch&&b(S.pendingBranch,i,w,A)}};return S}function Wm(t,e,i,n,r,s,o,c,l){const O=e.suspense=rf(e,n,i,t.parentNode,document.createElement("div"),null,r,s,o,c,!0),_=l(t,O.pendingBranch=e.ssContent,i,O,s,o);return O.deps===0&&O.resolve(!1,!0),_}function Gm(t){const{shapeFlag:e,children:i}=t,n=e&32;t.ssContent=Ml(n?i.default:i),t.ssFallback=n?Ml(i.fallback):Ft(Kt)}function Ml(t){let e;if(Ct(t)){const i=Yi&&t._c;i&&(t._d=!1,Ai()),t=t(),i&&(t._d=!0,e=ae,of())}return _t(t)&&(t=Nm(t)),t=ve(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(i=>i!==t)),t}function sf(t,e){e&&e.pendingBranch?_t(t)?e.effects.push(...t):e.effects.push(t):ur(t)}function dn(t,e){t.activeBranch=e;const{vnode:i,parentComponent:n}=t;let r=e.el;for(;!r&&e.component;)e=e.component.subTree,r=e.el;i.el=r,n&&n.subTree===i&&(n.vnode.el=r,Ws(n,r))}function $m(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const zt=Symbol.for("v-fgt"),fi=Symbol.for("v-txt"),Kt=Symbol.for("v-cmt"),Gi=Symbol.for("v-stc"),tr=[];let ae=null;function Ai(t=!1){tr.push(ae=t?null:[])}function of(){tr.pop(),ae=tr[tr.length-1]||null}let Yi=1;function Vo(t,e=!1){Yi+=t,t<0&&ae&&e&&(ae.hasOnce=!0)}function af(t){return t.dynamicChildren=Yi>0?ae||ln:null,of(),Yi>0&&ae&&ae.push(t),t}function lf(t,e,i,n,r,s){return af(Ha(t,e,i,n,r,s,!0))}function mn(t,e,i,n,r){return af(Ft(t,e,i,n,r,!0))}function Je(t){return t?t.__v_isVNode===!0:!1}function Ne(t,e){return t.type===e.type&&t.key===e.key}function Xm(t){}const cf=({key:t})=>t??null,Jr=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?Ut(t)||Dt(t)||Ct(t)?{i:Qt,r:t,k:e,f:!!i}:t:null);function Ha(t,e=null,i=null,n=0,r=null,s=t===zt?0:1,o=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&cf(e),ref:e&&Jr(e),scopeId:js,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Qt};return c?(Ua(l,i),s&128&&t.normalize(l)):i&&(l.shapeFlag|=Ut(i)?8:16),Yi>0&&!o&&ae&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ae.push(l),l}const Ft=Ym;function Ym(t,e=null,i=null,n=0,r=null,s=!1){if((!t||t===Mh)&&(t=Kt),Je(t)){const c=Qe(t,e,!0);return i&&Ua(c,i),Yi>0&&!s&&ae&&(c.shapeFlag&6?ae[ae.indexOf(t)]=c:ae.push(c)),c.patchFlag=-2,c}if(iv(t)&&(t=t.__vccOpts),e){e=uf(e);let{class:c,style:l}=e;c&&!Ut(c)&&(e.class=Tr(c)),jt(l)&&(Ds(l)&&!_t(l)&&(l=Bt({},l)),e.style=Sr(l))}const o=Ut(t)?1:hs(t)?128:mh(t)?64:jt(t)?4:Ct(t)?2:0;return Ha(t,e,i,n,r,o,s,!0)}function uf(t){return t?Ds(t)||Bh(t)?Bt({},t):t:null}function Qe(t,e,i=!1,n=!1){const{props:r,ref:s,patchFlag:o,children:c,transition:l}=t,O=e?Wa(r||{},e):r,_={__v_isVNode:!0,__v_skip:!0,type:t.type,props:O,key:O&&cf(O),ref:e&&e.ref?i&&s?_t(s)?s.concat(Jr(e)):[s,Jr(e)]:Jr(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:c,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==zt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Qe(t.ssContent),ssFallback:t.ssFallback&&Qe(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&n&&di(_,l.clone(_)),_}function Va(t=" ",e=0){return Ft(fi,null,t,e)}function zm(t,e){const i=Ft(Gi,null,t);return i.staticCount=e,i}function Km(t="",e=!1){return e?(Ai(),mn(Kt,null,t)):Ft(Kt,null,t)}function ve(t){return t==null||typeof t=="boolean"?Ft(Kt):_t(t)?Ft(zt,null,t.slice()):Je(t)?Ei(t):Ft(fi,null,String(t))}function Ei(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Qe(t)}function Ua(t,e){let i=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(_t(e))i=16;else if(typeof e=="object")if(n&65){const r=e.default;r&&(r._c&&(r._d=!1),Ua(t,r()),r._c&&(r._d=!0));return}else{i=32;const r=e._;!r&&!Bh(e)?e._ctx=Qt:r===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Ct(e)?(e={default:e,_ctx:Qt},i=32):(e=String(e),n&64?(i=16,e=[Va(e)]):i=8);t.children=e,t.shapeFlag|=i}function Wa(...t){const e={};for(let i=0;iZt||Qt;let fs,Uo;{const t=ks(),e=(i,n)=>{let r;return(r=t[i])||(r=t[i]=[]),r.push(n),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};fs=e("__VUE_INSTANCE_SETTERS__",i=>Zt=i),Uo=e("__VUE_SSR_SETTERS__",i=>vn=i)}const zi=t=>{const e=Zt;return fs(t),t.scope.on(),()=>{t.scope.off(),fs(e)}},Wo=()=>{Zt&&Zt.scope.off(),fs(null)};function ff(t){return t.vnode.shapeFlag&4}let vn=!1;function df(t,e=!1,i=!1){e&&Uo(e);const{props:n,children:r}=t.vnode,s=ff(t);Em(t,n,s,e),Om(t,r,i);const o=s?Jm(t,e):void 0;return e&&Uo(!1),o}function Jm(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Do);const{setup:n}=i;if(n){Li();const r=t.setupContext=n.length>1?gf(t):null,s=zi(t),o=Rn(n,t,0,[t.props,r]),c=xa(o);if(Mi(),s(),(c||t.sp)&&!Si(t)&&La(t),c){if(o.then(Wo,Wo),e)return o.then(l=>{Go(t,l,e)}).catch(l=>{Zi(l,t,0)});t.asyncDep=o}else Go(t,o,e)}else pf(t,e)}function Go(t,e,i){Ct(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:jt(e)&&(t.setupState=cr(e)),pf(t,i)}let ds,$o;function Qm(t){ds=t,$o=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,em))}}const tv=()=>!ds;function pf(t,e,i){const n=t.type;if(!t.render){if(!e&&ds&&!n.render){const r=n.template||ja(t).template;if(r){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:c,compilerOptions:l}=n,O=Bt(Bt({isCustomElement:s,delimiters:c},o),l);n.render=ds(r,O)}}t.render=n.render||Te,$o&&$o(t)}{const r=zi(t);Li();try{gm(t)}finally{Mi(),r()}}}const ev={get(t,e){return se(t,"get",""),t[e]}};function gf(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,ev),slots:t.slots,emit:t.emit,expose:e}}function Pr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(cr(rh(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Jn)return Jn[i](t)},has(e,i){return i in e||i in Jn}})):t.proxy}function Xo(t,e=!0){return Ct(t)?t.displayName||t.name:t.name||e&&t.__name}function iv(t){return Ct(t)&&"__vccOpts"in t}const $t=(t,e)=>dg(t,e,vn);function Se(t,e,i){const n=arguments.length;return n===2?jt(e)&&!_t(e)?Je(e)?Ft(t,null,[e]):Ft(t,e):Ft(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&Je(i)&&(i=[i]),Ft(t,e,i))}function nv(){}function rv(t,e,i,n){const r=i[n];if(r&&mf(r,t))return r;const s=e();return s.memo=t.slice(),s.cacheIndex=n,i[n]=s}function mf(t,e){const i=t.memo;if(i.length!=e.length)return!1;for(let n=0;n0&&ae&&ae.push(t),!0}const vf="3.5.13",sv=Te,ov=wg,av=nn,lv=ph,cv={createComponentInstance:hf,setupComponent:df,renderComponentRoot:Zr,setCurrentRenderingInstance:fr,isVNode:Je,normalizeVNode:ve,getComponentPublicInstance:Pr,ensureValidVNode:Da,pushWarningContext:yg,popWarningContext:xg},uv=cv,hv=null,fv=null,dv=null;/** -* @vue/runtime-dom v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Yo;const Il=typeof window<"u"&&window.trustedTypes;if(Il)try{Yo=Il.createPolicy("vue",{createHTML:t=>t})}catch{}const yf=Yo?t=>Yo.createHTML(t):t=>t,pv="http://www.w3.org/2000/svg",gv="http://www.w3.org/1998/Math/MathML",ai=typeof document<"u"?document:null,Rl=ai&&ai.createElement("template"),mv={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r=e==="svg"?ai.createElementNS(pv,t):e==="mathml"?ai.createElementNS(gv,t):i?ai.createElement(t,{is:i}):ai.createElement(t);return t==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:t=>ai.createTextNode(t),createComment:t=>ai.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ai.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,s){const o=i?i.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),!(r===s||!(r=r.nextSibling)););else{Rl.innerHTML=yf(n==="svg"?`${t}`:n==="mathml"?`${t}`:t);const c=Rl.content;if(n==="svg"||n==="mathml"){const l=c.firstChild;for(;l.firstChild;)c.appendChild(l.firstChild);c.removeChild(l)}e.insertBefore(c,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},mi="transition",Bn="animation",yn=Symbol("_vtc"),xf={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bf=Bt({},ka,xf),vv=t=>(t.displayName="Transition",t.props=bf,t),yv=vv((t,{slots:e})=>Se(wh,_f(t),e)),ji=(t,e=[])=>{_t(t)?t.forEach(i=>i(...e)):t&&t(...e)},Nl=t=>t?_t(t)?t.some(e=>e.length>1):t.length>1:!1;function _f(t){const e={};for(const x in t)x in xf||(e[x]=t[x]);if(t.css===!1)return e;const{name:i="v",type:n,duration:r,enterFromClass:s=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:c=`${i}-enter-to`,appearFromClass:l=s,appearActiveClass:O=o,appearToClass:_=c,leaveFromClass:v=`${i}-leave-from`,leaveActiveClass:E=`${i}-leave-active`,leaveToClass:b=`${i}-leave-to`}=t,P=xv(r),m=P&&P[0],T=P&&P[1],{onBeforeEnter:k,onEnter:M,onEnterCancelled:y,onLeave:a,onLeaveCancelled:S,onBeforeAppear:w=k,onAppear:A=M,onAppearCancelled:f=y}=e,u=(x,d,p,R)=>{x._enterCancelled=R,xi(x,d?_:c),xi(x,d?O:o),p&&p()},g=(x,d)=>{x._isLeaving=!1,xi(x,v),xi(x,b),xi(x,E),d&&d()},h=x=>(d,p)=>{const R=x?A:M,I=()=>u(d,x,p);ji(R,[d,I]),Dl(()=>{xi(d,x?l:s),$e(d,x?_:c),Nl(R)||jl(d,n,m,I)})};return Bt(e,{onBeforeEnter(x){ji(k,[x]),$e(x,s),$e(x,o)},onBeforeAppear(x){ji(w,[x]),$e(x,l),$e(x,O)},onEnter:h(!1),onAppear:h(!0),onLeave(x,d){x._isLeaving=!0;const p=()=>g(x,d);$e(x,v),x._enterCancelled?($e(x,E),zo()):(zo(),$e(x,E)),Dl(()=>{x._isLeaving&&(xi(x,v),$e(x,b),Nl(a)||jl(x,n,T,p))}),ji(a,[x,p])},onEnterCancelled(x){u(x,!1,void 0,!0),ji(y,[x])},onAppearCancelled(x){u(x,!0,void 0,!0),ji(f,[x])},onLeaveCancelled(x){g(x),ji(S,[x])}})}function xv(t){if(t==null)return null;if(jt(t))return[co(t.enter),co(t.leave)];{const e=co(t);return[e,e]}}function co(t){return rs(t)}function $e(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[yn]||(t[yn]=new Set)).add(e)}function xi(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const i=t[yn];i&&(i.delete(e),i.size||(t[yn]=void 0))}function Dl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let bv=0;function jl(t,e,i,n){const r=t._endId=++bv,s=()=>{r===t._endId&&n()};if(i!=null)return setTimeout(s,i);const{type:o,timeout:c,propCount:l}=wf(t,e);if(!o)return n();const O=o+"end";let _=0;const v=()=>{t.removeEventListener(O,E),s()},E=b=>{b.target===t&&++_>=l&&v()};setTimeout(()=>{_(i[P]||"").split(", "),r=n(`${mi}Delay`),s=n(`${mi}Duration`),o=Fl(r,s),c=n(`${Bn}Delay`),l=n(`${Bn}Duration`),O=Fl(c,l);let _=null,v=0,E=0;e===mi?o>0&&(_=mi,v=o,E=s.length):e===Bn?O>0&&(_=Bn,v=O,E=l.length):(v=Math.max(o,O),_=v>0?o>O?mi:Bn:null,E=_?_===mi?s.length:l.length:0);const b=_===mi&&/\b(transform|all)(,|$)/.test(n(`${mi}Property`).toString());return{type:_,timeout:v,propCount:E,hasTransform:b}}function Fl(t,e){for(;t.lengthBl(i)+Bl(t[n])))}function Bl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function zo(){return document.body.offsetHeight}function _v(t,e,i){const n=t[yn];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const ps=Symbol("_vod"),Ef=Symbol("_vsh"),Cf={beforeMount(t,{value:e},{transition:i}){t[ps]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):Hn(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:n}){!e!=!i&&(n?e?(n.beforeEnter(t),Hn(t,!0),n.enter(t)):n.leave(t,()=>{Hn(t,!1)}):Hn(t,e))},beforeUnmount(t,{value:e}){Hn(t,e)}};function Hn(t,e){t.style.display=e?t[ps]:"none",t[Ef]=!e}function wv(){Cf.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const Sf=Symbol("");function Ev(t){const e=ie();if(!e)return;const i=e.ut=(r=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>gs(s,r))},n=()=>{const r=t(e.proxy);e.ce?gs(e.ce,r):Ko(e.subTree,r),i(r)};Ia(()=>{ur(n)}),gi(()=>{le(n,Te,{flush:"post"});const r=new MutationObserver(n);r.observe(e.subTree.el.parentNode,{childList:!0}),Dn(()=>r.disconnect())})}function Ko(t,e){if(t.shapeFlag&128){const i=t.suspense;t=i.activeBranch,i.pendingBranch&&!i.isHydrating&&i.effects.push(()=>{Ko(i.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)gs(t.el,e);else if(t.type===zt)t.children.forEach(i=>Ko(i,e));else if(t.type===Gi){let{el:i,anchor:n}=t;for(;i&&(gs(i,e),i!==n);)i=i.nextSibling}}function gs(t,e){if(t.nodeType===1){const i=t.style;let n="";for(const r in e)i.setProperty(`--${r}`,e[r]),n+=`--${r}: ${e[r]};`;i[Sf]=n}}const Cv=/(^|;)\s*display\s*:/;function Sv(t,e,i){const n=t.style,r=Ut(i);let s=!1;if(i&&!r){if(e)if(Ut(e))for(const o of e.split(";")){const c=o.slice(0,o.indexOf(":")).trim();i[c]==null&&Qr(n,c,"")}else for(const o in e)i[o]==null&&Qr(n,o,"");for(const o in i)o==="display"&&(s=!0),Qr(n,o,i[o])}else if(r){if(e!==i){const o=n[Sf];o&&(i+=";"+o),n.cssText=i,s=Cv.test(i)}}else e&&t.removeAttribute("style");ps in t&&(t[ps]=s?n.display:"",t[Ef]&&(n.display="none"))}const Hl=/\s*!important$/;function Qr(t,e,i){if(_t(i))i.forEach(n=>Qr(t,e,n));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=Tv(t,e);Hl.test(i)?t.setProperty(ye(n),i.replace(Hl,""),"important"):t[n]=i}}const Vl=["Webkit","Moz","ms"],uo={};function Tv(t,e){const i=uo[e];if(i)return i;let n=ne(e);if(n!=="filter"&&n in t)return uo[e]=n;n=Cr(n);for(let r=0;rho||(kv.then(()=>ho=0),ho=Date.now());function Mv(t,e){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;ke(Iv(n,i.value),e,5,[n])};return i.value=t,i.attached=Lv(),i}function Iv(t,e){if(_t(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(n=>r=>!r._stopped&&n&&n(r))}else return e}const Yl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Rv=(t,e,i,n,r,s)=>{const o=r==="svg";e==="class"?_v(t,n,o):e==="style"?Sv(t,i,n):Er(e)?va(e)||Av(t,e,i,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Nv(t,e,n,o))?(Gl(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Wl(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Ut(n))?Gl(t,ne(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),Wl(t,e,n,o))};function Nv(t,e,i,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&Yl(e)&&Ct(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Yl(e)&&Ut(i)?!1:e in t}const zl={};/*! #__NO_SIDE_EFFECTS__ */function Tf(t,e,i){const n=Ue(t,e);As(n)&&Bt(n,e);class r extends Gs{constructor(o){super(n,o,i)}}return r.def=n,r}/*! #__NO_SIDE_EFFECTS__ */const Dv=(t,e)=>Tf(t,e,Ff),jv=typeof HTMLElement<"u"?HTMLElement:class{};class Gs extends jv{constructor(e,i={},n=bn){super(),this._def=e,this._props=i,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==bn?this._root=this.shadowRoot:e.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof Gs){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,Nn(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n{for(const r of n)this._setAttr(r.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(n,r=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:o}=n;let c;if(s&&!_t(s))for(const l in s){const O=s[l];(O===Number||O&&O.type===Number)&&(l in this._props&&(this._props[l]=rs(this._props[l])),(c||(c=Object.create(null)))[ne(l)]=!0)}this._numberProps=c,r&&this._resolveProps(n),this.shadowRoot&&this._applyStyles(o),this._mount(n)},i=this._def.__asyncLoader;i?this._pendingResolve=i().then(n=>e(this._def=n,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const i=this._instance&&this._instance.exposed;if(i)for(const n in i)Mt(this,n)||Object.defineProperty(this,n,{get:()=>Be(i[n])})}_resolveProps(e){const{props:i}=e,n=_t(i)?i:Object.keys(i||{});for(const r of Object.keys(this))r[0]!=="_"&&n.includes(r)&&this._setProp(r,this[r]);for(const r of n.map(ne))Object.defineProperty(this,r,{get(){return this._getProp(r)},set(s){this._setProp(r,s,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const i=this.hasAttribute(e);let n=i?this.getAttribute(e):zl;const r=ne(e);i&&this._numberProps&&this._numberProps[r]&&(n=rs(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,i,n=!0,r=!1){if(i!==this._props[e]&&(i===zl?delete this._props[e]:(this._props[e]=i,e==="key"&&this._app&&(this._app._ceVNode.key=i)),r&&this._instance&&this._update(),n)){const s=this._ob;s&&s.disconnect(),i===!0?this.setAttribute(ye(e),""):typeof i=="string"||typeof i=="number"?this.setAttribute(ye(e),i+""):i||this.removeAttribute(ye(e)),s&&s.observe(this,{attributes:!0})}}_update(){jf(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const i=Ft(this._def,Bt(e,this._props));return this._instance||(i.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const r=(s,o)=>{this.dispatchEvent(new CustomEvent(s,As(o[0])?Bt({detail:o},o[0]):{detail:o}))};n.emit=(s,...o)=>{r(s,o),ye(s)!==s&&r(ye(s),o)},this._setParent()}),i}_applyStyles(e,i){if(!e)return;if(i){if(i===this._def||this._styleChildren.has(i))return;this._styleChildren.add(i)}const n=this._nonce;for(let r=e.length-1;r>=0;r--){const s=document.createElement("style");n&&s.setAttribute("nonce",n),s.textContent=e[r],this.shadowRoot.prepend(s)}}_parseSlots(){const e=this._slots={};let i;for(;i=this.firstChild;){const n=i.nodeType===1&&i.getAttribute("slot")||"default";(e[n]||(e[n]=[])).push(i),this.removeChild(i)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),i=this._instance.type.__scopeId;for(let n=0;n(delete t.props.mode,t),Vv=Hv({name:"TransitionGroup",props:Bt({},bf,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=ie(),n=Pa();let r,s;return Hs(()=>{if(!r.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!Xv(r[0].el,i.vnode.el,o))return;r.forEach(Wv),r.forEach(Gv);const c=r.filter($v);zo(),c.forEach(l=>{const O=l.el,_=O.style;$e(O,o),_.transform=_.webkitTransform=_.transitionDuration="";const v=O[ms]=E=>{E&&E.target!==O||(!E||/transform$/.test(E.propertyName))&&(O.removeEventListener("transitionend",v),O[ms]=null,xi(O,o))};O.addEventListener("transitionend",v)})}),()=>{const o=Lt(t),c=_f(o);let l=o.tag||zt;if(r=[],s)for(let O=0;O{c.split(/\s+/).forEach(l=>l&&n.classList.remove(l))}),i.split(/\s+/).forEach(c=>c&&n.classList.add(c)),n.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(n);const{hasTransform:o}=wf(n);return s.removeChild(n),o}const Pi=t=>{const e=t.props["onUpdate:modelValue"]||!1;return _t(e)?i=>hn(e,i):e};function Yv(t){t.target.composing=!0}function ql(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ae=Symbol("_assign"),vs={created(t,{modifiers:{lazy:e,trim:i,number:n}},r){t[Ae]=Pi(r);const s=n||r.props&&r.props.type==="number";ui(t,e?"change":"input",o=>{if(o.target.composing)return;let c=t.value;i&&(c=c.trim()),s&&(c=ns(c)),t[Ae](c)}),i&&ui(t,"change",()=>{t.value=t.value.trim()}),e||(ui(t,"compositionstart",Yv),ui(t,"compositionend",ql),ui(t,"change",ql))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:n,trim:r,number:s}},o){if(t[Ae]=Pi(o),t.composing)return;const c=(s||t.type==="number")&&!/^0\d/.test(t.value)?ns(t.value):t.value,l=e??"";c!==l&&(document.activeElement===t&&t.type!=="range"&&(n&&e===i||r&&t.value.trim()===l)||(t.value=l))}},Ga={deep:!0,created(t,e,i){t[Ae]=Pi(i),ui(t,"change",()=>{const n=t._modelValue,r=xn(t),s=t.checked,o=t[Ae];if(_t(n)){const c=Ls(n,r),l=c!==-1;if(s&&!l)o(n.concat(r));else if(!s&&l){const O=[...n];O.splice(c,1),o(O)}}else if(Ki(n)){const c=new Set(n);s?c.add(r):c.delete(r),o(c)}else o(Lf(t,s))})},mounted:Zl,beforeUpdate(t,e,i){t[Ae]=Pi(i),Zl(t,e,i)}};function Zl(t,{value:e,oldValue:i},n){t._modelValue=e;let r;if(_t(e))r=Ls(e,n.props.value)>-1;else if(Ki(e))r=e.has(n.props.value);else{if(e===i)return;r=Ti(e,Lf(t,!0))}t.checked!==r&&(t.checked=r)}const $a={created(t,{value:e},i){t.checked=Ti(e,i.props.value),t[Ae]=Pi(i),ui(t,"change",()=>{t[Ae](xn(t))})},beforeUpdate(t,{value:e,oldValue:i},n){t[Ae]=Pi(n),e!==i&&(t.checked=Ti(e,n.props.value))}},kf={deep:!0,created(t,{value:e,modifiers:{number:i}},n){const r=Ki(e);ui(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>i?ns(xn(o)):xn(o));t[Ae](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Nn(()=>{t._assigning=!1})}),t[Ae]=Pi(n)},mounted(t,{value:e}){Jl(t,e)},beforeUpdate(t,e,i){t[Ae]=Pi(i)},updated(t,{value:e}){t._assigning||Jl(t,e)}};function Jl(t,e){const i=t.multiple,n=_t(e);if(!(i&&!n&&!Ki(e))){for(let r=0,s=t.options.length;rString(O)===String(c)):o.selected=Ls(e,c)>-1}else o.selected=e.has(c);else if(Ti(xn(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function xn(t){return"_value"in t?t._value:t.value}function Lf(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const Mf={created(t,e,i){Ur(t,e,i,null,"created")},mounted(t,e,i){Ur(t,e,i,null,"mounted")},beforeUpdate(t,e,i,n){Ur(t,e,i,n,"beforeUpdate")},updated(t,e,i,n){Ur(t,e,i,n,"updated")}};function If(t,e){switch(t){case"SELECT":return kf;case"TEXTAREA":return vs;default:switch(e){case"checkbox":return Ga;case"radio":return $a;default:return vs}}}function Ur(t,e,i,n,r){const o=If(t.tagName,i.props&&i.props.type)[r];o&&o(t,e,i,n)}function zv(){vs.getSSRProps=({value:t})=>({value:t}),$a.getSSRProps=({value:t},e)=>{if(e.props&&Ti(e.props.value,t))return{checked:!0}},Ga.getSSRProps=({value:t},e)=>{if(_t(t)){if(e.props&&Ls(t,e.props.value)>-1)return{checked:!0}}else if(Ki(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},Mf.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const i=If(e.type.toUpperCase(),e.props&&e.props.type);if(i.getSSRProps)return i.getSSRProps(t,e)}}const Kv=["ctrl","shift","alt","meta"],qv={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Kv.some(i=>t[`${i}Key`]&&!e.includes(i))},Zv=(t,e)=>{const i=t._withMods||(t._withMods={}),n=e.join(".");return i[n]||(i[n]=(r,...s)=>{for(let o=0;o{const i=t._withKeys||(t._withKeys={}),n=e.join(".");return i[n]||(i[n]=r=>{if(!("key"in r))return;const s=ye(r.key);if(e.some(o=>o===s||Jv[o]===s))return t(r)})},Rf=Bt({patchProp:Rv},mv);let er,Ql=!1;function Nf(){return er||(er=Xh(Rf))}function Df(){return er=Ql?er:Yh(Rf),Ql=!0,er}const jf=(...t)=>{Nf().render(...t)},ty=(...t)=>{Df().hydrate(...t)},bn=(...t)=>{const e=Nf().createApp(...t),{mount:i}=e;return e.mount=n=>{const r=Hf(n);if(!r)return;const s=e._component;!Ct(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=i(r,!1,Bf(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e},Ff=(...t)=>{const e=Df().createApp(...t),{mount:i}=e;return e.mount=n=>{const r=Hf(n);if(r)return i(r,!0,Bf(r))},e};function Bf(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Hf(t){return Ut(t)?document.querySelector(t):t}let tc=!1;const ey=()=>{tc||(tc=!0,zv(),wv())};/** -* vue v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const iy=()=>{},ny=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:wh,BaseTransitionPropsValidators:ka,Comment:Kt,DeprecationTypes:dv,EffectScope:_a,ErrorCodes:_g,ErrorTypeStrings:ov,Fragment:zt,KeepAlive:Yg,ReactiveEffect:or,Static:Gi,Suspense:Hm,Teleport:yh,Text:fi,TrackOpTypes:pg,Transition:yv,TransitionGroup:Uv,TriggerOpTypes:gg,VueElement:Gs,assertNumber:bg,callWithAsyncErrorHandling:ke,callWithErrorHandling:Rn,camelize:ne,capitalize:Cr,cloneVNode:Qe,compatUtils:fv,compile:iy,computed:$t,createApp:bn,createBlock:mn,createCommentVNode:Km,createElementBlock:lf,createElementVNode:Ha,createHydrationRenderer:Yh,createPropsRestProxy:dm,createRenderer:Xh,createSSRApp:Ff,createSlots:Qg,createStaticVNode:zm,createTextVNode:Va,createVNode:Ft,customRef:oh,defineAsyncComponent:$g,defineComponent:Ue,defineCustomElement:Tf,defineEmits:nm,defineExpose:rm,defineModel:am,defineOptions:sm,defineProps:im,defineSSRCustomElement:Dv,defineSlots:om,devtools:av,effect:jp,effectScope:Vu,getCurrentInstance:ie,getCurrentScope:Uu,getCurrentWatcher:mg,getTransitionRawChildren:Fs,guardReactiveProps:uf,h:Se,handleError:Zi,hasInjectionContext:wm,hydrate:ty,hydrateOnIdle:Bg,hydrateOnInteraction:Wg,hydrateOnMediaQuery:Ug,hydrateOnVisible:Vg,initCustomFormatter:nv,initDirectivesForSSR:ey,inject:Oe,isMemoSame:mf,isProxy:Ds,isReactive:qe,isReadonly:Oi,isRef:Dt,isRuntimeOnly:tv,isShallow:_e,isVNode:Je,markRaw:rh,mergeDefaults:hm,mergeModels:fm,mergeProps:Wa,nextTick:Nn,normalizeClass:Tr,normalizeProps:Lp,normalizeStyle:Sr,onActivated:Ch,onBeforeMount:Ma,onBeforeUnmount:Vs,onBeforeUpdate:Ia,onDeactivated:Sh,onErrorCaptured:kh,onMounted:gi,onRenderTracked:Ph,onRenderTriggered:Ah,onScopeDispose:Np,onServerPrefetch:Oh,onUnmounted:Dn,onUpdated:Hs,onWatcherCleanup:ch,openBlock:Ai,popScopeId:Tg,provide:Qn,proxyRefs:cr,pushScopeId:Sg,queuePostFlushCb:ur,reactive:qi,readonly:Ta,ref:Yt,registerRuntimeCompiler:Qm,render:jf,renderList:Jg,renderSlot:Ih,resolveComponent:Lh,resolveDirective:Zg,resolveDynamicComponent:qg,resolveFilter:hv,resolveTransitionHooks:gn,setBlockTracking:Vo,setDevtoolsHook:lv,setTransitionHooks:di,shallowReactive:Sa,shallowReadonly:ng,shallowRef:In,ssrContextKey:Zh,ssrUtils:uv,stop:Fp,toDisplayString:Bu,toHandlerKey:zn,toHandlers:tm,toRaw:Lt,toRef:hg,toRefs:ah,toValue:og,transformVNodeArgs:Xm,triggerRef:sg,unref:Be,useAttrs:um,useCssModule:Bv,useCssVars:Ev,useHost:Of,useId:Lg,useModel:Im,useSSRContext:Jh,useShadowRoot:Fv,useSlots:cm,useTemplateRef:Mg,useTransitionState:Pa,vModelCheckbox:Ga,vModelDynamic:Mf,vModelRadio:$a,vModelSelect:kf,vModelText:vs,vShow:Cf,version:vf,warn:sv,watch:le,watchEffect:km,watchPostEffect:Lm,watchSyncEffect:Qh,withAsyncContext:pm,withCtx:Aa,withDefaults:lm,withDirectives:Ag,withKeys:Qv,withMemo:rv,withModifiers:Zv,withScopeId:Og},Symbol.toStringTag,{value:"Module"}));/** - * vue-class-component v8.0.0-rc.1 - * (c) 2015-present Evan You - * @license MIT - */function ec(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ry(t,e){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function cy(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uy(t,e){return e&&(typeof e=="object"||typeof e=="function")?e:cy(t)}function hy(t){var e=ly();return function(){var n=ys(t),r;if(e){var s=ys(this).constructor;r=Reflect.construct(n,arguments,s)}else r=n.apply(this,arguments);return uy(this,r)}}function fy(t){return dy(t)||py(t)||gy(t)||my()}function dy(t){if(Array.isArray(t))return Zo(t)}function py(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function gy(t,e){if(t){if(typeof t=="string")return Zo(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Zo(t,e)}}function Zo(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i-1){r[_]=c[_];return}var v=Object.getOwnPropertyDescriptor(c,_);if(typeof v.value=="function"){r.methods[_]=v.value;return}if(v.get||v.set){r.computed[_]={get:v.get,set:v.set};return}}}),r.setup=function(_,v){var E,b=new i(_,v),P=Object.keys(b),m={},T=null;return P.forEach(function(k){b[k]===void 0||b[k]&&b[k].__s||(m[k]=Yt(b[k]),vy(b,k,m))}),P.forEach(function(k){if(b[k]&&b[k].__s){var M=b[k].__s();M instanceof Promise?(T||(T=Promise.resolve(m)),T=T.then(function(){return M.then(function(y){return m[k]=cr(y),m})})):m[k]=cr(M)}}),(E=T)!==null&&E!==void 0?E:m};var l=Gr(i,"__d");l&&l.forEach(function(_){return _(r)});var O=["render","ssrRender","__file","__cssModules","__scopeId","__hmrId"];return O.forEach(function(_){i[_]&&(r[_]=i[_])}),r}}]),t}();Vf.__h=["data","beforeCreate","created","beforeMount","mounted","beforeUnmount","unmounted","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];var Xa=Vf;let xy=class extends Xa{};const by=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},_y={class:"bg-white"};function wy(t,e,i,n,r,s){const o=Lh("router-view");return Ai(),lf("div",_y,[(Ai(),mn(o,{key:t.$route.path}))])}const Ey=by(xy,[["render",wy]]);Xa.registerHooks(["beforeRouterEnter","beforeRouteLeave","beforeRouteUpdate"]);const Cy="modulepreload",Sy=function(t,e){return new URL(t,e).href},nc={},po=function(e,i,n){let r=Promise.resolve();if(i&&i.length>0){const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),l=c?.nonce||c?.getAttribute("nonce");r=Promise.allSettled(i.map(O=>{if(O=Sy(O,n),O in nc)return;nc[O]=!0;const _=O.endsWith(".css"),v=_?'[rel="stylesheet"]':"";if(!!n)for(let P=o.length-1;P>=0;P--){const m=o[P];if(m.href===O&&(!_||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${O}"]${v}`))return;const b=document.createElement("link");if(b.rel=_?"stylesheet":Cy,_||(b.as="script"),b.crossOrigin="",b.href=O,l&&b.setAttribute("nonce",l),document.head.appendChild(b),_)return new Promise((P,m)=>{b.addEventListener("load",P),b.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${O}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return r.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};/*! - * vue-router v4.4.3 - * (c) 2024 Eduardo San Martin Morote - * @license MIT - */const rn=typeof document<"u";function Ty(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function go(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ve(r)?r.map(t):t(r)}return i}const ir=()=>{},Ve=Array.isArray,Uf=/#/g,Oy=/&/g,Ay=/\//g,Py=/=/g,ky=/\?/g,Wf=/\+/g,Ly=/%5B/g,My=/%5D/g,Gf=/%5E/g,Iy=/%60/g,$f=/%7B/g,Ry=/%7C/g,Xf=/%7D/g,Ny=/%20/g;function Ya(t){return encodeURI(""+t).replace(Ry,"|").replace(Ly,"[").replace(My,"]")}function Dy(t){return Ya(t).replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function Jo(t){return Ya(t).replace(Wf,"%2B").replace(Ny,"+").replace(Uf,"%23").replace(Oy,"%26").replace(Iy,"`").replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function jy(t){return Jo(t).replace(Py,"%3D")}function Fy(t){return Ya(t).replace(Uf,"%23").replace(ky,"%3F")}function By(t){return t==null?"":Fy(t).replace(Ay,"%2F")}function mr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Hy=/\/$/,Vy=t=>t.replace(Hy,"");function mo(t,e,i="/"){let n,r={},s="",o="";const c=e.indexOf("#");let l=e.indexOf("?");return c=0&&(l=-1),l>-1&&(n=e.slice(0,l),s=e.slice(l+1,c>-1?c:e.length),r=t(s)),c>-1&&(n=n||e.slice(0,c),o=e.slice(c,e.length)),n=$y(n??e,i),{fullPath:n+(s&&"?")+s+o,path:n,query:r,hash:mr(o)}}function Uy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function rc(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Wy(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&_n(e.matched[n],i.matched[r])&&Yf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function _n(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Yf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!Gy(t[i],e[i]))return!1;return!0}function Gy(t,e){return Ve(t)?sc(t,e):Ve(e)?sc(e,t):t===e}function sc(t,e){return Ve(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function $y(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let s=i.length-1,o,c;for(o=0;o1&&s--;else break;return i.slice(0,s).join("/")+"/"+n.slice(o).join("/")}const vi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var vr;(function(t){t.pop="pop",t.push="push"})(vr||(vr={}));var nr;(function(t){t.back="back",t.forward="forward",t.unknown=""})(nr||(nr={}));function Xy(t){if(!t)if(rn){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Vy(t)}const Yy=/^[^#]+#/;function zy(t,e){return t.replace(Yy,"#")+e}function Ky(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const $s=()=>({left:window.scrollX,top:window.scrollY});function qy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ky(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function oc(t,e){return(history.state?history.state.position-e:-1)+t}const Qo=new Map;function Zy(t,e){Qo.set(t,e)}function Jy(t){const e=Qo.get(t);return Qo.delete(t),e}let Qy=()=>location.protocol+"//"+location.host;function zf(t,e){const{pathname:i,search:n,hash:r}=e,s=t.indexOf("#");if(s>-1){let c=r.includes(t.slice(s))?t.slice(s).length:1,l=r.slice(c);return l[0]!=="/"&&(l="/"+l),rc(l,"")}return rc(i,t)+n+r}function t0(t,e,i,n){let r=[],s=[],o=null;const c=({state:E})=>{const b=zf(t,location),P=i.value,m=e.value;let T=0;if(E){if(i.value=b,e.value=E,o&&o===P){o=null;return}T=m?E.position-m.position:0}else n(b);r.forEach(k=>{k(i.value,P,{delta:T,type:vr.pop,direction:T?T>0?nr.forward:nr.back:nr.unknown})})};function l(){o=i.value}function O(E){r.push(E);const b=()=>{const P=r.indexOf(E);P>-1&&r.splice(P,1)};return s.push(b),b}function _(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:$s()}),"")}function v(){for(const E of s)E();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",_)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",_,{passive:!0}),{pauseListeners:l,listen:O,destroy:v}}function ac(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?$s():null}}function e0(t){const{history:e,location:i}=window,n={value:zf(t,i)},r={value:e.state};r.value||s(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,O,_){const v=t.indexOf("#"),E=v>-1?(i.host&&document.querySelector("base")?t:t.slice(v))+l:Qy()+t+l;try{e[_?"replaceState":"pushState"](O,"",E),r.value=O}catch(b){console.error(b),i[_?"replace":"assign"](E)}}function o(l,O){const _=Nt({},e.state,ac(r.value.back,l,r.value.forward,!0),O,{position:r.value.position});s(l,_,!0),n.value=l}function c(l,O){const _=Nt({},r.value,e.state,{forward:l,scroll:$s()});s(_.current,_,!0);const v=Nt({},ac(n.value,l,null),{position:_.position+1},O);s(l,v,!1),n.value=l}return{location:n,state:r,push:c,replace:o}}function i0(t){t=Xy(t);const e=e0(t),i=t0(t,e.state,e.location,e.replace);function n(s,o=!0){o||i.pauseListeners(),history.go(s)}const r=Nt({location:"",base:t,go:n,createHref:zy.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function n0(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),i0(t)}function r0(t){return typeof t=="string"||t&&typeof t=="object"}function Kf(t){return typeof t=="string"||typeof t=="symbol"}const qf=Symbol("");var lc;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(lc||(lc={}));function wn(t,e){return Nt(new Error,{type:t,[qf]:!0},e)}function ni(t,e){return t instanceof Error&&qf in t&&(e==null||!!(t.type&e))}const cc="[^/]+?",s0={sensitive:!1,strict:!1,start:!0,end:!0},o0=/[.+*?^${}()[\]/\\]/g;function a0(t,e){const i=Nt({},s0,e),n=[];let r=i.start?"^":"";const s=[];for(const O of t){const _=O.length?[]:[90];i.strict&&!O.length&&(r+="/");for(let v=0;ve.length?e.length===1&&e[0]===80?1:-1:0}function Zf(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const c0={type:0,value:""},u0=/[a-zA-Z0-9_]/;function h0(t){if(!t)return[[]];if(t==="/")return[[c0]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${O}": ${b}`)}let i=0,n=i;const r=[];let s;function o(){s&&r.push(s),s=[]}let c=0,l,O="",_="";function v(){O&&(i===0?s.push({type:0,value:O}):i===1||i===2||i===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${O}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:O,regexp:_,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),O="")}function E(){O+=l}for(;c{o(y)}:ir}function o(v){if(Kf(v)){const E=n.get(v);E&&(n.delete(v),i.splice(i.indexOf(E),1),E.children.forEach(o),E.alias.forEach(o))}else{const E=i.indexOf(v);E>-1&&(i.splice(E,1),v.record.name&&n.delete(v.record.name),v.children.forEach(o),v.alias.forEach(o))}}function c(){return i}function l(v){const E=v0(v,i);i.splice(E,0,v),v.record.name&&!fc(v)&&n.set(v.record.name,v)}function O(v,E){let b,P={},m,T;if("name"in v&&v.name){if(b=n.get(v.name),!b)throw wn(1,{location:v});T=b.record.name,P=Nt(hc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),v.params&&hc(v.params,b.keys.map(y=>y.name))),m=b.stringify(P)}else if(v.path!=null)m=v.path,b=i.find(y=>y.re.test(m)),b&&(P=b.parse(m),T=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw wn(1,{location:v,currentLocation:E});T=b.record.name,P=Nt({},E.params,v.params),m=b.stringify(P)}const k=[];let M=b;for(;M;)k.unshift(M.record),M=M.parent;return{name:T,path:m,params:P,matched:k,meta:m0(k)}}t.forEach(v=>s(v));function _(){i.length=0,n.clear()}return{addRoute:s,resolve:O,removeRoute:o,clearRoutes:_,getRoutes:c,getRecordMatcher:r}}function hc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function p0(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:g0(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function g0(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function fc(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function m0(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function dc(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function v0(t,e){let i=0,n=e.length;for(;i!==n;){const s=i+n>>1;Zf(t,e[s])<0?n=s:i=s+1}const r=y0(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function y0(t){let e=t;for(;e=e.parent;)if(Jf(e)&&Zf(t,e)===0)return e}function Jf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function x0(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;rs&&Jo(s)):[n&&Jo(n)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+i,s!=null&&(e+="="+s))})}return e}function b0(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ve(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const _0=Symbol(""),gc=Symbol(""),za=Symbol(""),Ka=Symbol(""),ta=Symbol("");function Vn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function Ci(t,e,i,n,r,s=o=>o()){const o=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((c,l)=>{const O=E=>{E===!1?l(wn(4,{from:i,to:e})):E instanceof Error?l(E):r0(E)?l(wn(2,{from:e,to:E})):(o&&n.enterCallbacks[r]===o&&typeof E=="function"&&o.push(E),c())},_=s(()=>t.call(n&&n.instances[r],e,i,O));let v=Promise.resolve(_);t.length<3&&(v=v.then(O)),v.catch(E=>l(E))})}function vo(t,e,i,n,r=s=>s()){const s=[];for(const o of t)for(const c in o.components){let l=o.components[c];if(!(e!=="beforeRouteEnter"&&!o.instances[c]))if(w0(l)){const _=(l.__vccOpts||l)[e];_&&s.push(Ci(_,i,n,o,c,r))}else{let O=l();s.push(()=>O.then(_=>{if(!_)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${o.path}"`));const v=Ty(_)?_.default:_;o.components[c]=v;const b=(v.__vccOpts||v)[e];return b&&Ci(b,i,n,o,c,r)()}))}}return s}function w0(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function mc(t){const e=Oe(za),i=Oe(Ka),n=$t(()=>{const l=Be(t.to);return e.resolve(l)}),r=$t(()=>{const{matched:l}=n.value,{length:O}=l,_=l[O-1],v=i.matched;if(!_||!v.length)return-1;const E=v.findIndex(_n.bind(null,_));if(E>-1)return E;const b=vc(l[O-2]);return O>1&&vc(_)===b&&v[v.length-1].path!==b?v.findIndex(_n.bind(null,l[O-2])):E}),s=$t(()=>r.value>-1&&T0(i.params,n.value.params)),o=$t(()=>r.value>-1&&r.value===i.matched.length-1&&Yf(i.params,n.value.params));function c(l={}){return S0(l)?e[Be(t.replace)?"replace":"push"](Be(t.to)).catch(ir):Promise.resolve()}return{route:n,href:$t(()=>n.value.href),isActive:s,isExactActive:o,navigate:c}}const E0=Ue({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:mc,setup(t,{slots:e}){const i=qi(mc(t)),{options:n}=Oe(za),r=$t(()=>({[yc(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[yc(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const s=e.default&&e.default(i);return t.custom?s:Se("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},s)}}}),C0=E0;function S0(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function T0(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ve(r)||r.length!==n.length||n.some((s,o)=>s!==r[o]))return!1}return!0}function vc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const yc=(t,e,i)=>t??e??i,O0=Ue({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Oe(ta),r=$t(()=>t.route||n.value),s=Oe(gc,0),o=$t(()=>{let O=Be(s);const{matched:_}=r.value;let v;for(;(v=_[O])&&!v.components;)O++;return O}),c=$t(()=>r.value.matched[o.value]);Qn(gc,$t(()=>o.value+1)),Qn(_0,c),Qn(ta,r);const l=Yt();return le(()=>[l.value,c.value,t.name],([O,_,v],[E,b,P])=>{_&&(_.instances[v]=O,b&&b!==_&&O&&O===E&&(_.leaveGuards.size||(_.leaveGuards=b.leaveGuards),_.updateGuards.size||(_.updateGuards=b.updateGuards))),O&&_&&(!b||!_n(_,b)||!E)&&(_.enterCallbacks[v]||[]).forEach(m=>m(O))},{flush:"post"}),()=>{const O=r.value,_=t.name,v=c.value,E=v&&v.components[_];if(!E)return xc(i.default,{Component:E,route:O});const b=v.props[_],P=b?b===!0?O.params:typeof b=="function"?b(O):b:null,T=Se(E,Nt({},P,e,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(v.instances[_]=null)},ref:l}));return xc(i.default,{Component:T,route:O})||T}}});function xc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const A0=O0;function P0(t){const e=d0(t.routes,t),i=t.parseQuery||x0,n=t.stringifyQuery||pc,r=t.history,s=Vn(),o=Vn(),c=Vn(),l=In(vi);let O=vi;rn&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=go.bind(null,G=>""+G),v=go.bind(null,By),E=go.bind(null,mr);function b(G,J){let C,U;return Kf(G)?(C=e.getRecordMatcher(G),U=J):U=G,e.addRoute(U,C)}function P(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function m(){return e.getRoutes().map(G=>G.record)}function T(G){return!!e.getRecordMatcher(G)}function k(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=mo(i,G,J.path),X=e.resolve({path:F.path},J),st=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:mr(F.hash),redirectedFrom:void 0,href:st})}let C;if(G.path!=null)C=Nt({},G,{path:mo(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];C=Nt({},G,{params:v(F)}),J.params=v(J.params)}const U=e.resolve(C,J),B=G.hash||"";U.params=_(E(U.params));const tt=Uy(n,Nt({},G,{hash:Dy(B),path:U.path})),D=r.createHref(tt);return Nt({fullPath:tt,hash:B,query:n===pc?b0(G.query):G.query||{}},U,{redirectedFrom:void 0,href:D})}function M(G){return typeof G=="string"?mo(i,G,l.value.path):Nt({},G)}function y(G,J){if(O!==G)return wn(8,{from:J,to:G})}function a(G){return A(G)}function S(G){return a(Nt(M(G),{replace:!0}))}function w(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:C}=J;let U=typeof C=="function"?C(G):C;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=M(U):{path:U},U.params={}),Nt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function A(G,J){const C=O=k(G),U=l.value,B=G.state,tt=G.force,D=G.replace===!0,F=w(C);if(F)return A(Nt(M(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:tt,replace:D}),J||C);const X=C;X.redirectedFrom=J;let st;return!tt&&Wy(n,U,C)&&(st=wn(16,{to:X,from:U}),H(U,U,!0,!1)),(st?Promise.resolve(st):g(X,U)).catch(ot=>ni(ot)?ni(ot,2)?ot:it(ot):$(ot,X,U)).then(ot=>{if(ot){if(ni(ot,2))return A(Nt({replace:D},M(ot.to),{state:typeof ot.to=="object"?Nt({},B,ot.to.state):B,force:tt}),J||X)}else ot=x(X,U,!0,D,B);return h(X,U,ot),ot})}function f(G,J){const C=y(G,J);return C?Promise.reject(C):Promise.resolve()}function u(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let C;const[U,B,tt]=k0(G,J);C=vo(U.reverse(),"beforeRouteLeave",G,J);for(const F of U)F.leaveGuards.forEach(X=>{C.push(Ci(X,G,J))});const D=f.bind(null,G,J);return C.push(D),K(C).then(()=>{C=[];for(const F of s.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).then(()=>{C=vo(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{C.push(Ci(X,G,J))});return C.push(D),K(C)}).then(()=>{C=[];for(const F of tt)if(F.beforeEnter)if(Ve(F.beforeEnter))for(const X of F.beforeEnter)C.push(Ci(X,G,J));else C.push(Ci(F.beforeEnter,G,J));return C.push(D),K(C)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),C=vo(tt,"beforeRouteEnter",G,J,u),C.push(D),K(C))).then(()=>{C=[];for(const F of o.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).catch(F=>ni(F,8)?F:Promise.reject(F))}function h(G,J,C){c.list().forEach(U=>u(()=>U(G,J,C)))}function x(G,J,C,U,B){const tt=y(G,J);if(tt)return tt;const D=J===vi,F=rn?history.state:{};C&&(U||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,C,D),it()}let d;function p(){d||(d=r.listen((G,J,C)=>{if(!V.listening)return;const U=k(G),B=w(U);if(B){A(Nt(B,{replace:!0}),U).catch(ir);return}O=U;const tt=l.value;rn&&Zy(oc(tt.fullPath,C.delta),$s()),g(U,tt).catch(D=>ni(D,12)?D:ni(D,2)?(A(D.to,U).then(F=>{ni(F,20)&&!C.delta&&C.type===vr.pop&&r.go(-1,!1)}).catch(ir),Promise.reject()):(C.delta&&r.go(-C.delta,!1),$(D,U,tt))).then(D=>{D=D||x(U,tt,!1),D&&(C.delta&&!ni(D,8)?r.go(-C.delta,!1):C.type===vr.pop&&ni(D,20)&&r.go(-1,!1)),h(U,tt,D)}).catch(ir)}))}let R=Vn(),I=Vn(),j;function $(G,J,C){it(G);const U=I.list();return U.length?U.forEach(B=>B(G,J,C)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==vi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,C])=>G?C(G):J()),R.reset()),G}function H(G,J,C,U){const{scrollBehavior:B}=t;if(!rn||!B)return Promise.resolve();const tt=!C&&Jy(oc(G.fullPath,0))||(U||!C)&&history.state&&history.state.scroll||null;return Nn().then(()=>B(G,J,tt)).then(D=>D&&qy(D)).catch(D=>$(D,G,J))}const z=G=>r.go(G);let L;const N=new Set,V={currentRoute:l,listening:!0,addRoute:b,removeRoute:P,clearRoutes:e.clearRoutes,hasRoute:T,getRoutes:m,resolve:k,options:t,push:a,replace:S,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:s.add,beforeResolve:o.add,afterEach:c.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",C0),G.component("RouterView",A0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(l)}),rn&&!L&&l.value===vi&&(L=!0,a(r.location).catch(B=>{}));const C={};for(const B in vi)Object.defineProperty(C,B,{get:()=>l.value[B],enumerable:!0});G.provide(za,J),G.provide(Ka,Sa(C)),G.provide(ta,l);const U=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(O=vi,d&&d(),d=null,l.value=vi,L=!1,j=!1),U()}}};function K(G){return G.reduce((J,C)=>J.then(()=>u(C)),Promise.resolve())}return V}function k0(t,e){const i=[],n=[],r=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;o_n(O,c))?n.push(c):i.push(c));const l=t.matched[o];l&&(e.matched.find(O=>_n(O,l))||r.push(l))}return[i,n,r]}function w1(t){return Oe(Ka)}const L0=[{path:"/",component:()=>po(()=>import("./story-OUarUCIt.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>po(()=>import("./story-OUarUCIt.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>po(()=>import("./story-OUarUCIt.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)}],M0=P0({routes:L0,history:n0(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! - * shared v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */const xs=typeof window<"u",Ii=(t,e=!1)=>e?Symbol.for(t):Symbol(t),I0=(t,e,i)=>R0({l:t,k:e,s:i}),R0=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Jt=t=>typeof t=="number"&&isFinite(t),N0=t=>td(t)==="[object Date]",ki=t=>td(t)==="[object RegExp]",Xs=t=>Tt(t)&&Object.keys(t).length===0,re=Object.assign;let bc;const hi=()=>bc||(bc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function _c(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const D0=Object.prototype.hasOwnProperty;function bs(t,e){return D0.call(t,e)}const Gt=Array.isArray,Vt=t=>typeof t=="function",bt=t=>typeof t=="string",At=t=>typeof t=="boolean",Rt=t=>t!==null&&typeof t=="object",j0=t=>Rt(t)&&Vt(t.then)&&Vt(t.catch),Qf=Object.prototype.toString,td=t=>Qf.call(t),Tt=t=>{if(!Rt(t))return!1;const e=Object.getPrototypeOf(t);return e===null||e.constructor===Object},F0=t=>t==null?"":Gt(t)||Tt(t)&&t.toString===Qf?JSON.stringify(t,null,2):String(t);function B0(t,e=""){return t.reduce((i,n,r)=>r===0?i+n:i+e+n,"")}function Ys(t){let e=t;return()=>++e}function H0(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const $r=t=>!Rt(t)||Gt(t);function ts(t,e){if($r(t)||$r(e))throw new Error("Invalid value");const i=[{src:t,des:e}];for(;i.length;){const{src:n,des:r}=i.pop();Object.keys(n).forEach(s=>{$r(n[s])||$r(r[s])?r[s]=n[s]:i.push({src:n[s],des:r[s]})})}}/*! - * message-compiler v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */function V0(t,e,i){return{line:t,column:e,offset:i}}function _s(t,e,i){return{start:t,end:e}}const U0=/\{([0-9a-zA-Z]+)\}/g;function ed(t,...e){return e.length===1&&W0(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(U0,(i,n)=>e.hasOwnProperty(n)?e[n]:"")}const id=Object.assign,wc=t=>typeof t=="string",W0=t=>t!==null&&typeof t=="object";function nd(t,e=""){return t.reduce((i,n,r)=>r===0?i+n:i+e+n,"")}const qa={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},G0={[qa.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function $0(t,e,...i){const n=ed(G0[t],...i||[]),r={message:String(n),code:t};return e&&(r.location=e),r}const St={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},X0={[St.EXPECTED_TOKEN]:"Expected token: '{0}'",[St.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[St.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[St.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[St.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[St.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[St.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[St.EMPTY_PLACEHOLDER]:"Empty placeholder",[St.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[St.INVALID_LINKED_FORMAT]:"Invalid linked format",[St.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[St.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[St.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[St.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[St.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[St.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function jn(t,e,i={}){const{domain:n,messages:r,args:s}=i,o=ed((r||X0)[t]||"",...s||[]),c=new SyntaxError(String(o));return c.code=t,e&&(c.location=e),c.domain=n,c}function Y0(t){throw t}const ri=" ",z0="\r",he=` -`,K0="\u2028",q0="\u2029";function Z0(t){const e=t;let i=0,n=1,r=1,s=0;const o=A=>e[A]===z0&&e[A+1]===he,c=A=>e[A]===he,l=A=>e[A]===q0,O=A=>e[A]===K0,_=A=>o(A)||c(A)||l(A)||O(A),v=()=>i,E=()=>n,b=()=>r,P=()=>s,m=A=>o(A)||l(A)||O(A)?he:e[A],T=()=>m(i),k=()=>m(i+s);function M(){return s=0,_(i)&&(n++,r=0),o(i)&&i++,i++,r++,e[i]}function y(){return o(i+s)&&s++,s++,e[i+s]}function a(){i=0,n=1,r=1,s=0}function S(A=0){s=A}function w(){const A=i+s;for(;A!==i;)M();s=0}return{index:v,line:E,column:b,peekOffset:P,charAt:m,currentChar:T,currentPeek:k,next:M,peek:y,reset:a,resetPeek:S,skipToPeek:w}}const yi=void 0,J0=".",Ec="'",Q0="tokenizer";function tx(t,e={}){const i=e.location!==!1,n=Z0(t),r=()=>n.index(),s=()=>V0(n.line(),n.column(),n.index()),o=s(),c=r(),l={currentType:14,offset:c,startLoc:o,endLoc:o,lastType:14,lastOffset:c,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},O=()=>l,{onError:_}=e;function v(q,Y,Z,...W){const Q=O();if(Y.column+=Z,Y.offset+=Z,_){const rt=i?_s(Q.startLoc,Y):null,nt=jn(q,rt,{domain:Q0,args:W});_(nt)}}function E(q,Y,Z){q.endLoc=s(),q.currentType=Y;const W={type:Y};return i&&(W.loc=_s(q.startLoc,q.endLoc)),Z!=null&&(W.value=Z),W}const b=q=>E(q,14);function P(q,Y){return q.currentChar()===Y?(q.next(),Y):(v(St.EXPECTED_TOKEN,s(),0,Y),"")}function m(q){let Y="";for(;q.currentPeek()===ri||q.currentPeek()===he;)Y+=q.currentPeek(),q.peek();return Y}function T(q){const Y=m(q);return q.skipToPeek(),Y}function k(q){if(q===yi)return!1;const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function M(q){if(q===yi)return!1;const Y=q.charCodeAt(0);return Y>=48&&Y<=57}function y(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=k(q.currentPeek());return q.resetPeek(),W}function a(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=q.currentPeek()==="-"?q.peek():q.currentPeek(),Q=M(W);return q.resetPeek(),Q}function S(q,Y){const{currentType:Z}=Y;if(Z!==2)return!1;m(q);const W=q.currentPeek()===Ec;return q.resetPeek(),W}function w(q,Y){const{currentType:Z}=Y;if(Z!==8)return!1;m(q);const W=q.currentPeek()===".";return q.resetPeek(),W}function A(q,Y){const{currentType:Z}=Y;if(Z!==9)return!1;m(q);const W=k(q.currentPeek());return q.resetPeek(),W}function f(q,Y){const{currentType:Z}=Y;if(!(Z===8||Z===12))return!1;m(q);const W=q.currentPeek()===":";return q.resetPeek(),W}function u(q,Y){const{currentType:Z}=Y;if(Z!==10)return!1;const W=()=>{const rt=q.currentPeek();return rt==="{"?k(q.peek()):rt==="@"||rt==="%"||rt==="|"||rt===":"||rt==="."||rt===ri||!rt?!1:rt===he?(q.peek(),W()):x(q,!1)},Q=W();return q.resetPeek(),Q}function g(q){m(q);const Y=q.currentPeek()==="|";return q.resetPeek(),Y}function h(q){const Y=m(q),Z=q.currentPeek()==="%"&&q.peek()==="{";return q.resetPeek(),{isModulo:Z,hasSpace:Y.length>0}}function x(q,Y=!0){const Z=(Q=!1,rt="",nt=!1)=>{const at=q.currentPeek();return at==="{"?rt==="%"?!1:Q:at==="@"||!at?rt==="%"?!0:Q:at==="%"?(q.peek(),Z(Q,"%",!0)):at==="|"?rt==="%"||nt?!0:!(rt===ri||rt===he):at===ri?(q.peek(),Z(!0,ri,nt)):at===he?(q.peek(),Z(!0,he,nt)):!0},W=Z();return Y&&q.resetPeek(),W}function d(q,Y){const Z=q.currentChar();return Z===yi?yi:Y(Z)?(q.next(),Z):null}function p(q){const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function R(q){return d(q,p)}function I(q){const Y=q.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function j(q){return d(q,I)}function $(q){const Y=q.charCodeAt(0);return Y>=48&&Y<=57}function et(q){return d(q,$)}function it(q){const Y=q.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function H(q){return d(q,it)}function z(q){let Y="",Z="";for(;Y=et(q);)Z+=Y;return Z}function L(q){T(q);const Y=q.currentChar();return Y!=="%"&&v(St.EXPECTED_TOKEN,s(),0,Y),q.next(),"%"}function N(q){let Y="";for(;;){const Z=q.currentChar();if(Z==="{"||Z==="}"||Z==="@"||Z==="|"||!Z)break;if(Z==="%")if(x(q))Y+=Z,q.next();else break;else if(Z===ri||Z===he)if(x(q))Y+=Z,q.next();else{if(g(q))break;Y+=Z,q.next()}else Y+=Z,q.next()}return Y}function V(q){T(q);let Y="",Z="";for(;Y=j(q);)Z+=Y;return q.currentChar()===yi&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z}function K(q){T(q);let Y="";return q.currentChar()==="-"?(q.next(),Y+=`-${z(q)}`):Y+=z(q),q.currentChar()===yi&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Y}function G(q){return q!==Ec&&q!==he}function J(q){T(q),P(q,"'");let Y="",Z="";for(;Y=d(q,G);)Y==="\\"?Z+=C(q):Z+=Y;const W=q.currentChar();return W===he||W===yi?(v(St.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),W===he&&(q.next(),P(q,"'")),Z):(P(q,"'"),Z)}function C(q){const Y=q.currentChar();switch(Y){case"\\":case"'":return q.next(),`\\${Y}`;case"u":return U(q,Y,4);case"U":return U(q,Y,6);default:return v(St.UNKNOWN_ESCAPE_SEQUENCE,s(),0,Y),""}}function U(q,Y,Z){P(q,Y);let W="";for(let Q=0;Q{const W=q.currentChar();return W==="{"||W==="%"||W==="@"||W==="|"||W==="("||W===")"||!W||W===ri?Z:(Z+=W,q.next(),Y(Z))};return Y("")}function X(q){T(q);const Y=P(q,"|");return T(q),Y}function st(q,Y){let Z=null;switch(q.currentChar()){case"{":return Y.braceNest>=1&&v(St.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),q.next(),Z=E(Y,2,"{"),T(q),Y.braceNest++,Z;case"}":return Y.braceNest>0&&Y.currentType===2&&v(St.EMPTY_PLACEHOLDER,s(),0),q.next(),Z=E(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&T(q),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),Z;case"@":return Y.braceNest>0&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z=ot(q,Y)||b(Y),Y.braceNest=0,Z;default:{let Q=!0,rt=!0,nt=!0;if(g(q))return Y.braceNest>0&&v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Z=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,Z;if(Y.braceNest>0&&(Y.currentType===5||Y.currentType===6||Y.currentType===7))return v(St.UNTERMINATED_CLOSING_BRACE,s(),0),Y.braceNest=0,lt(q,Y);if(Q=y(q,Y))return Z=E(Y,5,V(q)),T(q),Z;if(rt=a(q,Y))return Z=E(Y,6,K(q)),T(q),Z;if(nt=S(q,Y))return Z=E(Y,7,J(q)),T(q),Z;if(!Q&&!rt&&!nt)return Z=E(Y,13,tt(q)),v(St.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,Z.value),T(q),Z;break}}return Z}function ot(q,Y){const{currentType:Z}=Y;let W=null;const Q=q.currentChar();switch((Z===8||Z===9||Z===12||Z===10)&&(Q===he||Q===ri)&&v(St.INVALID_LINKED_FORMAT,s(),0),Q){case"@":return q.next(),W=E(Y,8,"@"),Y.inLinked=!0,W;case".":return T(q),q.next(),E(Y,9,".");case":":return T(q),q.next(),E(Y,10,":");default:return g(q)?(W=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,W):w(q,Y)||f(q,Y)?(T(q),ot(q,Y)):A(q,Y)?(T(q),E(Y,12,D(q))):u(q,Y)?(T(q),Q==="{"?st(q,Y)||W:E(Y,11,F(q))):(Z===8&&v(St.INVALID_LINKED_FORMAT,s(),0),Y.braceNest=0,Y.inLinked=!1,lt(q,Y))}}function lt(q,Y){let Z={type:14};if(Y.braceNest>0)return st(q,Y)||b(Y);if(Y.inLinked)return ot(q,Y)||b(Y);switch(q.currentChar()){case"{":return st(q,Y)||b(Y);case"}":return v(St.UNBALANCED_CLOSING_BRACE,s(),0),q.next(),E(Y,3,"}");case"@":return ot(q,Y)||b(Y);default:{if(g(q))return Z=E(Y,1,X(q)),Y.braceNest=0,Y.inLinked=!1,Z;const{isModulo:Q,hasSpace:rt}=h(q);if(Q)return rt?E(Y,0,N(q)):E(Y,4,L(q));if(x(q))return E(Y,0,N(q));break}}return Z}function ct(){const{currentType:q,offset:Y,startLoc:Z,endLoc:W}=l;return l.lastType=q,l.lastOffset=Y,l.lastStartLoc=Z,l.lastEndLoc=W,l.offset=r(),l.startLoc=s(),n.currentChar()===yi?E(l,14):lt(n,l)}return{nextToken:ct,currentOffset:r,currentPosition:s,context:O}}const ex="parser",ix=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function nx(t,e,i){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const n=parseInt(e||i,16);return n<=55295||n>=57344?String.fromCodePoint(n):"�"}}}function rx(t={}){const e=t.location!==!1,{onError:i,onWarn:n}=t;function r(y,a,S,w,...A){const f=y.currentPosition();if(f.offset+=w,f.column+=w,i){const u=e?_s(S,f):null,g=jn(a,u,{domain:ex,args:A});i(g)}}function s(y,a,S,w,...A){const f=y.currentPosition();if(f.offset+=w,f.column+=w,n){const u=e?_s(S,f):null;n($0(a,u,A))}}function o(y,a,S){const w={type:y};return e&&(w.start=a,w.end=a,w.loc={start:S,end:S}),w}function c(y,a,S,w){e&&(y.end=a,y.loc&&(y.loc.end=S))}function l(y,a){const S=y.context(),w=o(3,S.offset,S.startLoc);return w.value=a,c(w,y.currentOffset(),y.currentPosition()),w}function O(y,a){const S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(5,w,A);return f.index=parseInt(a,10),y.nextToken(),c(f,y.currentOffset(),y.currentPosition()),f}function _(y,a,S){const w=y.context(),{lastOffset:A,lastStartLoc:f}=w,u=o(4,A,f);return u.key=a,S===!0&&(u.modulo=!0),y.nextToken(),c(u,y.currentOffset(),y.currentPosition()),u}function v(y,a){const S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(9,w,A);return f.value=a.replace(ix,nx),y.nextToken(),c(f,y.currentOffset(),y.currentPosition()),f}function E(y){const a=y.nextToken(),S=y.context(),{lastOffset:w,lastStartLoc:A}=S,f=o(8,w,A);return a.type!==12?(r(y,St.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.lastStartLoc,0),f.value="",c(f,w,A),{nextConsumeToken:a,node:f}):(a.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Re(a)),f.value=a.value||"",c(f,y.currentOffset(),y.currentPosition()),{node:f})}function b(y,a){const S=y.context(),w=o(7,S.offset,S.startLoc);return w.value=a,c(w,y.currentOffset(),y.currentPosition()),w}function P(y){const a=y.context(),S=o(6,a.offset,a.startLoc);let w=y.nextToken();if(w.type===9){const A=E(y);S.modifier=A.node,w=A.nextConsumeToken||y.nextToken()}switch(w.type!==10&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),w=y.nextToken(),w.type===2&&(w=y.nextToken()),w.type){case 11:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=b(y,w.value||"");break;case 5:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=_(y,w.value||"");break;case 6:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=O(y,w.value||"");break;case 7:w.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(w)),S.key=v(y,w.value||"");break;default:{r(y,St.UNEXPECTED_EMPTY_LINKED_KEY,a.lastStartLoc,0);const A=y.context(),f=o(7,A.offset,A.startLoc);return f.value="",c(f,A.offset,A.startLoc),S.key=f,c(S,A.offset,A.startLoc),{nextConsumeToken:w,node:S}}}return c(S,y.currentOffset(),y.currentPosition()),{node:S}}function m(y){const a=y.context(),S=a.currentType===1?y.currentOffset():a.offset,w=a.currentType===1?a.endLoc:a.startLoc,A=o(2,S,w);A.items=[];let f=null,u=null;do{const x=f||y.nextToken();switch(f=null,x.type){case 0:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(l(y,x.value||""));break;case 6:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(O(y,x.value||""));break;case 4:u=!0;break;case 5:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(_(y,x.value||"",!!u)),u&&(s(y,qa.USE_MODULO_SYNTAX,a.lastStartLoc,0,Re(x)),u=null);break;case 7:x.value==null&&r(y,St.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,0,Re(x)),A.items.push(v(y,x.value||""));break;case 8:{const d=P(y);A.items.push(d.node),f=d.nextConsumeToken||null;break}}}while(a.currentType!==14&&a.currentType!==1);const g=a.currentType===1?a.lastOffset:y.currentOffset(),h=a.currentType===1?a.lastEndLoc:y.currentPosition();return c(A,g,h),A}function T(y,a,S,w){const A=y.context();let f=w.items.length===0;const u=o(1,a,S);u.cases=[],u.cases.push(w);do{const g=m(y);f||(f=g.items.length===0),u.cases.push(g)}while(A.currentType!==14);return f&&r(y,St.MUST_HAVE_MESSAGES_IN_PLURAL,S,0),c(u,y.currentOffset(),y.currentPosition()),u}function k(y){const a=y.context(),{offset:S,startLoc:w}=a,A=m(y);return a.currentType===14?A:T(y,S,w,A)}function M(y){const a=tx(y,id({},t)),S=a.context(),w=o(0,S.offset,S.startLoc);return e&&w.loc&&(w.loc.source=y),w.body=k(a),t.onCacheKey&&(w.cacheKey=t.onCacheKey(y)),S.currentType!==14&&r(a,St.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,y[S.offset]||""),c(w,a.currentOffset(),a.currentPosition()),w}return{parse:M}}function Re(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function sx(t,e={}){const i={ast:t,helpers:new Set};return{context:()=>i,helper:s=>(i.helpers.add(s),s)}}function Cc(t,e){for(let i=0;iSc(i)),t}function Sc(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let i=0;ic;function O(T,k){c.code+=T}function _(T,k=!0){const M=k?r:"";O(s?M+" ".repeat(T):M)}function v(T=!0){const k=++c.indentLevel;T&&_(k)}function E(T=!0){const k=--c.indentLevel;T&&_(k)}function b(){_(c.indentLevel)}return{context:l,push:O,indent:v,deindent:E,newline:b,helper:T=>`_${T}`,needIndent:()=>c.needIndent}}function hx(t,e){const{helper:i}=t;t.push(`${i("linked")}(`),En(t,e.key),e.modifier?(t.push(", "),En(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function fx(t,e){const{helper:i,needIndent:n}=t;t.push(`${i("normalize")}([`),t.indent(n());const r=e.items.length;for(let s=0;s1){t.push(`${i("plural")}([`),t.indent(n());const r=e.cases.length;for(let s=0;s{const i=wc(e.mode)?e.mode:"normal",n=wc(e.filename)?e.filename:"message.intl",r=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:i==="arrow"?";":` -`,o=e.needIndent?e.needIndent:i!=="arrow",c=t.helpers||[],l=ux(t,{mode:i,filename:n,sourceMap:r,breakLineCode:s,needIndent:o});l.push(i==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),c.length>0&&(l.push(`const { ${nd(c.map(v=>`${v}: _${v}`),", ")} } = ctx`),l.newline()),l.push("return "),En(l,t),l.deindent(o),l.push("}"),delete t.helpers;const{code:O,map:_}=l.context();return{ast:t,code:O,map:_?_.toJSON():void 0}};function mx(t,e={}){const i=id({},e),n=!!i.jit,r=!!i.minify,s=i.optimize==null?!0:i.optimize,c=rx(i).parse(t);return n?(s&&ax(c),r&&sn(c),{ast:c,code:""}):(ox(c,i),gx(c,i))}/*! - * core-base v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */function vx(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hi().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hi().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const Ri=[];Ri[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ri[1]={w:[1],".":[2],"[":[4],o:[7]};Ri[2]={w:[2],i:[3,0],0:[3,0]};Ri[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ri[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ri[5]={"'":[4,0],o:8,l:[5,0]};Ri[6]={'"':[4,0],o:8,l:[6,0]};const yx=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function xx(t){return yx.test(t)}function bx(t){const e=t.charCodeAt(0),i=t.charCodeAt(t.length-1);return e===i&&(e===34||e===39)?t.slice(1,-1):t}function _x(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function wx(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:xx(e)?bx(e):"*"+e}function Ex(t){const e=[];let i=-1,n=0,r=0,s,o,c,l,O,_,v;const E=[];E[0]=()=>{o===void 0?o=c:o+=c},E[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},E[2]=()=>{E[0](),r++},E[3]=()=>{if(r>0)r--,n=4,E[0]();else{if(r=0,o===void 0||(o=wx(o),o===!1))return!1;E[1]()}};function b(){const P=t[i+1];if(n===5&&P==="'"||n===6&&P==='"')return i++,c="\\"+P,E[0](),!0}for(;n!==null;)if(i++,s=t[i],!(s==="\\"&&b())){if(l=_x(s),v=Ri[n],O=v[l]||v.l||8,O===8||(n=O[0],O[1]!==void 0&&(_=E[O[1]],_&&(c=s,_()===!1))))return;if(n===7)return e}}const Tc=new Map;function Cx(t,e){return Rt(t)?t[e]:null}function Sx(t,e){if(!Rt(t))return null;let i=Tc.get(e);if(i||(i=Ex(e),i&&Tc.set(e,i)),!i)return null;const n=i.length;let r=t,s=0;for(;st,Ox=t=>"",Ax="text",Px=t=>t.length===0?"":B0(t),kx=F0;function Oc(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function Lx(t){const e=Jt(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Jt(t.named.count)||Jt(t.named.n))?Jt(t.named.count)?t.named.count:Jt(t.named.n)?t.named.n:e:e}function Mx(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Ix(t={}){const e=t.locale,i=Lx(t),n=Rt(t.pluralRules)&&bt(e)&&Vt(t.pluralRules[e])?t.pluralRules[e]:Oc,r=Rt(t.pluralRules)&&bt(e)&&Vt(t.pluralRules[e])?Oc:void 0,s=k=>k[n(i,k.length,r)],o=t.list||[],c=k=>o[k],l=t.named||{};Jt(t.pluralIndex)&&Mx(i,l);const O=k=>l[k];function _(k){const M=Vt(t.messages)?t.messages(k):Rt(t.messages)?t.messages[k]:!1;return M||(t.parent?t.parent.message(k):Ox)}const v=k=>t.modifiers?t.modifiers[k]:Tx,E=Tt(t.processor)&&Vt(t.processor.normalize)?t.processor.normalize:Px,b=Tt(t.processor)&&Vt(t.processor.interpolate)?t.processor.interpolate:kx,P=Tt(t.processor)&&bt(t.processor.type)?t.processor.type:Ax,T={list:c,named:O,plural:s,linked:(k,...M)=>{const[y,a]=M;let S="text",w="";M.length===1?Rt(y)?(w=y.modifier||w,S=y.type||S):bt(y)&&(w=y||w):M.length===2&&(bt(y)&&(w=y||w),bt(a)&&(S=a||S));const A=_(k)(T),f=S==="vnode"&&Gt(A)&&w?A[0]:A;return w?v(w)(f,S):f},message:_,type:P,interpolate:b,normalize:E,values:re({},o,l)};return T}let yr=null;function Rx(t){yr=t}function Nx(t,e,i){yr&&yr.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:i})}const Dx=jx("function:translate");function jx(t){return e=>yr&&yr.emit(t,e)}const rd=qa.__EXTEND_POINT__,Fi=Ys(rd),Fx={NOT_FOUND_KEY:rd,FALLBACK_TO_TRANSLATE:Fi(),CANNOT_FORMAT_NUMBER:Fi(),FALLBACK_TO_NUMBER_FORMAT:Fi(),CANNOT_FORMAT_DATE:Fi(),FALLBACK_TO_DATE_FORMAT:Fi(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:Fi(),__EXTEND_POINT__:Fi()},sd=St.__EXTEND_POINT__,Bi=Ys(sd),De={INVALID_ARGUMENT:sd,INVALID_DATE_ARGUMENT:Bi(),INVALID_ISO_DATE_ARGUMENT:Bi(),NOT_SUPPORT_NON_STRING_MESSAGE:Bi(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Bi(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Bi(),NOT_SUPPORT_LOCALE_TYPE:Bi(),__EXTEND_POINT__:Bi()};function Ke(t){return jn(t,null,void 0)}function Ja(t,e){return e.locale!=null?Ac(e.locale):Ac(t.locale)}let yo;function Ac(t){if(bt(t))return t;if(Vt(t)){if(t.resolvedOnce&&yo!=null)return yo;if(t.constructor.name==="Function"){const e=t();if(j0(e))throw Ke(De.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return yo=e}else throw Ke(De.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ke(De.NOT_SUPPORT_LOCALE_TYPE)}function Bx(t,e,i){return[...new Set([i,...Gt(e)?e:Rt(e)?Object.keys(e):bt(e)?[e]:[i]])]}function od(t,e,i){const n=bt(i)?i:Cn,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(n);if(!s){s=[];let o=[i];for(;Gt(o);)o=Pc(s,o,e);const c=Gt(e)||!Tt(e)?e:e.default?e.default:null;o=bt(c)?[c]:c,Gt(o)&&Pc(s,o,!1),r.__localeChainCache.set(n,s)}return s}function Pc(t,e,i){let n=!0;for(let r=0;r`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Wx(){return{upper:(t,e)=>e==="text"&&bt(t)?t.toUpperCase():e==="vnode"&&Rt(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&bt(t)?t.toLowerCase():e==="vnode"&&Rt(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&bt(t)?Lc(t):e==="vnode"&&Rt(t)&&"__v_isVNode"in t?Lc(t.children):t}}let ad;function Mc(t){ad=t}let ld;function Gx(t){ld=t}let cd;function $x(t){cd=t}let ud=null;const Xx=t=>{ud=t},Yx=()=>ud;let hd=null;const Ic=t=>{hd=t},zx=()=>hd;let Rc=0;function Kx(t={}){const e=Vt(t.onWarn)?t.onWarn:H0,i=bt(t.version)?t.version:Ux,n=bt(t.locale)||Vt(t.locale)?t.locale:Cn,r=Vt(n)?Cn:n,s=Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||bt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,o=Tt(t.messages)?t.messages:{[r]:{}},c=Tt(t.datetimeFormats)?t.datetimeFormats:{[r]:{}},l=Tt(t.numberFormats)?t.numberFormats:{[r]:{}},O=re({},t.modifiers||{},Wx()),_=t.pluralRules||{},v=Vt(t.missing)?t.missing:null,E=At(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,b=At(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,P=!!t.fallbackFormat,m=!!t.unresolving,T=Vt(t.postTranslation)?t.postTranslation:null,k=Tt(t.processor)?t.processor:null,M=At(t.warnHtmlMessage)?t.warnHtmlMessage:!0,y=!!t.escapeParameter,a=Vt(t.messageCompiler)?t.messageCompiler:ad,S=Vt(t.messageResolver)?t.messageResolver:ld||Cx,w=Vt(t.localeFallbacker)?t.localeFallbacker:cd||Bx,A=Rt(t.fallbackContext)?t.fallbackContext:void 0,f=t,u=Rt(f.__datetimeFormatters)?f.__datetimeFormatters:new Map,g=Rt(f.__numberFormatters)?f.__numberFormatters:new Map,h=Rt(f.__meta)?f.__meta:{};Rc++;const x={version:i,cid:Rc,locale:n,fallbackLocale:s,messages:o,modifiers:O,pluralRules:_,missing:v,missingWarn:E,fallbackWarn:b,fallbackFormat:P,unresolving:m,postTranslation:T,processor:k,warnHtmlMessage:M,escapeParameter:y,messageCompiler:a,messageResolver:S,localeFallbacker:w,fallbackContext:A,onWarn:e,__meta:h};return x.datetimeFormats=c,x.numberFormats=l,x.__datetimeFormatters=u,x.__numberFormatters=g,__INTLIFY_PROD_DEVTOOLS__&&Nx(x,i,h),x}function Qa(t,e,i,n,r){const{missing:s,onWarn:o}=t;if(s!==null){const c=s(t,i,e,r);return bt(c)?c:e}else return e}function Un(t,e,i){const n=t;n.__localeChainCache=new Map,t.localeFallbacker(t,i,e)}function qx(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Zx(t,e){const i=e.indexOf(t);if(i===-1)return!1;for(let n=i+1;nJx(i,t)}function Jx(t,e){const i=e.b||e.body;if((i.t||i.type)===1){const n=i,r=n.c||n.cases;return t.plural(r.reduce((s,o)=>[...s,Nc(t,o)],[]))}else return Nc(t,i)}function Nc(t,e){const i=e.s||e.static;if(i)return t.type==="text"?i:t.normalize([i]);{const n=(e.i||e.items).reduce((r,s)=>[...r,ea(t,s)],[]);return t.normalize(n)}}function ea(t,e){const i=e.t||e.type;switch(i){case 3:{const n=e;return n.v||n.value}case 9:{const n=e;return n.v||n.value}case 4:{const n=e;return t.interpolate(t.named(n.k||n.key))}case 5:{const n=e;return t.interpolate(t.list(n.i!=null?n.i:n.index))}case 6:{const n=e,r=n.m||n.modifier;return t.linked(ea(t,n.k||n.key),r?ea(t,r):void 0,t.type)}case 7:{const n=e;return n.v||n.value}case 8:{const n=e;return n.v||n.value}default:throw new Error(`unhandled node type on format message part: ${i}`)}}const fd=t=>t;let an=Object.create(null);const Sn=t=>Rt(t)&&(t.t===0||t.type===0)&&("b"in t||"body"in t);function dd(t,e={}){let i=!1;const n=e.onError||Y0;return e.onError=r=>{i=!0,n(r)},{...mx(t,e),detectError:i}}const Qx=(t,e)=>{if(!bt(t))throw Ke(De.NOT_SUPPORT_NON_STRING_MESSAGE);{At(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||fd)(t),r=an[n];if(r)return r;const{code:s,detectError:o}=dd(t,e),c=new Function(`return ${s}`)();return o?c:an[n]=c}};function tb(t,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&bt(t)){At(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||fd)(t),r=an[n];if(r)return r;const{ast:s,detectError:o}=dd(t,{...e,location:!1,jit:!0}),c=xo(s);return o?c:an[n]=c}else{const i=t.cacheKey;if(i){const n=an[i];return n||(an[i]=xo(t))}else return xo(t)}}const Dc=()=>"",Ce=t=>Vt(t);function jc(t,...e){const{fallbackFormat:i,postTranslation:n,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:c}=t,[l,O]=ia(...e),_=At(O.missingWarn)?O.missingWarn:t.missingWarn,v=At(O.fallbackWarn)?O.fallbackWarn:t.fallbackWarn,E=At(O.escapeParameter)?O.escapeParameter:t.escapeParameter,b=!!O.resolvedMessage,P=bt(O.default)||At(O.default)?At(O.default)?s?l:()=>l:O.default:i?s?l:()=>l:"",m=i||P!=="",T=Ja(t,O);E&&eb(O);let[k,M,y]=b?[l,T,c[T]||{}]:pd(t,l,T,o,v,_),a=k,S=l;if(!b&&!(bt(a)||Sn(a)||Ce(a))&&m&&(a=P,S=a),!b&&(!(bt(a)||Sn(a)||Ce(a))||!bt(M)))return r?zs:l;let w=!1;const A=()=>{w=!0},f=Ce(a)?a:gd(t,l,M,a,S,A);if(w)return a;const u=rb(t,M,y,O),g=Ix(u),h=ib(t,f,g),x=n?n(h,l):h;if(__INTLIFY_PROD_DEVTOOLS__){const d={timestamp:Date.now(),key:bt(l)?l:Ce(a)?a.key:"",locale:M||(Ce(a)?a.locale:""),format:bt(a)?a:Ce(a)?a.source:"",message:x};d.meta=re({},t.__meta,Yx()||{}),Dx(d)}return x}function eb(t){Gt(t.list)?t.list=t.list.map(e=>bt(e)?_c(e):e):Rt(t.named)&&Object.keys(t.named).forEach(e=>{bt(t.named[e])&&(t.named[e]=_c(t.named[e]))})}function pd(t,e,i,n,r,s){const{messages:o,onWarn:c,messageResolver:l,localeFallbacker:O}=t,_=O(t,n,i);let v={},E,b=null;const P="translate";for(let m=0;m<_.length&&(E=_[m],v=o[E]||{},(b=l(v,e))===null&&(b=v[e]),!(bt(b)||Sn(b)||Ce(b)));m++)if(!Zx(E,_)){const T=Qa(t,e,E,s,P);T!==e&&(b=T)}return[b,E,v]}function gd(t,e,i,n,r,s){const{messageCompiler:o,warnHtmlMessage:c}=t;if(Ce(n)){const O=n;return O.locale=O.locale||i,O.key=O.key||e,O}if(o==null){const O=()=>n;return O.locale=i,O.key=e,O}const l=o(n,nb(t,i,r,n,c,s));return l.locale=i,l.key=e,l.source=n,l}function ib(t,e,i){return e(i)}function ia(...t){const[e,i,n]=t,r={};if(!bt(e)&&!Jt(e)&&!Ce(e)&&!Sn(e))throw Ke(De.INVALID_ARGUMENT);const s=Jt(e)?String(e):(Ce(e),e);return Jt(i)?r.plural=i:bt(i)?r.default=i:Tt(i)&&!Xs(i)?r.named=i:Gt(i)&&(r.list=i),Jt(n)?r.plural=n:bt(n)?r.default=n:Tt(n)&&re(r,n),[s,r]}function nb(t,e,i,n,r,s){return{locale:e,key:i,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>I0(e,i,o)}}function rb(t,e,i,n){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:c,fallbackWarn:l,missingWarn:O,fallbackContext:_}=t,E={locale:e,modifiers:r,pluralRules:s,messages:b=>{let P=o(i,b);if(P==null&&_){const[,,m]=pd(_,b,e,c,l,O);P=o(m,b)}if(bt(P)||Sn(P)){let m=!1;const k=gd(t,b,e,P,b,()=>{m=!0});return m?Dc:k}else return Ce(P)?P:Dc}};return t.processor&&(E.processor=t.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),Jt(n.plural)&&(E.pluralIndex=n.plural),E}function Fc(t,...e){const{datetimeFormats:i,unresolving:n,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__datetimeFormatters:c}=t,[l,O,_,v]=na(...e),E=At(_.missingWarn)?_.missingWarn:t.missingWarn;At(_.fallbackWarn)?_.fallbackWarn:t.fallbackWarn;const b=!!_.part,P=Ja(t,_),m=o(t,r,P);if(!bt(l)||l==="")return new Intl.DateTimeFormat(P,v).format(O);let T={},k,M=null;const y="datetime format";for(let w=0;w{md.includes(l)?o[l]=i[l]:s[l]=i[l]}),bt(n)?s.locale=n:Tt(n)&&(o=n),Tt(r)&&(o=r),[s.key||"",c,s,o]}function Bc(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__datetimeFormatters.has(s)&&n.__datetimeFormatters.delete(s)}}function Hc(t,...e){const{numberFormats:i,unresolving:n,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:c}=t,[l,O,_,v]=ra(...e),E=At(_.missingWarn)?_.missingWarn:t.missingWarn;At(_.fallbackWarn)?_.fallbackWarn:t.fallbackWarn;const b=!!_.part,P=Ja(t,_),m=o(t,r,P);if(!bt(l)||l==="")return new Intl.NumberFormat(P,v).format(O);let T={},k,M=null;const y="number format";for(let w=0;w{vd.includes(l)?o[l]=i[l]:s[l]=i[l]}),bt(n)?s.locale=n:Tt(n)&&(o=n),Tt(r)&&(o=r),[s.key||"",c,s,o]}function Vc(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__numberFormatters.has(s)&&n.__numberFormatters.delete(s)}}vx();/*! - * vue-i18n v9.14.0 - * (c) 2024 kazuya kawaguchi - * Released under the MIT License. - */const sb="9.14.0";function ob(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(hi().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(hi().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hi().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hi().__INTLIFY_PROD_DEVTOOLS__=!1)}const yd=Fx.__EXTEND_POINT__,si=Ys(yd);si(),si(),si(),si(),si(),si(),si(),si(),si();const xd=De.__EXTEND_POINT__,ge=Ys(xd),te={UNEXPECTED_RETURN_TYPE:xd,INVALID_ARGUMENT:ge(),MUST_BE_CALL_SETUP_TOP:ge(),NOT_INSTALLED:ge(),NOT_AVAILABLE_IN_LEGACY_MODE:ge(),REQUIRED_VALUE:ge(),INVALID_VALUE:ge(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:ge(),NOT_INSTALLED_WITH_PROVIDE:ge(),UNEXPECTED_ERROR:ge(),NOT_COMPATIBLE_LEGACY_VUE_I18N:ge(),BRIDGE_SUPPORT_VUE_2_ONLY:ge(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:ge(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:ge(),__EXTEND_POINT__:ge()};function ee(t,...e){return jn(t,null,void 0)}const sa=Ii("__translateVNode"),oa=Ii("__datetimeParts"),aa=Ii("__numberParts"),bd=Ii("__setPluralRules"),_d=Ii("__injectWithOption"),la=Ii("__dispose");function xr(t){if(!Rt(t))return t;for(const e in t)if(bs(t,e))if(!e.includes("."))Rt(t[e])&&xr(t[e]);else{const i=e.split("."),n=i.length-1;let r=t,s=!1;for(let o=0;o{if("locale"in c&&"resource"in c){const{locale:l,resource:O}=c;l?(o[l]=o[l]||{},ts(O,o[l])):ts(O,o)}else bt(c)&&ts(JSON.parse(c),o)}),r==null&&s)for(const c in o)bs(o,c)&&xr(o[c]);return o}function wd(t){return t.type}function Ed(t,e,i){let n=Rt(e.messages)?e.messages:{};"__i18nGlobal"in i&&(n=Ks(t.locale.value,{messages:n,__i18n:i.__i18nGlobal}));const r=Object.keys(n);r.length&&r.forEach(s=>{t.mergeLocaleMessage(s,n[s])});{if(Rt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Rt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function Uc(t){return Ft(fi,null,t,0)}const Wc="__INTLIFY_META__",Gc=()=>[],ab=()=>!1;let $c=0;function Xc(t){return(e,i,n,r)=>t(i,n,ie()||void 0,r)}const lb=()=>{const t=ie();let e=null;return t&&(e=wd(t)[Wc])?{[Wc]:e}:null};function tl(t={},e){const{__root:i,__injectWithOption:n}=t,r=i===void 0,s=t.flatJson,o=xs?Yt:In,c=!!t.translateExistCompatible;let l=At(t.inheritLocale)?t.inheritLocale:!0;const O=o(i&&l?i.locale.value:bt(t.locale)?t.locale:Cn),_=o(i&&l?i.fallbackLocale.value:bt(t.fallbackLocale)||Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:O.value),v=o(Ks(O.value,t)),E=o(Tt(t.datetimeFormats)?t.datetimeFormats:{[O.value]:{}}),b=o(Tt(t.numberFormats)?t.numberFormats:{[O.value]:{}});let P=i?i.missingWarn:At(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,m=i?i.fallbackWarn:At(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,T=i?i.fallbackRoot:At(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,M=Vt(t.missing)?t.missing:null,y=Vt(t.missing)?Xc(t.missing):null,a=Vt(t.postTranslation)?t.postTranslation:null,S=i?i.warnHtmlMessage:At(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const A=i?i.modifiers:Tt(t.modifiers)?t.modifiers:{};let f=t.pluralRules||i&&i.pluralRules,u;u=(()=>{r&&Ic(null);const nt={version:sb,locale:O.value,fallbackLocale:_.value,messages:v.value,modifiers:A,pluralRules:f,missing:y===null?void 0:y,missingWarn:P,fallbackWarn:m,fallbackFormat:k,unresolving:!0,postTranslation:a===null?void 0:a,warnHtmlMessage:S,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};nt.datetimeFormats=E.value,nt.numberFormats=b.value,nt.__datetimeFormatters=Tt(u)?u.__datetimeFormatters:void 0,nt.__numberFormatters=Tt(u)?u.__numberFormatters:void 0;const at=Kx(nt);return r&&Ic(at),at})(),Un(u,O.value,_.value);function h(){return[O.value,_.value,v.value,E.value,b.value]}const x=$t({get:()=>O.value,set:nt=>{O.value=nt,u.locale=O.value}}),d=$t({get:()=>_.value,set:nt=>{_.value=nt,u.fallbackLocale=_.value,Un(u,O.value,nt)}}),p=$t(()=>v.value),R=$t(()=>E.value),I=$t(()=>b.value);function j(){return Vt(a)?a:null}function $(nt){a=nt,u.postTranslation=nt}function et(){return M}function it(nt){nt!==null&&(y=Xc(nt)),M=nt,u.missing=y}const H=(nt,at,ut,ft,gt,xt)=>{h();let vt;try{__INTLIFY_PROD_DEVTOOLS__,r||(u.fallbackContext=i?zx():void 0),vt=nt(u)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(u.fallbackContext=void 0)}if(ut!=="translate exists"&&Jt(vt)&&vt===zs||ut==="translate exists"&&!vt){const[dt,ht]=at();return i&&T?ft(i):gt(dt)}else{if(xt(vt))return vt;throw ee(te.UNEXPECTED_RETURN_TYPE)}};function z(...nt){return H(at=>Reflect.apply(jc,null,[at,...nt]),()=>ia(...nt),"translate",at=>Reflect.apply(at.t,at,[...nt]),at=>at,at=>bt(at))}function L(...nt){const[at,ut,ft]=nt;if(ft&&!Rt(ft))throw ee(te.INVALID_ARGUMENT);return z(at,ut,re({resolvedMessage:!0},ft||{}))}function N(...nt){return H(at=>Reflect.apply(Fc,null,[at,...nt]),()=>na(...nt),"datetime format",at=>Reflect.apply(at.d,at,[...nt]),()=>kc,at=>bt(at))}function V(...nt){return H(at=>Reflect.apply(Hc,null,[at,...nt]),()=>ra(...nt),"number format",at=>Reflect.apply(at.n,at,[...nt]),()=>kc,at=>bt(at))}function K(nt){return nt.map(at=>bt(at)||Jt(at)||At(at)?Uc(String(at)):at)}const J={normalize:K,interpolate:nt=>nt,type:"vnode"};function C(...nt){return H(at=>{let ut;const ft=at;try{ft.processor=J,ut=Reflect.apply(jc,null,[ft,...nt])}finally{ft.processor=null}return ut},()=>ia(...nt),"translate",at=>at[sa](...nt),at=>[Uc(at)],at=>Gt(at))}function U(...nt){return H(at=>Reflect.apply(Hc,null,[at,...nt]),()=>ra(...nt),"number format",at=>at[aa](...nt),Gc,at=>bt(at)||Gt(at))}function B(...nt){return H(at=>Reflect.apply(Fc,null,[at,...nt]),()=>na(...nt),"datetime format",at=>at[oa](...nt),Gc,at=>bt(at)||Gt(at))}function tt(nt){f=nt,u.pluralRules=f}function D(nt,at){return H(()=>{if(!nt)return!1;const ut=bt(at)?at:O.value,ft=st(ut),gt=u.messageResolver(ft,nt);return c?gt!=null:Sn(gt)||Ce(gt)||bt(gt)},()=>[nt],"translate exists",ut=>Reflect.apply(ut.te,ut,[nt,at]),ab,ut=>At(ut))}function F(nt){let at=null;const ut=od(u,_.value,O.value);for(let ft=0;ft{l&&(O.value=nt,u.locale=nt,Un(u,O.value,_.value))}),le(i.fallbackLocale,nt=>{l&&(_.value=nt,u.fallbackLocale=nt,Un(u,O.value,_.value))}));const rt={id:$c,locale:x,fallbackLocale:d,get inheritLocale(){return l},set inheritLocale(nt){l=nt,nt&&i&&(O.value=i.locale.value,_.value=i.fallbackLocale.value,Un(u,O.value,_.value))},get availableLocales(){return Object.keys(v.value).sort()},messages:p,get modifiers(){return A},get pluralRules(){return f||{}},get isGlobal(){return r},get missingWarn(){return P},set missingWarn(nt){P=nt,u.missingWarn=P},get fallbackWarn(){return m},set fallbackWarn(nt){m=nt,u.fallbackWarn=m},get fallbackRoot(){return T},set fallbackRoot(nt){T=nt},get fallbackFormat(){return k},set fallbackFormat(nt){k=nt,u.fallbackFormat=k},get warnHtmlMessage(){return S},set warnHtmlMessage(nt){S=nt,u.warnHtmlMessage=nt},get escapeParameter(){return w},set escapeParameter(nt){w=nt,u.escapeParameter=nt},t:z,getLocaleMessage:st,setLocaleMessage:ot,mergeLocaleMessage:lt,getPostTranslationHandler:j,setPostTranslationHandler:$,getMissingHandler:et,setMissingHandler:it,[bd]:tt};return rt.datetimeFormats=R,rt.numberFormats=I,rt.rt=L,rt.te=D,rt.tm=X,rt.d=N,rt.n=V,rt.getDateTimeFormat=ct,rt.setDateTimeFormat=q,rt.mergeDateTimeFormat=Y,rt.getNumberFormat=Z,rt.setNumberFormat=W,rt.mergeNumberFormat=Q,rt[_d]=n,rt[sa]=C,rt[oa]=B,rt[aa]=U,rt}function cb(t){const e=bt(t.locale)?t.locale:Cn,i=bt(t.fallbackLocale)||Gt(t.fallbackLocale)||Tt(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,n=Vt(t.missing)?t.missing:void 0,r=At(t.silentTranslationWarn)||ki(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=At(t.silentFallbackWarn)||ki(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=At(t.fallbackRoot)?t.fallbackRoot:!0,c=!!t.formatFallbackMessages,l=Tt(t.modifiers)?t.modifiers:{},O=t.pluralizationRules,_=Vt(t.postTranslation)?t.postTranslation:void 0,v=bt(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,E=!!t.escapeParameterHtml,b=At(t.sync)?t.sync:!0;let P=t.messages;if(Tt(t.sharedMessages)){const w=t.sharedMessages;P=Object.keys(w).reduce((f,u)=>{const g=f[u]||(f[u]={});return re(g,w[u]),f},P||{})}const{__i18n:m,__root:T,__injectWithOption:k}=t,M=t.datetimeFormats,y=t.numberFormats,a=t.flatJson,S=t.translateExistCompatible;return{locale:e,fallbackLocale:i,messages:P,flatJson:a,datetimeFormats:M,numberFormats:y,missing:n,missingWarn:r,fallbackWarn:s,fallbackRoot:o,fallbackFormat:c,modifiers:l,pluralRules:O,postTranslation:_,warnHtmlMessage:v,escapeParameter:E,messageResolver:t.messageResolver,inheritLocale:b,translateExistCompatible:S,__i18n:m,__root:T,__injectWithOption:k}}function ca(t={},e){{const i=tl(cb(t)),{__extender:n}=t,r={id:i.id,get locale(){return i.locale.value},set locale(s){i.locale.value=s},get fallbackLocale(){return i.fallbackLocale.value},set fallbackLocale(s){i.fallbackLocale.value=s},get messages(){return i.messages.value},get datetimeFormats(){return i.datetimeFormats.value},get numberFormats(){return i.numberFormats.value},get availableLocales(){return i.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return i.getMissingHandler()},set missing(s){i.setMissingHandler(s)},get silentTranslationWarn(){return At(i.missingWarn)?!i.missingWarn:i.missingWarn},set silentTranslationWarn(s){i.missingWarn=At(s)?!s:s},get silentFallbackWarn(){return At(i.fallbackWarn)?!i.fallbackWarn:i.fallbackWarn},set silentFallbackWarn(s){i.fallbackWarn=At(s)?!s:s},get modifiers(){return i.modifiers},get formatFallbackMessages(){return i.fallbackFormat},set formatFallbackMessages(s){i.fallbackFormat=s},get postTranslation(){return i.getPostTranslationHandler()},set postTranslation(s){i.setPostTranslationHandler(s)},get sync(){return i.inheritLocale},set sync(s){i.inheritLocale=s},get warnHtmlInMessage(){return i.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){i.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return i.escapeParameter},set escapeParameterHtml(s){i.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return i.pluralRules||{}},__composer:i,t(...s){const[o,c,l]=s,O={};let _=null,v=null;if(!bt(o))throw ee(te.INVALID_ARGUMENT);const E=o;return bt(c)?O.locale=c:Gt(c)?_=c:Tt(c)&&(v=c),Gt(l)?_=l:Tt(l)&&(v=l),Reflect.apply(i.t,i,[E,_||v||{},O])},rt(...s){return Reflect.apply(i.rt,i,[...s])},tc(...s){const[o,c,l]=s,O={plural:1};let _=null,v=null;if(!bt(o))throw ee(te.INVALID_ARGUMENT);const E=o;return bt(c)?O.locale=c:Jt(c)?O.plural=c:Gt(c)?_=c:Tt(c)&&(v=c),bt(l)?O.locale=l:Gt(l)?_=l:Tt(l)&&(v=l),Reflect.apply(i.t,i,[E,_||v||{},O])},te(s,o){return i.te(s,o)},tm(s){return i.tm(s)},getLocaleMessage(s){return i.getLocaleMessage(s)},setLocaleMessage(s,o){i.setLocaleMessage(s,o)},mergeLocaleMessage(s,o){i.mergeLocaleMessage(s,o)},d(...s){return Reflect.apply(i.d,i,[...s])},getDateTimeFormat(s){return i.getDateTimeFormat(s)},setDateTimeFormat(s,o){i.setDateTimeFormat(s,o)},mergeDateTimeFormat(s,o){i.mergeDateTimeFormat(s,o)},n(...s){return Reflect.apply(i.n,i,[...s])},getNumberFormat(s){return i.getNumberFormat(s)},setNumberFormat(s,o){i.setNumberFormat(s,o)},mergeNumberFormat(s,o){i.mergeNumberFormat(s,o)},getChoiceIndex(s,o){return-1}};return r.__extender=n,r}}const el={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function ub({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((n,r)=>[...n,...r.type===zt?r.children:[r]],[]):e.reduce((i,n)=>{const r=t[n];return r&&(i[n]=r()),i},{})}function Cd(t){return zt}const hb=Ue({name:"i18n-t",props:re({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Jt(t)||!isNaN(t)}},el),setup(t,e){const{slots:i,attrs:n}=e,r=t.i18n||il({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(i).filter(v=>v!=="_"),o={};t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=bt(t.plural)?+t.plural:t.plural);const c=ub(e,s),l=r[sa](t.keypath,c,o),O=re({},n),_=bt(t.tag)||Rt(t.tag)?t.tag:Cd();return Se(_,O,l)}}}),Yc=hb;function fb(t){return Gt(t)&&!bt(t[0])}function Sd(t,e,i,n){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let c={};t.locale&&(o.locale=t.locale),bt(t.format)?o.key=t.format:Rt(t.format)&&(bt(t.format.key)&&(o.key=t.format.key),c=Object.keys(t.format).reduce((E,b)=>i.includes(b)?re({},E,{[b]:t.format[b]}):E,{}));const l=n(t.value,o,c);let O=[o.key];Gt(l)?O=l.map((E,b)=>{const P=r[E.type],m=P?P({[E.type]:E.value,index:b,parts:l}):[E.value];return fb(m)&&(m[0].key=`${E.type}-${b}`),m}):bt(l)&&(O=[l]);const _=re({},s),v=bt(t.tag)||Rt(t.tag)?t.tag:Cd();return Se(v,_,O)}}const db=Ue({name:"i18n-n",props:re({value:{type:Number,required:!0},format:{type:[String,Object]}},el),setup(t,e){const i=t.i18n||il({useScope:t.scope,__useComponent:!0});return Sd(t,e,vd,(...n)=>i[aa](...n))}}),zc=db,pb=Ue({name:"i18n-d",props:re({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},el),setup(t,e){const i=t.i18n||il({useScope:t.scope,__useComponent:!0});return Sd(t,e,md,(...n)=>i[oa](...n))}}),Kc=pb;function gb(t,e){const i=t;if(t.mode==="composition")return i.__getInstance(e)||t.global;{const n=i.__getInstance(e);return n!=null?n.__composer:t.global.__composer}}function mb(t){const e=o=>{const{instance:c,modifiers:l,value:O}=o;if(!c||!c.$)throw ee(te.UNEXPECTED_ERROR);const _=gb(t,c.$),v=qc(O);return[Reflect.apply(_.t,_,[...Zc(v)]),_]};return{created:(o,c)=>{const[l,O]=e(c);xs&&t.global===O&&(o.__i18nWatcher=le(O.locale,()=>{c.instance&&c.instance.$forceUpdate()})),o.__composer=O,o.textContent=l},unmounted:o=>{xs&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:c})=>{if(o.__composer){const l=o.__composer,O=qc(c);o.textContent=Reflect.apply(l.t,l,[...Zc(O)])}},getSSRProps:o=>{const[c]=e(o);return{textContent:c}}}}function qc(t){if(bt(t))return{path:t};if(Tt(t)){if(!("path"in t))throw ee(te.REQUIRED_VALUE,"path");return t}else throw ee(te.INVALID_VALUE)}function Zc(t){const{path:e,locale:i,args:n,choice:r,plural:s}=t,o={},c=n||{};return bt(i)&&(o.locale=i),Jt(r)&&(o.plural=r),Jt(s)&&(o.plural=s),[e,c,o]}function vb(t,e,...i){const n=Tt(i[0])?i[0]:{},r=!!n.useI18nComponentName;(At(n.globalInstall)?n.globalInstall:!0)&&([r?"i18n":Yc.name,"I18nT"].forEach(o=>t.component(o,Yc)),[zc.name,"I18nN"].forEach(o=>t.component(o,zc)),[Kc.name,"I18nD"].forEach(o=>t.component(o,Kc))),t.directive("t",mb(e))}function yb(t,e,i){return{beforeCreate(){const n=ie();if(!n)throw ee(te.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=e,this===this.$root)this.$i18n=Jc(t,s);else{s.__injectWithOption=!0,s.__extender=i.__vueI18nExtend,this.$i18n=ca(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=Jc(t,r);else{this.$i18n=ca({__i18n:r.__i18n,__injectWithOption:!0,__extender:i.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;r.__i18nGlobal&&Ed(e,r,r),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),i.__setInstance(n,this.$i18n)},mounted(){},unmounted(){const n=ie();if(!n)throw ee(te.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),i.__deleteInstance(n),delete this.$i18n}}}function Jc(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[bd](e.pluralizationRules||t.pluralizationRules);const i=Ks(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(i).forEach(n=>t.mergeLocaleMessage(n,i[n])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(n=>t.mergeDateTimeFormat(n,e.datetimeFormats[n])),e.numberFormats&&Object.keys(e.numberFormats).forEach(n=>t.mergeNumberFormat(n,e.numberFormats[n])),t}const xb=Ii("global-vue-i18n");function bb(t={},e){const i=__VUE_I18N_LEGACY_API__&&At(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=At(t.globalInjection)?t.globalInjection:!0,r=__VUE_I18N_LEGACY_API__&&i?!!t.allowComposition:!0,s=new Map,[o,c]=_b(t,i),l=Ii("");function O(E){return s.get(E)||null}function _(E,b){s.set(E,b)}function v(E){s.delete(E)}{const E={get mode(){return __VUE_I18N_LEGACY_API__&&i?"legacy":"composition"},get allowComposition(){return r},async install(b,...P){if(b.__VUE_I18N_SYMBOL__=l,b.provide(b.__VUE_I18N_SYMBOL__,E),Tt(P[0])){const k=P[0];E.__composerExtend=k.__composerExtend,E.__vueI18nExtend=k.__vueI18nExtend}let m=null;!i&&n&&(m=kb(b,E.global)),__VUE_I18N_FULL_INSTALL__&&vb(b,E,...P),__VUE_I18N_LEGACY_API__&&i&&b.mixin(yb(c,c.__composer,E));const T=b.unmount;b.unmount=()=>{m&&m(),E.dispose(),T()}},get global(){return c},dispose(){o.stop()},__instances:s,__getInstance:O,__setInstance:_,__deleteInstance:v};return E}}function il(t={}){const e=ie();if(e==null)throw ee(te.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw ee(te.NOT_INSTALLED);const i=wb(e),n=Cb(i),r=wd(e),s=Eb(t,r);if(__VUE_I18N_LEGACY_API__&&i.mode==="legacy"&&!t.__useComponent){if(!i.allowComposition)throw ee(te.NOT_AVAILABLE_IN_LEGACY_MODE);return Ab(e,s,n,t)}if(s==="global")return Ed(n,t,r),n;if(s==="parent"){let l=Sb(i,e,t.__useComponent);return l==null&&(l=n),l}const o=i;let c=o.__getInstance(e);if(c==null){const l=re({},t);"__i18n"in r&&(l.__i18n=r.__i18n),n&&(l.__root=n),c=tl(l),o.__composerExtend&&(c[la]=o.__composerExtend(c)),Ob(o,e,c),o.__setInstance(e,c)}return c}function _b(t,e,i){const n=Vu();{const r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>ca(t)):n.run(()=>tl(t));if(r==null)throw ee(te.UNEXPECTED_ERROR);return[n,r]}}function wb(t){{const e=Oe(t.isCE?xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw ee(t.isCE?te.NOT_INSTALLED_WITH_PROVIDE:te.UNEXPECTED_ERROR);return e}}function Eb(t,e){return Xs(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Cb(t){return t.mode==="composition"?t.global:t.global.__composer}function Sb(t,e,i=!1){let n=null;const r=e.root;let s=Tb(e,i);for(;s!=null;){const o=t;if(t.mode==="composition")n=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const c=o.__getInstance(s);c!=null&&(n=c.__composer,i&&n&&!n[_d]&&(n=null))}if(n!=null||r===s)break;s=s.parent}return n}function Tb(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function Ob(t,e,i){gi(()=>{},e),Dn(()=>{const n=i;t.__deleteInstance(e);const r=n[la];r&&(r(),delete n[la])},e)}function Ab(t,e,i,n={}){const r=e==="local",s=In(null);if(r&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw ee(te.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=At(n.inheritLocale)?n.inheritLocale:!bt(n.locale),c=Yt(!r||o?i.locale.value:bt(n.locale)?n.locale:Cn),l=Yt(!r||o?i.fallbackLocale.value:bt(n.fallbackLocale)||Gt(n.fallbackLocale)||Tt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:c.value),O=Yt(Ks(c.value,n)),_=Yt(Tt(n.datetimeFormats)?n.datetimeFormats:{[c.value]:{}}),v=Yt(Tt(n.numberFormats)?n.numberFormats:{[c.value]:{}}),E=r?i.missingWarn:At(n.missingWarn)||ki(n.missingWarn)?n.missingWarn:!0,b=r?i.fallbackWarn:At(n.fallbackWarn)||ki(n.fallbackWarn)?n.fallbackWarn:!0,P=r?i.fallbackRoot:At(n.fallbackRoot)?n.fallbackRoot:!0,m=!!n.fallbackFormat,T=Vt(n.missing)?n.missing:null,k=Vt(n.postTranslation)?n.postTranslation:null,M=r?i.warnHtmlMessage:At(n.warnHtmlMessage)?n.warnHtmlMessage:!0,y=!!n.escapeParameter,a=r?i.modifiers:Tt(n.modifiers)?n.modifiers:{},S=n.pluralRules||r&&i.pluralRules;function w(){return[c.value,l.value,O.value,_.value,v.value]}const A=$t({get:()=>s.value?s.value.locale.value:c.value,set:F=>{s.value&&(s.value.locale.value=F),c.value=F}}),f=$t({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:F=>{s.value&&(s.value.fallbackLocale.value=F),l.value=F}}),u=$t(()=>s.value?s.value.messages.value:O.value),g=$t(()=>_.value),h=$t(()=>v.value);function x(){return s.value?s.value.getPostTranslationHandler():k}function d(F){s.value&&s.value.setPostTranslationHandler(F)}function p(){return s.value?s.value.getMissingHandler():T}function R(F){s.value&&s.value.setMissingHandler(F)}function I(F){return w(),F()}function j(...F){return s.value?I(()=>Reflect.apply(s.value.t,null,[...F])):I(()=>"")}function $(...F){return s.value?Reflect.apply(s.value.rt,null,[...F]):""}function et(...F){return s.value?I(()=>Reflect.apply(s.value.d,null,[...F])):I(()=>"")}function it(...F){return s.value?I(()=>Reflect.apply(s.value.n,null,[...F])):I(()=>"")}function H(F){return s.value?s.value.tm(F):{}}function z(F,X){return s.value?s.value.te(F,X):!1}function L(F){return s.value?s.value.getLocaleMessage(F):{}}function N(F,X){s.value&&(s.value.setLocaleMessage(F,X),O.value[F]=X)}function V(F,X){s.value&&s.value.mergeLocaleMessage(F,X)}function K(F){return s.value?s.value.getDateTimeFormat(F):{}}function G(F,X){s.value&&(s.value.setDateTimeFormat(F,X),_.value[F]=X)}function J(F,X){s.value&&s.value.mergeDateTimeFormat(F,X)}function C(F){return s.value?s.value.getNumberFormat(F):{}}function U(F,X){s.value&&(s.value.setNumberFormat(F,X),v.value[F]=X)}function B(F,X){s.value&&s.value.mergeNumberFormat(F,X)}const tt={get id(){return s.value?s.value.id:-1},locale:A,fallbackLocale:f,messages:u,datetimeFormats:g,numberFormats:h,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(F){s.value&&(s.value.inheritLocale=F)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(O.value)},get modifiers(){return s.value?s.value.modifiers:a},get pluralRules(){return s.value?s.value.pluralRules:S},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:E},set missingWarn(F){s.value&&(s.value.missingWarn=F)},get fallbackWarn(){return s.value?s.value.fallbackWarn:b},set fallbackWarn(F){s.value&&(s.value.missingWarn=F)},get fallbackRoot(){return s.value?s.value.fallbackRoot:P},set fallbackRoot(F){s.value&&(s.value.fallbackRoot=F)},get fallbackFormat(){return s.value?s.value.fallbackFormat:m},set fallbackFormat(F){s.value&&(s.value.fallbackFormat=F)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:M},set warnHtmlMessage(F){s.value&&(s.value.warnHtmlMessage=F)},get escapeParameter(){return s.value?s.value.escapeParameter:y},set escapeParameter(F){s.value&&(s.value.escapeParameter=F)},t:j,getPostTranslationHandler:x,setPostTranslationHandler:d,getMissingHandler:p,setMissingHandler:R,rt:$,d:et,n:it,tm:H,te:z,getLocaleMessage:L,setLocaleMessage:N,mergeLocaleMessage:V,getDateTimeFormat:K,setDateTimeFormat:G,mergeDateTimeFormat:J,getNumberFormat:C,setNumberFormat:U,mergeNumberFormat:B};function D(F){F.locale.value=c.value,F.fallbackLocale.value=l.value,Object.keys(O.value).forEach(X=>{F.mergeLocaleMessage(X,O.value[X])}),Object.keys(_.value).forEach(X=>{F.mergeDateTimeFormat(X,_.value[X])}),Object.keys(v.value).forEach(X=>{F.mergeNumberFormat(X,v.value[X])}),F.escapeParameter=y,F.fallbackFormat=m,F.fallbackRoot=P,F.fallbackWarn=b,F.missingWarn=E,F.warnHtmlMessage=M}return Ma(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw ee(te.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const F=s.value=t.proxy.$i18n.__composer;e==="global"?(c.value=F.locale.value,l.value=F.fallbackLocale.value,O.value=F.messages.value,_.value=F.datetimeFormats.value,v.value=F.numberFormats.value):r&&D(F)}),tt}const Pb=["locale","fallbackLocale","availableLocales"],Qc=["t","rt","d","n","tm","te"];function kb(t,e){const i=Object.create(null);return Pb.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw ee(te.UNEXPECTED_ERROR);const o=Dt(s.value)?{get(){return s.value.value},set(c){s.value.value=c}}:{get(){return s.get&&s.get()}};Object.defineProperty(i,r,o)}),t.config.globalProperties.$i18n=i,Qc.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw ee(te.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,s)}),()=>{delete t.config.globalProperties.$i18n,Qc.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}ob();__INTLIFY_JIT_COMPILATION__?Mc(tb):Mc(Qx);Gx(Sx);$x(od);if(__INTLIFY_PROD_DEVTOOLS__){const t=hi();t.__INTLIFY__=!0,Rx(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Lb=[{key:"chapters.title",enValue:"Chapters",enValid:"1",frValue:"Chapitres",frValid:"1"},{key:"chapters.return",enValue:"Return to top",enValid:"1",frValue:"Retournez en haut",frValid:"1"},{key:"chapters.menu",enValue:"Toggle menu",enValid:"1",frValue:"Menu bascule",frValid:"0"},{key:"chapters.menu.dropdown",enValue:"Toggle dropdown menu",enValid:"1",frValue:"Basculer le menu déroulant",frValid:"0"},{key:"chapters.untitled",enValue:"Untitled Slide",enValid:"1",frValue:"Diapositive sans titre",frValid:"0"},{key:"layer.loading",enValue:"The layer is loading...",enValid:"1",frValue:"La couche est en cours de téléchargement...",frValid:"1"},{key:"scrollguard.desc",enValue:"Use ctrl + scroll to zoom the map",enValid:"1",frValue:"Utilisez les touches Ctrl et + pour faire un zoom de la carte",frValid:"1"},{key:"story.date",enValue:"Date modified:",enValid:"1",frValue:"Date de modification:",frValid:"1"},{key:"story.error",enValue:"An error occurred while loading this Storylines product. See developer console for more information.",enValid:"1",frValue:"Une erreur est survenue pendant le chargement ce synopsis produit. Voir la console du promoteur pour obtenir de plus amples renseignements.",frValid:"1"},{key:"image.fullscreen",enValue:"Full Screen",enValid:"1",frValue:"Plein Écran",frValid:"1"},{key:"timeslider.expand",enValue:"Expand",enValid:"1",frValue:"Développer",frValid:"1"},{key:"timeslider.minimize",enValue:"Minimize",enValid:"1",frValue:"Réduire",frValid:"1"},{key:"timeslider.play",enValue:"Play",enValid:"1",frValue:"Lire",frValid:"0"},{key:"timeslider.pause",enValue:"Pause",enValid:"1",frValue:"Pause",frValid:"0"},{key:"fullscreen.activate",enValue:"Enter Fullscreen",enValid:"1",frValue:"Entrer en plein écran",frValid:"0"},{key:"fullscreen.deactivate",enValue:"Exit Fullscreen",enValid:"1",frValue:"Sortie plein écran",frValid:"0"},{key:"dynamic.back",enValue:"Back",enValid:"1",frValue:"Retour",frValid:"0"},{key:"video.transcript",enValue:"Transcript",enValid:"1",frValue:"Transcription",frValid:"0"},{key:"chart.viewFullscreen",enValue:"View in full screen",enValid:"1",frValue:"Plein Écran",frValid:"1"},{key:"chart.printChart",enValue:"Print chart",enValid:"1",frValue:"Imprimer",frValid:"1"},{key:"chart.downloadPNG",enValue:"Download PNG",enValid:"1",frValue:"Télécharger PNG",frValid:"1"},{key:"chart.downloadJPEG",enValue:"Download JPEG",enValid:"1",frValue:"Télécharger JPEG",frValid:"1"},{key:"chart.downloadPDF",enValue:"Download PDF",enValid:"1",frValue:"Télécharger PDF",frValid:"1"},{key:"chart.downloadSVG",enValue:"Download SVG",enValid:"1",frValue:"Télécharger SVG",frValid:"1"},{key:"chart.downloadCSV",enValue:"Download CSV",enValid:"1",frValue:"Télécharger CSV",frValid:"1"},{key:"chart.downloadXLS",enValue:"Download XLS",enValid:"1",frValue:"Télécharger XLS",frValid:"1"},{key:"chart.viewData",enValue:"View data table",enValid:"1",frValue:"Afficher le tableau de données",frValid:"1"}],Mb=document.documentElement.getAttribute("lang");function Ib(t){return t.reduce((e,i)=>(e.en[i.key]=i.enValue,e.fr[i.key]=i.frValue,e),{en:{},fr:{}})}const Rb=bb({legacy:!1,locale:Mb||void 0,fallbackLocale:"en",globalInjection:!0,messages:Ib(Lb)});/*! - * vue-tippy v6.4.4 - * (c) 2024 - * @license MIT - */var xe="top",Le="bottom",Me="right",be="left",nl="auto",kr=[xe,Le,Me,be],Tn="start",br="end",Nb="clippingParents",Td="viewport",Wn="popper",Db="reference",tu=kr.reduce(function(t,e){return t.concat([e+"-"+Tn,e+"-"+br])},[]),Od=[].concat(kr,[nl]).reduce(function(t,e){return t.concat([e,e+"-"+Tn,e+"-"+br])},[]),jb="beforeRead",Fb="read",Bb="afterRead",Hb="beforeMain",Vb="main",Ub="afterMain",Wb="beforeWrite",Gb="write",$b="afterWrite",Xb=[jb,Fb,Bb,Hb,Vb,Ub,Wb,Gb,$b];function ti(t){return t?(t.nodeName||"").toLowerCase():null}function We(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function On(t){var e=We(t).Element;return t instanceof e||t instanceof Element}function Pe(t){var e=We(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Ad(t){if(typeof ShadowRoot>"u")return!1;var e=We(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yb(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var n=e.styles[i]||{},r=e.attributes[i]||{},s=e.elements[i];!Pe(s)||!ti(s)||(Object.assign(s.style,n),Object.keys(r).forEach(function(o){var c=r[o];c===!1?s.removeAttribute(o):s.setAttribute(o,c===!0?"":c)}))})}function zb(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(n){var r=e.elements[n],s=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),c=o.reduce(function(l,O){return l[O]="",l},{});!Pe(r)||!ti(r)||(Object.assign(r.style,c),Object.keys(s).forEach(function(l){r.removeAttribute(l)}))})}}var Pd={name:"applyStyles",enabled:!0,phase:"write",fn:Yb,effect:zb,requires:["computeStyles"]};function Ze(t){return t.split("-")[0]}var $i=Math.max,ws=Math.min,An=Math.round;function Pn(t,e){e===void 0&&(e=!1);var i=t.getBoundingClientRect(),n=1,r=1;if(Pe(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(n=An(i.width)/o||1),s>0&&(r=An(i.height)/s||1)}return{width:i.width/n,height:i.height/r,top:i.top/r,right:i.right/n,bottom:i.bottom/r,left:i.left/n,x:i.left/n,y:i.top/r}}function rl(t){var e=Pn(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function kd(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ad(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ei(t){return We(t).getComputedStyle(t)}function Kb(t){return["table","td","th"].indexOf(ti(t))>=0}function Ni(t){return((On(t)?t.ownerDocument:t.document)||window.document).documentElement}function qs(t){return ti(t)==="html"?t:t.assignedSlot||t.parentNode||(Ad(t)?t.host:null)||Ni(t)}function eu(t){return!Pe(t)||ei(t).position==="fixed"?null:t.offsetParent}function qb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&Pe(t)){var n=ei(t);if(n.position==="fixed")return null}for(var r=qs(t);Pe(r)&&["html","body"].indexOf(ti(r))<0;){var s=ei(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Lr(t){for(var e=We(t),i=eu(t);i&&Kb(i)&&ei(i).position==="static";)i=eu(i);return i&&(ti(i)==="html"||ti(i)==="body"&&ei(i).position==="static")?e:i||qb(t)||e}function sl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function rr(t,e,i){return $i(t,ws(e,i))}function Zb(t,e,i){var n=rr(t,e,i);return n>i?i:n}function Ld(){return{top:0,right:0,bottom:0,left:0}}function Md(t){return Object.assign({},Ld(),t)}function Id(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Jb=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Md(typeof e!="number"?e:Id(e,kr))};function Qb(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,c=Ze(i.placement),l=sl(c),O=[be,Me].indexOf(c)>=0,_=O?"height":"width";if(!(!s||!o)){var v=Jb(r.padding,i),E=rl(s),b=l==="y"?xe:be,P=l==="y"?Le:Me,m=i.rects.reference[_]+i.rects.reference[l]-o[l]-i.rects.popper[_],T=o[l]-i.rects.reference[l],k=Lr(s),M=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,y=m/2-T/2,a=v[b],S=M-E[_]-v[P],w=M/2-E[_]/2+y,A=rr(a,w,S),f=l;i.modifiersData[n]=(e={},e[f]=A,e.centerOffset=A-w,e)}}function t_(t){var e=t.state,i=t.options,n=i.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||kd(e.elements.popper,r)&&(e.elements.arrow=r))}var e_={name:"arrow",enabled:!0,phase:"main",fn:Qb,effect:t_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kn(t){return t.split("-")[1]}var i_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function n_(t){var e=t.x,i=t.y,n=window,r=n.devicePixelRatio||1;return{x:An(e*r)/r||0,y:An(i*r)/r||0}}function iu(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,c=t.position,l=t.gpuAcceleration,O=t.adaptive,_=t.roundOffsets,v=t.isFixed,E=_===!0?n_(o):typeof _=="function"?_(o):o,b=E.x,P=b===void 0?0:b,m=E.y,T=m===void 0?0:m,k=o.hasOwnProperty("x"),M=o.hasOwnProperty("y"),y=be,a=xe,S=window;if(O){var w=Lr(i),A="clientHeight",f="clientWidth";if(w===We(i)&&(w=Ni(i),ei(w).position!=="static"&&c==="absolute"&&(A="scrollHeight",f="scrollWidth")),w=w,r===xe||(r===be||r===Me)&&s===br){a=Le;var u=v&&S.visualViewport?S.visualViewport.height:w[A];T-=u-n.height,T*=l?1:-1}if(r===be||(r===xe||r===Le)&&s===br){y=Me;var g=v&&S.visualViewport?S.visualViewport.width:w[f];P-=g-n.width,P*=l?1:-1}}var h=Object.assign({position:c},O&&i_);if(l){var x;return Object.assign({},h,(x={},x[a]=M?"0":"",x[y]=k?"0":"",x.transform=(S.devicePixelRatio||1)<=1?"translate("+P+"px, "+T+"px)":"translate3d("+P+"px, "+T+"px, 0)",x))}return Object.assign({},h,(e={},e[a]=M?T+"px":"",e[y]=k?P+"px":"",e.transform="",e))}function r_(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=n===void 0?!0:n,s=i.adaptive,o=s===void 0?!0:s,c=i.roundOffsets,l=c===void 0?!0:c,O={placement:Ze(e.placement),variation:kn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,iu(Object.assign({},O,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,iu(Object.assign({},O,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var s_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:r_,data:{}},Xr={passive:!0};function o_(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=r===void 0?!0:r,o=n.resize,c=o===void 0?!0:o,l=We(e.elements.popper),O=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&O.forEach(function(_){_.addEventListener("scroll",i.update,Xr)}),c&&l.addEventListener("resize",i.update,Xr),function(){s&&O.forEach(function(_){_.removeEventListener("scroll",i.update,Xr)}),c&&l.removeEventListener("resize",i.update,Xr)}}var a_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:o_,data:{}},l_={left:"right",right:"left",bottom:"top",top:"bottom"};function es(t){return t.replace(/left|right|bottom|top/g,function(e){return l_[e]})}var c_={start:"end",end:"start"};function nu(t){return t.replace(/start|end/g,function(e){return c_[e]})}function ol(t){var e=We(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function al(t){return Pn(Ni(t)).left+ol(t).scrollLeft}function u_(t){var e=We(t),i=Ni(t),n=e.visualViewport,r=i.clientWidth,s=i.clientHeight,o=0,c=0;return n&&(r=n.width,s=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,c=n.offsetTop)),{width:r,height:s,x:o+al(t),y:c}}function h_(t){var e,i=Ni(t),n=ol(t),r=(e=t.ownerDocument)==null?void 0:e.body,s=$i(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=$i(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-n.scrollLeft+al(t),l=-n.scrollTop;return ei(r||i).direction==="rtl"&&(c+=$i(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:c,y:l}}function ll(t){var e=ei(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Rd(t){return["html","body","#document"].indexOf(ti(t))>=0?t.ownerDocument.body:Pe(t)&&ll(t)?t:Rd(qs(t))}function sr(t,e){var i;e===void 0&&(e=[]);var n=Rd(t),r=n===((i=t.ownerDocument)==null?void 0:i.body),s=We(n),o=r?[s].concat(s.visualViewport||[],ll(n)?n:[]):n,c=e.concat(o);return r?c:c.concat(sr(qs(o)))}function ua(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function f_(t){var e=Pn(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ru(t,e){return e===Td?ua(u_(t)):On(e)?f_(e):ua(h_(Ni(t)))}function d_(t){var e=sr(qs(t)),i=["absolute","fixed"].indexOf(ei(t).position)>=0,n=i&&Pe(t)?Lr(t):t;return On(n)?e.filter(function(r){return On(r)&&kd(r,n)&&ti(r)!=="body"&&(i?ei(r).position!=="static":!0)}):[]}function p_(t,e,i){var n=e==="clippingParents"?d_(t):[].concat(e),r=[].concat(n,[i]),s=r[0],o=r.reduce(function(c,l){var O=ru(t,l);return c.top=$i(O.top,c.top),c.right=ws(O.right,c.right),c.bottom=ws(O.bottom,c.bottom),c.left=$i(O.left,c.left),c},ru(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Nd(t){var e=t.reference,i=t.element,n=t.placement,r=n?Ze(n):null,s=n?kn(n):null,o=e.x+e.width/2-i.width/2,c=e.y+e.height/2-i.height/2,l;switch(r){case xe:l={x:o,y:e.y-i.height};break;case Le:l={x:o,y:e.y+e.height};break;case Me:l={x:e.x+e.width,y:c};break;case be:l={x:e.x-i.width,y:c};break;default:l={x:e.x,y:e.y}}var O=r?sl(r):null;if(O!=null){var _=O==="y"?"height":"width";switch(s){case Tn:l[O]=l[O]-(e[_]/2-i[_]/2);break;case br:l[O]=l[O]+(e[_]/2-i[_]/2);break}}return l}function _r(t,e){e===void 0&&(e={});var i=e,n=i.placement,r=n===void 0?t.placement:n,s=i.boundary,o=s===void 0?Nb:s,c=i.rootBoundary,l=c===void 0?Td:c,O=i.elementContext,_=O===void 0?Wn:O,v=i.altBoundary,E=v===void 0?!1:v,b=i.padding,P=b===void 0?0:b,m=Md(typeof P!="number"?P:Id(P,kr)),T=_===Wn?Db:Wn,k=t.rects.popper,M=t.elements[E?T:_],y=p_(On(M)?M:M.contextElement||Ni(t.elements.popper),o,l),a=Pn(t.elements.reference),S=Nd({reference:a,element:k,strategy:"absolute",placement:r}),w=ua(Object.assign({},k,S)),A=_===Wn?w:a,f={top:y.top-A.top+m.top,bottom:A.bottom-y.bottom+m.bottom,left:y.left-A.left+m.left,right:A.right-y.right+m.right},u=t.modifiersData.offset;if(_===Wn&&u){var g=u[r];Object.keys(f).forEach(function(h){var x=[Me,Le].indexOf(h)>=0?1:-1,d=[xe,Le].indexOf(h)>=0?"y":"x";f[h]+=g[d]*x})}return f}function g_(t,e){e===void 0&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,c=i.flipVariations,l=i.allowedAutoPlacements,O=l===void 0?Od:l,_=kn(n),v=_?c?tu:tu.filter(function(P){return kn(P)===_}):kr,E=v.filter(function(P){return O.indexOf(P)>=0});E.length===0&&(E=v);var b=E.reduce(function(P,m){return P[m]=_r(t,{placement:m,boundary:r,rootBoundary:s,padding:o})[Ze(m)],P},{});return Object.keys(b).sort(function(P,m){return b[P]-b[m]})}function m_(t){if(Ze(t)===nl)return[];var e=es(t);return[nu(t),e,nu(e)]}function v_(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,c=o===void 0?!0:o,l=i.fallbackPlacements,O=i.padding,_=i.boundary,v=i.rootBoundary,E=i.altBoundary,b=i.flipVariations,P=b===void 0?!0:b,m=i.allowedAutoPlacements,T=e.options.placement,k=Ze(T),M=k===T,y=l||(M||!P?[es(T)]:m_(T)),a=[T].concat(y).reduce(function(N,V){return N.concat(Ze(V)===nl?g_(e,{placement:V,boundary:_,rootBoundary:v,padding:O,flipVariations:P,allowedAutoPlacements:m}):V)},[]),S=e.rects.reference,w=e.rects.popper,A=new Map,f=!0,u=a[0],g=0;g=0,R=p?"width":"height",I=_r(e,{placement:h,boundary:_,rootBoundary:v,altBoundary:E,padding:O}),j=p?d?Me:be:d?Le:xe;S[R]>w[R]&&(j=es(j));var $=es(j),et=[];if(s&&et.push(I[x]<=0),c&&et.push(I[j]<=0,I[$]<=0),et.every(function(N){return N})){u=h,f=!1;break}A.set(h,et)}if(f)for(var it=P?3:1,H=function(V){var K=a.find(function(G){var J=A.get(G);if(J)return J.slice(0,V).every(function(C){return C})});if(K)return u=K,"break"},z=it;z>0;z--){var L=H(z);if(L==="break")break}e.placement!==u&&(e.modifiersData[n]._skip=!0,e.placement=u,e.reset=!0)}}var y_={name:"flip",enabled:!0,phase:"main",fn:v_,requiresIfExists:["offset"],data:{_skip:!1}};function su(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ou(t){return[xe,Me,Le,be].some(function(e){return t[e]>=0})}function x_(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=_r(e,{elementContext:"reference"}),c=_r(e,{altBoundary:!0}),l=su(o,n),O=su(c,r,s),_=ou(l),v=ou(O);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:O,isReferenceHidden:_,hasPopperEscaped:v},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":_,"data-popper-escaped":v})}var b_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:x_};function __(t,e,i){var n=Ze(t),r=[be,xe].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],c=s[1];return o=o||0,c=(c||0)*r,[be,Me].indexOf(n)>=0?{x:c,y:o}:{x:o,y:c}}function w_(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=r===void 0?[0,0]:r,o=Od.reduce(function(_,v){return _[v]=__(v,e.rects,s),_},{}),c=o[e.placement],l=c.x,O=c.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=O),e.modifiersData[n]=o}var E_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:w_};function C_(t){var e=t.state,i=t.name;e.modifiersData[i]=Nd({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var S_={name:"popperOffsets",enabled:!0,phase:"read",fn:C_,data:{}};function T_(t){return t==="x"?"y":"x"}function O_(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=r===void 0?!0:r,o=i.altAxis,c=o===void 0?!1:o,l=i.boundary,O=i.rootBoundary,_=i.altBoundary,v=i.padding,E=i.tether,b=E===void 0?!0:E,P=i.tetherOffset,m=P===void 0?0:P,T=_r(e,{boundary:l,rootBoundary:O,padding:v,altBoundary:_}),k=Ze(e.placement),M=kn(e.placement),y=!M,a=sl(k),S=T_(a),w=e.modifiersData.popperOffsets,A=e.rects.reference,f=e.rects.popper,u=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,g=typeof u=="number"?{mainAxis:u,altAxis:u}:Object.assign({mainAxis:0,altAxis:0},u),h=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,x={x:0,y:0};if(w){if(s){var d,p=a==="y"?xe:be,R=a==="y"?Le:Me,I=a==="y"?"height":"width",j=w[a],$=j+T[p],et=j-T[R],it=b?-f[I]/2:0,H=M===Tn?A[I]:f[I],z=M===Tn?-f[I]:-A[I],L=e.elements.arrow,N=b&&L?rl(L):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ld(),K=V[p],G=V[R],J=rr(0,A[I],N[I]),C=y?A[I]/2-it-J-K-g.mainAxis:H-J-K-g.mainAxis,U=y?-A[I]/2+it+J+G+g.mainAxis:z+J+G+g.mainAxis,B=e.elements.arrow&&Lr(e.elements.arrow),tt=B?a==="y"?B.clientTop||0:B.clientLeft||0:0,D=(d=h?.[a])!=null?d:0,F=j+C-D-tt,X=j+U-D,st=rr(b?ws($,F):$,j,b?$i(et,X):et);w[a]=st,x[a]=st-j}if(c){var ot,lt=a==="x"?xe:be,ct=a==="x"?Le:Me,q=w[S],Y=S==="y"?"height":"width",Z=q+T[lt],W=q-T[ct],Q=[xe,be].indexOf(k)!==-1,rt=(ot=h?.[S])!=null?ot:0,nt=Q?Z:q-A[Y]-f[Y]-rt+g.altAxis,at=Q?q+A[Y]+f[Y]-rt-g.altAxis:W,ut=b&&Q?Zb(nt,q,at):rr(b?nt:Z,q,b?at:W);w[S]=ut,x[S]=ut-q}e.modifiersData[n]=x}}var A_={name:"preventOverflow",enabled:!0,phase:"main",fn:O_,requiresIfExists:["offset"]};function P_(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function k_(t){return t===We(t)||!Pe(t)?ol(t):P_(t)}function L_(t){var e=t.getBoundingClientRect(),i=An(e.width)/t.offsetWidth||1,n=An(e.height)/t.offsetHeight||1;return i!==1||n!==1}function M_(t,e,i){i===void 0&&(i=!1);var n=Pe(e),r=Pe(e)&&L_(e),s=Ni(e),o=Pn(t,r),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((ti(e)!=="body"||ll(s))&&(c=k_(e)),Pe(e)?(l=Pn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=al(s))),{x:o.left+c.scrollLeft-l.x,y:o.top+c.scrollTop-l.y,width:o.width,height:o.height}}function I_(t){var e=new Map,i=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function r(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(c){if(!i.has(c)){var l=e.get(c);l&&r(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||r(s)}),n}function R_(t){var e=I_(t);return Xb.reduce(function(i,n){return i.concat(e.filter(function(r){return r.phase===n}))},[])}function N_(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function D_(t){var e=t.reduce(function(i,n){var r=i[n.name];return i[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,i},{});return Object.keys(e).map(function(i){return e[i]})}var au={placement:"bottom",modifiers:[],strategy:"absolute"};function lu(){for(var t=arguments.length,e=new Array(t),i=0;i-1}function Vd(t,e){return typeof t=="function"?t.apply(void 0,e):t}function cu(t,e){if(e===0)return t;var i;return function(n){clearTimeout(i),i=setTimeout(function(){t(n)},e)}}function V_(t,e){var i=Object.assign({},t);return e.forEach(function(n){delete i[n]}),i}function U_(t){return t.split(/\s+/).filter(Boolean)}function Vi(t){return[].concat(t)}function uu(t,e){t.indexOf(e)===-1&&t.push(e)}function W_(t){return t.filter(function(e,i){return t.indexOf(e)===i})}function Ud(t){return t.split("-")[0]}function Ln(t){return[].slice.call(t)}function hu(t){return Object.keys(t).reduce(function(e,i){return t[i]!==void 0&&(e[i]=t[i]),e},{})}function Xi(){return document.createElement("div")}function Zs(t){return["Element","Fragment"].some(function(e){return cl(t,e)})}function G_(t){return cl(t,"NodeList")}function ul(t){return cl(t,"MouseEvent")}function $_(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function X_(t){return Zs(t)?[t]:G_(t)?Ln(t):Array.isArray(t)?t:Ln(document.querySelectorAll(t))}function _o(t,e){t.forEach(function(i){i&&(i.style.transitionDuration=e+"ms")})}function wr(t,e){t.forEach(function(i){i&&i.setAttribute("data-state",e)})}function Wd(t){var e,i=Vi(t),n=i[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function Y_(t,e){var i=e.clientX,n=e.clientY;return t.every(function(r){var s=r.popperRect,o=r.popperState,c=r.props,l=c.interactiveBorder,O=Ud(o.placement),_=o.modifiersData.offset;if(!_)return!0;var v=O==="bottom"?_.top.y:0,E=O==="top"?_.bottom.y:0,b=O==="right"?_.left.x:0,P=O==="left"?_.right.x:0,m=s.top-n+v>l,T=n-s.bottom-E>l,k=s.left-i+b>l,M=i-s.right-P>l;return m||T||k||M})}function wo(t,e,i){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[n](r,i)})}function fu(t,e){for(var i=e;i;){var n;if(t.contains(i))return!0;i=i.getRootNode==null||(n=i.getRootNode())==null?void 0:n.host}return!1}var ze={isTouch:!1},du=0;function z_(){ze.isTouch||(ze.isTouch=!0,window.performance&&document.addEventListener("mousemove",Gd))}function Gd(){var t=performance.now();t-du<20&&(ze.isTouch=!1,document.removeEventListener("mousemove",Gd)),du=t}function K_(){var t=document.activeElement;if($_(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function q_(){document.addEventListener("touchstart",z_,Hi),window.addEventListener("blur",K_)}var Z_=typeof window<"u"&&typeof document<"u",J_=Z_?!!window.msCrypto:!1,Q_={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},je=Object.assign({appendTo:Hd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Q_,tw),ew=Object.keys(je),iw=function(e){var i=Object.keys(e);i.forEach(function(n){je[n]=e[n]})};function $d(t){var e=t.plugins||[],i=e.reduce(function(n,r){var s=r.name,o=r.defaultValue;if(s){var c;n[s]=t[s]!==void 0?t[s]:(c=je[s])!=null?c:o}return n},{});return Object.assign({},t,i)}function nw(t,e){var i=e?Object.keys($d(Object.assign({},je,{plugins:e}))):ew,n=i.reduce(function(r,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return r;if(s==="content")r[s]=o;else try{r[s]=JSON.parse(o)}catch{r[s]=o}return r},{});return n}function pu(t,e){var i=Object.assign({},e,{content:Vd(e.content,[t])},e.ignoreAttributes?{}:nw(t,e.plugins));return i.aria=Object.assign({},je.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?e.interactive:i.aria.expanded,content:i.aria.content==="auto"?e.interactive?null:"describedby":i.aria.content},i}var rw=function(){return"innerHTML"};function ha(t,e){t[rw()]=e}function gu(t){var e=Xi();return t===!0?e.className=Fd:(e.className=Bd,Zs(t)?e.appendChild(t):ha(e,t)),e}function mu(t,e){Zs(e.content)?(ha(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ha(t,e.content):t.textContent=e.content)}function Es(t){var e=t.firstElementChild,i=Ln(e.children);return{box:e,content:i.find(function(n){return n.classList.contains(Dd)}),arrow:i.find(function(n){return n.classList.contains(Fd)||n.classList.contains(Bd)}),backdrop:i.find(function(n){return n.classList.contains(jd)})}}function Xd(t){var e=Xi(),i=Xi();i.className=H_,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=Xi();n.className=Dd,n.setAttribute("data-state","hidden"),mu(n,t.props),e.appendChild(i),i.appendChild(n),r(t.props,t.props);function r(s,o){var c=Es(e),l=c.box,O=c.content,_=c.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&mu(O,t.props),o.arrow?_?s.arrow!==o.arrow&&(l.removeChild(_),l.appendChild(gu(o.arrow))):l.appendChild(gu(o.arrow)):_&&l.removeChild(_)}return{popper:e,onUpdate:r}}Xd.$$tippy=!0;var sw=1,Yr=[],Eo=[];function ow(t,e){var i=pu(t,Object.assign({},je,$d(hu(e)))),n,r,s,o=!1,c=!1,l=!1,O=!1,_,v,E,b=[],P=cu(F,i.interactiveDebounce),m,T=sw++,k=null,M=W_(i.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},a={id:T,reference:t,popper:Xi(),popperInstance:k,props:i,state:y,plugins:M,clearDelayTimeouts:nt,setProps:at,setContent:ut,show:ft,hide:gt,hideWithInteractivity:xt,enable:Q,disable:rt,unmount:vt,destroy:dt};if(!i.render)return a;var S=i.render(a),w=S.popper,A=S.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+a.id,a.popper=w,t._tippy=a,w._tippy=a;var f=M.map(function(ht){return ht.fn(a)}),u=t.hasAttribute("aria-expanded");return B(),it(),j(),$("onCreate",[a]),i.showOnCreate&&Z(),w.addEventListener("mouseenter",function(){a.props.interactive&&a.state.isVisible&&a.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){a.props.interactive&&a.props.trigger.indexOf("mouseenter")>=0&&p().addEventListener("mousemove",P)}),a;function g(){var ht=a.props.touch;return Array.isArray(ht)?ht:[ht,0]}function h(){return g()[0]==="hold"}function x(){var ht;return!!((ht=a.props.render)!=null&&ht.$$tippy)}function d(){return m||t}function p(){var ht=d().parentNode;return ht?Wd(ht):document}function R(){return Es(w)}function I(ht){return a.state.isMounted&&!a.state.isVisible||ze.isTouch||_&&_.type==="focus"?0:bo(a.props.delay,ht?0:1,je.delay)}function j(ht){ht===void 0&&(ht=!1),w.style.pointerEvents=a.props.interactive&&!ht?"":"none",w.style.zIndex=""+a.props.zIndex}function $(ht,pt,mt){if(mt===void 0&&(mt=!0),f.forEach(function(wt){wt[ht]&&wt[ht].apply(wt,pt)}),mt){var yt;(yt=a.props)[ht].apply(yt,pt)}}function et(){var ht=a.props.aria;if(ht.content){var pt="aria-"+ht.content,mt=w.id,yt=Vi(a.props.triggerTarget||t);yt.forEach(function(wt){var kt=wt.getAttribute(pt);if(a.state.isVisible)wt.setAttribute(pt,kt?kt+" "+mt:mt);else{var Ot=kt&&kt.replace(mt,"").trim();Ot?wt.setAttribute(pt,Ot):wt.removeAttribute(pt)}})}}function it(){if(!(u||!a.props.aria.expanded)){var ht=Vi(a.props.triggerTarget||t);ht.forEach(function(pt){a.props.interactive?pt.setAttribute("aria-expanded",a.state.isVisible&&pt===d()?"true":"false"):pt.removeAttribute("aria-expanded")})}}function H(){p().removeEventListener("mousemove",P),Yr=Yr.filter(function(ht){return ht!==P})}function z(ht){if(!(ze.isTouch&&(l||ht.type==="mousedown"))){var pt=ht.composedPath&&ht.composedPath()[0]||ht.target;if(!(a.props.interactive&&fu(w,pt))){if(Vi(a.props.triggerTarget||t).some(function(mt){return fu(mt,pt)})){if(ze.isTouch||a.state.isVisible&&a.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[a,ht]);a.props.hideOnClick===!0&&(a.clearDelayTimeouts(),a.hide(),c=!0,setTimeout(function(){c=!1}),a.state.isMounted||K())}}}function L(){l=!0}function N(){l=!1}function V(){var ht=p();ht.addEventListener("mousedown",z,!0),ht.addEventListener("touchend",z,Hi),ht.addEventListener("touchstart",N,Hi),ht.addEventListener("touchmove",L,Hi)}function K(){var ht=p();ht.removeEventListener("mousedown",z,!0),ht.removeEventListener("touchend",z,Hi),ht.removeEventListener("touchstart",N,Hi),ht.removeEventListener("touchmove",L,Hi)}function G(ht,pt){C(ht,function(){!a.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&pt()})}function J(ht,pt){C(ht,pt)}function C(ht,pt){var mt=R().box;function yt(wt){wt.target===mt&&(wo(mt,"remove",yt),pt())}if(ht===0)return pt();wo(mt,"remove",v),wo(mt,"add",yt),v=yt}function U(ht,pt,mt){mt===void 0&&(mt=!1);var yt=Vi(a.props.triggerTarget||t);yt.forEach(function(wt){wt.addEventListener(ht,pt,mt),b.push({node:wt,eventType:ht,handler:pt,options:mt})})}function B(){h()&&(U("touchstart",D,{passive:!0}),U("touchend",X,{passive:!0})),U_(a.props.trigger).forEach(function(ht){if(ht!=="manual")switch(U(ht,D),ht){case"mouseenter":U("mouseleave",X);break;case"focus":U(J_?"focusout":"blur",st);break;case"focusin":U("focusout",st);break}})}function tt(){b.forEach(function(ht){var pt=ht.node,mt=ht.eventType,yt=ht.handler,wt=ht.options;pt.removeEventListener(mt,yt,wt)}),b=[]}function D(ht){var pt,mt=!1;if(!(!a.state.isEnabled||ot(ht)||c)){var yt=((pt=_)==null?void 0:pt.type)==="focus";_=ht,m=ht.currentTarget,it(),!a.state.isVisible&&ul(ht)&&Yr.forEach(function(wt){return wt(ht)}),ht.type==="click"&&(a.props.trigger.indexOf("mouseenter")<0||o)&&a.props.hideOnClick!==!1&&a.state.isVisible?mt=!0:Z(ht),ht.type==="click"&&(o=!mt),mt&&!yt&&W(ht)}}function F(ht){var pt=ht.target,mt=d().contains(pt)||w.contains(pt);if(!(ht.type==="mousemove"&&mt)){var yt=Y().concat(w).map(function(wt){var kt,Ot=wt._tippy,Xt=(kt=Ot.popperInstance)==null?void 0:kt.state;return Xt?{popperRect:wt.getBoundingClientRect(),popperState:Xt,props:i}:null}).filter(Boolean);Y_(yt,ht)&&(H(),W(ht))}}function X(ht){var pt=ot(ht)||a.props.trigger.indexOf("click")>=0&&o;if(!pt){if(a.props.interactive){a.hideWithInteractivity(ht);return}W(ht)}}function st(ht){a.props.trigger.indexOf("focusin")<0&&ht.target!==d()||a.props.interactive&&ht.relatedTarget&&w.contains(ht.relatedTarget)||W(ht)}function ot(ht){return ze.isTouch?h()!==ht.type.indexOf("touch")>=0:!1}function lt(){ct();var ht=a.props,pt=ht.popperOptions,mt=ht.placement,yt=ht.offset,wt=ht.getReferenceClientRect,kt=ht.moveTransition,Ot=x()?Es(w).arrow:null,Xt=wt?{getBoundingClientRect:wt,contextElement:wt.contextElement||d()}:t,we={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ie){var Ji=Ie.state;if(x()){var vp=R(),Qs=vp.box;["placement","reference-hidden","escaped"].forEach(function(Mr){Mr==="placement"?Qs.setAttribute("data-placement",Ji.placement):Ji.attributes.popper["data-popper-"+Mr]?Qs.setAttribute("data-"+Mr,""):Qs.removeAttribute("data-"+Mr)}),Ji.attributes.popper={}}}},It=[{name:"offset",options:{offset:yt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!kt}},we];x()&&Ot&&It.push({name:"arrow",options:{element:Ot,padding:3}}),It.push.apply(It,pt?.modifiers||[]),a.popperInstance=B_(Xt,w,Object.assign({},pt,{placement:mt,onFirstUpdate:E,modifiers:It}))}function ct(){a.popperInstance&&(a.popperInstance.destroy(),a.popperInstance=null)}function q(){var ht=a.props.appendTo,pt,mt=d();a.props.interactive&&ht===Hd||ht==="parent"?pt=mt.parentNode:pt=Vd(ht,[mt]),pt.contains(w)||pt.appendChild(w),a.state.isMounted=!0,lt()}function Y(){return Ln(w.querySelectorAll("[data-tippy-root]"))}function Z(ht){a.clearDelayTimeouts(),ht&&$("onTrigger",[a,ht]),V();var pt=I(!0),mt=g(),yt=mt[0],wt=mt[1];ze.isTouch&&yt==="hold"&&wt&&(pt=wt),pt?n=setTimeout(function(){a.show()},pt):a.show()}function W(ht){if(a.clearDelayTimeouts(),$("onUntrigger",[a,ht]),!a.state.isVisible){K();return}if(!(a.props.trigger.indexOf("mouseenter")>=0&&a.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ht.type)>=0&&o)){var pt=I(!1);pt?r=setTimeout(function(){a.state.isVisible&&a.hide()},pt):s=requestAnimationFrame(function(){a.hide()})}}function Q(){a.state.isEnabled=!0}function rt(){a.hide(),a.state.isEnabled=!1}function nt(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(s)}function at(ht){if(!a.state.isDestroyed){$("onBeforeUpdate",[a,ht]),tt();var pt=a.props,mt=pu(t,Object.assign({},pt,hu(ht),{ignoreAttributes:!0}));a.props=mt,B(),pt.interactiveDebounce!==mt.interactiveDebounce&&(H(),P=cu(F,mt.interactiveDebounce)),pt.triggerTarget&&!mt.triggerTarget?Vi(pt.triggerTarget).forEach(function(yt){yt.removeAttribute("aria-expanded")}):mt.triggerTarget&&t.removeAttribute("aria-expanded"),it(),j(),A&&A(pt,mt),a.popperInstance&&(lt(),Y().forEach(function(yt){requestAnimationFrame(yt._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[a,ht])}}function ut(ht){a.setProps({content:ht})}function ft(){var ht=a.state.isVisible,pt=a.state.isDestroyed,mt=!a.state.isEnabled,yt=ze.isTouch&&!a.props.touch,wt=bo(a.props.duration,0,je.duration);if(!(ht||pt||mt||yt)&&!d().hasAttribute("disabled")&&($("onShow",[a],!1),a.props.onShow(a)!==!1)){if(a.state.isVisible=!0,x()&&(w.style.visibility="visible"),j(),V(),a.state.isMounted||(w.style.transition="none"),x()){var kt=R(),Ot=kt.box,Xt=kt.content;_o([Ot,Xt],0)}E=function(){var It;if(!(!a.state.isVisible||O)){if(O=!0,w.offsetHeight,w.style.transition=a.props.moveTransition,x()&&a.props.animation){var ce=R(),Ie=ce.box,Ji=ce.content;_o([Ie,Ji],wt),wr([Ie,Ji],"visible")}et(),it(),uu(Eo,a),(It=a.popperInstance)==null||It.forceUpdate(),$("onMount",[a]),a.props.animation&&x()&&J(wt,function(){a.state.isShown=!0,$("onShown",[a])})}},q()}}function gt(){var ht=!a.state.isVisible,pt=a.state.isDestroyed,mt=!a.state.isEnabled,yt=bo(a.props.duration,1,je.duration);if(!(ht||pt||mt)&&($("onHide",[a],!1),a.props.onHide(a)!==!1)){if(a.state.isVisible=!1,a.state.isShown=!1,O=!1,o=!1,x()&&(w.style.visibility="hidden"),H(),K(),j(!0),x()){var wt=R(),kt=wt.box,Ot=wt.content;a.props.animation&&(_o([kt,Ot],yt),wr([kt,Ot],"hidden"))}et(),it(),a.props.animation?x()&&G(yt,a.unmount):a.unmount()}}function xt(ht){p().addEventListener("mousemove",P),uu(Yr,P),P(ht)}function vt(){a.state.isVisible&&a.hide(),a.state.isMounted&&(ct(),Y().forEach(function(ht){ht._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),Eo=Eo.filter(function(ht){return ht!==a}),a.state.isMounted=!1,$("onHidden",[a]))}function dt(){a.state.isDestroyed||(a.clearDelayTimeouts(),a.unmount(),tt(),delete t._tippy,a.state.isDestroyed=!0,$("onDestroy",[a]))}}function Et(t,e){e===void 0&&(e={});var i=je.plugins.concat(e.plugins||[]);q_();var n=Object.assign({},e,{plugins:i}),r=X_(t),s=r.reduce(function(o,c){var l=c&&ow(c,n);return l&&o.push(l),o},[]);return Zs(t)?s[0]:s}Et.defaultProps=je;Et.setDefaultProps=iw;Et.currentInput=ze;var aw=Object.assign({},Pd,{effect:function(e){var i=e.state,n={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,n.popper),i.styles=n,i.elements.arrow&&Object.assign(i.elements.arrow.style,n.arrow)}}),lw=function(e,i){var n;i===void 0&&(i={});var r=e,s=[],o=[],c,l=i.overrides,O=[],_=!1;function v(){o=r.map(function(a){return Vi(a.props.triggerTarget||a.reference)}).reduce(function(a,S){return a.concat(S)},[])}function E(){s=r.map(function(a){return a.reference})}function b(a){r.forEach(function(S){a?S.enable():S.disable()})}function P(a){return r.map(function(S){var w=S.setProps;return S.setProps=function(A){w(A),S.reference===c&&a.setProps(A)},function(){S.setProps=w}})}function m(a,S){var w=o.indexOf(S);if(S!==c){c=S;var A=(l||[]).concat("content").reduce(function(f,u){return f[u]=r[w].props[u],f},{});a.setProps(Object.assign({},A,{getReferenceClientRect:typeof A.getReferenceClientRect=="function"?A.getReferenceClientRect:function(){var f;return(f=s[w])==null?void 0:f.getBoundingClientRect()}}))}}b(!1),E(),v();var T={fn:function(){return{onDestroy:function(){b(!0)},onHidden:function(){c=null},onClickOutside:function(w){w.props.showOnCreate&&!_&&(_=!0,c=null)},onShow:function(w){w.props.showOnCreate&&!_&&(_=!0,m(w,s[0]))},onTrigger:function(w,A){m(w,A.currentTarget)}}}},k=Et(Xi(),Object.assign({},V_(i,["overrides"]),{plugins:[T].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat(((n=i.popperOptions)==null?void 0:n.modifiers)||[],[aw])})})),M=k.show;k.show=function(a){if(M(),!c&&a==null)return m(k,s[0]);if(!(c&&a==null)){if(typeof a=="number")return s[a]&&m(k,s[a]);if(r.indexOf(a)>=0){var S=a.reference;return m(k,S)}if(s.indexOf(a)>=0)return m(k,a)}},k.showNext=function(){var a=s[0];if(!c)return k.show(0);var S=s.indexOf(c);k.show(s[S+1]||a)},k.showPrevious=function(){var a=s[s.length-1];if(!c)return k.show(a);var S=s.indexOf(c),w=s[S-1]||a;k.show(w)};var y=k.setProps;return k.setProps=function(a){l=a.overrides||l,y(a)},k.setInstances=function(a){b(!0),O.forEach(function(S){return S()}),r=a,b(!1),E(),v(),O=P(k),k.setProps({triggerTarget:o})},O=P(k),k},cw={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(!((i=e.props.render)!=null&&i.$$tippy))return{};var n=Es(e.popper),r=n.box,s=n.content,o=e.props.animateFill?uw():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var l=r.style.transitionDuration,O=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(O/10)+"ms",o.style.transitionDuration=l,wr([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&wr([o],"hidden")}}}};function uw(){var t=Xi();return t.className=jd,wr([t],"hidden"),t}var fa={clientX:0,clientY:0},zr=[];function Yd(t){var e=t.clientX,i=t.clientY;fa={clientX:e,clientY:i}}function hw(t){t.addEventListener("mousemove",Yd)}function fw(t){t.removeEventListener("mousemove",Yd)}var dw={name:"followCursor",defaultValue:!1,fn:function(e){var i=e.reference,n=Wd(e.props.triggerTarget||i),r=!1,s=!1,o=!0,c=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function O(){n.addEventListener("mousemove",E)}function _(){n.removeEventListener("mousemove",E)}function v(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function E(m){var T=m.target?i.contains(m.target):!0,k=e.props.followCursor,M=m.clientX,y=m.clientY,a=i.getBoundingClientRect(),S=M-a.left,w=y-a.top;(T||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var f=i.getBoundingClientRect(),u=M,g=y;k==="initial"&&(u=f.left+S,g=f.top+w);var h=k==="horizontal"?f.top:g,x=k==="vertical"?f.right:u,d=k==="horizontal"?f.bottom:g,p=k==="vertical"?f.left:u;return{width:x-p,height:d-h,top:h,right:x,bottom:d,left:p}}})}function b(){e.props.followCursor&&(zr.push({instance:e,doc:n}),hw(n))}function P(){zr=zr.filter(function(m){return m.instance!==e}),zr.filter(function(m){return m.doc===n}).length===0&&fw(n)}return{onCreate:b,onDestroy:P,onBeforeUpdate:function(){c=e.props},onAfterUpdate:function(T,k){var M=k.followCursor;r||M!==void 0&&c.followCursor!==M&&(P(),M?(b(),e.state.isMounted&&!s&&!l()&&O()):(_(),v()))},onMount:function(){e.props.followCursor&&!s&&(o&&(E(fa),o=!1),l()||O())},onTrigger:function(T,k){ul(k)&&(fa={clientX:k.clientX,clientY:k.clientY}),s=k.type==="focus"},onHidden:function(){e.props.followCursor&&(v(),_(),o=!0)}}}};function pw(t,e){var i;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((((i=t.popperOptions)==null?void 0:i.modifiers)||[]).filter(function(n){var r=n.name;return r!==e.name}),[e])})}}var gw={name:"inlinePositioning",defaultValue:!1,fn:function(e){var i=e.reference;function n(){return!!e.props.inlinePositioning}var r,s=-1,o=!1,c=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(b){var P=b.state;n()&&(c.indexOf(P.placement)!==-1&&(c=[]),r!==P.placement&&c.indexOf(P.placement)===-1&&(c.push(P.placement),e.setProps({getReferenceClientRect:function(){return O(P.placement)}})),r=P.placement)}};function O(E){return mw(Ud(E),i.getBoundingClientRect(),Ln(i.getClientRects()),s)}function _(E){o=!0,e.setProps(E),o=!1}function v(){o||_(pw(e.props,l))}return{onCreate:v,onAfterUpdate:v,onTrigger:function(b,P){if(ul(P)){var m=Ln(e.reference.getClientRects()),T=m.find(function(M){return M.left-2<=P.clientX&&M.right+2>=P.clientX&&M.top-2<=P.clientY&&M.bottom+2>=P.clientY}),k=m.indexOf(T);s=k>-1?k:s}},onHidden:function(){s=-1}}}};function mw(t,e,i,n){if(i.length<2||t===null)return e;if(i.length===2&&n>=0&&i[0].left>i[1].right)return i[n]||e;switch(t){case"top":case"bottom":{var r=i[0],s=i[i.length-1],o=t==="top",c=r.top,l=s.bottom,O=o?r.left:s.left,_=o?r.right:s.right,v=_-O,E=l-c;return{top:c,bottom:l,left:O,right:_,width:v,height:E}}case"left":case"right":{var b=Math.min.apply(Math,i.map(function(w){return w.left})),P=Math.max.apply(Math,i.map(function(w){return w.right})),m=i.filter(function(w){return t==="left"?w.left===b:w.right===P}),T=m[0].top,k=m[m.length-1].bottom,M=b,y=P,a=y-M,S=k-T;return{top:T,bottom:k,left:M,right:y,width:a,height:S}}default:return e}}var vw={name:"sticky",defaultValue:!1,fn:function(e){var i=e.reference,n=e.popper;function r(){return e.popperInstance?e.popperInstance.state.elements.reference:i}function s(O){return e.props.sticky===!0||e.props.sticky===O}var o=null,c=null;function l(){var O=s("reference")?r().getBoundingClientRect():null,_=s("popper")?n.getBoundingClientRect():null;(O&&vu(o,O)||_&&vu(c,_))&&e.popperInstance&&e.popperInstance.update(),o=O,c=_,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function vu(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Et.setDefaultProps({render:Xd});Et.setDefaultProps({onShow:t=>{if(!t.props.content)return!1}});function zd(t,e={},i={mount:!0,appName:"Tippy"}){i=Object.assign({mount:!0,appName:"Tippy"},i);const n=ie(),r=Yt(),s=Yt({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1}),o=In();let c=null;const l=()=>c||(c=document.createDocumentFragment(),c),O=A=>{let f,u=Dt(A)?A.value:A;return Je(u)?(o.value||(o.value=bn({name:i.appName,setup:()=>()=>Dt(A)?A.value:A}),n&&Object.assign(o.value._context,n.appContext),o.value.mount(l())),f=()=>l()):typeof u=="object"?(o.value||(o.value=bn({name:i.appName,setup:()=>()=>Se(Dt(A)?A.value:A)}),n&&Object.assign(o.value._context,n.appContext),o.value.mount(l())),f=()=>l()):f=u,f},_=A=>{let f={};return Dt(A)?f=A.value||{}:qe(A)?f={...A}:f={...A},f.content&&(f.content=O(f.content)),f.triggerTarget&&(f.triggerTarget=Dt(f.triggerTarget)?f.triggerTarget.value:f.triggerTarget),(!f.plugins||!Array.isArray(f.plugins))&&(f.plugins=[]),f.plugins=f.plugins.filter(u=>u.name!=="vueTippyReactiveState"),f.plugins.push({name:"vueTippyReactiveState",fn:()=>({onCreate(){s.value.isEnabled=!0},onMount(){s.value.isMounted=!0},onShow(){s.value.isMounted=!0,s.value.isVisible=!0},onShown(){s.value.isShown=!0},onHide(){s.value.isMounted=!1,s.value.isVisible=!1},onHidden(){s.value.isShown=!1},onUnmounted(){s.value.isMounted=!1},onDestroy(){s.value.isDestroyed=!0}})}),f},v=()=>{r.value&&r.value.setProps(_(e))},E=()=>{!r.value||!e.content||r.value.setContent(O(e.content))},b=A=>{var f;(f=r.value)===null||f===void 0||f.setContent(O(A))},P=A=>{var f;(f=r.value)===null||f===void 0||f.setProps(_(A))},m=()=>{var A;r.value&&(r.value.destroy(),r.value=void 0),c=null,(A=o.value)===null||A===void 0||A.unmount(),o.value=void 0},T=()=>{var A;(A=r.value)===null||A===void 0||A.show()},k=()=>{var A;(A=r.value)===null||A===void 0||A.hide()},M=()=>{var A;(A=r.value)===null||A===void 0||A.disable(),s.value.isEnabled=!1},y=()=>{var A;(A=r.value)===null||A===void 0||A.enable(),s.value.isEnabled=!0},a=()=>{var A;(A=r.value)===null||A===void 0||A.unmount()},S=()=>{if(!t)return;let A=Dt(t)?t.value:t;typeof A=="function"&&(A=A()),A&&(r.value=Et(A,_(e)),A.$tippy=w)},w={tippy:r,refresh:v,refreshContent:E,setContent:b,setProps:P,destroy:m,hide:k,show:T,disable:M,enable:y,unmount:a,mount:S,state:s};return i.mount&&(n?n.isMounted?S():gi(S):S()),n&&Dn(()=>{m()}),Dt(e)||qe(e)?le(e,v,{immediate:!1}):Dt(e.content)&&le(e.content,E,{immediate:!1}),w}function yw(t,e){const i=Yt();return gi(()=>{const r=(Array.isArray(t)?t.map(s=>s.value):typeof t=="function"?t():t.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);i.value=lw(r,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:i}}function xw(t){return typeof t=="function"?t():Be(t)}function bw(t){var e,i;const n=xw(t);return(i=(e=n)===null||e===void 0?void 0:e.$el)!==null&&i!==void 0?i:n}const _w=Ue({props:{to:{type:[String,Function]},tag:{type:[String,Object],default:"span"},contentTag:{type:[String,Object],default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Et.defaultProps.appendTo},aria:{default:()=>Et.defaultProps.aria},delay:{default:()=>Et.defaultProps.delay},duration:{default:()=>Et.defaultProps.duration},getReferenceClientRect:{default:()=>Et.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Et.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Et.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Et.defaultProps.interactive},interactiveBorder:{default:()=>Et.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Et.defaultProps.interactiveDebounce},moveTransition:{default:()=>Et.defaultProps.moveTransition},offset:{default:()=>Et.defaultProps.offset},onAfterUpdate:{default:()=>Et.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Et.defaultProps.onBeforeUpdate},onCreate:{default:()=>Et.defaultProps.onCreate},onDestroy:{default:()=>Et.defaultProps.onDestroy},onHidden:{default:()=>Et.defaultProps.onHidden},onHide:{default:()=>Et.defaultProps.onHide},onMount:{default:()=>Et.defaultProps.onMount},onShow:{default:()=>Et.defaultProps.onShow},onShown:{default:()=>Et.defaultProps.onShown},onTrigger:{default:()=>Et.defaultProps.onTrigger},onUntrigger:{default:()=>Et.defaultProps.onUntrigger},onClickOutside:{default:()=>Et.defaultProps.onClickOutside},placement:{default:()=>Et.defaultProps.placement},plugins:{default:()=>Et.defaultProps.plugins},popperOptions:{default:()=>Et.defaultProps.popperOptions},render:{default:()=>Et.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Et.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Et.defaultProps.touch},trigger:{default:()=>Et.defaultProps.trigger},triggerTarget:{default:()=>Et.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Et.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Et.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Et.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Et.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Et.defaultProps.allowHTML},animation:{default:()=>Et.defaultProps.animation},arrow:{default:()=>Et.defaultProps.arrow},content:{default:()=>Et.defaultProps.content},inertia:{default:()=>Et.defaultProps.inertia},maxWidth:{default:()=>Et.defaultProps.maxWidth},role:{default:()=>Et.defaultProps.role},theme:{default:()=>Et.defaultProps.theme},zIndex:{default:()=>Et.defaultProps.zIndex}},emits:["state"],setup(t,{slots:e,emit:i,expose:n}){const r=Yt(),s=Yt(),o=Yt(),c=Yt(!1),l=()=>{let b={...t};for(const P of["to","tag","contentTag","contentClass"])b.hasOwnProperty(P)&&delete b[P];return b};let O=()=>bw(r);t.to&&(typeof Element<"u"&&t.to instanceof Element?O=()=>t.to:t.to==="parent"?O=()=>{let b=r.value;return b||(b=r.value=s.value.parentElement),b}:(typeof t.to=="string"||t.to instanceof String)&&(O=()=>document.querySelector(t.to)));const _=zd(O,l());let v=e.content;!v&&t.to==="parent"&&(v=e.default),gi(()=>{c.value=!0,Nn(()=>{v&&_.setContent(()=>o.value)})}),le(_.state,()=>{i("state",Be(_.state))},{immediate:!0,deep:!0}),le(()=>t,()=>{_.setProps(l()),v&&_.setContent(()=>o.value)},{deep:!0});let E=qi({elem:r,contentElem:o,mounted:c,..._});return n(E),()=>{const b=(typeof t.contentTag=="string",t.contentTag),P=v?Se(b,{ref:o,style:{display:c.value?"inherit":"none"},class:t.contentClass},v(E)):null;if(t.to==="parent"){const k=[];if(!r.value){const M=Se("span",{ref:s,"data-v-tippy":"",style:{display:"none"}});k.push(M)}return P&&k.push(P),k}const m=e.default?e.default(E):[];if(!t.tag){const k=Se(m[0],{ref:r,"data-v-tippy":""});return P?[k,P]:k}const T=(typeof t.tag=="string",t.tag);return Se(T,{ref:r,"data-v-tippy":""},P?[m,P]:m)}}}),ww=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let da={};Object.keys(Et.defaultProps).forEach(t=>{ww.includes(t)?da[t]={type:Boolean,default:function(){return Et.defaultProps[t]}}:da[t]={default:function(){return Et.defaultProps[t]}}});const Ew=Ue({props:da,setup(t){const e=Yt([]),{singleton:i}=yw(e,t);return{instances:e,singleton:i}},mounted(){var t;const i=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(i).map(n=>n._tippy).filter(Boolean),(t=this.singleton)===null||t===void 0||t.setInstances(this.instances)},render(){let t=this.$slots.default?this.$slots.default():[];return Se(()=>t)}}),Cw={mounted(t,e,i){const n=typeof e.value=="string"?{content:e.value}:e.value||{},r=Object.keys(e.modifiers||{}),s=r.find(c=>c!=="arrow"),o=r.findIndex(c=>c==="arrow")!==-1;s&&(n.placement=n.placement||s),o&&(n.arrow=n.arrow!==void 0?n.arrow:!0),i.props&&i.props.onTippyShow&&(n.onShow=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShow(...c)}),i.props&&i.props.onTippyShown&&(n.onShown=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShown(...c)}),i.props&&i.props.onTippyHidden&&(n.onHidden=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHidden(...c)}),i.props&&i.props.onTippyHide&&(n.onHide=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHide(...c)}),i.props&&i.props.onTippyMount&&(n.onMount=function(...c){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyMount(...c)}),t.getAttribute("title")&&!n.content&&(n.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!n.content&&(n.content=t.getAttribute("content")),zd(t,n)},unmounted(t){t.$tippy?t.$tippy.destroy():t._tippy&&t._tippy.destroy()},updated(t,e){const i=typeof e.value=="string"?{content:e.value}:e.value||{};t.getAttribute("title")&&!i.content&&(i.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!i.content&&(i.content=t.getAttribute("content")),t.$tippy?t.$tippy.setProps(i||{}):t._tippy&&t._tippy.setProps(i||{})}},Sw={install(t,e={}){Et.setDefaultProps(e.defaultProps||{}),t.directive(e.directive||"tippy",Cw),t.component(e.component||"tippy",_w),t.component(e.componentSingleton||"tippy-singleton",Ew)}},Tw=Et.setDefaultProps;Tw({ignoreAttributes:!0,plugins:[vw,gw,dw,cw]});var Kd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ow(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),i}var Zd={exports:{}},Co={exports:{}},yu;function Aw(){return yu||(yu=1,function(t){(function(e,i){t.exports?(i.default=i,t.exports=e.document?i(e):i):(e.Highcharts&&e.Highcharts.error(16,!0),e.Highcharts=i(e))})(typeof window<"u"?window:Kd,function(e){function i(r,s,o,c){r.hasOwnProperty(s)||(r[s]=c.apply(null,o))}var n={};return i(n,"Core/Globals.js",[],function(){var r=typeof e<"u"?e:typeof window<"u"?window:{},s;return function(o){o.SVG_NS="http://www.w3.org/2000/svg",o.product="Highcharts",o.version="9.3.3",o.win=r,o.doc=o.win.document,o.svg=o.doc&&o.doc.createElementNS&&!!o.doc.createElementNS(o.SVG_NS,"svg").createSVGRect,o.userAgent=o.win.navigator&&o.win.navigator.userAgent||"",o.isChrome=o.userAgent.indexOf("Chrome")!==-1,o.isFirefox=o.userAgent.indexOf("Firefox")!==-1,o.isMS=/(edge|msie|trident)/i.test(o.userAgent)&&!o.win.opera,o.isSafari=!o.isChrome&&o.userAgent.indexOf("Safari")!==-1,o.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(o.userAgent),o.isWebKit=o.userAgent.indexOf("AppleWebKit")!==-1,o.deg2rad=2*Math.PI/360,o.hasBidiBug=o.isFirefox&&4>parseInt(o.userAgent.split("Firefox/")[1],10),o.hasTouch=!!o.win.TouchEvent,o.marginNames=["plotTop","marginRight","marginBottom","plotLeft"],o.noop=function(){},o.supportsPassiveEvents=function(){var c=!1;if(!o.isMS){var l=Object.defineProperty({},"passive",{get:function(){c=!0}});o.win.addEventListener&&o.win.removeEventListener&&(o.win.addEventListener("testPassive",o.noop,l),o.win.removeEventListener("testPassive",o.noop,l))}return c}(),o.charts=[],o.dateFormats={},o.seriesTypes={},o.symbolSizes={},o.chartCount=0}(s||(s={})),s}),i(n,"Core/Utilities.js",[n["Core/Globals.js"]],function(r){function s(p,R,I,j){var $=R?"Highcharts error":"Highcharts warning";p===32&&(p=$+": Deprecated member");var et=b(p),it=et?$+" #"+p+": www.highcharts.com/errors/"+p+"/":p.toString();if(typeof j<"u"){var H="";et&&(it+="?"),S(j,function(z,L){H+=` - - `+L+": "+z,et&&(it+=encodeURI(L)+"="+encodeURI(z))}),it+=H}A(r,"displayError",{chart:I,code:p,message:it,params:j},function(){if(R)throw Error(it);g.console&&s.messages.indexOf(it)===-1&&console.warn(it)}),s.messages.push(it)}function o(p,R){var I={};return S(p,function(j,$){_(p[$],!0)&&!p.nodeType&&R[$]?(j=o(p[$],R[$]),Object.keys(j).length&&(I[$]=j)):(_(p[$])||p[$]!==R[$])&&(I[$]=p[$])}),I}function c(p,R){return parseInt(p,R||10)}function l(p){return typeof p=="string"}function O(p){return p=Object.prototype.toString.call(p),p==="[object Array]"||p==="[object Array Iterator]"}function _(p,R){return!!p&&typeof p=="object"&&(!R||!O(p))}function v(p){return _(p)&&typeof p.nodeType=="number"}function E(p){var R=p&&p.constructor;return!(!_(p,!0)||v(p)||!R||!R.name||R.name==="Object")}function b(p){return typeof p=="number"&&!isNaN(p)&&1/0>p&&-1/0=R-1&&(R=Math.floor(I)),Math.max(0,R-(j(p,"padding-left",!0)||0)-(j(p,"padding-right",!0)||0));if(R==="height")return Math.max(0,Math.min(p.offsetHeight,p.scrollHeight)-(j(p,"padding-top",!0)||0)-(j(p,"padding-bottom",!0)||0));if(g.getComputedStyle||s(27,!0),p=g.getComputedStyle(p,void 0)){var $=p.getPropertyValue(R);k(I,R!=="opacity")&&($=c($))}return $}function S(p,R,I){for(var j in p)Object.hasOwnProperty.call(p,j)&&R.call(I||p[j],p[j],j,p)}function w(p,R,I){function j(H,z){var L=p.removeEventListener||r.removeEventListenerPolyfill;L&&L.call(p,H,z,!1)}function $(H){var z;if(p.nodeName){if(R){var L={};L[R]=!0}else L=H;S(L,function(N,V){if(H[V])for(z=H[V].length;z--;)j(V,H[V][z].fn)})}}var et=typeof p=="function"&&p.prototype||p;if(Object.hasOwnProperty.call(et,"hcEvents")){var it=et.hcEvents;R?(et=it[R]||[],I?(it[R]=et.filter(function(H){return I!==H.fn}),j(R,I)):($(it),it[R]=[])):($(it),delete et.hcEvents)}}function A(p,R,I,j){if(I=I||{},u.createEvent&&(p.dispatchEvent||p.fireEvent&&p!==r)){var $=u.createEvent("Events");$.initEvent(R,!0,!0),I=T($,I),p.dispatchEvent?p.dispatchEvent(I):p.fireEvent(R,I)}else if(p.hcEvents){I.target||T(I,{preventDefault:function(){I.defaultPrevented=!0},target:p,type:R}),$=[];for(var et=p,it=!1;et.hcEvents;)Object.hasOwnProperty.call(et,"hcEvents")&&et.hcEvents[R]&&($.length&&(it=!0),$.unshift.apply($,et.hcEvents[R])),et=Object.getPrototypeOf(et);it&&$.sort(function(H,z){return H.order-z.order}),$.forEach(function(H){H.fn.call(p,I)===!1&&I.preventDefault()})}j&&!I.defaultPrevented&&j.call(p,I)}var f=r.charts,u=r.doc,g=r.win;(s||(s={})).messages=[],Math.easeInOutSine=function(p){return-.5*(Math.cos(Math.PI*p)-1)};var h=Array.prototype.find?function(p,R){return p.find(R)}:function(p,R){var I,j=p.length;for(I=0;II&&(I=p[R]);return I},arrayMin:function(p){for(var R=p.length,I=p[0];R--;)p[R]R?p"u"||I==="__proto__"||(R=R[I],!P(R)||typeof R=="function"||typeof R.nodeType=="number"||R===g))return}return R},getStyle:a,inArray:function(p,R,I){return s(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),R.indexOf(p,I)},isArray:O,isClass:E,isDOMElement:v,isFunction:function(p){return typeof p=="function"},isNumber:b,isObject:_,isString:l,keys:function(p){return s(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(p)},merge:function(){var p,R=arguments,I={},j=function(et,it){return typeof et!="object"&&(et={}),S(it,function(H,z){z!=="__proto__"&&z!=="constructor"&&(!_(H,!0)||E(H)||v(H)?et[z]=it[z]:et[z]=j(et[z]||{},H))}),et};R[0]===!0&&(I=R[1],R=Array.prototype.slice.call(R,2));var $=R.length;for(p=0;p<$;p++)I=j(I,R[p]);return I},normalizeTickInterval:function(p,R,I,j,$){var et=p;I=k(I,1);var it=p/I;for(R||(R=$?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],j===!1&&(I===1?R=R.filter(function(H){return H%1===0}):.1>=I&&(R=[1/I]))),j=0;j=p||!$&&it<=(R[j]+(R[j+1]||R[j]))/2));j++);return et=y(et*I,-Math.round(Math.log(.001)/Math.LN10))},objectEach:S,offset:function(p){var R=u.documentElement;return p=p.parentElement||p.parentNode?p.getBoundingClientRect():{top:0,left:0,width:0,height:0},{top:p.top+(g.pageYOffset||R.scrollTop)-(R.clientTop||0),left:p.left+(g.pageXOffset||R.scrollLeft)-(R.clientLeft||0),width:p.width,height:p.height}},pad:function(p,R,I){return Array((R||2)+1-String(p).replace("-","").length).join(I||"0")+p},pick:k,pInt:c,relativeLength:function(p,R,I){return/%$/.test(p)?R*parseFloat(p)/100+(I||0):parseFloat(p)},removeEvent:w,splat:function(p){return O(p)?p:[p]},stableSort:function(p,R){var I=p.length,j,$;for($=0;$>16,(b&65280)>>8,b&255,1]:E===4&&(v=[(b&3840)>>4|(b&3840)>>8,(b&240)>>4|b&240,(b&15)<<4|b&15,1])}if(!v)for(b=O.parsers.length;b--&&!v;){var P=O.parsers[b];(E=P.regex.exec(_))&&(v=P.parse(E))}}v&&(this.rgba=v)},O.prototype.get=function(_){var v=this.input,E=this.rgba;if(typeof v=="object"&&typeof this.stops<"u"){var b=c(v);return b.stops=[].slice.call(b.stops),this.stops.forEach(function(P,m){b.stops[m]=[b.stops[m][0],P.get(_)]}),b}return E&&o(E[0])?_==="rgb"||!_&&E[3]===1?"rgb("+E[0]+","+E[1]+","+E[2]+")":_==="a"?""+E[3]:"rgba("+E.join(",")+")":v},O.prototype.brighten=function(_){var v=this.rgba;if(this.stops)this.stops.forEach(function(b){b.brighten(_)});else if(o(_)&&_!==0)for(var E=0;3>E;E++)v[E]+=l(255*_),0>v[E]&&(v[E]=0),255u?"AM":"PM",P:12>u?"am":"pm",S:b(f.getSeconds()),L:b(Math.floor(S%1e3),3)},r.dateFormats),E(f,function(j,$){for(;a.indexOf("%"+$)!==-1;)a=a.replace("%"+$,typeof j=="function"?j.call(A,S):j)}),w?a.substr(0,1).toUpperCase()+a.substr(1):a},y.prototype.resolveDTLFormat=function(a){return _(a,!0)?a:(a=m(a),{main:a[0],from:a[1],to:a[2]})},y.prototype.getTimeTicks=function(a,S,w,A){var f=this,u=[],g={},h=new f.Date(S),x=a.unitRange,d=a.count||1,p;if(A=P(A,1),c(S)){if(f.set("Milliseconds",h,x>=T.second?0:d*Math.floor(f.get("Milliseconds",h)/d)),x>=T.second&&f.set("Seconds",h,x>=T.minute?0:d*Math.floor(f.get("Seconds",h)/d)),x>=T.minute&&f.set("Minutes",h,x>=T.hour?0:d*Math.floor(f.get("Minutes",h)/d)),x>=T.hour&&f.set("Hours",h,x>=T.day?0:d*Math.floor(f.get("Hours",h)/d)),x>=T.day&&f.set("Date",h,x>=T.month?1:Math.max(1,d*Math.floor(f.get("Date",h)/d))),x>=T.month){f.set("Month",h,x>=T.year?0:d*Math.floor(f.get("Month",h)/d));var R=f.get("FullYear",h)}x>=T.year&&f.set("FullYear",h,R-R%d),x===T.week&&(R=f.get("Day",h),f.set("Date",h,f.get("Date",h)-R+A+(R4*T.month||f.getTimezoneOffset(S)!==f.getTimezoneOffset(w)),S=h.getTime(),h=1;Su.length&&u.forEach(function($){$%18e5===0&&f.dateFormat("%H%M%S%L",$)==="000000000"&&(g[$]="day")})}return u.info=O(a,{higherRanks:g,totalRange:x*d}),u},y.prototype.getDateFormat=function(a,S,w,A){var f=this.dateFormat("%m-%d %H:%M:%S.%L",S),u={millisecond:15,second:12,minute:9,hour:6,day:3},g="millisecond";for(h in T){if(a===T.week&&+this.dateFormat("%w",S)===w&&f.substr(6)==="00:00:00.000"){var h="week";break}if(T[h]>a){h=g;break}if(u[h]&&f.substr(u[h])!=="01-01 00:00:00.000".substr(u[h]))break;h!=="week"&&(g=h)}if(h)var x=this.resolveDTLFormat(A[h]).main;return x},y}(),s}),i(n,"Core/DefaultOptions.js",[n["Core/Chart/ChartDefaults.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Color/Palettes.js"],n["Core/Time.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){s=s.parse;var _=O.merge,v={colors:c.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:r,title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:o.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:o.isTouchDevice?25:10,headerFormat:'{point.key}
',pointFormat:' {series.name}: {point.y}
',backgroundColor:s("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};v.chart.styledMode=!1;var E=new l(_(v.global,v.time));return r={defaultOptions:v,defaultTime:E,getOptions:function(){return v},setOptions:function(b){return _(!0,v,b),(b.time||b.global)&&(o.time?o.time.update(_(v.global,v.time,b.global,b.time)):o.time=E),v}},r}),i(n,"Core/Animation/Fx.js",[n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.parse,l=s.win,O=o.isNumber,_=o.objectEach;return function(){function v(E,b,P){this.pos=NaN,this.options=b,this.elem=E,this.prop=P}return v.prototype.dSetter=function(){var E=this.paths,b=E&&E[0];E=E&&E[1];var P=this.now||0,m=[];if(P!==1&&b&&E)if(b.length===E.length&&1>P)for(var T=0;T=k+this.startTime){this.now=this.end,this.pos=1,this.update();var y=M[this.prop]=!0;_(M,function(a){a!==!0&&(y=!1)}),y&&T&&T.call(m),E=!1}else this.pos=P.easing((b-this.startTime)/k),this.now=this.start+(this.end-this.start)*this.pos,this.update(),E=!0;return E},v.prototype.initPath=function(E,b,P){function m(f,u){for(;f.length"u"&&(b=[])}if(b.length&&O(S)){var A=P.length+S*a;w?(m(b,P),T(P,b)):(m(P,b),T(b,P))}return[b,P]},v.prototype.fillSetter=function(){v.prototype.strokeSetter.apply(this,arguments)},v.prototype.strokeSetter=function(){this.elem.attr(this.prop,c(this.start).tweenTo(c(this.end),this.pos),void 0,!0)},v.timers=[],v}()}),i(n,"Core/Animation/AnimationUtilities.js",[n["Core/Animation/Fx.js"],n["Core/Utilities.js"]],function(r,s){function o(T){return E(T)?b({duration:500,defer:0},T):{duration:T?500:0,defer:0}}function c(T,k){for(var M=r.timers.length;M--;)r.timers[M].elem!==T||k&&k!==r.timers[M].prop||(r.timers[M].stopped=!0)}var l=s.defined,O=s.getStyle,_=s.isArray,v=s.isNumber,E=s.isObject,b=s.merge,P=s.objectEach,m=s.pick;return{animate:function(T,k,M){var y,a="",S,w;if(!E(M)){var A=arguments;M={duration:A[2],easing:A[3],complete:A[4]}}v(M.duration)||(M.duration=400),M.easing=typeof M.easing=="function"?M.easing:Math[M.easing]||Math.easeInOutSine,M.curAnim=b(k),P(k,function(f,u){c(T,u),w=new r(T,M,u),S=void 0,u==="d"&&_(k.d)?(w.paths=w.initPath(T,T.pathArray,k.d),w.toD=k.d,y=0,S=1):T.attr?y=T.attr(u):(y=parseFloat(O(T,u))||0,u!=="opacity"&&(a="px")),S||(S=f),typeof S=="string"&&S.match("px")&&(S=S.replace(/px/g,"")),w.run(y,S,a)})},animObject:o,getDeferredAnimation:function(T,k,M){var y=o(k),a=0,S=0;return(M?[M]:T.series).forEach(function(w){w=o(w.options.animation),a=k&&l(k.defer)?y.defer:Math.max(a,w.duration+w.defer),S=Math.min(y.duration,w.duration)}),T.renderer.forExport&&(a=0),{defer:Math.max(0,a-S),duration:Math.min(a,S)}},setAnimation:function(T,k){k.renderer.globalAnimation=m(T,k.options.chart.animation,!0)},stop:c}}),i(n,"Core/Renderer/HTML/AST.js",[n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s){var o=r.SVG_NS,c=s.attr,l=s.createElement,O=s.error,_=s.isFunction,v=s.isString,E=s.objectEach,b=s.splat,P=(s=r.win.trustedTypes)&&_(s.createPolicy)&&s.createPolicy("highcharts",{createHTML:function(k){return k}}),m=P?P.createHTML(""):"";try{var T=!!new DOMParser().parseFromString(m,"text/html")}catch{T=!1}return _=function(){function k(M){this.nodes=typeof M=="string"?this.parseMarkup(M):M}return k.filterUserAttributes=function(M){return E(M,function(y,a){var S=!0;k.allowedAttributes.indexOf(a)===-1&&(S=!1),["background","dynsrc","href","lowsrc","src"].indexOf(a)!==-1&&(S=v(y)&&k.allowedReferences.some(function(w){return y.indexOf(w)===0})),S||(O("Highcharts warning: Invalid attribute '"+a+"' in config"),delete M[a])}),M},k.setElementHTML=function(M,y){M.innerHTML=k.emptyHTML,y&&new k(y).addToDOM(M)},k.prototype.addToDOM=function(M){function y(a,S){var w;return b(a).forEach(function(A){var f=A.tagName,u=A.textContent?r.doc.createTextNode(A.textContent):void 0;if(f)if(f==="#text")var g=u;else if(k.allowedTags.indexOf(f)!==-1){f=r.doc.createElementNS(f==="svg"?o:S.namespaceURI||o,f);var h=A.attributes||{};E(A,function(x,d){d!=="tagName"&&d!=="attributes"&&d!=="children"&&d!=="textContent"&&(h[d]=x)}),c(f,k.filterUserAttributes(h)),u&&f.appendChild(u),y(A.children||[],f),g=f}else O("Highcharts warning: Invalid tagName "+f+" in config");g&&S.appendChild(g),w=g}),w}return y(this.nodes,M)},k.prototype.parseMarkup=function(M){var y=[];if(M=M.trim(),T)M=new DOMParser().parseFromString(P?P.createHTML(M):M,"text/html");else{var a=l("div");a.innerHTML=M,M={body:a}}var S=function(w,A){var f=w.nodeName.toLowerCase(),u={tagName:f};if(f==="#text"&&(u.textContent=w.textContent||""),f=w.attributes){var g={};[].forEach.call(f,function(x){g[x.name]=x.value}),u.attributes=g}if(w.childNodes.length){var h=[];[].forEach.call(w.childNodes,function(x){S(x,h)}),h.length&&(u.children=h)}A.push(u)};return[].forEach.call(M.body.childNodes,function(w){return S(w,y)}),y},k.allowedAttributes="aria-controls aria-describedby aria-expanded aria-haspopup aria-hidden aria-label aria-labelledby aria-live aria-pressed aria-readonly aria-roledescription aria-selected class clip-path color colspan cx cy d dx dy disabled fill height href id in markerHeight markerWidth offset opacity orient padding paddingLeft paddingRight patternUnits r refX refY role scope slope src startOffset stdDeviation stroke stroke-linecap stroke-width style tableValues result rowspan summary target tabindex text-align textAnchor textLength title type valign width x x1 x2 y y1 y2 zIndex".split(" "),k.allowedReferences="https:// http:// mailto: / ../ ./ #".split(" "),k.allowedTags="a abbr b br button caption circle clipPath code dd defs div dl dt em feComponentTransfer feFuncA feFuncB feFuncG feFuncR feGaussianBlur feOffset feMerge feMergeNode filter h1 h2 h3 h4 h5 h6 hr i img li linearGradient marker ol p path pattern pre rect small span stop strong style sub sup svg table text thead tbody tspan td th tr u ul #text".split(" "),k.emptyHTML=m,k}(),_}),i(n,"Core/FormatUtilities.js",[n["Core/DefaultOptions.js"],n["Core/Utilities.js"]],function(r,s){function o(b,P,m,T){b=+b||0,P=+P;var k=c.lang,M=(b.toString().split(".")[1]||"").split("e")[0].length,y=b.toString().split("e"),a=P;if(P===-1)P=Math.min(M,20);else if(!_(P))P=2;else if(P&&y[1]&&0>y[1]){var S=P+ +y[1];0<=S?(y[0]=(+y[0]).toExponential(S).split("e")[0],P=S):(y[0]=y[0].split(".")[0]||0,b=20>P?(y[0]*Math.pow(10,y[1])).toFixed(P):0,y[1]=0)}S=(Math.abs(y[1]?y[0]:b)+Math.pow(10,-Math.max(P,M)-1)).toFixed(P),M=String(E(S));var w=3b?"-":"")+(w?M.substr(0,w)+T:""),b=0>+y[1]&&!a?"0":b+M.substr(w).replace(/(\d{3})(?=\d)/g,"$1"+T),P&&(b+=m+S.slice(-P)),y[1]&&+b!=0&&(b+="e"+y[1]),b}var c=r.defaultOptions,l=r.defaultTime,O=s.getNestedProperty,_=s.isNumber,v=s.pick,E=s.pInt;return{dateFormat:function(b,P,m){return l.dateFormat(b,P,m)},format:function(b,P,m){var T="{",k=!1,M=/f$/,y=/\.([0-9])/,a=c.lang,S=m&&m.time||l;m=m&&m.numberFormatter||o;for(var w=[];b;){var A=b.indexOf(T);if(A===-1)break;var f=b.slice(0,A);if(k){if(f=f.split(":"),T=O(f.shift()||"",P),f.length&&typeof T=="number")if(f=f.join(":"),M.test(f)){var u=parseInt((f.match(y)||["","-1"])[1],10);T!==null&&(T=m(T,u,a.decimalPoint,-1m){for(c(v,T),S=M=0;S<=m;)S+=v[M].size,M++;a=v.splice(M-1,v.length)}for(c(v,k),v=v.map(function(w){return{size:w.size,targets:[w.target],align:o(w.align,.5)}});y;){for(M=v.length;M--;)m=v[M],T=(Math.min.apply(0,m.targets)+Math.max.apply(0,m.targets))/2,m.pos=s(T-m.size*m.align,0,E-m.size);for(M=v.length,y=!1;M--;)0v[M].pos&&(v[M-1].size+=v[M].size,v[M-1].targets=v[M-1].targets.concat(v[M].targets),v[M-1].align=.5,v[M-1].pos+v[M-1].size>E&&(v[M-1].pos=E-v[M-1].size),v.splice(M,1),y=!0)}return P.push.apply(P,a),M=0,v.some(function(w){var A=0;return(w.targets||[]).some(function(){return P[M].pos=w.pos+A,typeof b<"u"&&Math.abs(P[M].pos-P[M].target)>b?(P.slice(0,M+1).forEach(function(f){return delete f.pos}),P.reducedLen=(P.reducedLen||E)-.1*E,P.reducedLen>.1*E&&_(P,E,b),!0):(A+=P[M].size,M++,!1)})}),c(P,k),P}O.distribute=_}(l||(l={})),l}),i(n,"Core/Renderer/SVG/SVGElement.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Renderer/HTML/AST.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o,c,l){var O=r.animate,_=r.animObject,v=r.stop,E=c.deg2rad,b=c.doc,P=c.noop,m=c.svg,T=c.SVG_NS,k=c.win,M=l.addEvent,y=l.attr,a=l.createElement,S=l.css,w=l.defined,A=l.erase,f=l.extend,u=l.fireEvent,g=l.isArray,h=l.isFunction,x=l.isNumber,d=l.isString,p=l.merge,R=l.objectEach,I=l.pick,j=l.pInt,$=l.syncTimeout,et=l.uniqueKey;return r=function(){function it(){this.element=void 0,this.onEvents={},this.opacity=1,this.renderer=void 0,this.SVG_NS=T,this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" ")}return it.prototype._defaultGetter=function(H){return H=I(this[H+"Value"],this[H],this.element?this.element.getAttribute(H):null,0),/^[\-0-9\.]+$/.test(H)&&(H=parseFloat(H)),H},it.prototype._defaultSetter=function(H,z,L){L.setAttribute(z,H)},it.prototype.add=function(H){var z=this.renderer,L=this.element;if(H&&(this.parentGroup=H),this.parentInverted=H&&H.inverted,typeof this.textStr<"u"&&this.element.nodeName==="text"&&z.buildText(this),this.added=!0,!H||H.handleZ||this.zIndex)var N=this.zIndexSetter();return N||(H?H.element:z.box).appendChild(L),this.onAdd&&this.onAdd(),this},it.prototype.addClass=function(H,z){var L=z?"":this.attr("class")||"";return H=(H||"").split(/ /g).reduce(function(N,V){return L.indexOf(V)===-1&&N.push(V),N},L?[L]:[]).join(" "),H!==L&&this.attr("class",H),this},it.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},it.prototype.align=function(H,z,L){var N={},V=this.renderer,K=V.alignedObjects,G,J,C;H?(this.alignOptions=H,this.alignByTranslate=z,(!L||d(L))&&(this.alignTo=G=L||"renderer",A(K,this),K.push(this),L=void 0)):(H=this.alignOptions,z=this.alignByTranslate,G=this.alignTo),L=I(L,V[G],G==="scrollablePlotBox"?V.plotBox:void 0,V),G=H.align;var U=H.verticalAlign;return V=(L.x||0)+(H.x||0),K=(L.y||0)+(H.y||0),G==="right"?J=1:G==="center"&&(J=2),J&&(V+=(L.width-(H.width||0))/J),N[z?"translateX":"x"]=Math.round(V),U==="bottom"?C=1:U==="middle"&&(C=2),C&&(K+=(L.height-(H.height||0))/C),N[z?"translateY":"y"]=Math.round(K),this[this.placed?"animate":"attr"](N),this.placed=!0,this.alignAttr=N,this},it.prototype.alignSetter=function(H){var z={left:"start",center:"middle",right:"end"};z[H]&&(this.alignValue=H,this.element.setAttribute("text-anchor",z[H]))},it.prototype.animate=function(H,z,L){var N=this,V=_(I(z,this.renderer.globalAnimation,!0));return z=V.defer,I(b.hidden,b.msHidden,b.webkitHidden,!1)&&(V.duration=0),V.duration!==0?(L&&(V.complete=L),$(function(){N.element&&O(N,H,V)},z)):(this.attr(H,void 0,L),R(H,function(K,G){V.step&&V.step.call(this,K,{prop:G,pos:1,elem:this})},this)),this},it.prototype.applyTextOutline=function(H){var z=this.element;H.indexOf("contrast")!==-1&&(H=H.replace(/contrast/g,this.renderer.getContrast(z.style.fill)));var L=H.split(" ");if(H=L[L.length-1],(L=L[0])&&L!=="none"&&c.svg){this.fakeTS=!0,this.ySetter=this.xSetter,L=L.replace(/(^[\d\.]+)(.*?)$/g,function(K,G,J){return 2*Number(G)+J}),this.removeTextOutline();var N=b.createElementNS(T,"tspan");y(N,{class:"highcharts-text-outline",fill:H,stroke:H,"stroke-width":L,"stroke-linejoin":"round"}),[].forEach.call(z.childNodes,function(K){var G=K.cloneNode(!0);G.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach(function(J){return G.removeAttribute(J)}),N.appendChild(G)});var V=b.createElementNS(T,"tspan");V.textContent="​",["x","y"].forEach(function(K){var G=z.getAttribute(K);G&&V.setAttribute(K,G)}),N.appendChild(V),z.insertBefore(N,z.firstChild)}},it.prototype.attr=function(H,z,L,N){var V=this.element,K=this.symbolCustomAttribs,G,J=this,C,U;if(typeof H=="string"&&typeof z<"u"){var B=H;H={},H[B]=z}return typeof H=="string"?J=(this[H+"Getter"]||this._defaultGetter).call(this,H,V):(R(H,function(tt,D){C=!1,N||v(this,D),this.symbolName&&K.indexOf(D)!==-1&&(G||(this.symbolAttr(H),G=!0),C=!0),!this.rotation||D!=="x"&&D!=="y"||(this.doTransform=!0),C||(U=this[D+"Setter"]||this._defaultSetter,U.call(this,tt,D,V),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(D)&&this.updateShadows(D,tt,U))},this),this.afterSetters()),L&&L.call(this),J},it.prototype.clip=function(H){return this.attr("clip-path",H?"url("+this.renderer.url+"#"+H.id+")":"none")},it.prototype.crisp=function(H,z){z=z||H.strokeWidth||0;var L=Math.round(z)%2/2;return H.x=Math.floor(H.x||this.x||0)+L,H.y=Math.floor(H.y||this.y||0)+L,H.width=Math.floor((H.width||this.width||0)-2*L),H.height=Math.floor((H.height||this.height||0)-2*L),w(H.strokeWidth)&&(H.strokeWidth=z),H},it.prototype.complexColor=function(H,z,L){var N=this.renderer,V,K,G,J,C,U,B,tt,D,F,X=[],st;u(this.renderer,"complexColor",{args:arguments},function(){if(H.radialGradient?K="radialGradient":H.linearGradient&&(K="linearGradient"),K){if(G=H[K],C=N.gradients,U=H.stops,D=L.radialReference,g(G)&&(H[K]=G={x1:G[0],y1:G[1],x2:G[2],y2:G[3],gradientUnits:"userSpaceOnUse"}),K==="radialGradient"&&D&&!w(G.gradientUnits)&&(J=G,G=p(G,N.getRadialAttr(D,J),{gradientUnits:"userSpaceOnUse"})),R(G,function(lt,ct){ct!=="id"&&X.push(ct,lt)}),R(U,function(lt){X.push(lt)}),X=X.join(","),C[X])F=C[X].attr("id");else{G.id=F=et();var ot=C[X]=N.createElement(K).attr(G).add(N.defs);ot.radAttr=J,ot.stops=[],U.forEach(function(lt){lt[1].indexOf("rgba")===0?(V=o.parse(lt[1]),B=V.get("rgb"),tt=V.get("a")):(B=lt[1],tt=1),lt=N.createElement("stop").attr({offset:lt[0],"stop-color":B,"stop-opacity":tt}).add(ot),ot.stops.push(lt)})}st="url("+N.url+"#"+F+")",L.setAttribute(z,st),L.gradient=X,H.toString=function(){return st}}})},it.prototype.css=function(H){var z=this.styles,L={},N=this.element,V=["textOutline","textOverflow","width"],K="",G=!z;if(H&&H.color&&(H.fill=H.color),z&&R(H,function(U,B){z&&z[B]!==U&&(L[B]=U,G=!0)}),G){if(z&&(H=f(z,L)),H){if(H.width===null||H.width==="auto")delete this.textWidth;else if(N.nodeName.toLowerCase()==="text"&&H.width)var J=this.textWidth=j(H.width)}if(this.styles=H,J&&!m&&this.renderer.forExport&&delete H.width,N.namespaceURI===this.SVG_NS){var C=function(U,B){return"-"+B.toLowerCase()};R(H,function(U,B){V.indexOf(B)===-1&&(K+=B.replace(/([A-Z])/g,C)+":"+U+";")}),K&&y(N,"style",K)}else S(N,H);this.added&&(this.element.nodeName==="text"&&this.renderer.buildText(this),H&&H.textOutline&&this.applyTextOutline(H.textOutline))}return this},it.prototype.dashstyleSetter=function(H){var z=this["stroke-width"];if(z==="inherit"&&(z=1),H=H&&H.toLowerCase()){var L=H.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(H=L.length;H--;)L[H]=""+j(L[H])*I(z,NaN);H=L.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",H)}},it.prototype.destroy=function(){var H=this,z=H.element||{},L=H.renderer,N=z.ownerSVGElement,V=L.isSVG&&z.nodeName==="SPAN"&&H.parentGroup||void 0;if(z.onclick=z.onmouseout=z.onmouseover=z.onmousemove=z.point=null,v(H),H.clipPath&&N){var K=H.clipPath;[].forEach.call(N.querySelectorAll("[clip-path],[CLIP-PATH]"),function(G){-1B.width)&&(B={width:0,height:0})}else B=this.htmlGetBBox();if(L.isSVG&&(H=B.width,L=B.height,C&&(B.height=L={"11px,17":14,"13px,20":16}[(U||"")+","+Math.round(L)]||L),z&&(C=z*E,B.width=Math.abs(L*Math.sin(C))+Math.abs(H*Math.cos(C)),B.height=Math.abs(L*Math.cos(C))+Math.abs(H*Math.sin(C)))),tt&&(K===""||0]*>/g,"").replace(/</g,"<").replace(/>/g,">")},it.prototype.toFront=function(){var H=this.element;return H.parentNode.appendChild(H),this},it.prototype.translate=function(H,z){return this.attr({translateX:H,translateY:z})},it.prototype.updateShadows=function(H,z,L){var N=this.shadows;if(N)for(var V=N.length;V--;)L.call(N[V],H==="height"?Math.max(z-(N[V].cutHeight||0),0):H==="d"?this.d:z,H,N[V])},it.prototype.updateTransform=function(){var H=this.scaleX,z=this.scaleY,L=this.inverted,N=this.rotation,V=this.matrix,K=this.element,G=this.translateX||0,J=this.translateY||0;L&&(G+=this.width,J+=this.height),G=["translate("+G+","+J+")"],w(V)&&G.push("matrix("+V.join(",")+")"),L?G.push("rotate(90) scale(-1,1)"):N&&G.push("rotate("+N+" "+I(this.rotationOriginX,K.getAttribute("x"),0)+" "+I(this.rotationOriginY,K.getAttribute("y")||0)+")"),(w(H)||w(z))&&G.push("scale("+I(H,1)+" "+I(z,1)+")"),G.length&&K.setAttribute("transform",G.join(" "))},it.prototype.visibilitySetter=function(H,z,L){H==="inherit"?L.removeAttribute(z):this[z]!==H&&L.setAttribute(z,H),this[z]=H},it.prototype.xGetter=function(H){return this.element.nodeName==="circle"&&(H==="x"?H="cx":H==="y"&&(H="cy")),this._defaultGetter(H)},it.prototype.zIndexSetter=function(H,z){var L=this.renderer,N=this.parentGroup,V=(N||L).element||L.box,K=this.element;L=V===L.box;var G=!1,J=this.added,C;if(w(H)?(K.setAttribute("data-z-index",H),H=+H,this[z]===H&&(J=!1)):w(this[z])&&K.removeAttribute("data-z-index"),this[z]=H,J){for((H=this.zIndex)&&N&&(N.handleZ=!0),z=V.childNodes,C=z.length-1;0<=C&&!G;C--){N=z[C],J=N.getAttribute("data-z-index");var U=!w(J);N!==K&&(0>H&&U&&!L&&!C?(V.insertBefore(K,z[C]),G=!0):(j(J)<=H||U&&(!w(H)||0<=H))&&(V.insertBefore(K,z[C+1]||null),G=!0))}G||(V.insertBefore(K,z[L?3:0]||null),G=!0)}return G},it}(),r.prototype["stroke-widthSetter"]=r.prototype.strokeSetter,r.prototype.yGetter=r.prototype.xGetter,r.prototype.matrixSetter=r.prototype.rotationOriginXSetter=r.prototype.rotationOriginYSetter=r.prototype.rotationSetter=r.prototype.scaleXSetter=r.prototype.scaleYSetter=r.prototype.translateXSetter=r.prototype.translateYSetter=r.prototype.verticalAlignSetter=function(it,H){this[H]=it,this.doTransform=!0},r}),i(n,"Core/Renderer/RendererRegistry.js",[n["Core/Globals.js"]],function(r){var s;return function(o){o.rendererTypes={};var c;o.getRendererType=function(l){return l===void 0&&(l=c),o.rendererTypes[l]||o.rendererTypes[c]},o.registerRendererType=function(l,O,_){o.rendererTypes[l]=O,(!c||_)&&(c=l,r.Renderer=O)}}(s||(s={})),s}),i(n,"Core/Renderer/SVG/SVGLabel.js",[n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s){var o=this&&this.__extends||function(){var b=function(P,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,k){T.__proto__=k}||function(T,k){for(var M in k)k.hasOwnProperty(M)&&(T[M]=k[M])},b(P,m)};return function(P,m){function T(){this.constructor=P}b(P,m),P.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}}(),c=s.defined,l=s.extend,O=s.isNumber,_=s.merge,v=s.pick,E=s.removeEvent;return function(b){function P(m,T,k,M,y,a,S,w,A,f){var u=b.call(this)||this;u.paddingLeftSetter=u.paddingSetter,u.paddingRightSetter=u.paddingSetter,u.init(m,"g"),u.textStr=T,u.x=k,u.y=M,u.anchorX=a,u.anchorY=S,u.baseline=A,u.className=f,u.addClass(f==="button"?"highcharts-no-tooltip":"highcharts-label"),f&&u.addClass("highcharts-"+f),u.text=m.text(void 0,0,0,w).attr({zIndex:1});var g;return typeof y=="string"&&((g=/^url\((.*?)\)$/.test(y))||u.renderer.symbols[y])&&(u.symbolKey=y),u.bBox=P.emptyBBox,u.padding=3,u.baselineOffset=0,u.needsBox=m.styledMode||g,u.deferredAttr={},u.alignFactor=0,u}return o(P,b),P.prototype.alignSetter=function(m){m={left:0,center:.5,right:1}[m],m!==this.alignFactor&&(this.alignFactor=m,this.bBox&&O(this.xSetting)&&this.attr({x:this.xSetting}))},P.prototype.anchorXSetter=function(m,T){this.anchorX=m,this.boxAttr(T,Math.round(m)-this.getCrispAdjust()-this.xSetting)},P.prototype.anchorYSetter=function(m,T){this.anchorY=m,this.boxAttr(T,m-this.ySetting)},P.prototype.boxAttr=function(m,T){this.box?this.box.attr(m,T):this.deferredAttr[m]=T},P.prototype.css=function(m){if(m){var T={};m=_(m),P.textProps.forEach(function(M){typeof m[M]<"u"&&(T[M]=m[M],delete m[M])}),this.text.css(T);var k="width"in T;"fontSize"in T||"fontWeight"in T?this.updateTextPadding():k&&this.updateBoxSize()}return r.prototype.css.call(this,m)},P.prototype.destroy=function(){E(this.element,"mouseenter"),E(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),r.prototype.destroy.call(this)},P.prototype.fillSetter=function(m,T){m&&(this.needsBox=!0),this.fill=m,this.boxAttr(T,m)},P.prototype.getBBox=function(){this.textStr&&this.bBox.width===0&&this.bBox.height===0&&this.updateBoxSize();var m=this.padding,T=v(this.paddingLeft,m);return{width:this.width,height:this.height,x:this.bBox.x-T,y:this.bBox.y-m}},P.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},P.prototype.heightSetter=function(m){this.heightSetting=m},P.prototype.onAdd=function(){var m=this.textStr;this.text.add(this),this.attr({text:c(m)?m:"",x:this.x,y:this.y}),this.box&&c(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},P.prototype.paddingSetter=function(m,T){O(m)?m!==this[T]&&(this[T]=m,this.updateTextPadding()):this[T]=void 0},P.prototype.rSetter=function(m,T){this.boxAttr(T,m)},P.prototype.shadow=function(m){return m&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(m)),this},P.prototype.strokeSetter=function(m,T){this.stroke=m,this.boxAttr(T,m)},P.prototype["stroke-widthSetter"]=function(m,T){m&&(this.needsBox=!0),this["stroke-width"]=m,this.boxAttr(T,m)},P.prototype["text-alignSetter"]=function(m){this.textAlign=m},P.prototype.textSetter=function(m){typeof m<"u"&&this.text.attr({text:m}),this.updateTextPadding()},P.prototype.updateBoxSize=function(){var m=this.text.element.style,T={},k=this.padding,M=this.bBox=O(this.widthSetting)&&O(this.heightSetting)&&!this.textAlign||!c(this.text.textStr)?P.emptyBBox:this.text.getBBox();this.width=this.getPaddedWidth(),this.height=(this.heightSetting||M.height||0)+2*k,m=this.renderer.fontMetrics(m&&m.fontSize,this.text),this.baselineOffset=k+Math.min((this.text.firstLineMetrics||m).b,M.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-m.h)/2),this.needsBox&&(this.box||(k=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),k.addClass((this.className==="button"?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),k.add(this)),k=this.getCrispAdjust(),T.x=k,T.y=(this.baseline?-this.baselineOffset:0)+k,T.width=Math.round(this.width),T.height=Math.round(this.height),this.box.attr(l(T,this.deferredAttr)),this.deferredAttr={})},P.prototype.updateTextPadding=function(){var m=this.text;this.updateBoxSize();var T=this.baseline?0:this.baselineOffset,k=v(this.paddingLeft,this.padding);c(this.widthSetting)&&this.bBox&&(this.textAlign==="center"||this.textAlign==="right")&&(k+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),(k!==m.x||T!==m.y)&&(m.attr("x",k),m.hasBoxWidthChanged&&(this.bBox=m.getBBox(!0)),typeof T<"u"&&m.attr("y",T)),m.x=k,m.y=T},P.prototype.widthSetter=function(m){this.widthSetting=O(m)?m:void 0},P.prototype.getPaddedWidth=function(){var m=this.padding,T=v(this.paddingLeft,m);return m=v(this.paddingRight,m),(this.widthSetting||this.bBox.width||0)+T+m},P.prototype.xSetter=function(m){this.x=m,this.alignFactor&&(m-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(m),this.attr("translateX",this.xSetting)},P.prototype.ySetter=function(m){this.ySetting=this.y=Math.round(m),this.attr("translateY",this.ySetting)},P.emptyBBox={width:0,height:0,x:0,y:0},P.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),P}(r)}),i(n,"Core/Renderer/SVG/Symbols.js",[n["Core/Utilities.js"]],function(r){function s(v,E,b,P,m){var T=[];if(m){var k=m.start||0,M=_(m.r,b);b=_(m.r,P||b);var y=(m.end||0)-.001;P=m.innerR;var a=_(m.open,.001>Math.abs((m.end||0)-k-2*Math.PI)),S=Math.cos(k),w=Math.sin(k),A=Math.cos(y),f=Math.sin(y);k=_(m.longArc,.001>y-k-Math.PI?0:1),T.push(["M",v+M*S,E+b*w],["A",M,b,0,k,_(m.clockwise,1),v+M*A,E+b*f]),l(P)&&T.push(a?["M",v+P*A,E+P*f]:["L",v+P*A,E+P*f],["A",P,P,0,k,l(m.clockwise)?1-m.clockwise:0,v+P*S,E+P*w]),a||T.push(["Z"])}return T}function o(v,E,b,P,m){return m&&m.r?c(v,E,b,P,m):[["M",v,E],["L",v+b,E],["L",v+b,E+P],["L",v,E+P],["Z"]]}function c(v,E,b,P,m){return m=m&&m.r||0,[["M",v+m,E],["L",v+b-m,E],["C",v+b,E,v+b,E,v+b,E+m],["L",v+b,E+P-m],["C",v+b,E+P,v+b,E+P,v+b-m,E+P],["L",v+m,E+P],["C",v,E+P,v,E+P,v,E+P-m],["L",v,E+m],["C",v,E,v,E,v+m,E]]}var l=r.defined,O=r.isNumber,_=r.pick;return{arc:s,callout:function(v,E,b,P,m){var T=Math.min(m&&m.r||0,b,P),k=T+6,M=m&&m.anchorX;m=m&&m.anchorY||0;var y=c(v,E,b,P,{r:T});return O(M)&&(v+M>=b?m>E+k&&m=v+M?m>E+k&&mP&&M>v+k&&Mm&&M>v+k&&M/g,w=[M,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,this.fontSize,this.width].join();if(w!==m.textCache){for(m.textCache=w,delete m.actualWidth,w=a.length;w--;)T.removeChild(a[w]);y||this.ellipsis||this.width||M.indexOf(" ")!==-1&&(!this.noWrap||S.test(M))?M!==""&&(k&&k.appendChild(T),M=new r(M),this.modifyTree(M.nodes),M.addToDOM(m.element),this.modifyDOM(),this.ellipsis&&(T.textContent||"").indexOf("…")!==-1&&m.attr("title",this.unescapeEntities(m.textStr||"",["<",">"])),k&&k.removeChild(T)):T.appendChild(c.createTextNode(this.unescapeEntities(M))),v(this.textOutline)&&m.applyTextOutline&&m.applyTextOutline(this.textOutline)}},P.prototype.modifyDOM=function(){var m=this,T=this.svgElement,k=_(T.element,"x");T.firstLineMetrics=void 0;for(var M;(M=T.element.firstChild)&&/^[\s\u200B]*$/.test(M.textContent||" ");)T.element.removeChild(M);[].forEach.call(T.element.querySelectorAll("tspan.highcharts-br"),function(w,A){w.nextSibling&&w.previousSibling&&(A===0&&w.previousSibling.nodeType===1&&(T.firstLineMetrics=T.renderer.fontMetrics(void 0,w.previousSibling)),_(w,{dy:m.getLineHeight(w.nextSibling),x:k}))});var y=this.width||0;if(y){var a=function(w,A){var f=w.textContent||"",u=f.replace(/([^\^])-/g,"$1- ").split(" "),g=!m.noWrap&&(1"u")if(j.getSubStringLength)try{f[I]=M+j.getSubStringLength(0,k?I+1:I)}catch{}else w.getSpanWidth&&(m.textContent=a(T||k,R),f[I]=M+w.getSpanWidth(S,m));return f[I]};S.rotation=0;var p=d(m.textContent.length);if(M+p>y){for(;u<=g;)h=Math.ceil((u+g)/2),k&&(x=a(k,h)),p=d(h,x&&x.length-1),u===g?u=g+1:p>y?g=h-1:u=h;g===0?m.textContent="":T&&g===T.length-1||(m.textContent=x||a(T||k,h))}k&&k.splice(0,h),S.actualWidth=p,S.rotation=A},P.prototype.unescapeEntities=function(m,T){return E(this.renderer.escapes,function(k,M){T&&T.indexOf(k)!==-1||(m=m.toString().replace(new RegExp(k,"g"),M))}),m},P}()}),i(n,"Core/Renderer/SVG/SVGRenderer.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Color/Color.js"],n["Core/Globals.js"],n["Core/Renderer/RendererRegistry.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGLabel.js"],n["Core/Renderer/SVG/Symbols.js"],n["Core/Renderer/SVG/TextBuilder.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E){var b=o.charts,P=o.deg2rad,m=o.doc,T=o.isFirefox,k=o.isMS,M=o.isWebKit,y=o.noop,a=o.SVG_NS,S=o.symbolSizes,w=o.win,A=E.addEvent,f=E.attr,u=E.createElement,g=E.css,h=E.defined,x=E.destroyObjectProperties,d=E.extend,p=E.isArray,R=E.isNumber,I=E.isObject,j=E.isString,$=E.merge,et=E.pick,it=E.pInt,H=E.uniqueKey,z;return o=function(){function L(N,V,K,G,J,C,U){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(N,V,K,G,J,C,U)}return L.prototype.init=function(N,V,K,G,J,C,U){var B=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}),tt=B.element;U||B.css(this.getStyle(G)),N.appendChild(tt),f(N,"dir","ltr"),N.innerHTML.indexOf("xmlns")===-1&&f(tt,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=tt,this.boxWrapper=B,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement("desc").add().element.appendChild(m.createTextNode("Created with Highcharts 9.3.3")),this.defs=this.createElement("defs").add(),this.allowHTML=C,this.forExport=J,this.styledMode=U,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(V,K,!1);var D;T&&N.getBoundingClientRect&&(V=function(){g(N,{left:0,top:0}),D=N.getBoundingClientRect(),g(N,{left:Math.ceil(D.left)-D.left+"px",top:Math.ceil(D.top)-D.top+"px"})},V(),this.unSubPixelFix=A(w,"resize",V))},L.prototype.definition=function(N){return new r([N]).addToDOM(this.defs.element)},L.prototype.getReferenceURL=function(){if((T||M)&&m.getElementsByTagName("base").length){if(!h(z)){var N=H();N=new r([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:N},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme",width:8,height:8,"clip-path":"url(#"+N+")",fill:"rgba(0,0,0,0.001)"}}]}]).addToDOM(m.body),g(N,{position:"fixed",top:0,left:0,zIndex:9e5});var V=m.elementFromPoint(6,6);z=(V&&V.id)==="hitme",m.body.removeChild(N)}if(z)return w.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20")}return""},L.prototype.getStyle=function(N){return this.style=d({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},N)},L.prototype.setStyle=function(N){this.boxWrapper.css(this.getStyle(N))},L.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},L.prototype.destroy=function(){var N=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),x(this.gradients||{}),this.gradients=null,N&&(this.defs=N.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},L.prototype.createElement=function(N){var V=new this.Element;return V.init(this,N),V},L.prototype.getRadialAttr=function(N,V){return{cx:N[0]-N[2]/2+(V.cx||0)*N[2],cy:N[1]-N[2]/2+(V.cy||0)*N[2],r:(V.r||0)*N[2]}},L.prototype.buildText=function(N){new v(N).buildSVG()},L.prototype.getContrast=function(N){return N=s.parse(N).rgba,N[0]*=1,N[1]*=1.2,N[2]*=.5,459"u"?{}:{x:N,y:V,r:K},V=this.createElement("circle"),V.xSetter=V.ySetter=function(G,J,C){C.setAttribute("c"+J,G)},V.attr(N)},L.prototype.arc=function(N,V,K,G,J,C){return I(N)?(G=N,V=G.y,K=G.r,N=G.x):G={innerR:G,start:J,end:C},N=this.symbol("arc",N,V,K,K,G),N.r=K,N},L.prototype.rect=function(N,V,K,G,J,C){J=I(N)?N.r:J;var U=this.createElement("rect");return N=I(N)?N:typeof N>"u"?{}:{x:N,y:V,width:Math.max(K,0),height:Math.max(G,0)},this.styledMode||(typeof C<"u"&&(N["stroke-width"]=C,N=U.crisp(N)),N.fill="none"),J&&(N.r=J),U.rSetter=function(B,tt,D){U.r=B,f(D,{rx:B,ry:B})},U.rGetter=function(){return U.r||0},U.attr(N)},L.prototype.setSize=function(N,V,K){this.width=N,this.height=V,this.boxWrapper.animate({width:N,height:V},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:et(K,!0)?void 0:0}),this.alignElements()},L.prototype.g=function(N){var V=this.createElement("g");return N?V.attr({class:"highcharts-"+N}):V},L.prototype.image=function(N,V,K,G,J,C){var U={preserveAspectRatio:"none"},B=function(D,F){D.setAttributeNS?D.setAttributeNS("http://www.w3.org/1999/xlink","href",F):D.setAttribute("hc-svg-href",F)};R(V)&&(U.x=V),R(K)&&(U.y=K),R(G)&&(U.width=G),R(J)&&(U.height=J);var tt=this.createElement("image").attr(U);return V=function(D){B(tt.element,N),C.call(tt,D)},C?(B(tt.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),K=new w.Image,A(K,"load",V),K.src=N,K.complete&&V({})):B(tt.element,N),tt},L.prototype.symbol=function(N,V,K,G,J,C){var U=this,B=/^url\((.*?)\)$/,tt=B.test(N),D=!tt&&(this.symbols[N]?N:"circle"),F=D&&this.symbols[D],X;if(F){typeof V=="number"&&(X=F.call(this.symbols,Math.round(V||0),Math.round(K||0),G||0,J||0,C));var st=this.path(X);U.styledMode||st.attr("fill","none"),d(st,{symbolName:D||void 0,x:V,y:K,width:G,height:J}),C&&d(st,C)}else if(tt){var ot=N.match(B)[1],lt=st=this.image(ot);lt.imgwidth=et(S[ot]&&S[ot].width,C&&C.width),lt.imgheight=et(S[ot]&&S[ot].height,C&&C.height);var ct=function(q){return q.attr({width:q.width,height:q.height})};["width","height"].forEach(function(q){lt[q+"Setter"]=function(Y,Z){var W=this["img"+Z];this[Z]=Y,h(W)&&(C&&C.backgroundSize==="within"&&this.width&&this.height&&(W=Math.round(W*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(Z,W),this.alignByTranslate||(Y=((this[Z]||0)-W)/2,this.attr(Z==="width"?{translateX:Y}:{translateY:Y})))}}),h(V)&<.attr({x:V,y:K}),lt.isImg=!0,h(lt.imgwidth)&&h(lt.imgheight)?ct(lt):(lt.attr({width:0,height:0}),u("img",{onload:function(){var q=b[U.chartIndex];this.width===0&&(g(this,{position:"absolute",top:"-999em"}),m.body.appendChild(this)),S[ot]={width:this.width,height:this.height},lt.imgwidth=this.width,lt.imgheight=this.height,lt.element&&ct(lt),this.parentNode&&this.parentNode.removeChild(this),U.imgCount--,!U.imgCount&&q&&!q.hasLoaded&&q.onload()},src:ot}),this.imgCount++)}return st},L.prototype.clipRect=function(N,V,K,G){var J=H()+"-",C=this.createElement("clipPath").attr({id:J}).add(this.defs);return N=this.rect(N,V,K,G,0).add(C),N.id=J,N.clipPath=C,N.count=0,N},L.prototype.text=function(N,V,K,G){var J={};return G&&(this.allowHTML||!this.forExport)?this.html(N,V,K):(J.x=Math.round(V||0),K&&(J.y=Math.round(K)),h(N)&&(J.text=N),N=this.createElement("text").attr(J),(!G||this.forExport&&!this.allowHTML)&&(N.xSetter=function(C,U,B){for(var tt=B.getElementsByTagName("tspan"),D=B.getAttribute(U),F=0,X;FN?N+3:Math.round(1.2*N),{h:V,b:Math.round(.8*V),f:N}},L.prototype.rotCorr=function(N,V,K){var G=N;return V&&K&&(G=Math.max(G*Math.cos(V*P),4)),{x:-N/3*Math.sin(V*P),y:G}},L.prototype.pathToSegments=function(N){for(var V=[],K=[],G={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},J=0;J":">","'":"'",'"':"""},symbols:_,draw:y}),c.registerRendererType("svg",o,!0),o}),i(n,"Core/Renderer/HTML/HTMLElement.js",[n["Core/Globals.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s,o){var c=this&&this.__extends||function(){var k=function(M,y){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,S){a.__proto__=S}||function(a,S){for(var w in S)S.hasOwnProperty(w)&&(a[w]=S[w])},k(M,y)};return function(M,y){function a(){this.constructor=M}k(M,y),M.prototype=y===null?Object.create(y):(a.prototype=y.prototype,new a)}}(),l=r.isFirefox,O=r.isMS,_=r.isWebKit,v=r.win,E=o.css,b=o.defined,P=o.extend,m=o.pick,T=o.pInt;return function(k){function M(){return k!==null&&k.apply(this,arguments)||this}return c(M,k),M.compose=function(y){if(M.composedClasses.indexOf(y)===-1){M.composedClasses.push(y);var a=M.prototype,S=y.prototype;S.getSpanCorrection=a.getSpanCorrection,S.htmlCss=a.htmlCss,S.htmlGetBBox=a.htmlGetBBox,S.htmlUpdateTransform=a.htmlUpdateTransform,S.setSpanRotation=a.setSpanRotation}return y},M.prototype.getSpanCorrection=function(y,a,S){this.xCorr=-y*S,this.yCorr=-a},M.prototype.htmlCss=function(y){var a=this.element.tagName==="SPAN"&&y&&"width"in y,S=m(a&&y.width,void 0);if(a){delete y.width,this.textWidth=S;var w=!0}return y&&y.textOverflow==="ellipsis"&&(y.whiteSpace="nowrap",y.overflow="hidden"),this.styles=P(this.styles,y),E(this.element,y),w&&this.htmlUpdateTransform(),this},M.prototype.htmlGetBBox=function(){var y=this.element;return{x:y.offsetLeft,y:y.offsetTop,width:y.offsetWidth,height:y.offsetHeight}},M.prototype.htmlUpdateTransform=function(){if(this.added){var y=this.renderer,a=this.element,S=this.translateX||0,w=this.translateY||0,A=this.x||0,f=this.y||0,u=this.textAlign||"left",g={left:0,center:.5,right:1}[u],h=this.styles;if(h=h&&h.whiteSpace,E(a,{marginLeft:S,marginTop:w}),!y.styledMode&&this.shadows&&this.shadows.forEach(function(j){E(j,{marginLeft:S+1,marginTop:w+1})}),this.inverted&&[].forEach.call(a.childNodes,function(j){y.invertChild(j,a)}),a.tagName==="SPAN"){var x=this.rotation,d=this.textWidth&&T(this.textWidth),p=[x,u,a.innerHTML,this.textWidth,this.textAlign].join(),R=void 0;if(R=!1,d!==this.oldTextWidth){if(this.textPxLength)var I=this.textPxLength;else E(a,{width:"",whiteSpace:h||"nowrap"}),I=a.offsetWidth;(d>this.oldTextWidth||I>d)&&(/[ \-]/.test(a.textContent||a.innerText)||a.style.textOverflow==="ellipsis")&&(E(a,{width:I>d||x?d+"px":"auto",display:"block",whiteSpace:h||"normal"}),this.oldTextWidth=d,R=!0)}this.hasBoxWidthChanged=R,p!==this.cTT&&(R=y.fontMetrics(a.style.fontSize,a).b,!b(x)||x===(this.oldRotation||0)&&u===this.oldAlign||this.setSpanRotation(x,g,R),this.getSpanCorrection(!b(x)&&this.textPxLength||a.offsetWidth,R,g,x,u)),E(a,{left:A+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"}),this.cTT=p,this.oldRotation=x,this.oldAlign=u}}else this.alignOnAdd=!0},M.prototype.setSpanRotation=function(y,a,S){var w={},A=O&&!/Edge/.test(v.navigator.userAgent)?"-ms-transform":_?"-webkit-transform":l?"MozTransform":v.opera?"-o-transform":void 0;A&&(w[A]=w.transform="rotate("+y+"deg)",w[A+(l?"Origin":"-origin")]=w.transformOrigin=100*a+"% "+S+"px",E(this.element,w))},M.composedClasses=[],M}(s)}),i(n,"Core/Renderer/HTML/HTMLRenderer.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGRenderer.js"],n["Core/Utilities.js"]],function(r,s,o,c){var l=this&&this.__extends||function(){var b=function(P,m){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,k){T.__proto__=k}||function(T,k){for(var M in k)k.hasOwnProperty(M)&&(T[M]=k[M])},b(P,m)};return function(P,m){function T(){this.constructor=P}b(P,m),P.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}}(),O=c.attr,_=c.createElement,v=c.extend,E=c.pick;return function(b){function P(){return b!==null&&b.apply(this,arguments)||this}return l(P,b),P.compose=function(m){return P.composedClasses.indexOf(m)===-1&&(P.composedClasses.push(m),m.prototype.html=P.prototype.html),m},P.prototype.html=function(m,T,k){var M=this.createElement("span"),y=M.element,a=M.renderer,S=a.isSVG,w=function(A,f){["opacity","visibility"].forEach(function(u){A[u+"Setter"]=function(g,h,x){var d=A.div?A.div.style:f;s.prototype[u+"Setter"].call(this,g,h,x),d&&(d[h]=g)}}),A.addedSetters=!0};return M.textSetter=function(A){A!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,r.setElementHTML(this.element,E(A,"")),this.textStr=A,M.doTransform=!0)},S&&w(M,M.element.style),M.xSetter=M.ySetter=M.alignSetter=M.rotationSetter=function(A,f){f==="align"?M.alignValue=M.textAlign=A:M[f]=A,M.doTransform=!0},M.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},M.attr({text:m,x:Math.round(T),y:Math.round(k)}).css({position:"absolute"}),a.styledMode||M.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),y.style.whiteSpace="nowrap",M.css=M.htmlCss,S&&(M.add=function(A){var f=a.box.parentNode,u=[];if(this.parentGroup=A){var g=A.div;if(!g){for(;A;)u.push(A),A=A.parentGroup;u.reverse().forEach(function(h){function x(I,j){h[j]=I,j==="translateX"?R.left=I+"px":R.top=I+"px",h.doTransform=!0}var d=O(h.element,"class"),p=h.styles||{};g=h.div=h.div||_("div",d?{className:d}:void 0,{position:"absolute",left:(h.translateX||0)+"px",top:(h.translateY||0)+"px",display:h.display,opacity:h.opacity,cursor:p.cursor,pointerEvents:p.pointerEvents,visibility:h.visibility},g||f);var R=g.style;v(h,{classSetter:function(I){return function(j){this.element.setAttribute("class",j),I.className=j}}(g),on:function(){return u[0].div&&M.on.apply({element:u[0].div,onEvents:h.onEvents},arguments),h},translateXSetter:x,translateYSetter:x}),h.addedSetters||w(h)})}}else g=f;return g.appendChild(y),M.added=!0,M.alignOnAdd&&M.htmlUpdateTransform(),M}),M},P.composedClasses=[],P}(o)}),i(n,"Core/Axis/AxisDefaults.js",[],function(){var r;return function(s){s.defaultXAxisOptions={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotation:void 0,autoRotationLimit:80,distance:void 0,enabled:!0,indentation:10,overflow:"justify",padding:5,reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,x:0,zIndex:7,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minPadding:.01,offset:void 0,opposite:!1,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",rotation:0,useHTML:!1,x:0,y:0,style:{color:"#666666"}},type:"linear",uniqueNames:!0,visible:!0,minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",gridLineWidth:void 0,tickColor:"#ccd6eb"},s.defaultYAxisOptions={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var o=this.axis.chart.numberFormatter;return o(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},s.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}},s.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}},s.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},s.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}}}(r||(r={})),r}),i(n,"Core/Foundation.js",[n["Core/Utilities.js"]],function(r){var s=r.addEvent,o=r.isFunction,c=r.objectEach,l=r.removeEvent,O;return function(_){_.registerEventOptions=function(v,E){v.eventOptions=v.eventOptions||{},c(E.events,function(b,P){v.eventOptions[P]!==b&&(v.eventOptions[P]&&(l(v,P,v.eventOptions[P]),delete v.eventOptions[P]),o(b)&&(v.eventOptions[P]=b,s(v,P,b)))})}}(O||(O={})),O}),i(n,"Core/Axis/Tick.js",[n["Core/FormatUtilities.js"],n["Core/Globals.js"],n["Core/Utilities.js"]],function(r,s,o){var c=s.deg2rad,l=o.clamp,O=o.correctFloat,_=o.defined,v=o.destroyObjectProperties,E=o.extend,b=o.fireEvent,P=o.isNumber,m=o.merge,T=o.objectEach,k=o.pick;return s=function(){function M(y,a,S,w,A){this.isNewLabel=this.isNew=!0,this.axis=y,this.pos=a,this.type=S||"",this.parameters=A||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,b(this,"init"),S||w||this.addLabel()}return M.prototype.addLabel=function(){var y=this,a=y.axis,S=a.options,w=a.chart,A=a.categories,f=a.logarithmic,u=a.names,g=y.pos,h=k(y.options&&y.options.labels,S.labels),x=a.tickPositions,d=g===x[0],p=g===x[x.length-1],R=(!h.step||h.step===1)&&a.tickInterval===1;x=x.info;var I=y.label,j;if(A=this.parameters.category||(A?k(A[g],u[g],g):g),f&&P(A)&&(A=O(f.lin2log(A))),a.dateTime)if(x)var $=w.time.resolveDTLFormat(S.dateTimeLabelFormats[!S.grid&&x.higherRanks[g]||x.unitName]),et=$.main;else P(A)&&(et=a.dateTime.getXDateFormat(A,S.dateTimeLabelFormats||{}));y.isFirst=d,y.isLast=p;var it={axis:a,chart:w,dateTimeLabelFormat:et,isFirst:d,isLast:p,pos:g,tick:y,tickPositionInfo:x,value:A};b(this,"labelFormat",it);var H=function(L){return h.formatter?h.formatter.call(L,L):h.format?(L.text=a.defaultLabelFormatter.call(L),r.format(h.format,L,w)):a.defaultLabelFormatter.call(L,L)};S=H.call(it,it);var z=$&&$.list;y.shortenLabel=z?function(){for(j=0;jh&&w-x*df&&($=Math.round((A-w)/Math.cos(h*c))):(A=w+(1-x)*d,w-x*df&&(I=f-y.x+I*x,j=-1),I=Math.min(p,I),II||a.autoRotation&&(g.styles||{}).width)&&($=I)),$&&(this.shortenLabel?this.shortenLabel():(R.width=Math.floor($)+"px",(S.style||{}).textOverflow||(R.textOverflow="ellipsis"),g.css(R)))},M.prototype.moveLabel=function(y,a){var S=this,w=S.label,A=S.axis,f=A.reversed,u=!1;if(w&&w.textStr===y?(S.movedLabel=w,u=!0,delete S.label):T(A.ticks,function(h){u||h.isNew||h===S||!h.label||h.label.textStr!==y||(S.movedLabel=h.label,u=!0,h.labelPos=S.movedLabel.xy,delete h.label)}),!u&&(S.labelPos||w)){var g=S.labelPos||w.xy;w=A.horiz?f?0:A.width+A.left:g.x,A=A.horiz?g.y:f?A.width+A.left:0,S.movedLabel=S.createLabel({x:w,y:A},y,a),S.movedLabel&&S.movedLabel.attr({opacity:0})}},M.prototype.render=function(y,a,S){var w=this.axis,A=w.horiz,f=this.pos,u=k(this.tickmarkOffset,w.tickmarkOffset);f=this.getPosition(A,f,u,a),u=f.x;var g=f.y;w=A&&u===w.pos+w.len||!A&&g===w.pos?-1:1,A=k(S,this.label&&this.label.newOpacity,1),S=k(S,1),this.isActive=!0,this.renderGridLine(a,S,w),this.renderMark(f,S,w),this.renderLabel(f,a,A,y),this.isNew=!1,b(this,"afterRender")},M.prototype.renderGridLine=function(y,a,S){var w=this.axis,A=w.options,f={},u=this.pos,g=this.type,h=k(this.tickmarkOffset,w.tickmarkOffset),x=w.chart.renderer,d=this.gridLine,p=A.gridLineWidth,R=A.gridLineColor,I=A.gridLineDashStyle;this.type==="minor"&&(p=A.minorGridLineWidth,R=A.minorGridLineColor,I=A.minorGridLineDashStyle),d||(w.chart.styledMode||(f.stroke=R,f["stroke-width"]=p||0,f.dashstyle=I),g||(f.zIndex=1),y&&(a=0),this.gridLine=d=x.path().attr(f).addClass("highcharts-"+(g?g+"-":"")+"grid-line").add(w.gridGroup)),d&&(S=w.getPlotLinePath({value:u+h,lineWidth:d.strokeWidth()*S,force:"pass",old:y}))&&d[y||this.isNew?"attr":"animate"]({d:S,opacity:a})},M.prototype.renderMark=function(y,a,S){var w=this.axis,A=w.options,f=w.chart.renderer,u=this.type,g=w.tickSize(u?u+"Tick":"tick"),h=y.x;y=y.y;var x=k(A[u!=="minor"?"tickWidth":"minorTickWidth"],!u&&w.isXAxis?1:0);A=A[u!=="minor"?"tickColor":"minorTickColor"];var d=this.mark,p=!d;g&&(w.opposite&&(g[0]=-g[0]),d||(this.mark=d=f.path().addClass("highcharts-"+(u?u+"-":"")+"tick").add(w.axisGroup),w.chart.styledMode||d.attr({stroke:A,"stroke-width":x})),d[p?"attr":"animate"]({d:this.getMarkPath(h,y,g[0],d.strokeWidth()*S,w.horiz,f),opacity:a}))},M.prototype.renderLabel=function(y,a,S,w){var A=this.axis,f=A.horiz,u=A.options,g=this.label,h=u.labels,x=h.step;A=k(this.tickmarkOffset,A.tickmarkOffset);var d=y.x;y=y.y;var p=!0;g&&P(d)&&(g.xy=y=this.getLabelPosition(d,y,g,f,h,A,w,x),this.isFirst&&!this.isLast&&!u.showFirstLabel||this.isLast&&!this.isFirst&&!u.showLastLabel?p=!1:!f||h.step||h.rotation||a||S===0||this.handleOverflow(y),x&&w%x&&(p=!1),p&&P(y.y)?(y.opacity=S,g[this.isNewLabel?"attr":"animate"](y),this.isNewLabel=!1):(g.attr("y",-9999),this.isNewLabel=!0))},M.prototype.replaceMovedLabel=function(){var y=this.label,a=this.axis,S=a.reversed;if(y&&!this.isNew){var w=a.horiz?S?a.left:a.width+a.left:y.xy.x;S=a.horiz?y.xy.y:S?a.width+a.top:a.top,y.animate({x:w,y:S,opacity:0},void 0,y.destroy),delete this.label}a.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},M}(),s}),i(n,"Core/Axis/Axis.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/AxisDefaults.js"],n["Core/Color/Color.js"],n["Core/DefaultOptions.js"],n["Core/Foundation.js"],n["Core/Globals.js"],n["Core/Axis/Tick.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v){var E=r.animObject,b=c.defaultOptions,P=l.registerEventOptions,m=O.deg2rad,T=v.arrayMax,k=v.arrayMin,M=v.clamp,y=v.correctFloat,a=v.defined,S=v.destroyObjectProperties,w=v.erase,A=v.error,f=v.extend,u=v.fireEvent,g=v.getMagnitude,h=v.isArray,x=v.isNumber,d=v.isString,p=v.merge,R=v.normalizeTickInterval,I=v.objectEach,j=v.pick,$=v.relativeLength,et=v.removeEvent,it=v.splat,H=v.syncTimeout;return r=function(){function z(L,N){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.eventOptions=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(L,N)}return z.prototype.init=function(L,N){var V=N.isX;this.chart=L,this.horiz=L.inverted&&!this.isZAxis?!V:V,this.isXAxis=V,this.coll=this.coll||(V?"xAxis":"yAxis"),u(this,"init",{userOptions:N}),this.opposite=j(N.opposite,this.opposite),this.side=j(N.side,this.side,this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(N);var K=this.options,G=K.labels,J=K.type;this.userOptions=N,this.minPixelPadding=0,this.reversed=j(K.reversed,this.reversed),this.visible=K.visible,this.zoomEnabled=K.zoomEnabled,this.hasNames=J==="category"||K.categories===!0,this.categories=K.categories||this.hasNames,this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=a(K.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=K.minRange||K.maxZoom,this.range=K.range,this.offset=K.offset||0,this.min=this.max=null,N=j(K.crosshair,it(L.options.tooltip.crosshairs)[V?0:1]),this.crosshair=N===!0?{}:N,L.axes.indexOf(this)===-1&&(V?L.axes.splice(L.xAxis.length,0,this):L.axes.push(this),L[this.coll].push(this)),this.series=this.series||[],L.inverted&&!this.isZAxis&&V&&typeof this.reversed>"u"&&(this.reversed=!0),this.labelRotation=x(G.rotation)?G.rotation:void 0,P(this,K),u(this,"afterInit")},z.prototype.setOptions=function(L){this.options=p(s.defaultXAxisOptions,this.coll==="yAxis"&&s.defaultYAxisOptions,[s.defaultTopAxisOptions,s.defaultRightAxisOptions,s.defaultBottomAxisOptions,s.defaultLeftAxisOptions][this.side],p(b[this.coll],L)),u(this,"afterSetOptions",{userOptions:L})},z.prototype.defaultLabelFormatter=function(L){var N=this.axis;L=this.chart.numberFormatter;var V=x(this.value)?this.value:NaN,K=N.chart.time,G=this.dateTimeLabelFormat,J=b.lang,C=J.numericSymbols;J=J.numericSymbolMagnitude||1e3;var U=N.logarithmic?Math.abs(V):N.tickInterval,B=C&&C.length;if(N.categories)var tt=""+this.value;else if(G)tt=K.dateFormat(G,V);else if(B&&1e3<=U)for(;B--&&typeof tt>"u";)N=Math.pow(J,B+1),U>=N&&10*V%N===0&&C[B]!==null&&V!==0&&(tt=L(V/N,-1)+C[B]);return typeof tt>"u"&&(tt=1e4<=Math.abs(V)?L(V,-1):L(V,-1,void 0,"")),tt},z.prototype.getSeriesExtremes=function(){var L=this,N=L.chart,V;u(this,"getSeriesExtremes",null,function(){L.hasVisibleSeries=!1,L.dataMin=L.dataMax=L.threshold=null,L.softThreshold=!L.isXAxis,L.stacking&&L.stacking.buildStacks(),L.series.forEach(function(K){if(K.visible||!N.options.chart.ignoreHiddenSeries){var G=K.options,J=G.threshold;if(L.hasVisibleSeries=!0,L.positiveValuesOnly&&0>=J&&(J=null),L.isXAxis){if(G=K.xData,G.length){G=L.logarithmic?G.filter(L.validatePositiveValue):G,V=K.getXExtremes(G);var C=V.min,U=V.max;x(C)||C instanceof Date||(G=G.filter(x),V=K.getXExtremes(G),C=V.min,U=V.max),G.length&&(L.dataMin=Math.min(j(L.dataMin,C),C),L.dataMax=Math.max(j(L.dataMax,U),U))}}else K=K.applyExtremes(),x(K.dataMin)&&(C=K.dataMin,L.dataMin=Math.min(j(L.dataMin,C),C)),x(K.dataMax)&&(U=K.dataMax,L.dataMax=Math.max(j(L.dataMax,U),U)),a(J)&&(L.threshold=J),(!G.softThreshold||L.positiveValuesOnly)&&(L.softThreshold=!1)}})}),u(this,"afterGetSeriesExtremes")},z.prototype.translate=function(L,N,V,K,G,J){var C=this.linkedParent||this,U=K&&C.old?C.old.min:C.min,B=C.minPixelPadding;G=(C.isOrdinal||C.brokenAxis&&C.brokenAxis.hasBreaks||C.logarithmic&&G)&&C.lin2val;var tt=1,D=0;return K=K&&C.old?C.old.transA:C.transA,K||(K=C.transA),V&&(tt*=-1,D=C.len),C.reversed&&(tt*=-1,D-=tt*(C.sector||C.len)),N?(L=(L*tt+D-B)/K+U,G&&(L=C.lin2val(L))):(G&&(L=C.val2lin(L)),L=x(U)?tt*(L-U)*K+D+tt*B+(x(J)?K*J:0):void 0),L},z.prototype.toPixels=function(L,N){return this.translate(L,!1,!this.horiz,null,!0)+(N?0:this.pos)},z.prototype.toValue=function(L,N){return this.translate(L-(N?0:this.pos),!0,!this.horiz,null,!0)},z.prototype.getPlotLinePath=function(L){function N(Z,W,Q){return(st!=="pass"&&ZQ)&&(st?Z=M(Z,W,Q):Y=!0),Z}var V=this,K=V.chart,G=V.left,J=V.top,C=L.old,U=L.value,B=L.lineWidth,tt=C&&K.oldChartHeight||K.chartHeight,D=C&&K.oldChartWidth||K.chartWidth,F=V.transB,X=L.translatedValue,st=L.force,ot,lt,ct,q,Y;return L={value:U,lineWidth:B,old:C,force:st,acrossPanes:L.acrossPanes,translatedValue:X},u(this,"getPlotLinePath",L,function(Z){X=j(X,V.translate(U,null,null,C)),X=M(X,-1e5,1e5),ot=ct=Math.round(X+F),lt=q=Math.round(tt-X-F),x(X)?V.horiz?(lt=J,q=tt-V.bottom,ot=ct=N(ot,G,G+V.width)):(ot=G,ct=D-V.right,lt=q=N(lt,J,J+V.height)):(Y=!0,st=!1),Z.path=Y&&!st?null:K.renderer.crispLine([["M",ot,lt],["L",ct,q]],B||1)}),L.path},z.prototype.getLinearTickPositions=function(L,N,V){var K=y(Math.floor(N/L)*L);V=y(Math.ceil(V/L)*L);var G=[],J;if(y(K+L)===K&&(J=20),this.single)return[N];for(N=K;N<=V&&(G.push(N),N=y(N+L,J),N!==C);)var C=N;return G},z.prototype.getMinorTickInterval=function(){var L=this.options;return L.minorTicks===!0?j(L.minorTickInterval,"auto"):L.minorTicks===!1?null:L.minorTickInterval},z.prototype.getMinorTickPositions=function(){var L=this.options,N=this.tickPositions,V=this.minorTickInterval,K=this.pointRangePadding||0,G=this.min-K;K=this.max+K;var J=K-G,C=[];if(J&&J/V"u"&&!N&&(a(L.min)||a(L.max)||a(L.floor)||a(L.ceiling)?this.minRange=null:(this.series.forEach(function(X){if(U=X.xData,B=X.xIncrement?1:U.length-1,1=this.minRange,D=this.minRange,F=(D-K+V)/2;F=[V-F,j(L.min,V-F)],tt&&(F[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),V=T(F),K=[V+D,j(L.max,V+D)],tt&&(K[2]=N?N.log2lin(this.dataMax):this.dataMax),K=k(K),K-V=X)lt=X,D=0;else if(this.dataMax<=X){var ct=X;tt=0}}this.min=j(st,lt,this.dataMin),this.max=j(ot,ct,this.dataMax)}if(V&&(this.positiveValuesOnly&&!L&&0>=Math.min(this.min,j(this.dataMin,this.min))&&A(10,1,N),this.min=y(V.log2lin(this.min),16),this.max=y(V.log2lin(this.max),16)),this.range&&a(this.max)&&(this.userMin=this.min=st=Math.max(this.dataMin,this.minFromRange()),this.userMax=ot=this.max,this.range=null),u(this,"foundExtremes"),this.beforePadding&&this.beforePadding(),this.adjustForMinRange(),!(U||this.axisPointRange||this.stacking&&this.stacking.usePercentage||J)&&a(this.min)&&a(this.max)&&(N=this.max-this.min)&&(!a(st)&&D&&(this.min-=N*D),!a(ot)&&tt&&(this.max+=N*tt)),x(this.userMin)||(x(K.softMin)&&K.softMinthis.max&&(this.max=ot=K.softMax),x(K.ceiling)&&(this.max=Math.min(this.max,K.ceiling))),B&&a(this.dataMin)&&(X=X||0,!a(st)&&this.min=X?this.min=this.options.minRange?Math.min(X,this.max-this.minRange):X:!a(ot)&&this.max>X&&this.dataMax<=X&&(this.max=this.options.minRange?Math.max(X,this.min+this.minRange):X)),x(this.min)&&x(this.max)&&!this.chart.polar&&this.min>this.max&&(a(this.options.min)?this.max=this.min:a(this.options.max)&&(this.min=this.max)),this.tickInterval=this.min===this.max||typeof this.min>"u"||typeof this.max>"u"?1:J&&this.linkedParent&&!F&&C===this.linkedParent.options.tickPixelInterval?F=this.linkedParent.tickInterval:j(F,this.tickAmount?(this.max-this.min)/Math.max(this.tickAmount-1,1):void 0,U?1:(this.max-this.min)*C/Math.max(this.len,C)),G&&!L){var q=this.min!==(this.old&&this.old.min)||this.max!==(this.old&&this.old.max);this.series.forEach(function(Y){Y.forceCrop=Y.forceCropping&&Y.forceCropping(),Y.processData(q)}),u(this,"postProcessData",{hasExtemesChanged:q})}this.setAxisTranslation(),u(this,"initialAxisTranslation"),this.pointRange&&!F&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval)),L=j(K.minTickInterval,this.dateTime&&!this.series.some(function(Y){return Y.noSharedTooltip})?this.closestPointRange:0),!F&&this.tickIntervalthis.tickInterval||this.tickAmount!==void 0),!!this.tickAmount)),this.tickAmount||(this.tickInterval=this.unsquish()),this.setTickPositions()},z.prototype.setTickPositions=function(){var L=this.options,N=L.tickPositions,V=this.getMinorTickInterval(),K=this.hasVerticalPanning(),G=this.coll==="colorAxis",J=(G||!K)&&L.startOnTick;K=(G||!K)&&L.endOnTick,G=L.tickPositioner,this.tickmarkOffset=this.categories&&L.tickmarkPlacement==="between"&&this.tickInterval===1?.5:0,this.minorTickInterval=V==="auto"&&this.tickInterval?this.tickInterval/5:V,this.single=this.min===this.max&&a(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||L.allowDecimals!==!1),this.tickPositions=V=N&&N.slice(),!V&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?V=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,L.units),this.min,this.max,L.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(V=[this.min,this.max],A(19,!1,this.chart)),V.length>this.len&&(V=[V[0],V.pop()],V[0]===V[1]&&(V.length=1)),this.tickPositions=V,G&&(G=G.apply(this,[this.min,this.max])))&&(this.tickPositions=V=G),this.paddedTicks=V.slice(0),this.trimTicks(V,J,K),this.isLinked||(this.single&&2>V.length&&!this.categories&&!this.series.some(function(C){return C.is("heatmap")&&C.options.pointPlacement==="between"})&&(this.min-=.5,this.max+=.5),N||G||this.adjustTickAmount()),u(this,"afterSetTickPositions")},z.prototype.trimTicks=function(L,N,V){var K=L[0],G=L[L.length-1],J=!this.isOrdinal&&this.minPointOffset||0;if(u(this,"trimTicks"),!this.isLinked){if(N&&K!==-1/0)this.min=K;else for(;this.min-J>L[0];)L.shift();if(V)this.max=G;else for(;this.max+JV&&(this.finalTickAmt=V,V=5),this.tickAmount=V},z.prototype.adjustTickAmount=function(){var L=this.options,N=this.tickInterval,V=this.tickPositions,K=this.tickAmount,G=this.finalTickAmt,J=V&&V.length,C=j(this.threshold,this.softThreshold?0:null);if(this.hasData()&&x(this.min)&&x(this.max)){if(JK&&(this.tickInterval*=2,this.setTickPositions());if(a(G)){for(N=L=V.length;N--;)(G===3&&N%2===1||2>=G&&0U&&(tt=U)),a(G)&&(DU&&(D=U))),V.displayBtn=typeof tt<"u"||typeof D<"u",V.setExtremes(tt,D,!1,void 0,{trigger:"zoom"})),B.zoomed=!0}),L.zoomed},z.prototype.setAxisSize=function(){var L=this.chart,N=this.options,V=N.offsets||[0,0,0,0],K=this.horiz,G=this.width=Math.round($(j(N.width,L.plotWidth-V[3]+V[1]),L.plotWidth)),J=this.height=Math.round($(j(N.height,L.plotHeight-V[0]+V[2]),L.plotHeight)),C=this.top=Math.round($(j(N.top,L.plotTop+V[0]),L.plotHeight,L.plotTop));N=this.left=Math.round($(j(N.left,L.plotLeft+V[3]),L.plotWidth,L.plotLeft)),this.bottom=L.chartHeight-J-C,this.right=L.chartWidth-G-N,this.len=Math.max(K?G:J,0),this.pos=K?N:C},z.prototype.getExtremes=function(){var L=this.logarithmic;return{min:L?y(L.lin2log(this.min)):this.min,max:L?y(L.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},z.prototype.getThreshold=function(L){var N=this.logarithmic,V=N?N.lin2log(this.min):this.min;return N=N?N.lin2log(this.max):this.max,L===null||L===-1/0?L=V:L===1/0?L=N:V>L?L=V:NN?V.align="right":195N&&(V.align="left")}),L.align},z.prototype.tickSize=function(L){var N=this.options,V=j(N[L==="tick"?"tickWidth":"minorTickWidth"],L==="tick"&&this.isXAxis&&!this.categories?1:0),K=N[L==="tick"?"tickLength":"minorTickLength"];if(V&&K){N[L+"Position"]==="inside"&&(K=-K);var G=[K,V]}return L={tickSize:G},u(this,"afterTickSize",L),L.tickSize},z.prototype.labelMetrics=function(){var L=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize,this.ticks[L]&&this.ticks[L].label)},z.prototype.unsquish=function(){var L=this.options.labels,N=this.horiz,V=this.tickInterval,K=this.len/(((this.categories?1:0)+this.max-this.min)/V),G=L.rotation,J=this.labelMetrics(),C=Math.max(this.max-this.min,0),U=function(st){var ot=st/(K||1);return ot=1C&&st!==1/0&&K!==1/0&&C&&(ot=Math.ceil(C/V)),y(ot*V)},B=V,tt,D,F=Number.MAX_VALUE;if(N){if(!L.staggerLines&&!L.step)if(x(G))var X=[G];else K=st){D=U(Math.abs(J.h/Math.sin(m*st)));var ot=D+Math.abs(st/360);otK.step)return K.rotation?0:(this.staggerLines||1)*this.len/G;if(!V){if(L=K.style.width,L!==void 0)return parseInt(String(L),10);if(J)return J-N.spacing[3]}return .33*N.chartWidth},z.prototype.renderUnsquish=function(){var L=this.chart,N=L.renderer,V=this.tickPositions,K=this.ticks,G=this.options.labels,J=G.style,C=this.horiz,U=this.getSlotWidth(),B=Math.max(1,Math.round(U-2*G.padding)),tt={},D=this.labelMetrics(),F=J.textOverflow,X=0;if(d(G.rotation)||(tt.rotation=G.rotation||0),V.forEach(function(ct){ct=K[ct],ct.movedLabel&&ct.replaceMovedLabel(),ct&&ct.label&&ct.label.textPxLength>X&&(X=ct.label.textPxLength)}),this.maxLabelLength=X,this.autoRotation)X>B&&X>D.h?tt.rotation=this.labelRotation:this.labelRotation=0;else if(U){var st=B;if(!F){var ot="clip";for(B=V.length;!C&&B--;){var lt=V[B];(lt=K[lt].label)&&(lt.styles&<.styles.textOverflow==="ellipsis"?lt.css({textOverflow:"clip"}):lt.textPxLength>U&<.css({width:U+"px"}),lt.getBBox().height>this.len/V.length-(D.h-D.f)&&(lt.specificTextOverflow="ellipsis"))}}}tt.rotation&&(st=X>.5*L.chartHeight?.33*L.chartHeight:X,F||(ot="ellipsis")),(this.labelAlign=G.align||this.autoLabelAlign(this.labelRotation))&&(tt.align=this.labelAlign),V.forEach(function(ct){var q=(ct=K[ct])&&ct.label,Y=J.width,Z={};q&&(q.attr(tt),ct.shortenLabel?ct.shortenLabel():st&&!Y&&J.whiteSpace!=="nowrap"&&(st=this.min&&L<=this.max||this.grid&&this.grid.isColumn)&&(K[L]||(K[L]=new _(this,L)),V&&K[L].isNew&&K[L].render(N,!0,-1),K[L].render(N))},z.prototype.render=function(){var L=this,N=L.chart,V=L.logarithmic,K=L.options,G=L.isLinked,J=L.tickPositions,C=L.axisTitle,U=L.ticks,B=L.minorTicks,tt=L.alternateBands,D=K.stackLabels,F=K.alternateGridColor,X=L.tickmarkOffset,st=L.axisLine,ot=L.showAxis,lt=E(N.renderer.globalAnimation),ct,q;if(L.labelEdge.length=0,L.overlap=!1,[U,B,tt].forEach(function(Z){I(Z,function(W){W.isActive=!1})}),L.hasData()||G){var Y=L.chart.hasRendered&&L.old&&x(L.old.min);L.minorTickInterval&&!L.categories&&L.getMinorTickPositions().forEach(function(Z){L.renderMinorTick(Z,Y)}),J.length&&(J.forEach(function(Z,W){L.renderTick(Z,W,Y)}),X&&(L.min===0||L.single)&&(U[-1]||(U[-1]=new _(L,-1,null,!0)),U[-1].render(-1))),F&&J.forEach(function(Z,W){q=typeof J[W+1]<"u"?J[W+1]+X:L.max-X,W%2===0&&Zk&&(!y||w<=M)&&typeof w<"u"&&A.push(w),w>M&&(g=!0),w=x}}}else k=this.lin2log(k),M=this.lin2log(M),T=y?a.getMinorTickInterval():w.tickInterval,T=l(T==="auto"?null:T,this.minorAutoInterval,w.tickPixelInterval/(y?5:1)*(M-k)/((y?S/a.tickPositions.length:S)||1)),T=c(T,void 0,o(T)),A=a.getLinearTickPositions(T,k,M).map(this.log2lin),y||(this.minorAutoInterval=T/5);return y||(a.tickInterval=T),A},m.prototype.lin2log=function(T){return Math.pow(10,T)},m.prototype.log2lin=function(T){return Math.log(T)/Math.LN10},m}();_.Additions=P}(O||(O={})),O}),i(n,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[n["Core/Utilities.js"]],function(r){var s=r.erase,o=r.extend,c=r.isNumber,l;return function(O){var _=[],v;O.compose=function(b,P){return v||(v=b),_.indexOf(P)===-1&&(_.push(P),o(P.prototype,E.prototype)),P};var E=function(){function b(){}return b.prototype.getPlotBandPath=function(P,m,T){T===void 0&&(T=this.options);var k=this.getPlotLinePath({value:m,force:!0,acrossPanes:T.acrossPanes}),M=[],y=this.horiz;if(m=!c(this.min)||!c(this.max)||Pthis.max&&m>this.max,P=this.getPlotLinePath({value:P,force:!0,acrossPanes:T.acrossPanes}),T=1,P&&k){if(m){var a=P.toString()===k.toString();T=0}for(m=0;m"u"&&(x=p.normalize(x)),p=[x.chartX-j,x.chartY-I]):h[0].tooltipPos?p=h[0].tooltipPos:(h.forEach(function(z){$=z.series.yAxis,et=z.series.xAxis,it+=z.plotX||0,H+=z.plotLow?(z.plotLow+(z.plotHigh||0))/2:z.plotY||0,et&&$&&(R?(it+=I+d.plotHeight-et.len-et.pos,H+=j+d.plotWidth-$.len-$.pos):(it+=et.pos-j,H+=$.pos-I))}),it/=h.length,H/=h.length,p=[R?d.plotWidth-H:it,R?d.plotHeight-it:H],this.shared&&1Z-j?Z:Z-j);else if(Y)I[B]=Math.max(st,X+j+D>tt?X:X+j);else return!1},J=function(B,tt,D,F,X){var st;return Xtt-R?st=!1:I[B]=Xtt-F/2?tt-F-2:X-D/2,st},C=function(B){var tt=L;L=N,N=tt,V=B},U=function(){G.apply(0,L)!==!1?J.apply(0,N)!==!1||V||(C(!0),U()):V?I.x=I.y=0:(C(!0),U())};return(p.inverted||1Z})&&(h=h.map(function(Y){var Z=d(Y.anchorX,Y.anchorY,Y.point.isHeader,Y.boxWidth,!1);return k(Y,{target:Z.y,x:Z.x})})),p.cleanSplit(),v(h,lt);var ct=X,q=X;h.forEach(function(Y){var Z=Y.x,W=Y.boxWidth;Y=Y.isHeader,Y||(p.outside&&X+Zq&&(q=X+Z))}),h.forEach(function(Y){var Z=Y.x,W=Y.anchorX,Q=Y.pos,rt=Y.point.isHeader;if(Q={visibility:typeof Q>"u"?"hidden":"inherit",x:Z,y:Q+st,anchorX:W,anchorY:Y.anchorY},p.outside&&Zd[0]?Math.max(Math.abs(d[0]),R.width-d[0]):Math.max(Math.abs(d[0]),R.width),p.height=0>d[1]?Math.max(Math.abs(d[1]),R.height-Math.abs(d[1])):Math.max(Math.abs(d[1]),R.height),this.tracker?this.tracker.attr(p):(this.tracker=x.renderer.rect(p).addClass("highcharts-tracker").add(x),h.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},g.prototype.styledModeFormat=function(h){return h.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},g.prototype.tooltipFooterHeaderFormatter=function(h,x){var d=h.series,p=d.tooltipOptions,R=d.xAxis,I=R&&R.dateTime;R={isFooter:x,labelConfig:h};var j=p.xDateFormat,$=p[x?"footerFormat":"headerFormat"];return M(this,"headerFormatter",R,function(et){I&&!j&&a(h.key)&&(j=I.getXDateFormat(h.key,p.dateTimeLabelFormats)),I&&j&&(h.point&&h.point.tooltipDateKeys||["key"]).forEach(function(it){$=$.replace("{point."+it+"}","{point."+it+":"+j+"}")}),d.chart.styledMode&&($=this.styledModeFormat($)),et.text=O($,{point:h,series:d},this.chart)}),R.text},g.prototype.update=function(h){this.destroy(),w(!0,this.chart.options.tooltip.userOptions,h),this.init(this.chart,w(!0,this.options,h))},g.prototype.updatePosition=function(h){var x=this.chart,d=this.options,p=x.pointer,R=this.getLabel();p=p.getChartPosition();var I=(d.positioner||this.getPosition).call(this,R.width,R.height,h),j=h.plotX+x.plotLeft;h=h.plotY+x.plotTop,this.outside&&(d=d.borderWidth+2*this.distance,this.renderer.setSize(R.width+d,R.height+d,!1),(p.scaleX!==1||p.scaleY!==1)&&(P(this.container,{transform:"scale("+p.scaleX+", "+p.scaleY+")"}),j*=p.scaleX,h*=p.scaleY),j+=p.left-I.x,h+=p.top-I.y),this.move(Math.round(I.x),Math.round(I.y||0),j,h)},g}(),r}),i(n,"Core/Series/Point.js",[n["Core/Renderer/HTML/AST.js"],n["Core/Animation/AnimationUtilities.js"],n["Core/DefaultOptions.js"],n["Core/FormatUtilities.js"],n["Core/Utilities.js"]],function(r,s,o,c,l){var O=s.animObject,_=o.defaultOptions,v=c.format,E=l.addEvent,b=l.defined,P=l.erase,m=l.extend,T=l.fireEvent,k=l.getNestedProperty,M=l.isArray,y=l.isFunction,a=l.isNumber,S=l.isObject,w=l.merge,A=l.objectEach,f=l.pick,u=l.syncTimeout,g=l.removeEvent,h=l.uniqueKey;return s=function(){function x(){this.colorIndex=this.category=void 0,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.series=void 0,this.visible=!0,this.x=void 0}return x.prototype.animateBeforeDestroy=function(){var d=this,p={x:d.startXPos,opacity:0},R=d.getGraphicalProps();R.singular.forEach(function(I){d[I]=d[I].animate(I==="dataLabel"?{x:d[I].startXPos,y:d[I].startYPos,opacity:0}:p)}),R.plural.forEach(function(I){d[I].forEach(function(j){j.element&&j.animate(m({x:d.startXPos},j.startYPos?{x:j.startXPos,y:j.startYPos}:{}))})})},x.prototype.applyOptions=function(d,p){var R=this.series,I=R.options.pointValKey||R.pointValKey;return d=x.prototype.optionsToObject.call(this,d),m(this,d),this.options=this.options?m(this.options,d):d,d.group&&delete this.group,d.dataLabels&&delete this.dataLabels,I&&(this.y=x.prototype.getNestedProperty.call(this,I)),this.formatPrefix=(this.isNull=f(this.isValid&&!this.isValid(),this.x===null||!a(this.y)))?"null":"point",this.selected&&(this.state="select"),"name"in this&&typeof p>"u"&&R.xAxis&&R.xAxis.hasNames&&(this.x=R.xAxis.nameToX(this)),typeof this.x>"u"&&R?this.x=typeof p>"u"?R.autoIncrement():p:a(d.x)&&R.options.relativeXValue&&(this.x=R.autoIncrement(d.x)),this},x.prototype.destroy=function(){function d(){(p.graphic||p.dataLabel||p.dataLabels)&&(g(p),p.destroyElements());for(et in p)p[et]=null}var p=this,R=p.series,I=R.chart;R=R.options.dataSorting;var j=I.hoverPoints,$=O(p.series.chart.renderer.globalAnimation),et;p.legendItem&&I.legend.destroyItem(p),j&&(p.setState(),P(j,p),j.length||(I.hoverPoints=null)),p===I.hoverPoint&&p.onMouseOut(),R&&R.enabled?(this.animateBeforeDestroy(),u(d,$.duration)):d(),I.pointCount--},x.prototype.destroyElements=function(d){var p=this;d=p.getGraphicalProps(d),d.singular.forEach(function(R){p[R]=p[R].destroy()}),d.plural.forEach(function(R){p[R].forEach(function(I){I.element&&I.destroy()}),delete p[R]})},x.prototype.firePointEvent=function(d,p,R){var I=this,j=this.series.options;(j.point.events[d]||I.options&&I.options.events&&I.options.events[d])&&I.importEvents(),d==="click"&&j.allowPointSelect&&(R=function($){I.select&&I.select(null,$.ctrlKey||$.metaKey||$.shiftKey)}),T(I,d,p,R)},x.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(typeof this.colorIndex<"u"?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},x.prototype.getGraphicalProps=function(d){var p=this,R=[],I={singular:[],plural:[]},j;for(d=d||{graphic:1,dataLabel:1},d.graphic&&R.push("graphic","upperGraphic","shadowGroup"),d.dataLabel&&R.push("dataLabel","dataLabelUpper","connector"),j=R.length;j--;){var $=R[j];p[$]&&I.singular.push($)}return["dataLabel","connector"].forEach(function(et){var it=et+"s";d[et]&&p[it]&&I.plural.push(it)}),I},x.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},x.prototype.getNestedProperty=function(d){if(d)return d.indexOf("custom.")===0?k(d,this.options):this[d]},x.prototype.getZone=function(){var d=this.series,p=d.zones;d=d.zoneAxis||"y";var R,I=0;for(R=p[I];this[d]>=R.value;)R=p[++I];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=R&&R.color&&!this.options.color?R.color:this.nonZonedColor,R},x.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},x.prototype.init=function(d,p,R){return this.series=d,this.applyOptions(p,R),this.id=b(this.id)?this.id:h(),this.resolveColor(),d.chart.pointCount++,T(this,"afterInit"),this},x.prototype.optionsToObject=function(d){var p=this.series,R=p.options.keys,I=R||p.pointArrayMap||["y"],j=I.length,$={},et=0,it=0;if(a(d)||d===null)$[I[0]]=d;else if(M(d))for(!R&&d.length>j&&(p=typeof d[0],p==="string"?$.name=d[0]:p==="number"&&($.x=d[0]),et++);it"u"||(0p+I&&(z=p+I),LR+j&&(L=R+j),this.hasDragged=Math.sqrt(Math.pow($-z,2)+Math.pow(et-L,2)),10R.options.findNearestPointBy.indexOf("y");if(R=R.searchPoint(h,I),(I=y(R,!0)&&R.series)&&!(I=!y(p,!0))){I=p.distX-R.distX;var j=p.dist-R.dist,$=(R.series.group&&R.series.group.zIndex)-(p.series.group&&p.series.group.zIndex);I=0<(I!==0&&g?I:j!==0?j:$!==0?$:p.series.index>R.series.index?-1:1)}I&&(p=R)}),p},f.prototype.getChartCoordinatesFromPoint=function(u,g){var h=u.series,x=h.xAxis;h=h.yAxis;var d=u.shapeArgs;if(x&&h){var p=w(u.clientX,u.plotX),R=u.plotY||0;return u.isNode&&d&&M(d.x)&&M(d.y)&&(p=d.x,R=d.y),g?{chartX:h.len+h.pos-R,chartY:x.len+x.pos-p}:{chartX:p+x.pos,chartY:R+h.pos}}if(d&&d.x&&d.y)return{chartX:d.x,chartY:d.y}},f.prototype.getChartPosition=function(){if(this.chartPosition)return this.chartPosition;var u=this.chart.container,g=S(u);this.chartPosition={left:g.left,top:g.top,scaleX:1,scaleY:1};var h=u.offsetWidth;return u=u.offsetHeight,2"u"||g)&&(this.zoomOption(u),g&&u.preventDefault&&u.preventDefault(),this.dragStart(u))},f.prototype.onContainerMouseLeave=function(u){var g=O[w(f.hoverChartIndex,-1)],h=this.chart.tooltip;h&&h.shouldStickOnContact()&&this.inClass(u.relatedTarget,"highcharts-tooltip-container")||(u=this.normalize(u),g&&(u.relatedTarget||u.toElement)&&(g.pointer.reset(),g.pointer.chartPosition=void 0),h&&!h.isHidden&&this.reset())},f.prototype.onContainerMouseEnter=function(u){delete this.chartPosition},f.prototype.onContainerMouseMove=function(u){var g=this.chart;u=this.normalize(u),this.setHoverChartIndex(),u.preventDefault||(u.returnValue=!1),(g.mouseIsDown==="mousedown"||this.touchSelect(u))&&this.drag(u),g.openMenu||!this.inClass(u.target,"highcharts-tracker")&&!g.isInsidePlot(u.chartX-g.plotLeft,u.chartY-g.plotTop,{visiblePlotOnly:!0})||(this.inClass(u.target,"highcharts-no-tooltip")?this.reset(!1,0):this.runPointActions(u))},f.prototype.onDocumentTouchEnd=function(u){var g=O[w(f.hoverChartIndex,-1)];g&&g.pointer.drop(u)},f.prototype.onContainerTouchMove=function(u){this.touchSelect(u)?this.onContainerMouseMove(u):this.touch(u)},f.prototype.onContainerTouchStart=function(u){this.touchSelect(u)?this.onContainerMouseDown(u):(this.zoomOption(u),this.touch(u,!0))},f.prototype.onDocumentMouseMove=function(u){var g=this.chart,h=this.chartPosition;u=this.normalize(u,h);var x=g.tooltip;!h||x&&x.isStickyOnContact()||g.isInsidePlot(u.chartX-g.plotLeft,u.chartY-g.plotTop,{visiblePlotOnly:!0})||this.inClass(u.target,"highcharts-tracker")||this.reset()},f.prototype.onDocumentMouseUp=function(u){var g=O[w(f.hoverChartIndex,-1)];g&&g.pointer.drop(u)},f.prototype.pinch=function(u){var g=this,h=g.chart,x=g.pinchDown,d=u.touches||[],p=d.length,R=g.lastValidTouch,I=g.hasZoom,j={},$=p===1&&(g.inClass(u.target,"highcharts-tracker")&&h.runTrackerClick||g.runChartClick),et={},it=g.selectionMarker;1N.max&&(h=N.max-J,D=!0);D?(B-=.8*(B-R[$][0]),typeof tt=="number"&&(tt-=.8*(tt-R[$][1])),g()):R[$]=[B,tt],L||(p[$]=C-z,p[H]=J),p=L?1/U:U,d[H]=J,d[$]=h,x[L?u?"scaleY":"scaleX":"scale"+et]=U,x["translate"+et]=p*z+(B-p*K)},f.prototype.reset=function(u,g){var h=this.chart,x=h.hoverSeries,d=h.hoverPoint,p=h.hoverPoints,R=h.tooltip,I=R&&R.shared?p:d;u&&I&&A(I).forEach(function(j){j.series.isCartesian&&typeof j.plotX>"u"&&(u=!1)}),u?R&&I&&A(I).length&&(R.refresh(I),R.shared&&p?p.forEach(function(j){j.setState(j.state,!0),j.series.isCartesian&&(j.series.xAxis.crosshair&&j.series.xAxis.drawCrosshair(null,j),j.series.yAxis.crosshair&&j.series.yAxis.drawCrosshair(null,j))}):d&&(d.setState(d.state,!0),h.axes.forEach(function(j){j.crosshair&&d.series[j.coll]===j&&j.drawCrosshair(null,d)}))):(d&&d.onMouseOut(),p&&p.forEach(function(j){j.setState()}),x&&x.onMouseOut(),R&&R.hide(g),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),h.axes.forEach(function(j){j.hideCrosshair()}),this.hoverX=h.hoverPoints=h.hoverPoint=null)},f.prototype.runPointActions=function(u,g){var h=this.chart,x=h.tooltip&&h.tooltip.options.enabled?h.tooltip:void 0,d=x?x.shared:!1,p=g||h.hoverPoint,R=p&&p.series||h.hoverSeries;g=this.getHoverData(p,R,h.series,(!u||u.type!=="touchmove")&&(!!g||R&&R.directTouch&&this.isDirectTouch),d,u),p=g.hoverPoint,R=g.hoverSeries;var I=g.hoverPoints;if(g=R&&R.tooltipOptions.followPointer&&!R.tooltipOptions.split,d=d&&R&&!R.noSharedTooltip,p&&(p!==h.hoverPoint||x&&x.isHidden)){if((h.hoverPoints||[]).forEach(function(j){I.indexOf(j)===-1&&j.setState()}),h.hoverSeries!==R&&R.onMouseOver(),this.applyInactiveState(I),(I||[]).forEach(function(j){j.setState("hover")}),h.hoverPoint&&h.hoverPoint.firePointEvent("mouseOut"),!p.series)return;h.hoverPoints=I,h.hoverPoint=p,p.firePointEvent("mouseOver"),x&&x.refresh(d?I:p,u)}else g&&x&&!x.isHidden&&(p=x.getAnchor([{}],u),h.isInsidePlot(p[0],p[1],{visiblePlotOnly:!0})&&x.updatePosition({plotX:p[0],plotY:p[1]}));this.unDocMouseMove||(this.unDocMouseMove=v(h.container.ownerDocument,"mousemove",function(j){var $=O[f.hoverChartIndex];$&&$.pointer.onDocumentMouseMove(j)}),this.eventsToUnbind.push(this.unDocMouseMove)),h.axes.forEach(function(j){var $=w((j.crosshair||{}).snap,!0),et;$&&((et=h.hoverPoint)&&et.series[j.coll]===j||(et=T(I,function(it){return it.series[j.coll]===j}))),et||!$?j.drawCrosshair(u,et):j.hideCrosshair()})},f.prototype.scaleGroups=function(u,g){var h=this.chart;h.series.forEach(function(x){var d=u||x.getPlotBox();x.group&&(x.xAxis&&x.xAxis.zoomEnabled||h.mapView)&&(x.group.attr(d),x.markerGroup&&(x.markerGroup.attr(d),x.markerGroup.clip(g?h.clipRect:null)),x.dataLabelsGroup&&x.dataLabelsGroup.attr(d))}),h.clipRect.attr(g||h.clipBox)},f.prototype.setDOMEvents=function(){var u=this,g=this.chart.container,h=g.ownerDocument;g.onmousedown=this.onContainerMouseDown.bind(this),g.onmousemove=this.onContainerMouseMove.bind(this),g.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(v(g,"mouseenter",this.onContainerMouseEnter.bind(this))),this.eventsToUnbind.push(v(g,"mouseleave",this.onContainerMouseLeave.bind(this))),f.unbindDocumentMouseUp||(f.unbindDocumentMouseUp=v(h,"mouseup",this.onDocumentMouseUp.bind(this)));for(var x=this.chart.renderTo.parentElement;x&&x.tagName!=="BODY";)this.eventsToUnbind.push(v(x,"scroll",function(){delete u.chartPosition})),x=x.parentElement;s.hasTouch&&(this.eventsToUnbind.push(v(g,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1})),this.eventsToUnbind.push(v(g,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),f.unbindDocumentTouchEnd||(f.unbindDocumentTouchEnd=v(h,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))},f.prototype.setHoverChartIndex=function(){var u=this.chart,g=s.charts[w(f.hoverChartIndex,-1)];g&&g!==u&&g.pointer.onContainerMouseLeave({relatedTarget:!0}),g&&g.mouseIsDown||(f.hoverChartIndex=u.index)},f.prototype.touch=function(u,g){var h=this.chart;if(this.setHoverChartIndex(),u.touches.length===1)if(u=this.normalize(u),h.isInsidePlot(u.chartX-h.plotLeft,u.chartY-h.plotTop,{visiblePlotOnly:!0})&&!h.openMenu){if(g&&this.runPointActions(u),u.type==="touchmove"){g=this.pinchDown;var x=g[0]?4<=Math.sqrt(Math.pow(g[0].chartX-u.chartX,2)+Math.pow(g[0].chartY-u.chartY,2)):!1}w(x,!0)&&this.pinch(u)}else g&&this.reset();else u.touches.length===2&&this.pinch(u)},f.prototype.touchSelect=function(u){return!(!this.chart.options.chart.zoomBySingleTouch||!u.touches||u.touches.length!==1)},f.prototype.zoomOption=function(u){var g=this.chart,h=g.options.chart;g=g.inverted;var x=h.zoomType||"";/touch/.test(u.type)&&(x=w(h.pinchType,x)),this.zoomX=u=/x/.test(x),this.zoomY=h=/y/.test(x),this.zoomHor=u&&!g||h&&g,this.zoomVert=h&&!g||u&&g,this.hasZoom=u||h},f}(),r}),i(n,"Core/MSPointer.js",[n["Core/Globals.js"],n["Core/Pointer.js"],n["Core/Utilities.js"]],function(r,s,o){function c(){var a=[];return a.item=function(S){return this[S]},T(M,function(S){a.push({pageX:S.pageX,pageY:S.pageY,target:S.target})}),a}function l(a,S,w,A){var f=_[s.hoverChartIndex||NaN];a.pointerType!=="touch"&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!f||(f=f.pointer,A(a),f[S]({type:w,target:a.currentTarget,preventDefault:E,touches:c()}))}var O=this&&this.__extends||function(){var a=function(S,w){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,f){A.__proto__=f}||function(A,f){for(var u in f)f.hasOwnProperty(u)&&(A[u]=f[u])},a(S,w)};return function(S,w){function A(){this.constructor=S}a(S,w),S.prototype=w===null?Object.create(w):(A.prototype=w.prototype,new A)}}(),_=r.charts,v=r.doc,E=r.noop,b=r.win,P=o.addEvent,m=o.css,T=o.objectEach,k=o.removeEvent,M={},y=!!b.PointerEvent;return function(a){function S(){return a!==null&&a.apply(this,arguments)||this}return O(S,a),S.isRequired=function(){return!(r.hasTouch||!b.PointerEvent&&!b.MSPointerEvent)},S.prototype.batchMSEvents=function(w){w(this.chart.container,y?"pointerdown":"MSPointerDown",this.onContainerPointerDown),w(this.chart.container,y?"pointermove":"MSPointerMove",this.onContainerPointerMove),w(v,y?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},S.prototype.destroy=function(){this.batchMSEvents(k),a.prototype.destroy.call(this)},S.prototype.init=function(w,A){a.prototype.init.call(this,w,A),this.hasZoom&&m(w.container,{"-ms-touch-action":"none","touch-action":"none"})},S.prototype.onContainerPointerDown=function(w){l(w,"onContainerTouchStart","touchstart",function(A){M[A.pointerId]={pageX:A.pageX,pageY:A.pageY,target:A.currentTarget}})},S.prototype.onContainerPointerMove=function(w){l(w,"onContainerTouchMove","touchmove",function(A){M[A.pointerId]={pageX:A.pageX,pageY:A.pageY},M[A.pointerId].target||(M[A.pointerId].target=A.currentTarget)})},S.prototype.onDocumentPointerUp=function(w){l(w,"onDocumentTouchEnd","touchend",function(A){delete M[A.pointerId]})},S.prototype.setDOMEvents=function(){a.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(P)},S}(s)}),i(n,"Core/Legend/Legend.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/FormatUtilities.js"],n["Core/Globals.js"],n["Core/Series/Point.js"],n["Core/Renderer/RendererUtilities.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){var _=r.animObject,v=r.setAnimation,E=s.format;r=o.isFirefox;var b=o.marginNames;o=o.win;var P=l.distribute,m=O.addEvent,T=O.createElement,k=O.css,M=O.defined,y=O.discardElement,a=O.find,S=O.fireEvent,w=O.isNumber,A=O.merge,f=O.pick,u=O.relativeLength,g=O.stableSort,h=O.syncTimeout;return l=O.wrap,O=function(){function x(d,p){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=d,this.init(d,p)}return x.prototype.init=function(d,p){this.chart=d,this.setOptions(p),p.enabled&&(this.render(),m(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=m(this.chart,"render",function(){this.legend.proximatePositions(),this.legend.positionItems()}):this.unchartrender&&this.unchartrender())},x.prototype.setOptions=function(d){var p=f(d.padding,8);this.options=d,this.chart.styledMode||(this.itemStyle=d.itemStyle,this.itemHiddenStyle=A(this.itemStyle,d.itemHiddenStyle)),this.itemMarginTop=d.itemMarginTop||0,this.itemMarginBottom=d.itemMarginBottom||0,this.padding=p,this.initialItemY=p-5,this.symbolWidth=f(d.symbolWidth,16),this.pages=[],this.proximate=d.layout==="proximate"&&!this.chart.inverted,this.baseline=void 0},x.prototype.update=function(d,p){var R=this.chart;this.setOptions(A(!0,this.options,d)),this.destroy(),R.isDirtyLegend=R.isDirtyBox=!0,f(p,!0)&&R.redraw(),S(this,"afterUpdate")},x.prototype.colorizeItem=function(d,p){if(d.legendGroup[p?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var R=this.options,I=d.legendItem,j=d.legendLine,$=d.legendSymbol,et=this.itemHiddenStyle.color;R=p?R.itemStyle.color:et;var it=p&&d.color||et,H=d.options&&d.options.marker,z={fill:it};I&&I.css({fill:R,color:R}),j&&j.attr({stroke:it}),$&&(H&&$.isMarker&&(z=d.pointAttribs(),p||(z.stroke=z.fill=et)),$.attr(z))}S(this,"afterColorizeItem",{item:d,visible:p})},x.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},x.prototype.positionItem=function(d){var p=this,R=this.options,I=R.symbolPadding,j=!R.rtl,$=d._legendItemPos;R=$[0],$=$[1];var et=d.checkbox,it=d.legendGroup;it&&it.element&&(I={translateX:j?R:this.legendWidth-R-2*I-4,translateY:$},j=function(){S(p,"afterPositionItem",{item:d})},M(it.translateY)?it.animate(I,void 0,j):(it.attr(I),j())),et&&(et.x=R,et.y=$)},x.prototype.destroyItem=function(d){var p=d.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(R){d[R]&&(d[R]=d[R].destroy())}),p&&y(d.checkbox)},x.prototype.destroy=function(){function d(p){this[p]&&(this[p]=this[p].destroy())}this.getAllItems().forEach(function(p){["legendItem","legendGroup"].forEach(d,p)}),"clipRect up down pager nav box title group".split(" ").forEach(d,this),this.display=null},x.prototype.positionCheckboxes=function(){var d=this.group&&this.group.alignAttr,p=this.clipHeight||this.legendHeight,R=this.titleHeight;if(d){var I=d.translateY;this.allItems.forEach(function(j){var $=j.checkbox;if($){var et=I+R+$.y+(this.scrollOffset||0)+3;k($,{left:d.translateX+j.checkboxOffset+$.x-20+"px",top:et+"px",display:this.proximate||et>I-6&&et1.5*R?p.height:R))},x.prototype.layoutItem=function(d){var p=this.options,R=this.padding,I=p.layout==="horizontal",j=d.itemHeight,$=this.itemMarginBottom,et=this.itemMarginTop,it=I?f(p.itemDistance,20):0,H=this.maxLegendWidth;p=p.alignColumns&&this.totalItemWidth>H?this.maxItemWidth:d.itemWidth,I&&this.itemX-R+p>H&&(this.itemX=R,this.lastLineHeight&&(this.itemY+=et+this.lastLineHeight+$),this.lastLineHeight=0),this.lastItemY=et+this.itemY+$,this.lastLineHeight=Math.max(j,this.lastLineHeight),d._legendItemPos=[this.itemX,this.itemY],I?this.itemX+=p:(this.itemY+=et+j+$,this.lastLineHeight=j),this.offsetWidth=this.widthOption||Math.max((I?this.itemX-R-(d.checkbox?0:it):p)+R,this.offsetWidth)},x.prototype.getAllItems=function(){var d=[];return this.chart.series.forEach(function(p){var R=p&&p.options;p&&f(R.showInLegend,M(R.linkedTo)?!1:void 0,!0)&&(d=d.concat(p.legendItems||(R.legendType==="point"?p.data:p)))}),S(this,"afterGetAllItems",{allItems:d}),d},x.prototype.getAlignment=function(){var d=this.options;return this.proximate?d.align.charAt(0)+"tv":d.floating?"":d.align.charAt(0)+d.verticalAlign.charAt(0)+d.layout.charAt(0)},x.prototype.adjustMargins=function(d,p){var R=this.chart,I=this.options,j=this.getAlignment();j&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function($,et){$.test(j)&&!M(d[et])&&(R[b[et]]=Math.max(R[b[et]],R.legend[(et+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][et]*I[et%2?"x":"y"]+f(I.margin,12)+p[et]+(R.titleOffset[et]||0)))})},x.prototype.proximatePositions=function(){var d=this.chart,p=[],R=this.options.align==="left";this.allItems.forEach(function(I){var j,$=R;if(I.yAxis){I.xAxis.options.reversed&&($=!$),I.points&&(j=a($?I.points:I.points.slice(0).reverse(),function(it){return w(it.plotY)})),$=this.itemMarginTop+I.legendItem.getBBox().height+this.itemMarginBottom;var et=I.yAxis.top-d.plotTop;I.visible?(j=j?j.plotY:I.yAxis.height,j+=et-.3*$):j=et+I.yAxis.height,p.push({target:j,size:$,item:I})}},this),P(p,d.plotHeight).forEach(function(I){I.item._legendItemPos&&(I.item._legendItemPos[1]=d.plotTop-d.spacing[0]+I.pos)})},x.prototype.render=function(){var d=this.chart,p=d.renderer,R=this.options,I=this.padding,j=this.getAllItems(),$=this.group,et=this.box;this.itemX=I,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=u(R.width,d.spacingBox.width-I);var it=d.spacingBox.width-2*I-R.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(it/=2),this.maxLegendWidth=this.widthOption||it,$||(this.group=$=p.g("legend").addClass(R.className||"").attr({zIndex:7}).add(),this.contentGroup=p.g().attr({zIndex:1}).add($),this.scrollGroup=p.g().add(this.contentGroup)),this.renderTitle(),g(j,function(z,L){return(z.options&&z.options.legendIndex||0)-(L.options&&L.options.legendIndex||0)}),R.reversed&&j.reverse(),this.allItems=j,this.display=it=!!j.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,j.forEach(this.renderItem,this),j.forEach(this.layoutItem,this),j=(this.widthOption||this.offsetWidth)+I;var H=this.lastItemY+this.lastLineHeight+this.titleHeight;H=this.handleOverflow(H),H+=I,et||(this.box=et=p.rect().addClass("highcharts-legend-box").attr({r:R.borderRadius}).add($),et.isNew=!0),d.styledMode||et.attr({stroke:R.borderColor,"stroke-width":R.borderWidth||0,fill:R.backgroundColor||"none"}).shadow(R.shadow),0$&&z.enabled!==!1?(this.clipHeight=C=Math.max($-20-this.titleHeight-it,0),this.currentPage=f(this.currentPage,1),this.fullHeight=d,K.forEach(function(D,F){var X=D._legendItemPos[1],st=Math.round(D.legendItem.getBBox().height),ot=V.length;(!ot||X-V[ot-1]>C&&(U||X)!==V[ot-1])&&(V.push(U||X),ot++),D.pageIx=ot-1,U&&(K[F-1].pageIx=ot-1),F===K.length-1&&X+st-V[ot-1]>C&&st<=C&&(V.push(X),D.pageIx=ot),X!==U&&(U=X)}),tt||(tt=p.clipRect=I.clipRect(0,it,9999,0),p.contentGroup.clip(tt)),G(C),B||(this.nav=B=I.g().attr({zIndex:1}).add(this.group),this.up=I.symbol("triangle",0,0,N,N).add(B),J("upTracker").on("click",function(){p.scroll(-1,L)}),this.pager=I.text("",15,10).addClass("highcharts-legend-navigation"),R.styledMode||this.pager.css(z.style),this.pager.add(B),this.down=I.symbol("triangle-down",0,0,N,N).add(B),J("downTracker").on("click",function(){p.scroll(1,L)})),p.scroll(0),d=$):B&&(G(),this.nav=B.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),d},x.prototype.scroll=function(d,p){var R=this,I=this.chart,j=this.pages,$=j.length,et=this.clipHeight,it=this.options.navigation,H=this.pager,z=this.padding,L=this.currentPage+d;L>$&&(L=$),0=Math.max(xt+ut,ht.pos)&><=Math.min(xt+ut+at.width,ht.pos+ht.len)||(W.isInsidePlot=!1)}return!rt.ignoreY&&W.isInsidePlot&&(nt=dt&&(nt?dt.xAxis:dt.yAxis)||{pos:ft,len:1/0},rt=rt.paneCoordinates?nt.pos+Q:ft+Q,rt>=Math.max(vt+ft,nt.pos)&&rt<=Math.min(vt+ft+at.height,nt.pos+nt.len)||(W.isInsidePlot=!1)),G(this,"afterIsInsidePlot",W),W.isInsidePlot},Z.prototype.redraw=function(W){G(this,"beforeRedraw");var Q=this.hasCartesianSeries?this.axes:this.colorAxis||[],rt=this.series,nt=this.pointer,at=this.legend,ut=this.userOptions.legend,ft=this.renderer,gt=ft.isHidden(),xt=[],vt=this.isDirtyBox,dt=this.isDirtyLegend;for(this.setResponsive&&this.setResponsive(!1),S(this.hasRendered?W:!1,this),gt&&this.temporaryDisplay(),this.layOutTitles(),W=rt.length;W--;){var ht=rt[W];if(ht.options.stacking||ht.options.centerInCategory){var pt=!0;if(ht.isDirty){var mt=!0;break}}}if(mt)for(W=rt.length;W--;)ht=rt[W],ht.options.stacking&&(ht.isDirty=!0);rt.forEach(function(yt){yt.isDirty&&(yt.options.legendType==="point"?(typeof yt.updateTotals=="function"&&yt.updateTotals(),dt=!0):ut&&(ut.labelFormatter||ut.labelFormat)&&(dt=!0)),yt.isDirtyData&&G(yt,"updatedData")}),dt&&at&&at.options.enabled&&(at.render(),this.isDirtyLegend=!1),pt&&this.getStacks(),Q.forEach(function(yt){yt.updateNames(),yt.setScale()}),this.getMargins(),Q.forEach(function(yt){yt.isDirty&&(vt=!0)}),Q.forEach(function(yt){var wt=yt.min+","+yt.max;yt.extKey!==wt&&(yt.extKey=wt,xt.push(function(){G(yt,"afterSetExtremes",V(yt.eventArgs,yt.getExtremes())),delete yt.eventArgs})),(vt||pt)&&yt.redraw()}),vt&&this.drawChartBox(),G(this,"predraw"),rt.forEach(function(yt){(vt||yt.isDirty)&&yt.visible&&yt.redraw(),yt.isDirtyData=!1}),nt&&nt.reset(!0),ft.draw(),G(this,"redraw"),G(this,"render"),gt&&this.temporaryDisplay(!0),xt.forEach(function(yt){yt.call()})},Z.prototype.get=function(W){function Q(ut){return ut.id===W||ut.options&&ut.options.id===W}for(var rt=this.series,nt=K(this.axes,Q)||K(this.series,Q),at=0;!nt&&at=vt&&nt<=dt||ht||!H(nt))&&(pt=!0),rt[ht?"zoomX":"zoomY"]&&pt&&(ut=xt.zoom(gt.min,gt.max),xt.displayBtn&&(at=!0))});var ft=Q.resetZoomButton;at&&!ft?Q.showResetZoom():!at&&B(ft)&&(Q.resetZoomButton=ft.destroy()),ut&&Q.redraw(X(Q.options.chart.animation,W&&W.animation,100>Q.pointCount))},Z.prototype.pan=function(W,Q){var rt=this,nt=rt.hoverPoints;Q=typeof Q=="object"?Q:{enabled:Q,type:"x"};var at=rt.options.chart,ut=rt.options.mapNavigation&&rt.options.mapNavigation.enabled;at&&at.panning&&(at.panning=Q);var ft=Q.type,gt;G(this,"pan",{originalEvent:W},function(){nt&&nt.forEach(function(dt){dt.setState()});var xt=rt.xAxis;ft==="xy"?xt=xt.concat(rt.yAxis):ft==="y"&&(xt=rt.yAxis);var vt={};xt.forEach(function(dt){if(dt.options.panningEnabled&&!dt.options.isInternal){var ht=dt.horiz,pt=W[ht?"chartX":"chartY"];ht=ht?"mouseDownX":"mouseDownY";var mt=rt[ht],yt=dt.minPointOffset||0,wt=dt.reversed&&!rt.inverted||!dt.reversed&&rt.inverted?-1:1,kt=dt.getExtremes(),Ot=dt.toValue(mt-pt,!0)+yt*wt,Xt=dt.toValue(mt+dt.len-pt,!0)-(yt*wt||dt.isXAxis&&dt.pointRangePadding||0),we=Xt=wt&&Ot<=Xt&&(dt.setExtremes(mt,Ot,!1,!1,{trigger:"pan"}),rt.resetZoomButton||ut||mt===wt||Ot===Xt||!ft.match("y")||(rt.showResetZoom(),dt.displayBtn=!1),gt=!0),vt[ht]=pt)}}),F(vt,function(dt,ht){rt[ht]=dt}),gt&&rt.redraw(!1),it(rt.container,{cursor:"move"})})},Z}(),V(r.prototype,{callbacks:[],collectionsWithInit:{xAxis:[r.prototype.addAxis,[!0]],yAxis:[r.prototype.addAxis,[!1]],series:[r.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")}),r}),i(n,"Core/Legend/LegendSymbol.js",[n["Core/Utilities.js"]],function(r){var s=r.merge,o=r.pick,c;return function(l){l.drawLineMarker=function(O){var _=this.options,v=O.symbolWidth,E=O.symbolHeight,b=E/2,P=this.chart.renderer,m=this.legendGroup;O=O.baseline-Math.round(.3*O.fontMetrics.b);var T={},k=_.marker;this.chart.styledMode||(T={"stroke-width":_.lineWidth||0},_.dashStyle&&(T.dashstyle=_.dashStyle)),this.legendLine=P.path([["M",0,O],["L",v,O]]).addClass("highcharts-graph").attr(T).add(m),k&&k.enabled!==!1&&v&&(_=Math.min(o(k.radius,b),b),this.symbol.indexOf("url")===0&&(k=s(k,{width:E,height:E}),_=0),this.legendSymbol=v=P.symbol(this.symbol,v/2-_,O-_,2*_,2*_,k).addClass("highcharts-point").add(m),v.isMarker=!0)},l.drawRectangle=function(O,_){var v=O.symbolHeight,E=O.options.squareSymbol;_.legendSymbol=this.chart.renderer.rect(E?(O.symbolWidth-v)/2:0,O.baseline-v+1,E?v:O.symbolWidth,v,o(O.options.symbolRadius,v/2)).addClass("highcharts-point").attr({zIndex:3}).add(_.legendGroup)}}(c||(c={})),c}),i(n,"Core/Series/SeriesDefaults.js",[],function(){return{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var r=this.series.chart.numberFormatter;return typeof this.y!="number"?"":r(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}}),i(n,"Core/Series/Series.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/DefaultOptions.js"],n["Core/Foundation.js"],n["Core/Globals.js"],n["Core/Legend/LegendSymbol.js"],n["Core/Series/Point.js"],n["Core/Series/SeriesDefaults.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E,b){var P=r.animObject,m=r.setAnimation,T=s.defaultOptions,k=o.registerEventOptions,M=c.hasTouch,y=c.svg,a=c.win,S=v.seriesTypes,w=b.addEvent,A=b.arrayMax,f=b.arrayMin,u=b.clamp,g=b.cleanRecursively,h=b.correctFloat,x=b.defined,d=b.erase,p=b.error,R=b.extend,I=b.find,j=b.fireEvent,$=b.getNestedProperty,et=b.isArray,it=b.isNumber,H=b.isString,z=b.merge,L=b.objectEach,N=b.pick,V=b.removeEvent,K=b.splat,G=b.syncTimeout;return r=function(){function J(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}return J.prototype.init=function(C,U){j(this,"init",{options:U});var B=this,tt=C.series;this.eventsToUnbind=[],B.chart=C,B.options=B.setOptions(U),U=B.options,B.linkedSeries=[],B.bindAxes(),R(B,{name:U.name,state:"",visible:U.visible!==!1,selected:U.selected===!0}),k(this,U);var D=U.events;(D&&D.click||U.point&&U.point.events&&U.point.events.click||U.allowPointSelect)&&(C.runTrackerClick=!0),B.getColor(),B.getSymbol(),B.parallelArrays.forEach(function(X){B[X+"Data"]||(B[X+"Data"]=[])}),B.isCartesian&&(C.hasCartesianSeries=!0);var F;tt.length&&(F=tt[tt.length-1]),B._i=N(F&&F._i,-1)+1,B.opacity=B.options.opacity,C.orderSeries(this.insert(tt)),U.dataSorting&&U.dataSorting.enabled?B.setDataSortingOptions():B.points||B.data||B.setData(U.data,!1),j(this,"afterInit")},J.prototype.is=function(C){return S[C]&&this instanceof S[C]},J.prototype.insert=function(C){var U=this.options.index,B;if(it(U)){for(B=C.length;B--;)if(U>=N(C[B].options.index,C[B]._i)){C.splice(B+1,0,this);break}B===-1&&C.unshift(this),B+=1}else C.push(this);return N(B,C.length-1)},J.prototype.bindAxes=function(){var C=this,U=C.options,B=C.chart,tt;j(this,"bindAxes",null,function(){(C.axisTypes||[]).forEach(function(D){var F=0;B[D].forEach(function(X){tt=X.options,(U[D]===F&&!tt.isInternal||typeof U[D]<"u"&&U[D]===tt.id||typeof U[D]>"u"&&tt.index===0)&&(C.insert(X.series),C[D]=X,X.isDirty=!0),tt.isInternal||F++}),C[D]||C.optionalAxis===D||p(18,!0,B)})}),j(this,"afterBindAxes")},J.prototype.updateParallelArrays=function(C,U){var B=C.series,tt=arguments,D=it(U)?function(F){var X=F==="y"&&B.toYData?B.toYData(C):C[F];B[F+"Data"][U]=X}:function(F){Array.prototype[U].apply(B[F+"Data"],Array.prototype.slice.call(tt,2))};B.parallelArrays.forEach(D)},J.prototype.hasData=function(){return this.visible&&typeof this.dataMax<"u"&&typeof this.dataMin<"u"||this.visible&&this.yData&&0"u"&&it(tt)&&(ot=this.xData.indexOf(tt,U)),ot!==-1&&typeof ot<"u"&&this.cropped&&(ot=ot>=this.cropStart?ot-this.cropStart:ot),!st&&it(ot)&&D[ot]&&D[ot].touched&&(ot=void 0),ot},J.prototype.updateData=function(C,U){var B=this.options,tt=B.dataSorting,D=this.points,F=[],X=this.requireSorting,st=C.length===D.length,ot,lt,ct,q=!0;if(this.xIncrement=null,C.forEach(function(Y,Z){var W=x(Y)&&this.pointClass.prototype.optionsToObject.call({series:this},Y)||{},Q=W.x;W.id||it(Q)?(W=this.findPointIndex(W,ct),W===-1||typeof W>"u"?F.push(Y):D[W]&&Y!==B.data[W]?(D[W].update(Y,!1,null,!1),D[W].touched=!0,X&&(ct=W+1)):D[W]&&(D[W].touched=!0),(!st||Z!==W||tt&&tt.enabled||this.hasDerivedData)&&(ot=!0)):F.push(Y)},this),ot)for(C=D.length;C--;)(lt=D[C])&&!lt.touched&<.remove&<.remove(!1,U);else!st||tt&&tt.enabled?q=!1:(C.forEach(function(Y,Z){Y!==D[Z].y&&D[Z].update&&D[Z].update(Y,!1,null,!1)}),F.length=0);return D.forEach(function(Y){Y&&(Y.touched=!1)}),q?(F.forEach(function(Y){this.addPoint(Y,!1,null,null,!1)},this),this.xIncrement===null&&this.xData&&this.xData.length&&(this.xIncrement=A(this.xData),this.autoIncrement()),!0):!1},J.prototype.setData=function(C,U,B,tt){var D=this,F=D.points,X=F&&F.length||0,st=D.options,ot=D.chart,lt=st.dataSorting,ct=D.xAxis,q=st.turboThreshold,Y=this.xData,Z=this.yData,W=D.pointArrayMap;W=W&&W.length;var Q=st.keys,rt,nt=0,at=1,ut=null;C=C||[];var ft=C.length;if(U=N(U,!0),lt&<.enabled&&(C=this.sortData(C)),tt!==!1&&ft&&X&&!D.cropped&&!D.hasGroupedData&&D.visible&&!D.isSeriesBoosting&&(rt=this.updateData(C,B)),!rt){if(D.xIncrement=null,D.colorCounter=0,this.parallelArrays.forEach(function(gt){D[gt+"Data"].length=0}),q&&ft>q)if(ut=D.getFirstValidPoint(C),it(ut))for(B=0;BD?1:0}).forEach(function(D,F){D.x=F},this),U.linkedSeries&&U.linkedSeries.forEach(function(D){var F=D.options,X=F.data;F.dataSorting&&F.dataSorting.enabled||!X||(X.forEach(function(st,ot){X[ot]=tt(D,st),C[ot]&&(X[ot].x=C[ot].x,X[ot].index=ot)}),D.setData(X,!1))}),C},J.prototype.getProcessedData=function(C){var U=this.xAxis,B=this.options,tt=B.cropThreshold,D=C||this.getExtremesFromAll||B.getExtremesFromAll,F=this.isCartesian;C=U&&U.val2lin,B=!(!U||!U.logarithmic);var X=0,st=this.xData,ot=this.yData,lt=this.requireSorting,ct=!1,q=st.length;if(U){ct=U.getExtremes();var Y=ct.min,Z=ct.max;ct=U.categories&&!U.names.length}if(F&&this.sorted&&!D&&(!tt||q>tt||this.forceCrop)){if(st[q-1]Z)st=[],ot=[];else if(this.yData&&(st[0]Z)){var W=this.cropData(this.xData,this.yData,Y,Z);st=W.xData,ot=W.yData,X=W.start,W=!0}}for(tt=st.length||1;--tt;)if(U=B?C(st[tt])-C(st[tt-1]):st[tt]-st[tt-1],0"u"||UU&<&&!ct&&(p(15,!1,this.chart),lt=!1);return{xData:st,yData:ot,cropped:W,cropStart:X,closestPointRange:Q}},J.prototype.processData=function(C){var U=this.xAxis;if(this.isCartesian&&!this.isDirty&&!U.isDirty&&!this.yAxis.isDirty&&!C)return!1;C=this.getProcessedData(),this.cropped=C.cropped,this.cropStart=C.cropStart,this.processedXData=C.xData,this.processedYData=C.yData,this.closestPointRange=this.basePointRange=C.closestPointRange,j(this,"afterProcessData")},J.prototype.cropData=function(C,U,B,tt,D){var F=C.length,X,st=0,ot=F;for(D=N(D,this.cropShoulder),X=0;X=B){st=Math.max(0,X-D);break}for(B=X;Btt){ot=B+D;break}return{xData:C.slice(st,ot),yData:U.slice(st,ot),start:st,end:ot}},J.prototype.generatePoints=function(){var C=this.options,U=C.data,B=this.processedXData,tt=this.processedYData,D=this.pointClass,F=B.length,X=this.cropStart||0,st=this.hasGroupedData,ot=C.keys,lt=[];C=C.dataGrouping&&C.dataGrouping.groupAll?X:0;var ct,q,Y=this.data;if(!Y&&!st){var Z=[];Z.length=U.length,Y=this.data=Z}for(ot&&st&&(this.options.keys=!1),q=0;q"u"||(Y[Z]=W=new D().init(this,U[Z],B[q]));W&&(W.index=st?C+q:Z,lt[q]=W)}if(this.options.keys=ot,Y&&(F!==(ct=Y.length)||st))for(q=0;q=ot&&(D[st-X]||Z)<=lt,W&&Z)if(W=Y.length)for(;W--;)it(Y[W])&&(F[ct++]=Y[W]);else F[ct++]=Y}return C={activeYData:F,dataMin:f(F),dataMax:A(F)},j(this,"afterGetExtremes",{dataExtremes:C}),C},J.prototype.applyExtremes=function(){var C=this.getExtremes();return this.dataMin=C.dataMin,this.dataMax=C.dataMax,C},J.prototype.getFirstValidPoint=function(C){for(var U=C.length,B=0,tt=null;tt===null&&B=gt&&(gt=null),rt.total=rt.stackTotal=at.total,rt.percentage=at.total&&rt.y/at.total*100,rt.stackY=ft,this.irregularWidths||at.setOffset(this.pointXOffset||0,this.barW||0)),rt.yBottom=x(gt)?u(F.translate(gt,0,1,0,1),-1e5,1e5):null,this.dataModify&&(ft=this.dataModify.modifyValue(ft,Z)),rt.plotY=void 0,it(ft)&&(at=F.translate(ft,!1,!0,!1,!0),typeof at<"u"&&(rt.plotY=u(at,-1e5,1e5))),rt.isInside=this.isPointInside(rt),rt.clientX=lt?h(B.translate(nt,0,0,0,1,ot)):W,rt.negative=rt[Y]<(C[Y+"Threshold"]||ct||0),rt.category=tt&&typeof tt[rt.x]<"u"?tt[rt.x]:rt.x,!rt.isNull&&rt.visible!==!1){typeof dt<"u"&&(Q=Math.min(Q,Math.abs(W-dt)));var dt=W}rt.zone=this.zones.length?rt.getZone():void 0,!rt.graphic&&this.group&&D&&(rt.isNew=!0)}this.closestPointRangePx=Q,j(this,"afterTranslate")},J.prototype.getValidPoints=function(C,U,B){var tt=this.chart;return(C||this.points||[]).filter(function(D){return U&&!tt.isInsidePlot(D.plotX,D.plotY,{inverted:tt.inverted})?!1:D.visible!==!1&&(B||!D.isNull)})},J.prototype.getClipBox=function(){var C=this.chart,U=this.xAxis,B=this.yAxis,tt=z(C.clipBox);return U&&U.len!==C.plotSizeX&&(tt.width=U.len),B&&B.len!==C.plotSizeY&&(tt.height=B.len),tt},J.prototype.getSharedClipKey=function(){return this.sharedClipKey=(this.options.xAxis||0)+","+(this.options.yAxis||0)},J.prototype.setClip=function(){var C=this.chart,U=this.group,B=this.markerGroup,tt=C.sharedClips;C=C.renderer;var D=this.getClipBox(),F=this.getSharedClipKey(),X=tt[F];X?X.animate(D):tt[F]=X=C.clipRect(D),U&&U.clip(this.options.clip===!1?void 0:X),B&&B.clip()},J.prototype.animate=function(C){var U=this.chart,B=this.group,tt=this.markerGroup,D=U.inverted,F=P(this.options.animation),X=[this.getSharedClipKey(),F.duration,F.easing,F.defer].join(),st=U.sharedClips[X],ot=U.sharedClips[X+"m"];if(C&&B)F=this.getClipBox(),st?st.attr("height",F.height):(F.width=0,D&&(F.x=U.plotHeight),st=U.renderer.clipRect(F),U.sharedClips[X]=st,ot=U.renderer.clipRect({x:D?(U.plotSizeX||0)+99:-99,y:D?-U.plotLeft:-U.plotTop,width:99,height:D?U.chartWidth:U.chartHeight}),U.sharedClips[X+"m"]=ot),B.clip(st),tt&&tt.clip(ot);else if(st&&!st.hasClass("highcharts-animating")){U=this.getClipBox();var lt=F.step;tt&&tt.element.childNodes.length&&(F.step=function(ct,q){lt&<.apply(q,arguments),ot&&ot.element&&ot.attr(q.prop,q.prop==="width"?ct+99:ct)}),st.addClass("highcharts-animating").animate(U,F)}},J.prototype.afterAnimate=function(){var C=this;this.setClip(),L(this.chart.sharedClips,function(U,B,tt){U&&!C.chart.container.querySelector('[clip-path="url(#'+U.id+')"]')&&(U.destroy(),delete tt[B])}),this.finishedAnimating=!0,j(this,"afterAnimate")},J.prototype.drawPoints=function(){var C=this.points,U=this.chart,B=this.options.marker,tt=this[this.specialGroup]||this.markerGroup,D=this.xAxis,F=N(B.enabled,!D||D.isRadial?!0:null,this.closestPointRangePx>=B.enabledThreshold*B.radius),X,st;if(B.enabled!==!1||this._hasPointMarkers)for(X=0;X"u"||ct.enabled)&&!ot.isNull&&ot.visible!==!1){var Y=N(ct.symbol,this.symbol,"rect"),Z=this.markerAttribs(ot,ot.selected&&"select");this.enabledDataSorting&&(ot.startXPos=D.reversed?-(Z.width||0):D.width);var W=ot.isInside!==!1;st?st[W?"show":"hide"](W).animate(Z):W&&(0<(Z.width||0)||ot.hasImage)&&(ot.graphic=st=U.renderer.symbol(Y,Z.x,Z.y,Z.width,Z.height,q?ct:B).add(tt),this.enabledDataSorting&&U.hasRendered&&(st.attr({x:ot.startXPos}),lt="animate")),st&<==="animate"&&st[W?"show":"hide"](W).animate(Z),st&&!U.styledMode&&st[lt](this.pointAttribs(ot,ot.selected&&"select")),st&&st.addClass(ot.getClassName(),!0)}else st&&(ot.graphic=st.destroy())}},J.prototype.markerAttribs=function(C,U){var B=this.options,tt=B.marker,D=C.marker||{},F=D.symbol||tt.symbol,X=N(D.radius,tt.radius);return U&&(tt=tt.states[U],U=D.states&&D.states[U],X=N(U&&U.radius,tt&&tt.radius,X+(tt&&tt.radiusPlus||0))),C.hasImage=F&&F.indexOf("url")===0,C.hasImage&&(X=0),C={x:B.crisp?Math.floor(C.plotX-X):C.plotX-X,y:C.plotY-X},X&&(C.width=C.height=2*X),C},J.prototype.pointAttribs=function(C,U){var B=this.options.marker,tt=C&&C.options,D=tt&&tt.marker||{},F=tt&&tt.color,X=C&&C.color,st=C&&C.zone&&C.zone.color,ot=this.color;return C=N(D.lineWidth,B.lineWidth),tt=1,ot=F||st||X||ot,F=D.fillColor||B.fillColor||ot,X=D.lineColor||B.lineColor||ot,U=U||"normal",B=B.states[U]||{},U=D.states&&D.states[U]||{},C=N(U.lineWidth,B.lineWidth,C+N(U.lineWidthPlus,B.lineWidthPlus,0)),F=U.fillColor||B.fillColor||F,X=U.lineColor||B.lineColor||X,tt=N(U.opacity,B.opacity,tt),{stroke:X,"stroke-width":C,fill:F,opacity:tt}},J.prototype.destroy=function(C){var U=this,B=U.chart,tt=/AppleWebKit\/533/.test(a.navigator.userAgent),D=U.data||[],F,X,st,ot;for(j(U,"destroy"),this.removeEvents(C),(U.axisTypes||[]).forEach(function(lt){(ot=U[lt])&&ot.series&&(d(ot.series,U),ot.isDirty=ot.forceRedraw=!0)}),U.legendItem&&U.chart.legend.destroyItem(U),X=D.length;X--;)(st=D[X])&&st.destroy&&st.destroy();U.clips&&U.clips.forEach(function(lt){return lt.destroy()}),b.clearTimeout(U.animationTimeout),L(U,function(lt,ct){lt instanceof E&&!lt.survive&&(F=tt&&ct==="group"?"hide":"destroy",lt[F]())}),B.hoverSeries===U&&(B.hoverSeries=void 0),d(B.series,U),B.orderSeries(),L(U,function(lt,ct){C&&ct==="hcEvents"||delete U[ct]})},J.prototype.applyZones=function(){var C=this,U=this.chart,B=U.renderer,tt=this.zones,D=this.clips||[],F=this.graph,X=this.area,st=Math.max(U.chartWidth,U.chartHeight),ot=this[(this.zoneAxis||"y")+"Axis"],lt=U.inverted,ct,q,Y,Z,W,Q,rt,nt,at=!1;if(tt.length&&(F||X)&&ot&&typeof ot.min<"u"){var ut=ot.reversed,ft=ot.horiz;F&&!this.showLine&&F.hide(),X&&X.hide();var gt=ot.getExtremes();tt.forEach(function(xt,vt){ct=ut?ft?U.plotWidth:0:ft?0:ot.toPixels(gt.min)||0,ct=u(N(q,ct),0,st),q=u(Math.round(ot.toPixels(N(xt.value,gt.max),!0)||0),0,st),at&&(ct=q=ot.toPixels(gt.max)),Z=Math.abs(ct-q),W=Math.min(ct,q),Q=Math.max(ct,q),ot.isXAxis?(Y={x:lt?Q:W,y:0,width:Z,height:st},ft||(Y.x=U.plotHeight-Y.x)):(Y={x:0,y:lt?Q:W,width:st,height:Z},ft&&(Y.y=U.plotWidth-Y.y)),lt&&B.isVML&&(Y=ot.isXAxis?{x:0,y:ut?W:Q,height:Y.width,width:U.chartWidth}:{x:Y.y-U.plotLeft-U.spacingBox.x,y:0,width:Y.height,height:U.chartHeight}),D[vt]?D[vt].animate(Y):D[vt]=B.clipRect(Y),rt=C["zone-area-"+vt],nt=C["zone-graph-"+vt],F&&nt&&nt.clip(D[vt]),X&&rt&&rt.clip(D[vt]),at=xt.value>gt.max,C.resetZones&&q===0&&(q=void 0)}),this.clips=D}else C.visible&&(F&&F.show(!0),X&&X.show(!0))},J.prototype.invertGroups=function(C){function U(){["group","markerGroup"].forEach(function(D){B[D]&&(tt.renderer.isVML&&B[D].attr({width:B.yAxis.len,height:B.xAxis.len}),B[D].width=B.yAxis.len,B[D].height=B.xAxis.len,B[D].invert(B.isRadialSeries?!1:C))})}var B=this,tt=B.chart;B.xAxis&&(B.eventsToUnbind.push(w(tt,"resize",U)),U(),B.invertGroups=U)},J.prototype.plotGroup=function(C,U,B,tt,D){var F=this[C],X=!F;return B={visibility:B,zIndex:tt||.1},typeof this.opacity>"u"||this.chart.styledMode||this.state==="inactive"||(B.opacity=this.opacity),X&&(this[C]=F=this.chart.renderer.g().add(D)),F.addClass("highcharts-"+U+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(x(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(F.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),F.attr(B)[X?"attr":"animate"](this.getPlotBox()),F},J.prototype.getPlotBox=function(){var C=this.chart,U=this.xAxis,B=this.yAxis;return C.inverted&&(U=B,B=this.xAxis),{translateX:U?U.left:C.plotLeft,translateY:B?B.top:C.plotTop,scaleX:1,scaleY:1}},J.prototype.removeEvents=function(C){C||V(this),this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(U){U()}),this.eventsToUnbind.length=0)},J.prototype.render=function(){var C=this,U=C.chart,B=C.options,tt=P(B.animation),D=C.visible?"inherit":"hidden",F=B.zIndex,X=C.hasRendered,st=U.seriesGroup,ot=U.inverted;U=!C.finishedAnimating&&U.renderer.isSVG?tt.duration:0,j(this,"render");var lt=C.plotGroup("group","series",D,F,st);C.markerGroup=C.plotGroup("markerGroup","markers",D,F,st),B.clip!==!1&&C.setClip(),C.animate&&U&&C.animate(!0),lt.inverted=N(C.invertible,C.isCartesian)?ot:!1,C.drawGraph&&(C.drawGraph(),C.applyZones()),C.visible&&C.drawPoints(),C.drawDataLabels&&C.drawDataLabels(),C.redrawPoints&&C.redrawPoints(),C.drawTracker&&C.options.enableMouseTracking!==!1&&C.drawTracker(),C.invertGroups(ot),C.animate&&U&&C.animate(),X||(U&&tt.defer&&(U+=tt.defer),C.animationTimeout=G(function(){C.afterAnimate()},U||0)),C.isDirty=!1,C.hasRendered=!0,j(C,"afterRender")},J.prototype.redraw=function(){var C=this.chart,U=this.isDirty||this.isDirtyData,B=this.group,tt=this.xAxis,D=this.yAxis;B&&(C.inverted&&B.attr({width:C.plotWidth,height:C.plotHeight}),B.animate({translateX:N(tt&&tt.left,C.plotLeft),translateY:N(D&&D.top,C.plotTop)})),this.translate(),this.render(),U&&delete this.kdTree},J.prototype.searchPoint=function(C,U){var B=this.xAxis,tt=this.yAxis,D=this.chart.inverted;return this.searchKDTree({clientX:D?B.len-C.chartY+B.pos:C.chartX-B.pos,plotY:D?tt.len-C.chartX+tt.pos:C.chartY-tt.pos},U,C)},J.prototype.buildKDTree=function(C){function U(D,F,X){var st=D&&D.length;if(st){var ot=B.kdAxisArray[F%X];return D.sort(function(lt,ct){return lt[ot]-ct[ot]}),st=Math.floor(st/2),{point:D[st],left:U(D.slice(0,st),F+1,X),right:U(D.slice(st+1),F+1,X)}}}this.buildingKdTree=!0;var B=this,tt=-1Z?"left":"right",Q=0>Z?"right":"left",lt[rt]&&(rt=tt(ot,lt[rt],ct+1,q),W=rt[st]Z;)W--;this.updateParallelArrays(Y,"splice",W,0,0),this.updateParallelArrays(Y,W),ot&&Y.name&&(ot[Z]=Y.name),lt.splice(W,0,C),q&&(this.data.splice(W,0,null),this.processData()),F.legendType==="point"&&this.generatePoints(),B&&(X[0]&&X[0].remove?X[0].remove(!1):(X.shift(),this.updateParallelArrays(Y,"shift"),lt.shift())),D!==!1&&j(this,"addPoint",{point:Y}),this.isDirtyData=this.isDirty=!0,U&&st.redraw(tt)},J.prototype.removePoint=function(C,U,B){var tt=this,D=tt.data,F=D[C],X=tt.points,st=tt.chart,ot=function(){X&&X.length===D.length&&X.splice(C,1),D.splice(C,1),tt.options.data.splice(C,1),tt.updateParallelArrays(F||{series:tt},"splice",C,1),F&&F.destroy(),tt.isDirty=!0,tt.isDirtyData=!0,U&&st.redraw()};m(B,st),U=N(U,!0),F?F.firePointEvent("remove",null,ot):ot()},J.prototype.remove=function(C,U,B,tt){function D(){F.destroy(tt),X.isDirtyLegend=X.isDirtyBox=!0,X.linkSeries(),N(C,!0)&&X.redraw(U)}var F=this,X=F.chart;B!==!1?j(F,"remove",null,D):D()},J.prototype.update=function(C,U){C=g(C,this.userOptions),j(this,"update",{options:C});var B=this,tt=B.chart,D=B.userOptions,F=B.initialType||B.type,X=tt.options.plotOptions,st=S[F].prototype,ot=B.finishedAnimating&&{animation:!1},lt={},ct,q=["eventOptions","navigatorSeries","baseSeries"],Y=C.type||D.type||tt.options.chart.type,Z=!(this.hasDerivedData||Y&&Y!==this.type||typeof C.pointStart<"u"||typeof C.pointInterval<"u"||typeof C.relativeXValue<"u"||B.hasOptionChanged("dataGrouping")||B.hasOptionChanged("pointStart")||B.hasOptionChanged("pointInterval")||B.hasOptionChanged("pointIntervalUnit")||B.hasOptionChanged("keys"));if(Y=Y||F,Z&&(q.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","clips","nodes","layout","mapMap","mapData","minY","maxY","minX","maxX"),C.visible!==!1&&q.push("area","graph"),B.parallelArrays.forEach(function(Q){q.push(Q+"Data")}),C.data&&(C.dataSorting&&R(B.options.dataSorting,C.dataSorting),this.setData(C.data,!1))),C=z(D,ot,{index:typeof D.index>"u"?B.index:D.index,pointStart:N(X&&X.series&&X.series.pointStart,D.pointStart,B.xData[0])},!Z&&{data:B.options.data},C),Z&&C.data&&(C.data=B.options.data),q=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(q),q.forEach(function(Q){q[Q]=B[Q],delete B[Q]}),X=!1,S[Y]){if(X=Y!==B.type,B.remove(!1,!1,!1,!0),X)if(Object.setPrototypeOf)Object.setPrototypeOf(B,S[Y].prototype);else{ot=Object.hasOwnProperty.call(B,"hcEvents")&&B.hcEvents;for(ct in st)B[ct]=void 0;R(B,S[Y].prototype),ot?B.hcEvents=ot:delete B.hcEvents}}else p(17,!0,tt,{missingModuleFor:Y});if(q.forEach(function(Q){B[Q]=q[Q]}),B.init(tt,C),Z&&this.points){var W=B.options;W.visible===!1?(lt.graphic=1,lt.dataLabel=1):B._hasPointLabels||(C=W.marker,st=W.dataLabels,!C||C.enabled!==!1&&(D.marker&&D.marker.symbol)===C.symbol||(lt.graphic=1),st&&st.enabled===!1&&(lt.dataLabel=1)),this.points.forEach(function(Q){Q&&Q.series&&(Q.resolveColor(),Object.keys(lt).length&&Q.destroyElements(lt),W.showInLegend===!1&&Q.legendItem&&tt.legend.destroyItem(Q))},this)}B.initialType=F,tt.linkSeries(),X&&B.linkedSeries.length&&(B.isDirtyData=!0),j(this,"afterUpdate"),N(U,!0)&&tt.redraw(Z?void 0:!1)},J.prototype.setName=function(C){this.name=this.options.name=this.userOptions.name=C,this.chart.isDirtyLegend=!0},J.prototype.hasOptionChanged=function(C){var U=this.options[C],B=this.chart.options.plotOptions,tt=this.userOptions[C];return tt?U!==tt:U!==N(B&&B[this.type]&&B[this.type][C],B&&B.series&&B.series[C],U)},J.prototype.onMouseOver=function(){var C=this.chart,U=C.hoverSeries;C.pointer.setHoverChartIndex(),U&&U!==this&&U.onMouseOut(),this.options.events.mouseOver&&j(this,"mouseOver"),this.setState("hover"),C.hoverSeries=this},J.prototype.onMouseOut=function(){var C=this.options,U=this.chart,B=U.tooltip,tt=U.hoverPoint;U.hoverSeries=null,tt&&tt.onMouseOut(),this&&C.events.mouseOut&&j(this,"mouseOut"),!B||this.stickyTracking||B.shared&&!this.noSharedTooltip||B.hide(),U.series.forEach(function(D){D.setState("",!0)})},J.prototype.setState=function(C,U){var B=this,tt=B.options,D=B.graph,F=tt.inactiveOtherPoints,X=tt.states,st=N(X[C||"normal"]&&X[C||"normal"].animation,B.chart.options.chart.animation),ot=tt.lineWidth,lt=0,ct=tt.opacity;if(C=C||"",B.state!==C&&([B.group,B.markerGroup,B.dataLabelsGroup].forEach(function(q){q&&(B.state&&q.removeClass("highcharts-series-"+B.state),C&&q.addClass("highcharts-series-"+C))}),B.state=C,!B.chart.styledMode)){if(X[C]&&X[C].enabled===!1)return;if(C&&(ot=X[C].lineWidth||ot+(X[C].lineWidthPlus||0),ct=N(X[C].opacity,ct)),D&&!D.dashstyle)for(tt={"stroke-width":ot},D.animate(tt,st);B["zone-graph-"+lt];)B["zone-graph-"+lt].animate(tt,st),lt+=1;F||[B.group,B.markerGroup,B.dataLabelsGroup,B.labelBySeries].forEach(function(q){q&&q.animate({opacity:ct},st)})}U&&F&&B.points&&B.setAllPointsToState(C||void 0)},J.prototype.setAllPointsToState=function(C){this.points.forEach(function(U){U.setState&&U.setState(C)})},J.prototype.setVisible=function(C,U){var B=this,tt=B.chart,D=B.legendItem,F=tt.options.chart.ignoreHiddenSeries,X=B.visible,st=(B.visible=C=B.options.visible=B.userOptions.visible=typeof C>"u"?!X:C)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(ot){B[ot]&&B[ot][st]()}),(tt.hoverSeries===B||(tt.hoverPoint&&tt.hoverPoint.series)===B)&&B.onMouseOut(),D&&tt.legend.colorizeItem(B,C),B.isDirty=!0,B.options.stacking&&tt.series.forEach(function(ot){ot.options.stacking&&ot.visible&&(ot.isDirty=!0)}),B.linkedSeries.forEach(function(ot){ot.setVisible(C,!1)}),F&&(tt.isDirtyBox=!0),j(B,st),U!==!1&&tt.redraw()},J.prototype.show=function(){this.setVisible(!0)},J.prototype.hide=function(){this.setVisible(!1)},J.prototype.select=function(C){this.selected=C=this.options.selected=typeof C>"u"?!this.selected:C,this.checkbox&&(this.checkbox.checked=C),j(this,C?"select":"unselect")},J.prototype.shouldShowTooltip=function(C,U,B){return B===void 0&&(B={}),B.series=this,B.visiblePlotOnly=!0,this.chart.isInsidePlot(C,U,B)},J.defaultOptions=_,J}(),R(r.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,drawLegendSymbol:l.drawLineMarker,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:O,requireSorting:!0,sorted:!0}),v.series=r,r}),i(n,"Extensions/ScrollablePlotArea.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/Axis.js"],n["Core/Chart/Chart.js"],n["Core/Series/Series.js"],n["Core/Renderer/RendererRegistry.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O){var _=r.stop,v=O.addEvent,E=O.createElement,b=O.merge,P=O.pick;v(o,"afterSetChartSize",function(m){var T=this.options.chart.scrollablePlotArea,k=T&&T.minWidth;if(T=T&&T.minHeight,!this.renderer.forExport){if(k){if(this.scrollablePixelsX=k=Math.max(0,k-this.chartWidth)){this.scrollablePlotBox=this.renderer.scrollablePlotBox=b(this.plotBox),this.plotBox.width=this.plotWidth+=k,this.inverted?this.clipBox.height+=k:this.clipBox.width+=k;var M={1:{name:"right",value:k}}}}else T&&(this.scrollablePixelsY=k=Math.max(0,T-this.chartHeight))&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=b(this.plotBox),this.plotBox.height=this.plotHeight+=k,this.inverted?this.clipBox.width+=k:this.clipBox.height+=k,M={2:{name:"bottom",value:k}});M&&!m.skipAxes&&this.axes.forEach(function(y){M[y.side]?y.getPlotLinePath=function(){var a=M[y.side].name,S=this[a];this[a]=S-M[y.side].value;var w=s.prototype.getPlotLinePath.apply(this,arguments);return this[a]=S,w}:(y.setAxisSize(),y.setAxisTranslation())})}}),v(o,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()}),o.prototype.setUpScrolling=function(){var m=this,T={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(T.overflowX="auto"),this.scrollablePixelsY&&(T.overflowY="auto"),this.scrollingParent=E("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=E("div",{className:"highcharts-scrolling"},T,this.scrollingParent),v(this.scrollingContainer,"scroll",function(){m.pointer&&delete m.pointer.chartPosition}),this.innerContainer=E("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},o.prototype.moveFixedElements=function(){var m=this.container,T=this.fixedRenderer,k=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-drillup-button .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),M;this.scrollablePixelsX&&!this.inverted?M=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?M=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(M=".highcharts-yaxis"),M&&k.push(M+":not(.highcharts-radial-axis)",M+"-labels:not(.highcharts-radial-axis-labels)"),k.forEach(function(y){[].forEach.call(m.querySelectorAll(y),function(a){(a.namespaceURI===T.SVG_NS?T.box:T.box.parentNode).appendChild(a),a.style.pointerEvents="auto"})})},o.prototype.applyFixed=function(){var m=!this.fixedDiv,T=this.options.chart,k=T.scrollablePlotArea,M=l.getRendererType();m?(this.fixedDiv=E("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(T.style&&T.style.zIndex||0)+2,top:0},null,!0),this.scrollingContainer&&this.scrollingContainer.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=T=new M(this.fixedDiv,this.chartWidth,this.chartHeight,this.options.chart.style),this.scrollableMask=T.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":P(k.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),v(this,"afterShowResetZoom",this.moveFixedElements),v(this,"afterDrilldown",this.moveFixedElements),v(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),(this.scrollableDirty||m)&&(this.scrollableDirty=!1,this.moveFixedElements()),T=this.chartWidth+(this.scrollablePixelsX||0),M=this.chartHeight+(this.scrollablePixelsY||0),_(this.container),this.container.style.width=T+"px",this.container.style.height=M+"px",this.renderer.boxWrapper.attr({width:T,height:M,viewBox:[0,0,T,M].join(" ")}),this.chartBackground.attr({width:T,height:M}),this.scrollingContainer.style.height=this.chartHeight+"px",m&&(k.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*k.scrollPositionX),k.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*k.scrollPositionY)),M=this.axisOffset,m=this.plotTop-M[0]-1,k=this.plotLeft-M[3]-1,T=this.plotTop+this.plotHeight+M[2]+1,M=this.plotLeft+this.plotWidth+M[1]+1;var y=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),a=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);m=this.scrollablePixelsX?[["M",0,m],["L",this.plotLeft-1,m],["L",this.plotLeft-1,T],["L",0,T],["Z"],["M",y,m],["L",this.chartWidth,m],["L",this.chartWidth,T],["L",y,T],["Z"]]:this.scrollablePixelsY?[["M",k,0],["L",k,this.plotTop-1],["L",M,this.plotTop-1],["L",M,0],["Z"],["M",k,a],["L",k,this.chartHeight],["L",M,this.chartHeight],["L",M,a],["Z"]]:[["M",0,0]],this.redrawTrigger!=="adjustHeight"&&this.scrollableMask.attr({d:m})},v(s,"afterInit",function(){this.chart.scrollableDirty=!0}),v(c,"show",function(){this.chart.scrollableDirty=!0})}),i(n,"Core/Axis/StackingAxis.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Axis/Axis.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.getDeferredAnimation,l=o.addEvent,O=o.destroyObjectProperties,_=o.fireEvent,v=o.isNumber,E=o.objectEach,b;return function(P){function m(){var y=this.stacking;if(y){var a=y.stacks;E(a,function(S,w){O(S),a[w]=null}),y&&y.stackTotalGroup&&y.stackTotalGroup.destroy()}}function T(){this.stacking||(this.stacking=new M(this))}var k=[];P.compose=function(y){return k.indexOf(y)===-1&&(k.push(y),l(y,"init",T),l(y,"destroy",m)),y};var M=function(){function y(a){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=a}return y.prototype.buildStacks=function(){var a=this.axis,S=a.series,w=a.options.reversedStacks,A=S.length,f;if(!a.isXAxis){for(this.usePercentage=!1,f=A;f--;){var u=S[w?f:A-f-1];u.setStackedPoints(),u.setGroupedPoints()}for(f=0;fM&&b.shadow)),a&&(a.startX=P.xMap,a.isArea=P.isArea)})},v.prototype.getGraphPath=function(E,b,P){var m=this,T=m.options,k=[],M=[],y,a=T.step;E=E||m.points;var S=E.reversed;return S&&E.reverse(),(a={right:1,center:2}[a]||a&&3)&&S&&(a=4-a),E=this.getValidPoints(E,!1,!(T.connectNulls&&!b&&!P)),E.forEach(function(w,A){var f=w.plotX,u=w.plotY,g=E[A-1];(w.leftCliff||g&&g.rightCliff)&&!P&&(y=!0),w.isNull&&!l(b)&&0E&&S>T?(S=Math.max(E,T),w=2*T-S):SP&&w>T?(w=Math.max(P,T),S=2*T-w):w"u"&&(I[j]=$++);var V=I[j]}else N.grouping!==!1&&(V=$++);z.columnIndex=V}});var et=Math.min(Math.abs(d.transA)*(d.ordinal&&d.ordinal.slope||x.pointRange||d.closestPointRange||d.tickInterval||1),d.len),it=et*x.groupPadding,H=(et-2*it)/($||1);return x=Math.min(x.maxPointWidth||d.len,A(x.pointWidth,H*(1-2*x.pointPadding))),h.columnMetrics={width:x,offset:(H-x)/2+(it+((h.columnIndex||0)+(R?1:0))*H-et/2)*(R?-1:1),paddedWidth:H,columnCount:$},h.columnMetrics},g.prototype.crispCol=function(h,x,d,p){var R=this.chart,I=this.borderWidth,j=-(I%2?.5:0);return I=I%2?.5:1,R.inverted&&R.renderer.isVML&&(I+=1),this.options.crisp&&(d=Math.round(h+d)+j,h=Math.round(h)+j,d-=h),p=Math.round(x+p)+I,j=.5>=Math.abs(x)&&.5h.closestPointRange*h.xAxis.transA;p=h.borderWidth=A(d.borderWidth,p?0:1);var R=h.xAxis,I=h.yAxis,j=d.threshold,$=h.translatedThreshold=I.getThreshold(j),et=A(d.minPointLength,5),it=h.getColumnMetrics(),H=it.width,z=h.pointXOffset=it.offset,L=h.dataMin,N=h.dataMax,V=h.barW=Math.max(H,1+2*p);x.inverted&&($-=.5),d.pointPadding&&(V=Math.ceil(V)),l.prototype.translate.apply(h),h.points.forEach(function(K){var G=A(K.yBottom,$),J=999+Math.abs(G),C=K.plotX||0;J=m(K.plotY,-J,I.len+J);var U=Math.min(J,G),B=Math.max(J,G)-U,tt=H,D=C+z,F=V;et&&Math.abs(B)et?G-et:$-(C?et:0)),k(K.options.pointWidth)&&(tt=F=Math.ceil(K.options.pointWidth),D-=Math.round((tt-H)/2)),d.centerInCategory&&(D=h.adjustForMissingColumns(D,tt,K,it)),K.barX=D,K.pointWidth=tt,K.tooltipPos=x.inverted?[m(I.len+I.pos-x.plotLeft-J,I.pos-x.plotLeft,I.len+I.pos-x.plotLeft),R.len+R.pos-x.plotTop-D-F/2,B]:[R.left-x.plotLeft+D+F/2,m(J+I.pos-x.plotTop,I.pos-x.plotTop,I.len+I.pos-x.plotTop),B],K.shapeType=h.pointClass.prototype.shapeType||"rect",K.shapeArgs=h.crispCol.apply(h,K.isNull?[D,$,F,0]:[D,U,F,B])})},g.prototype.drawGraph=function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},g.prototype.pointAttribs=function(h,x){var d=this.options,p=this.pointAttrToOptions||{},R=p.stroke||"borderColor",I=p["stroke-width"]||"borderWidth",j=h&&h.color||this.color,$=h&&h[R]||d[R]||j;p=h&&h.options.dashStyle||d.dashStyle;var et=h&&h[I]||d[I]||this[I]||0,it=A(h&&h.opacity,d.opacity,1);if(h&&this.zones.length){var H=h.getZone();j=h.options.color||H&&(H.color||h.nonZonedColor)||this.color,H&&($=H.borderColor||$,p=H.dashStyle||p,et=H.borderWidth||et)}return x&&h&&(h=w(d.states[x],h.options.states&&h.options.states[x]||{}),x=h.brightness,j=h.color||typeof x<"u"&&b(j).brighten(h.brightness).get()||j,$=h[R]||$,et=h[I]||et,p=h.dashStyle||p,it=A(h.opacity,it)),R={fill:j,stroke:$,"stroke-width":et,opacity:it},p&&(R.dashstyle=p),R},g.prototype.drawPoints=function(){var h=this,x=this.chart,d=h.options,p=x.renderer,R=d.animationLimit||250,I;h.points.forEach(function(j){var $=j.graphic,et=!!$,it=$&&x.pointCountV,L==="left"?et.y-=V?H.height:0:L==="center"?(et.x-=H.width/2,et.y-=H.height/2):L==="right"&&(et.x-=H.width,et.y-=V?0:H.height),h.placed=!0,h.alignAttr=et):(V(d),h.align(x,void 0,d),et=h.alignAttr),K&&0<=d.height?this.justifyDataLabel(h,x,et,H,d,p):m(x.crop,!0)&&(G=I.isInsidePlot(et.x,et.y,{paneCoordinates:!0,series:R})&&I.isInsidePlot(et.x+H.width,et.y+H.height,{paneCoordinates:!0,series:R})),x.shape&&!z&&h[p?"attr":"animate"]({anchorX:j?I.plotWidth-g.plotY:g.plotX,anchorY:j?I.plotHeight-g.plotX:g.plotY})}p&&$&&(h.placed=!1),G||$&&!K||(h.hide(!0),h.placed=!1)}function a(g,h){var x=h.filter;return x?(h=x.operator,g=g[x.property],x=x.value,h===">"&&g>x||h==="<"&&g="&&g>=x||h==="<="&&g<=x||h==="=="&&g==x||h==="==="&&g===x):!0}function S(){var g=this,h=g.chart,x=g.options,d=g.points,p=g.hasRendered||0,R=h.renderer,I=x.dataLabels,j,$=I.animation;if($=I.defer?c(h,$,g):{defer:0,duration:0},I=A(A(h.options.plotOptions&&h.options.plotOptions.series&&h.options.plotOptions.series.dataLabels,h.options.plotOptions&&h.options.plotOptions[g.type]&&h.options.plotOptions[g.type].dataLabels),I),v(this,"drawDataLabels"),E(I)||I.enabled||g._hasPointLabels){var et=g.plotGroup("dataLabelsGroup","data-labels",p?"inherit":"hidden",I.zIndex||6);et.attr({opacity:+p}),!p&&(p=g.dataLabelsGroup)&&(g.visible&&et.show(!0),p[x.animation?"animate":"attr"]({opacity:1},$)),d.forEach(function(it){j=T(A(I,it.dlOptions||it.options&&it.options.dataLabels)),j.forEach(function(H,z){var L=H.enabled&&(!it.isNull||it.dataLabelOnNull)&&a(it,H),N=it.connectors?it.connectors[z]:it.connector,V=it.dataLabels?it.dataLabels[z]:it.dataLabel,K=m(H.distance,it.labelDistance),G=!V;if(L){var J=it.getLabelConfig(),C=m(H[it.formatPrefix+"Format"],H.format);J=O(C)?l(C,J,h):(H[it.formatPrefix+"Formatter"]||H.formatter).call(J,H),C=H.style;var U=H.rotation;h.styledMode||(C.color=m(H.color,C.color,g.color,"#000000"),C.color==="contrast"?(it.contrastColor=R.getContrast(it.color||g.color),C.color=!O(K)&&H.inside||0>K||x.stacking?it.contrastColor:"#000000"):delete it.contrastColor,x.cursor&&(C.cursor=x.cursor));var B={r:H.borderRadius||0,rotation:U,padding:H.padding,zIndex:1};h.styledMode||(B.fill=H.backgroundColor,B.stroke=H.borderColor,B["stroke-width"]=H.borderWidth),P(B,function(tt,D){typeof tt>"u"&&delete B[D]})}!V||L&&O(J)&&!!V.div==!!H.useHTML||(it.dataLabel=V=it.dataLabel&&it.dataLabel.destroy(),it.dataLabels&&(it.dataLabels.length===1?delete it.dataLabels:delete it.dataLabels[z]),z||delete it.dataLabel,N&&(it.connector=it.connector.destroy(),it.connectors&&(it.connectors.length===1?delete it.connectors:delete it.connectors[z]))),L&&O(J)&&(V?B.text=J:(it.dataLabels=it.dataLabels||[],V=it.dataLabels[z]=U?R.text(J,0,-9999,H.useHTML).addClass("highcharts-data-label"):R.label(J,0,-9999,H.shape,null,null,H.useHTML,null,"data-label"),z||(it.dataLabel=V),V.addClass(" highcharts-data-label-color-"+it.colorIndex+" "+(H.className||"")+(H.useHTML?" highcharts-tracker":""))),V.options=H,V.attr(B),h.styledMode||V.css(C).shadow(H.shadow),V.added||V.add(et),H.textPath&&!H.useHTML&&(V.setTextPath(it.getDataLabelPath&&it.getDataLabelPath(V)||it.graphic,H.textPath),it.dataLabelPath&&!H.textPath.enabled&&(it.dataLabelPath=it.dataLabelPath.destroy())),g.alignDataLabel(it,V,H,null,G))})})}v(this,"afterDrawDataLabels")}function w(g,h,x,d,p,R){var I=this.chart,j=h.align,$=h.verticalAlign,et=g.box?0:g.padding||0,it=h.x;it=it===void 0?0:it;var H=h.y;H=H===void 0?0:H;var z=(x.x||0)+et;if(0>z){j==="right"&&0<=it?(h.align="left",h.inside=!0):it-=z;var L=!0}return z=(x.x||0)+d.width-et,z>I.plotWidth&&(j==="left"&&0>=it?(h.align="right",h.inside=!0):it+=I.plotWidth-z,L=!0),z=x.y+et,0>z&&($==="bottom"&&0<=H?(h.verticalAlign="top",h.inside=!0):H-=z,L=!0),z=(x.y||0)+d.height-et,z>I.plotHeight&&($==="top"&&0>=H?(h.verticalAlign="bottom",h.inside=!0):H+=I.plotHeight-z,L=!0),L&&(h.x=it,h.y=H,g.placed=!R,g.align(h,void 0,p)),L}function A(g,h){var x=[],d;if(E(g)&&!E(h))x=g.map(function(p){return b(p,h)});else if(E(h)&&!E(g))x=h.map(function(p){return b(g,p)});else if(E(g)||E(h))for(d=Math.max(g.length,h.length);d--;)x[d]=b(g[d],h[d]);else x=b(g,h);return x}function f(g,h,x,d,p){var R=this.chart,I=R.inverted,j=this.xAxis,$=j.reversed,et=I?h.height/2:h.width/2;g=(g=g.pointWidth)?g/2:0,h.startXPos=I?p.x:$?-et-g:j.width-et+g,h.startYPos=I?$?this.yAxis.height-et+g:-et-g:p.y,d?h.visibility==="hidden"&&(h.show(),h.attr({opacity:0}).animate({opacity:1})):h.attr({opacity:1}).animate({opacity:0},void 0,h.hide),R.hasRendered&&(x&&h.attr({x:h.startXPos,y:h.startYPos}),h.placed=!0)}var u=[];M.compose=function(g){if(u.indexOf(g)===-1){var h=g.prototype;u.push(g),h.alignDataLabel=y,h.drawDataLabels=S,h.justifyDataLabel=w,h.setDataLabelStartPos=f}}}(k||(k={})),k}),i(n,"Series/Column/ColumnDataLabel.js",[n["Core/Series/DataLabel.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Utilities.js"]],function(r,s,o){var c=s.series,l=o.merge,O=o.pick,_;return function(v){function E(P,m,T,k,M){var y=this.chart.inverted,a=P.series,S=(a.xAxis?a.xAxis.len:this.chart.plotSizeX)||0;a=(a.yAxis?a.yAxis.len:this.chart.plotSizeY)||0;var w=P.dlBox||P.shapeArgs,A=O(P.below,P.plotY>O(this.translatedThreshold,a)),f=O(T.inside,!!this.options.stacking);w&&(k=l(w),0>k.y&&(k.height+=k.y,k.y=0),w=k.y+k.height-a,0 {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}}),b}(s),_(c.prototype,{drawTracker:r.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1}),O(c,"afterTranslate",function(){this.applyJitter()}),o.registerSeriesType("scatter",c),c}),i(n,"Series/CenteredUtilities.js",[n["Core/Globals.js"],n["Core/Series/Series.js"],n["Core/Utilities.js"]],function(r,s,o){var c=r.deg2rad,l=o.isNumber,O=o.pick,_=o.relativeLength,v;return function(E){E.getCenter=function(){var b=this.options,P=this.chart,m=2*(b.slicedOffset||0),T=P.plotWidth-2*m,k=P.plotHeight-2*m,M=b.center,y=Math.min(T,k),a=b.size,S=b.innerSize||0;for(typeof a=="string"&&(a=parseFloat(a)),typeof S=="string"&&(S=parseFloat(S)),b=[O(M[0],"50%"),O(M[1],"50%"),O(a&&0>a?void 0:b.size,"100%"),O(S&&0>S?void 0:b.innerSize||0,"0%")],!P.angular||this instanceof s||(b[3]=0),M=0;4>M;++M)a=b[M],P=2>M||M===2&&/%$/.test(a),b[M]=_(a,[T,k,y,b[2]][M])+(P?m:0);return b[3]>b[2]&&(b[3]=b[2]),b},E.getStartAndEndRadians=function(b,P){return b=l(b)?b:0,P=l(P)&&P>b&&360>P-b?P:b+360,{start:c*(b+-90),end:c*(P+-90)}}}(v||(v={})),v}),i(n,"Series/Pie/PiePoint.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Series/Point.js"],n["Core/Utilities.js"]],function(r,s,o){var c=this&&this.__extends||function(){var P=function(m,T){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,M){k.__proto__=M}||function(k,M){for(var y in M)M.hasOwnProperty(y)&&(k[y]=M[y])},P(m,T)};return function(m,T){function k(){this.constructor=m}P(m,T),m.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}}(),l=r.setAnimation,O=o.addEvent,_=o.defined;r=o.extend;var v=o.isNumber,E=o.pick,b=o.relativeLength;return s=function(P){function m(){var T=P!==null&&P.apply(this,arguments)||this;return T.labelDistance=void 0,T.options=void 0,T.series=void 0,T}return c(m,P),m.prototype.getConnectorPath=function(){var T=this.labelPosition,k=this.series.options.dataLabels,M=this.connectorShapes,y=k.connectorShape;return M[y]&&(y=M[y]),y.call(this,{x:T.final.x,y:T.final.y,alignment:T.alignment},T.connectorPosition,k)},m.prototype.getTranslate=function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},m.prototype.haloPath=function(T){var k=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(k.x,k.y,k.r+T,k.r+T,{innerR:k.r-1,start:k.start,end:k.end})},m.prototype.init=function(){var T=this;P.prototype.init.apply(this,arguments),this.name=E(this.name,"Slice");var k=function(M){T.slice(M.type==="select")};return O(this,"select",k),O(this,"unselect",k),this},m.prototype.isValid=function(){return v(this.y)&&0<=this.y},m.prototype.setVisible=function(T,k){var M=this,y=this.series,a=y.chart,S=y.options.ignoreHiddenPoint;k=E(k,S),T!==this.visible&&(this.visible=this.options.visible=T=typeof T>"u"?!this.visible:T,y.options.data[y.data.indexOf(this)]=this.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(w){M[w]&&M[w][T?"show":"hide"](T)}),this.legendItem&&a.legend.colorizeItem(this,T),T||this.state!=="hover"||this.setState(""),S&&(y.isDirty=!0),k&&a.redraw())},m.prototype.slice=function(T,k,M){var y=this.series;l(M,y.chart),E(k,!0),this.sliced=this.options.sliced=_(T)?T:!this.sliced,y.options.data[y.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},m}(s),r(s.prototype,{connectorShapes:{fixedOffset:function(P,m,T){var k=m.breakAt;return m=m.touchingSliceAt,[["M",P.x,P.y],T.softConnector?["C",P.x+(P.alignment==="left"?-5:5),P.y,2*k.x-m.x,2*k.y-m.y,k.x,k.y]:["L",k.x,k.y],["L",m.x,m.y]]},straight:function(P,m){return m=m.touchingSliceAt,[["M",P.x,P.y],["L",m.x,m.y]]},crookedLine:function(P,m,T){m=m.touchingSliceAt;var k=this.series,M=k.center[0],y=k.chart.plotWidth,a=k.chart.plotLeft;k=P.alignment;var S=this.shapeArgs.r;return T=b(T.crookDistance,1),y=k==="left"?M+S+(y+a-M-S)*(1-T):a+(M-S)*T,T=["L",y,P.y],M=!0,(k==="left"?y>P.x||ym.x)&&(M=!1),P=[["M",P.x,P.y]],M&&P.push(T),P.push(["L",m.x,m.y]),P}}}),s}),i(n,"Series/Pie/PieSeries.js",[n["Series/CenteredUtilities.js"],n["Series/Column/ColumnSeries.js"],n["Core/Globals.js"],n["Core/Legend/LegendSymbol.js"],n["Series/Pie/PiePoint.js"],n["Core/Series/Series.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Renderer/SVG/Symbols.js"],n["Core/Utilities.js"]],function(r,s,o,c,l,O,_,v,E){var b=this&&this.__extends||function(){var S=function(w,A){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var g in u)u.hasOwnProperty(g)&&(f[g]=u[g])},S(w,A)};return function(w,A){function f(){this.constructor=w}S(w,A),w.prototype=A===null?Object.create(A):(f.prototype=A.prototype,new f)}}(),P=r.getStartAndEndRadians;o=o.noop;var m=E.clamp,T=E.extend,k=E.fireEvent,M=E.merge,y=E.pick,a=E.relativeLength;return E=function(S){function w(){var A=S!==null&&S.apply(this,arguments)||this;return A.center=void 0,A.data=void 0,A.maxLabelDistance=void 0,A.options=void 0,A.points=void 0,A}return b(w,S),w.prototype.animate=function(A){var f=this,u=f.points,g=f.startAngleRad;A||u.forEach(function(h){var x=h.graphic,d=h.shapeArgs;x&&d&&(x.attr({r:y(h.startR,f.center&&f.center[3]/2),start:g,end:g}),x.animate({r:d.r,start:d.start,end:d.end},f.options.animation))})},w.prototype.drawEmpty=function(){var A=this.startAngleRad,f=this.endAngleRad,u=this.options;if(this.total===0&&this.center){var g=this.center[0],h=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(g,h,this.center[1]/2,0,A,f).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:v.arc(g,h,this.center[2]/2,0,{start:A,end:f,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":u.borderWidth,fill:u.fillColor||"none",stroke:u.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},w.prototype.drawPoints=function(){var A=this.chart.renderer;this.points.forEach(function(f){f.graphic&&f.hasNewShapeType()&&(f.graphic=f.graphic.destroy()),f.graphic||(f.graphic=A[f.shapeType](f.shapeArgs).add(f.series.group),f.delayedRendering=!0)})},w.prototype.generatePoints=function(){S.prototype.generatePoints.call(this),this.updateTotals()},w.prototype.getX=function(A,f,u){var g=this.center,h=this.radii?this.radii[u.index]||0:g[2]/2;return A=Math.asin(m((A-g[1])/(h+u.labelDistance),-1,1)),g[0]+(f?-1:1)*Math.cos(A)*(h+u.labelDistance)+(01.5*Math.PI?it-=2*Math.PI:it<-Math.PI/2&&(it+=2*Math.PI),$.slicedTranslation={translateX:Math.round(Math.cos(it)*u),translateY:Math.round(Math.sin(it)*u)},H=Math.cos(it)*A[2]/2;var z=Math.sin(it)*A[2]/2;$.tooltipPos=[A[0]+.7*H,A[1]+.7*z],$.half=it<-Math.PI/2||it>Math.PI/2?1:0,$.angle=it,et=Math.min(g,$.labelDistance/5),$.labelPosition={natural:{x:A[0]+H+Math.cos(it)*$.labelDistance,y:A[1]+z+Math.sin(it)*$.labelDistance},final:{},alignment:0>$.labelDistance?"center":$.half?"right":"left",connectorPosition:{breakAt:{x:A[0]+H+Math.cos(it)*et,y:A[1]+z+Math.sin(it)*et},touchingSliceAt:{x:A[0]+H,y:A[1]+z}}}}k(this,"afterTranslate")},w.prototype.updateTotals=function(){var A=this.points,f=A.length,u=this.options.ignoreHiddenPoint,g,h=0;for(g=0;gj&&(st.dataLabel.css({width:Math.round(.7*j)+"px"}),st.dataLabel.shortened=!0)):(st.dataLabel=st.dataLabel.destroy(),st.dataLabels&&st.dataLabels.length===1&&delete st.dataLabels))}),H.forEach(function(st,ot){var lt=st.length,ct=[],q;if(lt){if(u.sortByAngle(st,ot-.5),0"u"?D="hidden":(U=N.distributeBox.size,tt=L.radialDistributionY(N))),delete N.positionIndex,x.justify)B=L.justify(N,et,$);else switch(x.alignTo){case"connectors":B=L.alignToConnectors(st,ot,p,I);break;case"plotEdges":B=L.alignToPlotEdges(G,ot,p,I);break;default:B=L.radialDistributionX(u,N,tt,Y)}G._attr={visibility:D,align:C.alignment},X=N.options.dataLabels||{},G._pos={x:B+T(X.x,x.x)+({left:d,right:-d}[C.alignment]||0),y:tt+T(X.y,x.y)-10},C.final.x=B,C.final.y=tt,T(x.crop,!0)&&(J=G.getBBox().width,Y=null,B-Jp-d&&ot===0&&(Y=Math.round(B+J-p+d),z[1]=Math.max(Y,z[1])),0>tt-U/2?z[0]=Math.max(Math.round(-tt+U/2),z[0]):tt+U/2>R&&(z[2]=Math.max(Math.round(tt+U/2-R),z[2])),G.sideOverflow=Y)}}}),E(z)===0||this.verifyDataLabelOverflow(z))&&(this.placeDataLabels(),this.points.forEach(function(st){if(X=m(x,st.options.dataLabels),V=T(X.connectorWidth,1)){var ot;K=st.connector,(G=st.dataLabel)&&G._pos&&st.visible&&0g.bottom-2?x:h,g.half,g)},justify:function(u,g,h){return h[0]+(u.half?-1:1)*(g+u.labelDistance)},alignToPlotEdges:function(u,g,h,x){return u=u.getBBox().width,g?u+x:h-u-x},alignToConnectors:function(u,g,h,x){var d=0,p;return u.forEach(function(R){p=R.dataLabel.getBBox().width,p>d&&(d=p)}),g?d+x:h-d-x}};y.compose=function(u){r.compose(v),A.indexOf(u)===-1&&(A.push(u),u=u.prototype,u.dataLabelPositioners=f,u.alignDataLabel=O,u.drawDataLabels=a,u.placeDataLabels=S,u.verifyDataLabelOverflow=w)}}(M||(M={})),M}),i(n,"Extensions/OverlappingDataLabels.js",[n["Core/Chart/Chart.js"],n["Core/Utilities.js"]],function(r,s){function o(b,P){var m=!1;if(b){var T=b.newOpacity;b.oldOpacity!==T&&(b.alignAttr&&b.placed?(b[T?"removeClass":"addClass"]("highcharts-data-label-hidden"),m=!0,b.alignAttr.opacity=T,b[b.isOld?"animate":"attr"](b.alignAttr,null,function(){P.styledMode||b.css({pointerEvents:T?"auto":"none"})}),l(P,"afterHideOverlappingLabel")):b.attr({opacity:T})),b.isOld=!0}return m}var c=s.addEvent,l=s.fireEvent,O=s.isArray,_=s.isNumber,v=s.objectEach,E=s.pick;c(r,"render",function(){var b=this,P=[];(this.labelCollectors||[]).forEach(function(m){P=P.concat(m())}),(this.yAxis||[]).forEach(function(m){m.stacking&&m.options.stackLabels&&!m.options.stackLabels.allowOverlap&&v(m.stacking.stacks,function(T){v(T,function(k){k.label&&k.label.visibility!=="hidden"&&P.push(k.label)})})}),(this.series||[]).forEach(function(m){var T=m.options.dataLabels;m.visible&&(T.enabled!==!1||m._hasPointLabels)&&(T=function(k){return k.forEach(function(M){M.visible&&(O(M.dataLabels)?M.dataLabels:M.dataLabel?[M.dataLabel]:[]).forEach(function(y){var a=y.options;y.labelrank=E(a.labelrank,M.labelrank,M.shapeArgs&&M.shapeArgs.height),a.allowOverlap?(y.oldOpacity=y.opacity,y.newOpacity=1,o(y,b)):P.push(y)})})},T(m.nodes||[]),T(m.points))}),this.hideOverlappingLabels(P)}),r.prototype.hideOverlappingLabels=function(b){var P=this,m=b.length,T=P.renderer,k,M,y,a=!1,S=function(f){var u,g=f.box?0:f.padding||0,h=u=0,x;if(f&&(!f.alignAttr||f.placed)){var d=f.alignAttr||{x:f.attr("x"),y:f.attr("y")},p=f.parentGroup;f.width||(u=f.getBBox(),f.width=u.width,f.height=u.height,u=T.fontMetrics(null,f.element).h);var R=f.width-2*g;return(x={left:"0",center:"0.5",right:"1"}[f.alignValue])?h=+x*R:_(f.x)&&Math.round(f.x)!==f.translateX&&(h=f.x-f.translateX),{x:d.x+(p.translateX||0)+g-(h||0),y:d.y+(p.translateY||0)+g-u,width:f.width-2*g,height:f.height-2*g}}};for(M=0;M=w.x+w.width||A.x+A.width<=w.x||A.y>=w.y+w.height||A.y+A.height<=w.y||((S.labelrank"u"?null:f[d]})}var S=this,w={};return a(y,this.options,w,0),w},M.prototype.matchResponsiveRule=function(y,a){var S=y.condition;(S.callback||function(){return this.chartWidth<=v(S.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=v(S.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=v(S.minWidth,0)&&this.chartHeight>=v(S.minHeight,0)}).call(this)&&a.push(y._id)},M.prototype.setResponsive=function(y,a){var S=this,w=this.options.responsive,A=this.currentResponsive,f=[];!a&&w&&w.rules&&w.rules.forEach(function(u){typeof u._id>"u"&&(u._id=b()),S.matchResponsiveRule(u,f)},this),a=O.apply(void 0,f.map(function(u){return o((w||{}).rules||[],function(g){return g._id===u})}).map(function(u){return u&&u.chartOptions})),a.isResponsiveOptions=!0,f=f.toString()||void 0,f!==(A&&A.ruleIds)&&(A&&this.update(A.undoOptions,y,!0),f?(A=this.currentOptions(a),A.isResponsiveOptions=!0,this.currentResponsive={ruleIds:f,mergedOptions:a,undoOptions:A},this.update(a,y,!0)):this.currentResponsive=void 0)},M}()}(P||(P={})),P}),i(n,"masters/highcharts.src.js",[n["Core/Globals.js"],n["Core/Utilities.js"],n["Core/DefaultOptions.js"],n["Core/Animation/Fx.js"],n["Core/Animation/AnimationUtilities.js"],n["Core/Renderer/HTML/AST.js"],n["Core/FormatUtilities.js"],n["Core/Renderer/RendererUtilities.js"],n["Core/Renderer/SVG/SVGElement.js"],n["Core/Renderer/SVG/SVGRenderer.js"],n["Core/Renderer/HTML/HTMLElement.js"],n["Core/Renderer/HTML/HTMLRenderer.js"],n["Core/Axis/Axis.js"],n["Core/Axis/DateTimeAxis.js"],n["Core/Axis/LogarithmicAxis.js"],n["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],n["Core/Axis/Tick.js"],n["Core/Tooltip.js"],n["Core/Series/Point.js"],n["Core/Pointer.js"],n["Core/MSPointer.js"],n["Core/Legend/Legend.js"],n["Core/Chart/Chart.js"],n["Core/Series/Series.js"],n["Core/Series/SeriesRegistry.js"],n["Series/Column/ColumnSeries.js"],n["Series/Column/ColumnDataLabel.js"],n["Series/Pie/PieSeries.js"],n["Series/Pie/PieDataLabel.js"],n["Core/Series/DataLabel.js"],n["Core/Responsive.js"],n["Core/Color/Color.js"],n["Core/Time.js"]],function(r,s,o,c,l,O,_,v,E,b,P,m,T,k,M,y,a,S,w,A,f,u,g,h,x,d,p,R,I,j,$,et,it){return r.animate=l.animate,r.animObject=l.animObject,r.getDeferredAnimation=l.getDeferredAnimation,r.setAnimation=l.setAnimation,r.stop=l.stop,r.timers=c.timers,r.AST=O,r.Axis=T,r.Chart=g,r.chart=g.chart,r.Fx=c,r.Legend=u,r.PlotLineOrBand=y,r.Point=w,r.Pointer=f.isRequired()?f:A,r.Series=h,r.SVGElement=E,r.SVGRenderer=b,r.Tick=a,r.Time=it,r.Tooltip=S,r.Color=et,r.color=et.parse,m.compose(b),P.compose(E),r.defaultOptions=o.defaultOptions,r.getOptions=o.getOptions,r.time=o.defaultTime,r.setOptions=o.setOptions,r.dateFormat=_.dateFormat,r.format=_.format,r.numberFormat=_.numberFormat,r.addEvent=s.addEvent,r.arrayMax=s.arrayMax,r.arrayMin=s.arrayMin,r.attr=s.attr,r.clearTimeout=s.clearTimeout,r.correctFloat=s.correctFloat,r.createElement=s.createElement,r.css=s.css,r.defined=s.defined,r.destroyObjectProperties=s.destroyObjectProperties,r.discardElement=s.discardElement,r.distribute=v.distribute,r.erase=s.erase,r.error=s.error,r.extend=s.extend,r.extendClass=s.extendClass,r.find=s.find,r.fireEvent=s.fireEvent,r.getMagnitude=s.getMagnitude,r.getStyle=s.getStyle,r.inArray=s.inArray,r.isArray=s.isArray,r.isClass=s.isClass,r.isDOMElement=s.isDOMElement,r.isFunction=s.isFunction,r.isNumber=s.isNumber,r.isObject=s.isObject,r.isString=s.isString,r.keys=s.keys,r.merge=s.merge,r.normalizeTickInterval=s.normalizeTickInterval,r.objectEach=s.objectEach,r.offset=s.offset,r.pad=s.pad,r.pick=s.pick,r.pInt=s.pInt,r.relativeLength=s.relativeLength,r.removeEvent=s.removeEvent,r.seriesType=x.seriesType,r.splat=s.splat,r.stableSort=s.stableSort,r.syncTimeout=s.syncTimeout,r.timeUnits=s.timeUnits,r.uniqueKey=s.uniqueKey,r.useSerialIds=s.useSerialIds,r.wrap=s.wrap,p.compose(d),j.compose(h),k.compose(T),M.compose(T),I.compose(R),y.compose(T),$.compose(g),r}),n["masters/highcharts.src.js"]._modules=n,n["masters/highcharts.src.js"]})}(Co)),Co.exports}const Pw=Ow(ny);(function(t,e){(function(i,n){t.exports=n(Aw(),Pw)})(window,function(i,n){return s=[function(c,l){c.exports=i},function(c,l){c.exports=n},function(c,_,O){O.r(_),O.d(_,"Chart",function(){return S}),O.d(_,"default",function(){return w});var _=O(0),v=O.n(_);function E(A,f){return function u(g,h,x){function d(p,R){!v.a.isObject(p,!x)||v.a.isClass(p)||v.a.isDOMElement(p)?g[R]=h[R]:g[R]=u(g[R]||v.a.isArray(p)?[]:{},p,x)}return v.a.isArray(h)?h.forEach(d):v.a.objectEach(h,d),g}({},A,f)}var b=O(1);function P(A){return(P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(A)}function m(A){return function(f){if(Array.isArray(f))return T(f)}(A)||function(f){if(typeof Symbol<"u"&&f[Symbol.iterator]!=null||f["@@iterator"]!=null)return Array.from(f)}(A)||function(f,u){var g;if(f)return typeof f=="string"?T(f,u):(g=(g=Object.prototype.toString.call(f).slice(8,-1))==="Object"&&f.constructor?f.constructor.name:g)==="Map"||g==="Set"?Array.from(f):g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?T(f,u):void 0}(A)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function T(A,f){(f==null||f>A.length)&&(f=A.length);for(var u=0,g=new Array(f);u',props:{constructorType:{type:String,default:"chart"},options:{type:Object,required:!0},callback:Function,updateArgs:{type:Array,default:function(){return[!0,!0]}},highcharts:{type:Object},deepCopyOnUpdate:{type:Boolean,default:!0}}},a=function(A,f){return f.split(".")[0]<3?M(M({},y),{},{render:function(u){return u("div",{ref:"chart"})},beforeDestroy:function(){this.chart&&this.chart.destroy()},watch:{options:{handler:function(u){var g;(g=this.chart).update.apply(g,[E(u,this.deepCopyOnUpdate)].concat(m(this.updateArgs)))},deep:!0}},mounted:function(){var u=this.highcharts||A;this.options&&u[this.constructorType]?this.chart=u[this.constructorType](this.$refs.chart,E(this.options,!0),this.callback||null):this.options?console.warn("'".concat(this.constructorType,"' constructor-type is incorrect. Sometimes this error is caused by the fact, that the corresponding module wasn't imported.")):console.warn('The "options" parameter was not passed.')}}):M(M({},y),{},{render:function(){return Object(b.h)("div",{ref:"chartContainer"})},setup:function(u){var g=Object(b.ref)(null),h=Object(b.shallowRef)({});return Object(b.onMounted)(function(){var x=u.highcharts||A;u.options&&x[u.constructorType]?h.value=x[u.constructorType](g.value,E(u.options,!0),u.callback||null):u.options?console.warn("'".concat(u.constructorType,"' constructor-type is incorrect. Sometimes this error is caused by the fact, that the corresponding module wasn't imported.")):console.warn('The "options" parameter was not passed.')}),Object(b.watch)(function(){return u.options},function(x,d){var p;(p=h.value).update.apply(p,[E(x,u.deepCopyOnUpdate)].concat(m(u.updateArgs)))},{deep:!0}),Object(b.onBeforeUnmount)(function(){h.value&&h.value.destroy()}),{chart:h,chartContainer:g,props:u}}})},S=a(v.a,b.version||O.n(b).a.version);function w(A){var f=1=this._config.preview;if(s)n.postMessage({results:d,workerId:l.WORKER_ID,finished:R});else if(A(this._config.chunk)&&!g){if(this._config.chunk(d,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);d=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(d.data),this._completeResults.errors=this._completeResults.errors.concat(d.errors),this._completeResults.meta=d.meta),this._completed||!R||!A(this._config.complete)||d&&d.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),R||d&&d.meta.paused||this._nextChunk(),d}this._halted=!0},this._sendError=function(u){A(this._config.error)?this._config.error(u):s&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:u,finished:!1})}}function v(f){var u;(f=f||{}).chunkSize||(f.chunkSize=l.RemoteChunkSize),_.call(this,f),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(g){this._input=g,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(u=new XMLHttpRequest,this._config.withCredentials&&(u.withCredentials=this._config.withCredentials),r||(u.onload=w(this._chunkLoaded,this),u.onerror=w(this._chunkError,this)),u.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var g=this._config.downloadRequestHeaders;for(var h in g)u.setRequestHeader(h,g[h])}if(this._config.chunkSize){var x=this._start+this._config.chunkSize-1;u.setRequestHeader("Range","bytes="+this._start+"-"+x)}try{u.send(this._config.downloadRequestBody)}catch(d){this._chunkError(d.message)}r&&u.status===0&&this._chunkError()}},this._chunkLoaded=function(){u.readyState===4&&(u.status<200||400<=u.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:u.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(g){var h=g.getResponseHeader("Content-Range");return h===null?-1:parseInt(h.substring(h.lastIndexOf("/")+1))}(u),this.parseChunk(u.responseText)))},this._chunkError=function(g){var h=u.statusText||g;this._sendError(new Error(h))}}function E(f){var u,g;(f=f||{}).chunkSize||(f.chunkSize=l.LocalChunkSize),_.call(this,f);var h=typeof FileReader<"u";this.stream=function(x){this._input=x,g=x.slice||x.webkitSlice||x.mozSlice,h?((u=new FileReader).onload=w(this._chunkLoaded,this),u.onerror=w(this._chunkError,this)):u=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(x.target.result)},this._chunkError=function(){this._sendError(u.error)}}function b(f){var u;_.call(this,f=f||{}),this.stream=function(g){return u=g,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var g,h=this._config.chunkSize;return h?(g=u.substring(0,h),u=u.substring(h)):(g=u,u=""),this._finished=!u,this.parseChunk(g)}}}function P(f){_.call(this,f=f||{});var u=[],g=!0,h=!1;this.pause=function(){_.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){_.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(x){this._input=x,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){h&&u.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),u.length?this.parseChunk(u.shift()):g=!0},this._streamData=w(function(x){try{u.push(typeof x=="string"?x:x.toString(this._config.encoding)),g&&(g=!1,this._checkIsFinished(),this.parseChunk(u.shift()))}catch(d){this._streamError(d)}},this),this._streamError=w(function(x){this._streamCleanUp(),this._sendError(x)},this),this._streamEnd=w(function(){this._streamCleanUp(),h=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(f){var u,g,h,x=Math.pow(2,53),d=-x,p=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,R=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,I=this,j=0,$=0,et=!1,it=!1,H=[],z={data:[],errors:[],meta:{}};if(A(f.step)){var L=f.step;f.step=function(C){if(z=C,K())V();else{if(V(),z.data.length===0)return;j+=C.data.length,f.preview&&j>f.preview?g.abort():(z.data=z.data[0],L(z,I))}}}function N(C){return f.skipEmptyLines==="greedy"?C.join("").trim()==="":C.length===1&&C[0].length===0}function V(){return z&&h&&(J("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),h=!1),f.skipEmptyLines&&(z.data=z.data.filter(function(C){return!N(C)})),K()&&function(){if(!z)return;function C(B,tt){A(f.transformHeader)&&(B=f.transformHeader(B,tt)),H.push(B)}if(Array.isArray(z.data[0])){for(var U=0;K()&&U=H.length?"__parsed_extra":H[D]),f.transform&&(st=f.transform(st,X)),st=G(X,st),X==="__parsed_extra"?(F[X]=F[X]||[],F[X].push(st)):F[X]=st}return f.header&&(D>H.length?J("FieldMismatch","TooManyFields","Too many fields: expected "+H.length+" fields but parsed "+D,$+tt):D=lt.length/2?`\r -`:"\r"}(C,tt)),h=!1,f.delimiter)A(f.delimiter)&&(f.delimiter=f.delimiter(C),z.meta.delimiter=f.delimiter);else{var D=function(X,st,ot,lt,ct){var q,Y,Z,W;ct=ct||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Q=0;Q=p)return vt(!0)}else for(rt=j,j++;;){if((rt=et.indexOf(u,rt+1))===-1)return H||J.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:G.length,index:j}),gt();if(rt===z-1)return gt(et.substring(j,rt).replace(Q,u));if(u!==I||et[rt+1]!==I){if(u===I||rt===0||et[rt-1]!==I){Z!==-1&&Z=p)return vt(!0);break}J.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:G.length,index:j}),rt++}}else rt++}return gt();function ut(ht){G.push(ht),U=j}function ft(ht){var pt=0;if(ht!==-1){var mt=et.substring(rt+1,ht);mt&&mt.trim()===""&&(pt=mt.length)}return pt}function gt(ht){return H||(ht===void 0&&(ht=et.substring(j)),C.push(ht),j=z,ut(C),K&&dt()),vt()}function xt(ht){j=ht,ut(C),C=[],W=et.indexOf(h,j)}function vt(ht){return{data:G,errors:J,meta:{delimiter:g,linebreak:h,aborted:$,truncated:!!ht,cursor:U+(it||0)}}}function dt(){d(vt()),G=[],J=[]}},this.abort=function(){$=!0},this.getCharIndex=function(){return j}}function M(f){var u=f.data,g=o[u.workerId],h=!1;if(u.error)g.userError(u.error,u.file);else if(u.results&&u.results.data){var x={abort:function(){h=!0,y(u.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:a,resume:a};if(A(g.userStep)){for(var d=0;d{try{const i=new Blob([t],{type:"text/csv"}),n=URL.createObjectURL(i),r=document.createElement("a");r.id=`csv-${parseInt(Math.random().toString().slice(2,16))}`,r.href=n,document.body.appendChild(r);const s=document.getElementById(r.id);return s.style.visibility="hidden",s.download=`${e}.csv`,s.click(),setTimeout(()=>{document.body.removeChild(r)},1),!0}catch{return!1}},Nw=t=>t.map(e=>JSON.stringify(e)).reduce((e,i)=>(e.find(n=>n===i)||e.push(i),e),[]).map(e=>JSON.parse(e)),Dw={install(t,e){const i={download:Rw,dedupe:Nw},n=Object.entries(Iw).reduce((s,[o,c])=>(s[o]=c,s),{}),r=Object.assign(n,i);"config"in t&&"globalProperties"in t.config?t.config.globalProperties.$papa=r:t.prototype.$papa=r}};var jw=Object.defineProperty,Fw=Object.defineProperties,Bw=Object.getOwnPropertyDescriptors,Cs=Object.getOwnPropertySymbols,tp=Object.prototype.hasOwnProperty,ep=Object.prototype.propertyIsEnumerable,xu=(t,e,i)=>e in t?jw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ip=function(t){return t},Hw=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},bu=Math.max,Vw=function(t,e,i){return e=bu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,r=-1,s=bu(n.length-e,0),o=Array(s);++r0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(mE),xE=ip,bE=Vw,_E=yE,wE=function(t,e){return _E(bE(t,e,xE),t+"")},op=function(t,e){return t===e||t!=t&&e!=e},ap=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991},EE=sp,CE=ap,lp=function(t){return t!=null&&CE(t.length)&&!EE(t)},SE=/^(?:0|[1-9]\d*)$/,cp=function(t,e){var i=typeof t;return!!(e=e??9007199254740991)&&(i=="number"||i!="symbol"&&SE.test(t))&&t>-1&&t%1==0&&t2?e[2]:void 0;for(r&&h1(e[0],e[1],r)&&(n=1);++it.pageOnly||!oi.isEnabled),s=$t(()=>(r.value||t.teleport)&&n.isFullscreen?{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}:void 0);function o(){e("change",n.isFullscreen),e("update:modelValue",n.isFullscreen),e("update:fullscreen",n.isFullscreen)}function c(){oi.isFullscreen||oi.off("change",c),n.isFullscreen=oi.isFullscreen,o()}function l(E){E.key==="Escape"&&_()}function O(){r.value?(n.isFullscreen=!0,o(),document.removeEventListener("keyup",l),document.addEventListener("keyup",l)):(oi.off("change",c),oi.on("change",c),oi.request(t.teleport?document.body:i.value))}function _(){n.isFullscreen&&(r.value?(n.isFullscreen=!1,o(),document.removeEventListener("keyup",l)):oi.exit())}return le(()=>t.fullscreen,E=>{E!==n.isFullscreen&&(E?O():_())}),le(()=>t.modelValue,E=>{E!==n.isFullscreen&&(E?O():_())}),v=((E,b)=>{for(var P in b||(b={}))tp.call(b,P)&&xu(E,P,b[P]);if(Cs)for(var P of Cs(b))ep.call(b,P)&&xu(E,P,b[P]);return E})({wrapper:i,wrapperStyle:s},ah(n)),Fw(v,Bw({toggle:function(E){E===void 0?n.isFullscreen?_():O():E?O():_()},request:O,exit:_,shadeClick:function(E){E.target===i.value&&t.exitOnClickWrapper&&_()}}));var v}});pp.render=function(t,e,i,n,r,s){return Ai(),mn(yh,{to:"body",disabled:!t.teleport||!t.fullscreen},[Ft("div",Wa({ref:"wrapper"},t.$attrs,{style:t.wrapperStyle,class:{[t.fullscreenClass]:t.isFullscreen},onClick:e[1]||(e[1]=o=>t.shadeClick(o))}),[Ih(t.$slots,"default")],16)],8,["disabled"])};const g1=typeof window<"u"&&window!==null;(function(){if(g1&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0})();const m1=Object.prototype.propertyIsEnumerable,Mu=Object.getOwnPropertySymbols;function is(t){return typeof t=="function"||toString.call(t)==="[object Object]"}function v1(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"}function y1(t,...e){if(!is(t))throw new TypeError("expected the first argument to be an object");if(e.length===0||typeof Symbol!="function"||typeof Mu!="function")return t;for(const i of e){const n=Mu(i);for(const r of n)m1.call(i,r)&&(t[r]=i[r])}return t}function pl(t,...e){let i=0;var n;for((typeof(n=t)=="object"?n===null:typeof n!="function")&&(t=e[i++]),t||(t={});i{n.key==="Escape"&&(document.removeEventListener("keyup",i),this.exit())};return this.isFullscreen=!0,this.element=t,document.removeEventListener("keyup",i),document.addEventListener("keyup",i),this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()}{const i=()=>{Ge.isFullscreen||(Ge.off("change",i),Ru(this)),this.isFullscreen=Ge.isFullscreen,this.options.teleport?this.element=t||null:this.element=Ge.element,this.options.callback&&this.options.callback(Ge.isFullscreen)};return Ge.on("change",i),Ge.request(this.options.teleport?document.body:t)}},exit(){return this.isFullscreen?this.options.pageOnly?(Ru(this),this.isFullscreen=!1,this.element=null,this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()):Ge.exit():Promise.resolve()}},x1=(t,e,i)=>{const n=()=>{let r;const s={teleport:e.modifiers.teleport,pageOnly:e.modifiers.pageOnly};if(e.value)if(typeof e.value=="string")r=e.value;else{const o=e.value,{target:c}=o,l=((O,_)=>{var v={};for(var E in O)tp.call(O,E)&&_.indexOf(E)<0&&(v[E]=O[E]);if(O!=null&&Cs)for(var E of Cs(O))_.indexOf(E)<0&&ep.call(O,E)&&(v[E]=O[E]);return v})(o,["target"]);r=c,pl(s,l)}typeof r=="string"&&(r=document.querySelector(r)),mp.toggle(r,s)};t._onClickFullScreen&&t.removeEventListener("click",t._onClickFullScreen),t.addEventListener("click",n),t._onClickFullScreen=n};var b1={install(t,{name:e="fullscreen"}={}){t.config.globalProperties[`$${e}`]=mp,t.component(e,p1(pp,{name:e})),t.directive(e,x1)}};const Ts=bn(Ey);Ts.use(M0).use(Rb).use(Lw,{tagName:"charts"}).use(Sw,{directive:"tippy",component:"tippy"}).use(Dw).use(b1);Ts.provide("$papa",Ts.config.globalProperties.$papa);Ts.mount("#app");export{Ow as A,qd as B,km as C,qg as D,Va as E,zt as F,Sr as G,bn as H,Se as I,Sw as J,Rb as K,Be as L,mp as M,ie as N,Qv as O,$g as P,w1 as Q,Ma as R,Qn as S,yv as T,Nn as U,Dn as V,Qe as W,Oe as X,Aw as Y,Ev as Z,po as _,Zg as a,lf as b,Kd as c,Ue as d,Ha as e,Km as f,mn as g,Aa as h,Ih as i,Yt as j,$t as k,le as l,gi as m,Tr as n,Ai as o,zm as p,Jg as q,Lh as r,Ft as s,Bu as t,il as u,Cf as v,Ag as w,by as x,Vs as y,qi as z}; diff --git a/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-CuHQHwu6.js b/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-CuHQHwu6.js deleted file mode 100644 index 6c9becb6..00000000 --- a/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-CuHQHwu6.js +++ /dev/null @@ -1,438 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MapView-BGOJJ8ch-MH2z-up5.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-OUarUCIt.js","./story-DSWe5kwC.css","./Cyclical-C_9rKUUQ-BqcUyGYR.js","./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js","./workers-PiCjreoO-mU03Z-E4.js","./projection-BA9M1R7d-Cytmrlsd.js","./projectBuffer-CvCBvJ6W-CiwR2FyN.js","./TileInfo-CWIRDhZl-561xzxdP.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-CpWzbU7H.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js","./signal-CETehA7D-TD-k6B-y.js","./Map-1zd11DKO-DZlipvJg.js","./Basemap-BEqqSTw9-6qmF8bsX.js","./loadAll-e978YItg-cyBswBq0.js","./PortalItem-CctGdnxF-DgukgleB.js","./writeUtils-D5qlLkwk-BhsnyRJI.js","./compilerUtils-CV1QYWI8-yV6K-awH.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-R4uQiiTY.js","./Layer-ChoECxvZ-DxWUU3pP.js","./TimeExtent-Cn0Jofqr-BYNqT7sE.js","./GraphicsCollection-CWTXNZOX-EGgNeYwI.js","./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js","./ReactiveMap-CFk6jPfN-DLjzYieQ.js","./Query-BrwMGK8U-gUIs0TS1.js","./Field-C6hA1tZj-DY7R6puO.js","./fieldType-CD2CL2hr-D-1zqE7t.js","./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-DDmsm7e7.js","./TileKey-C5IL-JBr-Cy7bNm0k.js","./QueueProcessor-DbfV9fLy-2ansCCcJ.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-DaA_UEnd.js","./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js","./utils-9sQxfkoa-Djr5L7DU.js","./utils-Bq23Xwmj-CIl5z47y.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-C-sG6deK.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Bv29bzNX.js","./imageUtils-BA2D6Uf1-rtvarRV-.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-5qCYzF4G.js","./ColorBackground-gVZldRLm-BKgsF61w.js"])))=>i.map(i=>d[i]); -import{_ as Te}from"./main-lj2zzr_L.js";import{K,aZ as xr,o as fe,al as dt,au as rr,aA as rt,aW as Mr,ah as _e,aL as Ke,ay as Sr,f as ge,di as Pr,aC as pt,bj as Je,hm as ir,P as sr,et as se,I as Cr,bo as Or,L as Tr,hT as z,ae as mt,iV as Rr,$ as it,aY as Er,p as _t,J as ft,w as gt,d6 as yt,m as zr,a1 as st,aU as vt,C as Fr,b as kr,cW as Ar,dg as Be,hX as Ir,es as Br,E as Dr,aS as Lr,bt as Nr}from"./story-OUarUCIt.js";import{o as Ur}from"./signal-CETehA7D-TD-k6B-y.js";import{y as Vr,e as Fe,E as W,u as Gr,A as we,v as $r,w as Hr,x as bt}from"./MapView-BGOJJ8ch-MH2z-up5.js";import{x as Wr}from"./colorUtils-Cthpxcks-DchH3ayn.js";import{B as qr,k as le,D as at,l as Ce,H as jr,m as Xr,n as Yr,o as Kr,p as Jr,q as Qr,r as Zr}from"./UpdateTracking2D-Du_WIf4G-Bk5fiwfr.js";import{q as ei,$ as ti,M as ri,T as ot,s as nt,t as wt}from"./FeatureCommandQueue-DzV-HBIG-xVPBWv5I.js";import{Y as ii,T as N,g as ar,N as si,l as xe,n as S,k as De,O as Le,i as ne,E as xt,A as ai,G as Mt,m as oi,M as ni,y as li,C as hi,R as ci,x as ui,P as O,a as St,w as R,D as or,Q as di}from"./utils-SPbpQbmm-BNEY6jgo.js";import{r as Re,c as Qe,s as nr}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{Y as Ze,H as Pt,E as pi,V as mi,K as _i}from"./SDFHelper-B6k8Ig6R-D3_atHyF.js";import{c as de}from"./OverrideHelper-DWRbVlj1-CsyvnxCE.js";import{Y as Ct}from"./PieChartMeshWriter-C5yLDFwp-DCrKmwbH.js";import{R as fi,y as et,H as Ne,m as gi,F as Ot,Q as yi,s as vi,h as Tt,j as bi,k as wi,q as xi,a as Rt,M as Mi,J as Si,I as Et,n as Z,N as Pi,p as pe,u as Ci}from"./definitions-DJSdSb77-DkoRHaVx.js";import{x as Oi,T as lr}from"./Container-BcuL1ZEG-DGKfmUxH.js";import{G as Ti,t as Ri,e as Ei,i as zi}from"./Tile-D75RMC64-DDmsm7e7.js";import{m as Fi,n as ki,F as ye,s as zt,R as Ft}from"./WGLContainer-LxgEo4I_-DR17gokR.js";import{N as U}from"./enums-qHpGJ28Q-CmnLAccm.js";import{d as Ee,c as Ai}from"./ProgramTemplate-DQOm6Omy-5xKhv4ig.js";import{glslifyDefineMap as ke}from"./webglDeps-Bgavuh0h-CRZNTeK3.js";import{d as Ii,E as Bi,r as Di,a as kt,b as Li,t as Ni,T as Ui,c as Vi,m as Gi}from"./GridShader-75bC4UUM-C70OrCUT.js";import{j as Al,F as Il}from"./GridShader-75bC4UUM-C70OrCUT.js";import{r as hr}from"./BufferObject-BM_7mcDb-Pn3dvEnK.js";import{G as F,B as $i,H as lt,U as A,F as ht,M as q,L as tt,A as w,N as At,C as Ue,T as Oe,n as cr,D as Ve,I as It}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as ur}from"./VertexArrayObject-M4iRGGoi-Z_yPXqAH.js";import{U as Hi,p as Wi}from"./RenderingContext-DbCVbtGZ-CLtHlEj9.js";import{T as qi}from"./imageUtils-BA2D6Uf1-rtvarRV-.js";import{z as ji,D as Xi}from"./rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js";import{a as H}from"./Rect-DD6XS68q-D_hsV3ag.js";import{H as k,V as J,G as Yi}from"./Texture-BCt2hphT-Bv29bzNX.js";import{o as Bt}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{l as Ki}from"./floatRGBA-4pIJN00G-DCWbfrRi.js";import{X as Ji,$ as Qi,W as Zi}from"./LabelMetric-BeluzH3o-D5oryYiP.js";import{T as es}from"./utils-Dcs650Ic-BN6ELyDC.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-2ansCCcJ.js";import{r as rs}from"./common-CYWrYyJl-E8-sukrT.js";import{J as is,C as dr,D as pr,H as ss,I as as,G as Dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as os,e as ns}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{_ as Ge}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{n as Lt}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{G as X,E as ct,a as ls}from"./Program-DLVwTiPA-DeIeQX6y.js";import{d as hs}from"./MeshWriterRegistry-CIC9Yk_f-BkUQh61q.js";import{X as Dl}from"./GraphicsView2D-C4wYE2ut-Z1TuKooJ.js";import{d as Nl}from"./GraphicContainer-DuOHUciE-DpgZsbDS.js";import{i as cs}from"./UpdatingHandles-CUu3u1ms-CQ9rGZXi.js";import{r as Nt}from"./requestImageUtils-Ut4YcoNU-BuJzHX4v.js";import{m as Ut,T as us,v as $e,P as He}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{f as We}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{B as ds,K as ps}from"./projection-BA9M1R7d-Cytmrlsd.js";import{c as ms,D as _s}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{f as fs}from"./scaleUtils-DxsfQwK1-rzzukPSH.js";import{P as gs,c as ys}from"./geodesicUtils-B8mFUfTk-vCqdY65r.js";import"./Cyclical-C_9rKUUQ-BqcUyGYR.js";import"./CollectionFlattener-DkHuHn5E-BaAeLIOQ.js";import"./workers-PiCjreoO-mU03Z-E4.js";import"./TileInfo-CWIRDhZl-561xzxdP.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-CpWzbU7H.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-DZlipvJg.js";import"./Basemap-BEqqSTw9-6qmF8bsX.js";import"./loadAll-e978YItg-cyBswBq0.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./writeUtils-D5qlLkwk-BhsnyRJI.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./TablesMixin-C8RojhYs-R4uQiiTY.js";import"./Layer-ChoECxvZ-DxWUU3pP.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./GraphicsCollection-CWTXNZOX-EGgNeYwI.js";import"./HeightModelInfo-C5vFqzyF-BrMy6Kw6.js";import"./ReactiveMap-CFk6jPfN-DLjzYieQ.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-C-sG6deK.js";import"./TileKey-C5IL-JBr-Cy7bNm0k.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-5qCYzF4G.js";import"./ColorBackground-gVZldRLm-BKgsF61w.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-Ds_R1Wcb.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./quantizationUtils-bJy1cRwp-Ds815HQE.js";import"./TurboLine-CIlsAy5m-BIV61-kY.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./parser-DyDJ-rlI-BZnJ9Tpt.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DYMWtMgs.js";import"./AttributeStore-DjyP9U7y-r_lH0yBG.js";import"./TimeOnly-DSMefxKy-C9JclgbM.js";import"./UnknownTimeZone-C--TOcPG-BlA07cjv.js";import"./timeSupport-jPViR5jn-BLBOCVnL.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-DeXQjA1z.js";import"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import"./diffUtils-Cz3Fi8Xb-JVwNDDxH.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./grouping-RwmXkHDc-saUNiwHr.js";import"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import"./AGraphicContainer-LUCT6Gle-BEOATdol.js";import"./TechniqueInstance-DGTKoOL6-DHC_8Pj6.js";import"./TileContainer-D48pXXgL-DF8HooMp.js";function Me(r,e,t){return{transform:Ps(r,e,t.transform),fromColor:Cs(r,e,t.fromColor),toColor:Os(r,e,t.toColor),colorMix:Ts(r,e,t.colorMix),toOpacity:Rs(r,e,t.toOpacity),opacityMix:Es(r,e,t.opacityMix),hasAnimations:t.hasAnimations||!!e.animations&&e.animations.length>0}}function mr(r){return!wt.forceStaticPath&&(wt.forceAnimatedPath||r.hasAnimations)}function vs(r,e,t){if(e.type==="CIMCharacterMarker")return st.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),t;const s=O(r,e,"OffsetX"),i=O(r,e,"OffsetY");if(e.type==="CIMPictureMarker")return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([s,i]),rotation:P(0),scale:P(O(r,e,"Size")),parent:t.transform}};const a=e.frame,o=a.ymax-a.ymin;return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([s,i]),rotation:P(0),scale:P({type:"Process",op:"Divide",left:O(r,e,"Size"),right:o}),parent:t.transform}}}function _r(r,e){let t=0,s=0;const i=r.anchorPointUnits!=="Absolute";return r.anchorPoint&&(t=-r.anchorPoint.x,s=-r.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:P([t,s]),rotation:P(0),scale:P(1),parent:e.transform}}}function bs(r,e){return r.anchorPointUnits==="Absolute"?e:_r(r,e)}function ws(r,e){return r.anchorPointUnits!=="Absolute"?e:_r(r,e)}function xs(r,e,t){return{...r,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([e,t]),rotation:P(0),scale:P(1),parent:r.transform}}}function Ms(r,e){const t=e?.5*-(e.xmin+e.xmax):0,s=e?.5*-(e.ymin+e.ymax):0;let i=0,a=0;if("x"in r&&"y"in r)i=r.x+t,a=r.y+s;else{const o=Ze(r);o&&(i=(o[0]+o[2])/2+t,a=(o[1]+o[3])/2+s)}return[i,a]}function Ss(r,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return O(r,e,"Rotation")}return 0}function fr(r,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return O(r,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return O(r,e,"TintColor")}return[1,1,1,1]}function Ps(r,e,t){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:Fs(r,e),rotation:ks(r,e),scale:zs(r,e),parent:t}}function Cs(r,e,t){return{type:"AnimatedColor",color:P(fr(r,e)),opacity:P(1),parent:t}}function Os(r,e,t){const{animations:s}=e;let i=fr(r,e);const a=s?.filter(o=>o.type==="CIMSymbolAnimationColor")[0];return a&&(i=O(r,a,"ToColor")),{type:"AnimatedColor",color:P(i),opacity:P(1),parent:t}}function Ts(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationColor")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function Rs(r,e,t){const{animations:s}=e;let i=P(1);const a=s?.filter(o=>o.type==="CIMSymbolAnimationTransparency")[0];return a&&(i=P({type:"Process",op:"Transparency",value:O(r,a,"ToTransparency")})),{type:"AnimatedColor",color:P([1,1,1,1]),opacity:i,parent:t}}function Es(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationTransparency")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function he(r,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0};const t=O(r,e,"Duration");let s;O(r,e,"RandomizeStartTime")?s={type:"Process",op:"Random",min:0,max:t,seed:O(r,e,"RandomizeStartSeed")}:s=O(r,e,"StartTimeOffset");const i=O(r,e,"RepeatDelay"),a=O(r,e,"PlayAnimation"),o=O(r,e,"ReverseAnimation"),n=St(e.repeatType,R.CIMAnimatedSymbolProperties.repeattype);return{duration:t,startTimeOffset:s,repeatDelay:i,timeOriginSelector:n===Qe.None?Ce.Local:Ce.Global,repeatType:n,easing:St(e.easing,R.CIMAnimatedSymbolProperties.easing),playAnimation:a,reverseAnimation:o}}function zs(r,e){const{animations:t}=e;if(e.type!=="CIMPictureMarker"&&e.type!=="CIMVectorMarker"&&e.type!=="CIMPointSymbol")return P(1);let s;s=e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"?O(r,e,"Size"):ar(e)||10;const i=t?.filter(a=>a.type==="CIMSymbolAnimationScale")[0];if(!i){const a=t?.filter(o=>o.type==="CIMSymbolAnimationSize")[0];return a?{from:1,to:{type:"Process",op:"Divide",left:O(r,a,"ToSize"),right:s},timing:he(r,a.animatedSymbolProperties)}:P(1)}return{from:1,to:O(r,i,"ScaleFactor"),timing:he(r,i.animatedSymbolProperties)}}function Fs(r,e){const{animations:t}=e,s=t?.filter(i=>i.type==="CIMSymbolAnimationOffset")[0];return s?{from:[0,0],to:[O(r,s,"OffsetX"),O(r,s,"OffsetY")],timing:he(r,s.animatedSymbolProperties)}:P([0,0])}function ks(r,e){const{animations:t}=e,s=Ss(r,e),i=t?.filter(a=>a.type==="CIMSymbolAnimationRotation")[0];return i?{from:s,to:O(r,i,"ToRotation"),timing:he(r,i.animatedSymbolProperties)}:P(s)}function P(r){return{from:r,to:r,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0}}}function gr(r){if(r==null||typeof r!="object")return!1;if(r.animations&&Array.isArray(r.animations)&&r.animations.length>0)return!0;for(const e in r)if(gr(r[e]))return!0;return!1}const As=()=>st.getLogger("esri.symbols.cim.cimAnalyzer");function Is(r){const e=r.markerPlacement;return e&&e.angleToLine?Re.MAP:Re.SCREEN}class Bs{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,s){if(this._cimLayers=s??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const i of this._primitiveOverrides){const a=i.valueExpressionInfo;if(a)this._setPoMap(i.primitiveName,i.propertyName,a);else if(i.value!=null){let o=i.value;i.propertyName.includes("Color")&&(Wr(o)&&(o=ii(o)),o=N(o)),this._setPoMap(i.primitiveName,i.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const s=e?.symbolLayers;if(!s)return;const i=e.effects;let a=Re.SCREEN;const o=ar(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=Re.MAP);let n={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],hasAnimations:gr(e)};n=Me(this._poMap,e,n);const l=e.type==="CIMPolygonSymbol";let h=s.length;for(;h--;){const c=s[h];if(!c||c.enable===!1)continue;let u;i?.length&&(u=[...i]);const d=c.effects;d?.length&&(i?u.push(...d):u=[...d]);let p=null;if(u){p=[];for(const m of u){const y=de.findEffectOverrides(m,this._primitiveOverrides);y&&p.push(y)}}const _=[];switch(de.findApplicableOverrides(c,this._primitiveOverrides,_),c.type){case"CIMSolidFill":this._analyzeSolidFill(c,p);break;case"CIMPictureFill":this._analyzePictureFill(c,p);break;case"CIMHatchFill":this._analyzeHatchFill(c,p);break;case"CIMGradientFill":this._analyzeGradientFill(c,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(c,p,l,o);break;case"CIMPictureStroke":this._analyzePictureStroke(c,p,l,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(c,p,l,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=Is(c));const m=[],y=c.primitiveName;y&&m.push(y);const g=l&&si(c.markerPlacement);this._analyzeMarker(c,p,null,m,a,o,t,[],n,!1,g);break}default:As().error("Cannot analyze CIM layer",c.type)}}}_analyzeSolidFill(e,t){const{primitiveName:s,type:i}=e,a=N(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,s,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:s,type:i}=e,a=xe(e),o=S(e.height,R.CIMPictureFill.height);let n=S(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const h=e.width;let c=1;const u=this._resourceManager.getResource(e.url);u!=null&&(c=u.width/u.height),n/=c*(o/h)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,s,"TintColor",a),height:this._getValueOrOverrideExpression(i,s,"Height",o),scaleX:this._getValueOrOverrideExpression(i,s,"ScaleX",n),angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:s,type:i}=e,a=this._analyzeMaterialOverrides(s,["Rotation","OffsetX","OffsetY"]),o=De(a);let n=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const u=c.primitiveName??s;l||!u||c.colorLocked||this._poMap[u]?.Color==null&&this._poMap[u]?.StrokeColor==null||(n=N(c.color),n=this._maybeGetValueOrOverrideExpression(u,"StrokeColor")??this._getValueOrOverrideExpression(i,u,"Color",n),l=!0);const d=this._maybeGetValueOrOverrideExpression(u,"StrokeWidth");if(d){let p=null,_=null;typeof d=="number"?p=d:_=d.valueExpressionInfo;let m=o.find(y=>y.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:u,propertyName:"width",valueExpressionInfo:_,value:p,defaultValue:Le(i,"width")},o.push(m))}}const h={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(i,s,"Separation",S(e.separation,R.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=N(e.color),l=S(e.width,R.CIMSolidStroke.width),h=ne(e.capStyle,R.CIMSolidStroke.capstyle),c=ne(e.joinStyle,R.CIMSolidStroke.joinstyle),u=e.miterLimit;let d,p,_,m,y=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(y=this._getPrimitiveMaterialOverrides(a,o)),t&&Array.isArray(t)&&t.length>0){const f=t[t.length-1].effect;f&&f.type==="CIMGeometricEffectDashes"&&f.lineDashEnding==="NoConstraint"&&(d=f.dashTemplate,p=f.scaleDash,_=f.offsetAlongLine,m=f.primitiveName,(t=[...t]).pop())}m!=null&&y.push(...this._getPrimitiveMaterialOverrides(m,o).filter(f=>f.propertyName==="dashTemplate"));const g=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:m},overrides:y}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"Color",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(m,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(o,m,"OffsetAlongLine",_??0),scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=xe(e),l=S(e.width,R.CIMPictureStroke.width),h=ne(e.capStyle,R.CIMPictureStroke.capstyle),c=ne(e.joinStyle,R.CIMPictureStroke.joinstyle),u=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"TintColor",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=S(e.width,R.CIMSolidStroke.width),l=ne(e.capStyle,R.CIMGradientStroke.capstyle),h=ne(e.joinStyle,R.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,a,"Width",n),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",l),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(o,a,"MiterLimit",c),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,s,i,a,o,n,l,h,c=!1,u=!1){if(c||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,c))return;const d=S(e.size,R.CIMVectorMarker.size),p=S(e.rotation),_=S(e.offsetX),m=S(e.offsetY),{primitiveName:y,type:g}=e,f=this._getValueOrOverrideExpression(g,y,"Size",d),x=this._getValueOrOverrideExpression(g,y,"Rotation",p),b=this._getValueOrOverrideExpression(g,y,"OffsetX",_),v=this._getValueOrOverrideExpression(g,y,"OffsetY",m);let M=h;switch(M=ws(e,M),M=vs(this._poMap,e,M),M=bs(e,M),M=Me(this._poMap,e,M),e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,s,i,a,o,f,x,b,v,l,M,c,u);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,s,i,a,o,f,x,b,v,l,M,n,c,u)}}_analyzeMarkerInsidePolygon(e,t,s){const{markerPlacement:i,type:a}=e;if(!i||i.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=i.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const m of _){const{symbol:y}=m;if(y?.type==="CIMPolygonSymbol"&&y.symbolLayers){const{symbolLayers:g}=y;for(const f of g)if(f.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const o=Math.abs(i.stepX),n=Math.abs(i.stepY);if(o===0||n===0)return!0;let l,h;if(i.gridType==="Random"){const d=Br(Mi),p=Math.max(Math.floor(d/o),1);l=n*Math.max(Math.floor(d/n),1),h=p*o/l}else i.shiftOddRows?(l=2*n,h=o/n*.5):(l=n,h=o/n);const c=xe(e),u=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:s,effects:t,color:c,height:l,scaleX:h,angle:i.gridAngle,offsetX:S(i.offsetX),offsetY:S(i.offsetY),applyRandomOffset:i.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_){const{animatedSymbolProperties:m,primitiveName:y,type:g}=e;let f=S(e.scaleX,1);const x=xe(e);s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const b=this._createGIFAnimatedSymbolPropertiesOverrideExpression(m),v=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const B=e.width;let $=1;const I=this._resourceManager.getResource(e.url);I!=null&&($=I.width/I.height),f/=$*(S(e.size)/B)}const M=[...i];let C;e.primitiveName&&M.push(e.primitiveName),m||b?C={type:"animated",url:e.url,urlHash:"H"+ir(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=sr(e),C.markerPlacement=null);const T={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(M,g)};b&&T.overrides.push(...b.overrides);const G=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:T,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(g,y,"ScaleX",f),rotation:l,offsetX:h,offsetY:c,transform:{type:"cim-marker-transform-param",params:u},color:this._getValueOrOverrideExpression(g,y,"TintColor",x),anchorPoint:{x:v.x,y:v.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:_,markerPlacement:s,animationParams:je(d),baseSize:G})}_analyzeVectorMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_,m){const y=e.markerGraphics;if(!y)return;const g=e.frame;let f=0;f=g?g.ymax-g.ymin:o;const x=!!e.scaleSymbolsProportionally;if(f){const b={offsetX:h,offsetY:c,rotation:l,size:n,frameHeight:f,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:x};u=[...u,b]}s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const b of y)if(b){const v=b.symbol;if(!v)continue;const M=b.primitiveName;M&&i.push(M);let C,T=d;if((v.type==="CIMPointSymbol"||v.type==="CIMTextSymbol")&&g){let I=0,E=0;const Y=b.geometry;"x"in Y&&"y"in Y&&(I+=Y.x-.5*(g.xmin+g.xmax),E+=Y.y-.5*(g.ymin+g.ymax));const D=e.anchorPoint;let ee=!1;D&&(e.anchorPointUnits==="Absolute"?(I-=D.x,E-=D.y,ee=!0):g&&(I-=(g.xmax-g.xmin)*D.x,E-=(g.ymax-g.ymin)*D.y));const ae={offsetX:I,offsetY:E,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:ee,scaleSymbolsProportionally:x};C=[...u,ae]}const G=b.geometry,[B,$]=Ms(G,g);switch(B===0&&$===0||(T=xs(T,B,$)),v.type==="CIMPointSymbol"&&(T=Me(this._poMap,v,T)),v.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||Ns(v)?(T={...T,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([0,0]),rotation:P(0),scale:P(f),parent:d.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,s,b,i,a,o,C??u,T,f,_,m)):this._analyzeMultiLayerGraphic(e,t,s,b,i,a,o,C??u,T,f,_,m);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,s,b,i,a,o,C??u,_)}M&&i.pop()}}_analyzeMultiLayerGraphic(e,t,s,i,a,o,n,l,h,c,u,d){const p=i.symbol,_=p.symbolLayers;if(!_)return;let m=_.length;if(Ls(_)&&!mr(h))return void this._analyzeCompositeMarkerGraphic(e,t,s,i,_,o,n,l,c,u,d);const y=this._resourceManager.geometryEngine,g=Ct.applyEffects(p.effects,i.geometry,y);if(g)for(;m--;){const f=_[m];if(!f||f.enable===!1)continue;const x=f.primitiveName;switch(x&&a.push(x),f.type){case"CIMSolidFill":case"CIMSolidStroke":{const b=Ct.applyEffects(f.effects,g,y),v=Ze(b);if(!v)continue;const M=e.anchorPointUnits!=="Relative",C=xt(f)??0,{frameSizeRatio:T,anchorX:G,anchorY:B,widthRatio:$,sdfPaddingRatio:I}=Pt(v,e.frame,e.size,e.anchorPoint,M,C,e.scaleSymbolsProportionally),E=f.type==="CIMSolidFill",Y={type:"sdf",geom:b,sdfPaddingRatio:I,asFill:E},{path:D}=f,ee=E?N(ai(f)):D==null?N(Mt(f)):[0,0,0,0],ae=E?[0,0,0,0]:N(Mt(f));if(!E&&!C)break;const oe=i.primitiveName;let ce=null;E&&!f.colorLocked&&(ce=this._maybeGetValueOrOverrideExpression(oe,"FillColor"));let ue=null;E||f.colorLocked||(ue=this._maybeGetValueOrOverrideExpression(oe,"StrokeColor"));const ve=ce??this._getValueOrOverrideExpression(f.type,x,"Color",ee),Ae=ue??this._getValueOrOverrideExpression(f.type,x,"Color",ae),be=this._maybeGetValueOrOverrideExpression(oe,"StrokeWidth")??this._getValueOrOverrideExpression(f.type,x,"Width",C),Ie=D?{type:"sprite-rasterization-param",resource:{type:"path",path:D,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:Y,overrides:[]},L=Me(this._poMap,f,h),j=S(e.size,R.CIMVectorMarker.size),Q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",j);this._cimLayers.push({type:"marker",spriteRasterizationParam:Ie,colorLocked:!!f.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:G,y:B},isAbsoluteAnchorPoint:M,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:$,rotateClockwise:!1,referenceSize:n,sizeRatio:T,color:ve,outlineColor:Ae,outlineWidth:be,isOutline:d,markerPlacement:s,animationParams:je(L),isStroke:f.type!=="CIMSolidFill",baseSize:Q,...pi(b,I)});break}case"CIMPictureMarker":case"CIMVectorMarker":f.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d):this._analyzeMarker(f,t,s,a,o,n,!1,l,h,u,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d)}x&&a.pop()}}_analyzeTextGraphic(e,t,s,i,a,o,n,l){const h=[];de.findApplicableOverrides(s,this._primitiveOverrides,h);const c=s.geometry;if(!("x"in c)||!("y"in c))return;const u=s.symbol,d=oi(u),p=ni(u.fontStyleName),_=qr(u.fontFamilyName);u.font={family:_,decoration:d,...p};const m=S(u.height,R.CIMTextSymbol.height),y=S(u.angle),g=S(u.offsetX),f=S(u.offsetY),{haloSymbol:x}=u,b=S(u.haloSize,0);let v=[0,0,0,0];if(x?.symbolLayers?.length){const L=x.symbolLayers;for(const j of L)if(j.color){v=this._getValueOrOverrideExpression(u?.haloSymbol?.type??"CIMPolygonSymbol",j.primitiveName,"Color",N(j.color));break}}const M=s.primitiveName;let C=[0,0,0,1],T=[0,0,0,0],G=0,B=!1;if(u.symbol?.symbolLayers)for(const L of u.symbol.symbolLayers){const j=L.primitiveName;if(L.type==="CIMSolidStroke")T=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Color",N(L.color)),G=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Width",xt(L)??0);else if(L.type==="CIMSolidFill"){const Q=N(L.color);B=B??!!L.colorLocked,C=this._getValueOrOverrideExpression("CIMSolidFill",j??M,"Color",Q)}}let $=null,I=null,E=null,Y=null,D=null;M&&($=this._maybeGetValueOrOverrideExpression(M,"TextSize"),I=this._maybeGetValueOrOverrideExpression(M,"TextAngle"),E=this._maybeGetValueOrOverrideExpression(M,"TextOffsetX"),Y=this._maybeGetValueOrOverrideExpression(M,"TextOffsetY"),B||(D=this._maybeGetValueOrOverrideExpression(M,"FillColor")));const ee=D??C;let ae=null,oe=null,ce=0;if(u.callout&&u.callout.type==="CIMBackgroundCallout"){const L=u.callout;if(L.backgroundSymbol){const j=L.backgroundSymbol.symbolLayers;if(j)for(const Q of j)Q.type==="CIMSolidFill"?ae=N(Q.color):Q.type==="CIMSolidStroke"&&(oe=N(Q.color),ce=S(Q.width,R.CIMSolidStroke.width))}}const ue=this._getValueOrOverrideExpression(u.type,s.primitiveName,"TextString",s.textString??"");if(ue==null)return;const{fontStyleName:ve}=u,Ae=_+(ve?"-"+ve.toLowerCase():"-regular"),be=this._getMaterialOverrides(i,u.type);be.push(...this._getPrimitiveMaterialOverrides(s.primitiveName,u.type));const Ie={type:"text-rasterization-param",resource:{type:"text",textString:s.textString??"",font:u.font,symbol:u,primitiveName:s.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:u.lineWidth,textRasterizationParam:Ie,colorLocked:!!l||!!B,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:Ae,decoration:d,haloSize:b,haloColor:v,weight:p.weight,style:p.style,size:$??m,angle:I??y,offsetX:E??g,offsetY:Y??f,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:li(u.horizontalAlignment),verticalAlignment:hi(u.verticalAlignment),text:ue,color:ee,outlineColor:T,outlineSize:G,backgroundColor:ae,borderLineColor:oe,borderLineWidth:ce,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,u,d){const p=Ds(e,i),_=e.primitiveName,m=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),y=De(m),[g,f,x]=le.getTextureAnchor(p,this._resourceManager),b=this._getMaterialOverrides(a,e.type);b.push(...y);const v={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:b},M=S(e.size,R.CIMVectorMarker.size),C=this._getValueOrOverrideExpression(e.type,_,"Size",M);this._cimLayers.push({type:"marker",spriteRasterizationParam:v,colorLocked:u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:g,y:f},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:n,sizeRatio:x/se(e.size),isOutline:d,markerPlacement:s,animationParams:je(h),baseSize:C})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:Vt(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:Vt(t)}}_analyzeCompositeMarkerGraphic(e,t,s,i,a,o,n,l,h,c,u){const d=i.geometry,p=a[0],_=a[1],m=Ze(d);if(!m)return;const y=e.anchorPointUnits!=="Relative",g=S(p.width,R.CIMSolidStroke.width),{frameSizeRatio:f,anchorX:x,anchorY:b,widthRatio:v,sdfPaddingRatio:M}=Pt(m,e.frame,e.size,e.anchorPoint,y,g,e.scaleSymbolsProportionally),{path:C}=_,T=_.primitiveName,G=p.primitiveName,B=i.primitiveName;let $=null;_.colorLocked||c||($=this._maybeGetValueOrOverrideExpression(B,"FillColor"));const I=$??this._getValueOrOverrideExpression(_.type,T,"Color",N(_.color));let E=null;p.colorLocked||c||(E=this._maybeGetValueOrOverrideExpression(B,"StrokeColor"));const Y=E??this._getValueOrOverrideExpression(p.type,G,"Color",N(p.color)),D=this._maybeGetValueOrOverrideExpression(B,"StrokeWidth")??this._getValueOrOverrideExpression(p.type,G,"Width",g),ee={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:d,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:ee,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x,y:b},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:v,rotateClockwise:!1,referenceSize:n,sizeRatio:f,color:I,outlineColor:Y,outlineWidth:D,isOutline:u,markerPlacement:s})}_setPoMap(e,t,s){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=s}_maybeGetValueOrOverrideExpression(e,t,s){return this._getValueOrOverrideExpression("",e,t,s,!1)}_getValueOrOverrideExpression(e,t,s,i,a=!0){if(a&&!ci(i)&&(i=Le(e,s.toLowerCase())),t==null)return i;const o=this._poMap[t];if(o==null)return i;const n=o[s];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,s,i){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if(a?.overrides.length>0)return!0}if(s!=null){for(const a of s)if(a?.overrides.length>0)return!0}if(i!=null){for(const a of i)if(a?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const s=[];for(const i of e)s.push(...this._getPrimitiveMaterialOverrides(i,t));return s}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const s=De(this._primitiveOverrides.filter(i=>i.primitiveName===e));return s.forEach(i=>i.defaultValue=Le(t,i.propertyName.toLowerCase())),s}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(s=>s.primitiveName!==e||!t.includes(s.propertyName))}}function Ds(r,e){return{type:r.type,enable:!0,name:r.name,colorLocked:r.colorLocked,primitiveName:r.primitiveName,anchorPoint:r.anchorPoint,anchorPointUnits:r.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:r.rotateClockwise,rotation:0,size:r.size,billboardMode3D:r.billboardMode3D,depth3D:r.depth3D,frame:r.frame,markerGraphics:[e],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function qe(r){if(r&&r.indexOf("Level_")===0){const e=parseInt(r.slice(6),10);if(!isNaN(e))return e}return 0}const Ls=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&r[0].path==null&&r[1].path==null&&!r[0].effects&&!r[1].effects&&!r[0].animations&&!r[1].animations;function Ns(r){const e=r.symbolLayers;if(!e)return!1;const t=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectDashes"&&a.dashTemplate!=null)),s=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!s}function Vt(r){return sr(r).map(e=>({...e,propertyName:ui(e.propertyName)}))}function je(r){return mr(r)?{type:"animation-params",params:r}:null}let Us=class{constructor(r){this.events=new Cr,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const e={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};r.appendChild(this._canvas);let t=this._canvas.getContext("webgl2",e);t||(t=this._canvas.getContext("webgl2",{...e,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=t,this._handles=Or([Tr(this._canvas,"webglcontextlost",s=>this.events.emit("webgl-context-lost",s))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(r,e){if(this._hasMajorPerformanceCaveat||K("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=K("esri-performance-mode-frames-between-render")&&(e(),this._lastRenderViewState=r.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,s,i,a,o,n]=this._computeViewTransform(this._lastRenderViewState,r.state);this._canvas.style.transform=`matrix(${t}, ${s}, ${i}, ${a}, ${o}, ${n})`}}else e()}resize(r){const e=this._canvas,t=e.style,{state:{size:s},pixelRatio:i}=r,a=s[0],o=s[1],n=Math.round(a*i),l=Math.round(o*i);e.width===n&&e.height===l||(e.width=n,e.height=l),t.width=a+"px",t.height=o+"px"}_computeViewTransform(r,e){const[t,s]=r.center,[i,a]=e.center,[o,n]=r.toScreen([0,0],i,a),[l,h]=r.toScreen([0,0],t,s),c=l-o,u=h-n,d=r.scale/e.scale,p=e.rotation-r.rotation,_=Gr();return Ti(_),Ri(_,_,[d,d]),Ei(_,_,Je(p)),zi(_,_,[c,u]),_}};const Vs={background:{"background.frag":`#ifdef PATTERN -uniform lowp float u_opacity; -uniform lowp sampler2D u_texture; -varying mediump vec4 v_tlbr; -varying mediump vec2 v_tileTextureCoord; -#else -uniform lowp vec4 u_color; -#endif -void main() { -#ifdef PATTERN -mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); -mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); -lowp vec4 color = texture2D(u_texture, samplePos); -gl_FragColor = u_opacity * color; -#else -gl_FragColor = u_color; -#endif -}`,"background.vert":`precision mediump float; -attribute vec2 a_pos; -uniform highp mat3 u_dvsMat3; -uniform mediump float u_coord_range; -uniform mediump float u_depth; -#ifdef PATTERN -uniform mediump mat3 u_pattern_matrix; -varying mediump vec2 v_tileTextureCoord; -uniform mediump vec4 u_tlbr; -uniform mediump vec2 u_mosaicSize; -varying mediump vec4 v_tlbr; -#endif -void main() { -gl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0); -#ifdef PATTERN -v_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy; -v_tlbr = u_tlbr / u_mosaicSize.xyxy; -#endif -}`},circle:{"circle.frag":`precision lowp float; -varying lowp vec4 v_color; -varying lowp vec4 v_stroke_color; -varying mediump float v_blur; -varying mediump float v_stroke_width; -varying mediump float v_radius; -varying mediump vec2 v_offset; -void main() -{ -mediump float dist = length(v_offset); -mediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0); -lowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width)); -gl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio); -}`,"circle.vert":`precision mediump float; -attribute vec2 a_pos; -#pragma header -varying lowp vec4 v_color; -varying lowp vec4 v_stroke_color; -varying mediump float v_blur; -varying mediump float v_stroke_width; -varying mediump float v_radius; -varying mediump vec2 v_offset; -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform mediump vec2 u_circleTranslation; -uniform mediump float u_depth; -uniform mediump float u_antialiasingWidth; -void main() -{ -#pragma main -v_color = color * opacity; -v_stroke_color = stroke_color * stroke_opacity; -v_stroke_width = stroke_width; -v_radius = radius; -v_blur = max(blur, u_antialiasingWidth / (radius + stroke_width)); -mediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); -v_offset = offset; -mediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth, 1.0); -}`},fill:{"fill.frag":`precision lowp float; -#ifdef PATTERN -uniform lowp sampler2D u_texture; -varying mediump vec2 v_tileTextureCoord; -varying mediump vec4 v_tlbr; -#endif -varying lowp vec4 v_color; -vec4 mixColors(vec4 color1, vec4 color2) { -float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); -vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); -return vec4(compositeColor, compositeAlpha); -} -void main() -{ -#ifdef PATTERN -mediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord); -mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); -lowp vec4 color = texture2D(u_texture, samplePos); -gl_FragColor = v_color[3] * color; -#else -gl_FragColor = v_color; -#endif -}`,"fill.vert":`precision mediump float; -attribute vec2 a_pos; -#pragma header -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform mediump float u_depth; -uniform mediump vec2 u_fillTranslation; -#ifdef PATTERN -#include -uniform mediump vec2 u_mosaicSize; -uniform mediump float u_patternFactor; -varying mediump vec2 v_tileTextureCoord; -varying mediump vec4 v_tlbr; -#endif -varying lowp vec4 v_color; -void main() -{ -#pragma main -v_color = color * opacity; -#ifdef PATTERN -float patternWidth = nextPOT(tlbr.z - tlbr.x); -float patternHeight = nextPOT(tlbr.w - tlbr.y); -float scaleX = 1.0 / (patternWidth * u_patternFactor); -float scaleY = 1.0 / (patternHeight * u_patternFactor); -mat3 patterMat = mat3(scaleX, 0.0, 0.0, -0.0, -scaleY, 0.0, -0.0, 0.0, 1.0); -v_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy; -v_tlbr = tlbr / u_mosaicSize.xyxy; -#endif -vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth, 1.0); -}`},icon:{"icon.frag":`precision mediump float; -uniform lowp sampler2D u_texture; -#ifdef SDF -uniform lowp vec4 u_color; -uniform lowp vec4 u_outlineColor; -#endif -varying mediump vec2 v_tex; -varying lowp float v_opacity; -varying mediump vec2 v_size; -varying lowp vec4 v_color; -#ifdef SDF -varying mediump flaot v_halo_width; -#endif -#include -vec4 mixColors(vec4 color1, vec4 color2) { -float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); -vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); -return vec4(compositeColor, compositeAlpha); -} -void main() -{ -#ifdef SDF -lowp vec4 fillPixelColor = v_color; -float d = rgba2float(texture2D(u_texture, v_tex)) - 0.5; -const float softEdgeRatio = 0.248062016; -float size = max(v_size.x, v_size.y); -float dist = d * softEdgeRatio * size; -fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); -if (v_halo_width > 0.25) { -lowp vec4 outlinePixelColor = u_outlineColor; -const float outlineLimitRatio = (16.0 / 86.0); -float clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y)); -outlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0); -gl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor); -} -else { -gl_FragColor = v_opacity * fillPixelColor; -} -#else -lowp vec4 texColor = texture2D(u_texture, v_tex); -gl_FragColor = v_opacity * texColor; -#endif -}`,"icon.vert":`attribute vec2 a_pos; -attribute vec2 a_vertexOffset; -attribute vec4 a_texAngleRange; -attribute vec4 a_levelInfo; -attribute float a_opacityInfo; -#pragma header -varying lowp vec4 v_color; -#ifdef SDF -varying mediump float v_halo_width; -#endif -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform highp mat3 u_displayViewMat3; -uniform mediump vec2 u_iconTranslation; -uniform vec2 u_mosaicSize; -uniform mediump float u_depth; -uniform mediump float u_mapRotation; -uniform mediump float u_level; -uniform lowp float u_keepUpright; -uniform mediump float u_fadeDuration; -varying mediump vec2 v_tex; -varying lowp float v_opacity; -varying mediump vec2 v_size; -const float C_OFFSET_PRECISION = 1.0 / 8.0; -const float C_256_TO_RAD = 3.14159265359 / 128.0; -const float C_DEG_TO_RAD = 3.14159265359 / 180.0; -const float tileCoordRatio = 1.0 / 8.0; -uniform highp float u_time; -void main() -{ -#pragma main -v_color = color; -v_opacity = opacity; -#ifdef SDF -v_halo_width = halo_width; -#endif -float modded = mod(a_opacityInfo, 128.0); -float targetOpacity = (a_opacityInfo - modded) / 128.0; -float startOpacity = modded / 127.0; -float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); -v_opacity *= interpolatedOpacity; -mediump float a_angle = a_levelInfo[1]; -mediump float a_minLevel = a_levelInfo[2]; -mediump float a_maxLevel = a_levelInfo[3]; -mediump vec2 a_tex = a_texAngleRange.xy; -mediump float delta_z = 0.0; -mediump float rotated = mod(a_angle + u_mapRotation, 256.0); -delta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated)); -delta_z += 1.0 - step(a_minLevel, u_level); -delta_z += step(a_maxLevel, u_level); -delta_z += step(v_opacity, 0.0); -vec2 offset = C_OFFSET_PRECISION * a_vertexOffset; -v_size = abs(offset); -#ifdef SDF -offset = (120.0 / 86.0) * offset; -#endif -mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); -v_tex = a_tex.xy / u_mosaicSize; -}`},line:{"line.frag":`precision lowp float; -varying mediump vec2 v_normal; -varying highp float v_accumulatedDistance; -varying mediump float v_lineHalfWidth; -varying lowp vec4 v_color; -varying mediump float v_blur; -#if defined (PATTERN) || defined(SDF) -varying mediump vec4 v_tlbr; -varying mediump vec2 v_patternSize; -varying mediump float v_widthRatio; -uniform sampler2D u_texture; -uniform mediump float u_antialiasing; -#endif -#ifdef SDF -#include -#endif -void main() -{ -mediump float fragDist = length(v_normal) * v_lineHalfWidth; -lowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0); -#ifdef PATTERN -mediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio)); -mediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio); -mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); -lowp vec4 color = texture2D(u_texture, texCoord); -gl_FragColor = alpha * v_color[3] * color; -#elif defined(SDF) -mediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio)); -mediump float relativeTexY = 0.5 + 0.25 * v_normal.y; -mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); -mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; -float dist = d * (v_lineHalfWidth + u_antialiasing / 2.0); -gl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color; -#else -gl_FragColor = alpha * v_color; -#endif -}`,"line.vert":`precision mediump float; -attribute vec2 a_pos; -attribute vec4 a_extrude_offset; -attribute vec4 a_dir_normal; -attribute vec2 a_accumulatedDistance; -#pragma header -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform highp mat3 u_displayViewMat3; -uniform mediump float u_zoomFactor; -uniform mediump vec2 u_lineTranslation; -uniform mediump float u_antialiasing; -uniform mediump float u_depth; -varying mediump vec2 v_normal; -varying highp float v_accumulatedDistance; -const float scale = 1.0 / 31.0; -const mediump float tileCoordRatio = 8.0; -#if defined (SDF) -const mediump float sdfPatternHalfWidth = 15.5; -#endif -#if defined (PATTERN) || defined(SDF) -uniform mediump vec2 u_mosaicSize; -varying mediump vec4 v_tlbr; -varying mediump vec2 v_patternSize; -varying mediump float v_widthRatio; -#endif -varying lowp vec4 v_color; -varying mediump float v_lineHalfWidth; -varying mediump float v_blur; -void main() -{ -#pragma main -v_color = color * opacity; -v_blur = blur + u_antialiasing; -v_normal = a_dir_normal.zw * scale; -#if defined (PATTERN) || defined(SDF) -v_tlbr = tlbr / u_mosaicSize.xyxy; -v_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w); -#if defined (PATTERN) -v_widthRatio = width / v_patternSize.y; -#else -v_widthRatio = width / sdfPatternHalfWidth / 2.0; -#endif -#endif -v_lineHalfWidth = (width + u_antialiasing) * 0.5; -mediump vec2 dir = a_dir_normal.xy * scale; -mediump vec2 offset_ = a_extrude_offset.zw * scale * offset; -mediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy; -mediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth, 1.0); -#if defined (PATTERN) || defined(SDF) -v_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_); -#endif -}`},outline:{"outline.frag":`varying lowp vec4 v_color; -varying mediump vec2 v_normal; -void main() -{ -lowp float dist = abs(v_normal.y); -lowp float alpha = smoothstep(1.0, 0.0, dist); -gl_FragColor = alpha * v_color; -}`,"outline.vert":`attribute vec2 a_pos; -attribute vec2 a_offset; -attribute vec2 a_xnormal; -#pragma header -varying lowp vec4 v_color; -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform mediump vec2 u_fillTranslation; -uniform mediump float u_depth; -uniform mediump float u_outline_width; -varying lowp vec2 v_normal; -const float scale = 1.0 / 15.0; -void main() -{ -#pragma main -v_color = color * opacity; -v_normal = a_xnormal; -mediump vec2 dist = u_outline_width * scale * a_offset; -mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth, 1.0); -}`},text:{"text.frag":`uniform lowp sampler2D u_texture; -varying lowp vec2 v_tex; -varying lowp vec4 v_color; -varying mediump float v_edgeWidth; -varying mediump float v_edgeDistance; -void main() -{ -lowp float dist = texture2D(u_texture, v_tex).a; -mediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist); -gl_FragColor = alpha * v_color; -}`,"text.vert":`attribute vec2 a_pos; -attribute vec2 a_vertexOffset; -attribute vec4 a_texAngleRange; -attribute vec4 a_levelInfo; -attribute float a_opacityInfo; -#pragma header -varying lowp vec4 v_color; -uniform highp mat3 u_dvsMat3; -uniform highp mat3 u_displayMat3; -uniform highp mat3 u_displayViewMat3; -uniform mediump vec2 u_textTranslation; -uniform vec2 u_mosaicSize; -uniform mediump float u_depth; -uniform mediump float u_mapRotation; -uniform mediump float u_level; -uniform lowp float u_keepUpright; -uniform mediump float u_fadeDuration; -varying lowp vec2 v_tex; -const float offsetPrecision = 1.0 / 8.0; -const mediump float edgePos = 0.75; -uniform mediump float u_antialiasingWidth; -varying mediump float v_edgeDistance; -varying mediump float v_edgeWidth; -uniform lowp float u_halo; -const float sdfFontScale = 1.0 / 24.0; -const float sdfPixel = 3.0; -uniform highp float u_time; -void main() -{ -#pragma main -if (u_halo > 0.5) -{ -v_color = halo_color * opacity; -halo_width *= sdfPixel; -halo_blur *= sdfPixel; -} -else -{ -v_color = color * opacity; -halo_width = 0.0; -halo_blur = 0.0; -} -float modded = mod(a_opacityInfo, 128.0); -float targetOpacity = (a_opacityInfo - modded) / 128.0; -float startOpacity = modded / 127.0; -float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); -v_color *= interpolatedOpacity; -mediump float a_angle = a_levelInfo[1]; -mediump float a_minLevel = a_levelInfo[2]; -mediump float a_maxLevel = a_levelInfo[3]; -mediump vec2 a_tex = a_texAngleRange.xy; -mediump float a_visMinAngle = a_texAngleRange.z; -mediump float a_visMaxAngle = a_texAngleRange.w; -mediump float delta_z = 0.0; -mediump float angle = mod(a_angle + u_mapRotation, 256.0); -if (a_visMinAngle < a_visMaxAngle) -{ -delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle))); -} -else -{ -delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle))); -} -delta_z += 1.0 - step(a_minLevel, u_level); -delta_z += step(a_maxLevel, u_level); -delta_z += step(v_color[3], 0.0); -v_tex = a_tex.xy / u_mosaicSize; -v_edgeDistance = edgePos - halo_width / size; -v_edgeWidth = (u_antialiasingWidth + halo_blur) / size; -mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0); -gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); -}`},util:{"encoding.glsl":`const vec4 rgba2float_factors = vec4( -255.0 / (256.0), -255.0 / (256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0), -255.0 / (256.0 * 256.0 * 256.0 * 256.0) -); -float rgba2float(vec4 rgba) { -return dot(rgba, rgba2float_factors); -}`,"util.glsl":`float nextPOT(in float x) { -return pow(2.0, ceil(log2(abs(x)))); -}`}};function Gs(r){let e=Vs;return r.split("/").forEach(t=>{e&&(e=e[t])}),e}const $s=new Ai(Gs);function V(r){return $s.resolveIncludes(r)}const Gt=r=>ke({PATTERN:r.pattern}),Hs={shaders:r=>({vertexShader:Gt(r)+V("background/background.vert"),fragmentShader:Gt(r)+V("background/background.frag")})},Ws={shaders:r=>({vertexShader:V("circle/circle.vert"),fragmentShader:V("circle/circle.frag")})},$t=r=>ke({PATTERN:r.pattern}),qs={shaders:r=>({vertexShader:$t(r)+V("fill/fill.vert"),fragmentShader:$t(r)+V("fill/fill.frag")})},js={shaders:r=>({vertexShader:V("outline/outline.vert"),fragmentShader:V("outline/outline.frag")})},Ht=r=>ke({SDF:r.sdf}),Xs={shaders:r=>({vertexShader:Ht(r)+V("icon/icon.vert"),fragmentShader:Ht(r)+V("icon/icon.frag")})},Wt=r=>ke({PATTERN:r.pattern,SDF:r.sdf}),Ys={shaders:r=>({vertexShader:Wt(r)+V("line/line.vert"),fragmentShader:Wt(r)+V("line/line.frag")})},Ks={shaders:r=>({vertexShader:V("text/text.vert"),fragmentShader:V("text/text.frag")})};let Js=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(r=>r.dispose()),this._programByKey.clear()}getMaterialProgram(r,e,t){const s=e.key<<3|this._getMaterialOptionsValue(e.type,t);if(this._programByKey.has(s))return this._programByKey.get(s);const i=this._getProgramTemplate(e.type),{shaders:a}=i,{vertexShader:o,fragmentShader:n}=a(t),l=e.getShaderHeader(),h=e.getShaderMain(),c=o.replace("#pragma header",l).replace("#pragma main",h),u=r.programCache.acquire(c,n,e.getAttributeLocations());return this._programByKey.set(s,u),u}_getMaterialOptionsValue(r,e){switch(r){case U.BACKGROUND:return(e.pattern?1:0)<<1;case U.FILL:return(e.pattern?1:0)<<1;case U.OUTLINE:return 0;case U.LINE:{const t=e;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1}case U.ICON:return(e.sdf?1:0)<<1;case U.CIRCLE:case U.TEXT:default:return 0}}_getProgramTemplate(r){switch(r){case U.BACKGROUND:return Hs;case U.CIRCLE:return Ws;case U.FILL:return qs;case U.ICON:return Xs;case U.LINE:return Ys;case U.OUTLINE:return js;case U.TEXT:return Ks;default:return null}}},yr=class{constructor(){this._initialized=!1}dispose(){this._program=z(this._program),this._vertexArrayObject=z(this._vertexArrayObject)}render(r,e,t,s){r&&(this._initialized||this._initialize(r),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.bindVAO(this._vertexArrayObject),r.useProgram(this._program),e.setSamplingMode(t),r.bindTexture(e,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindTexture(null,0),r.bindVAO())}_initialize(r){if(this._initialized)return!0;const e=Ee(r,kt);if(!e)return!1;const t=new Int8Array(16);t[0]=-1,t[1]=-1,t[2]=0,t[3]=0,t[4]=1,t[5]=-1,t[6]=1,t[7]=0,t[8]=-1,t[9]=1,t[10]=0,t[11]=1,t[12]=1,t[13]=1,t[14]=1,t[15]=1;const s=kt.attributes,i=new ur(r,s,ki,new Map([["geometry",hr.createVertex(r,cr.STATIC_DRAW,t)]]));return this._program=e,this._vertexArrayObject=i,this._initialized=!0,!0}};class Qs{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const s=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(s))return this._programByKey.get(s);const i={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,u)=>({...c,[u.name]:u.value}),{})},{vsPath:a,fsPath:o,attributes:n}=e,l=Wi(a,o,n,i),h=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!h)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(s,h),h}}let Zs=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(r){return this._resourceMap.get(r)??null}async fetchResource(r,e){const t=this._resourceMap.get(r);if(t)return{width:t.width,height:t.height};let s=this._inFlightResourceMap.get(r);return s?s.then(i=>({width:i.width,height:i.height})):(s=qi(r,e),this._inFlightResourceMap.set(r,s),s.then(i=>(this._inFlightResourceMap.delete(r),this._resourceMap.set(r,i),{width:i.width,height:i.height}),()=>({width:0,height:0})))}deleteResource(r){this._inFlightResourceMap.delete(r),this._resourceMap.delete(r)}loadFont(r){return Yr(r)}};const ea=512;let ta=class{constructor(r){this._resourceManager=r,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||(this._cachedRasterizationCanvas=document.createElement("canvas")),this._cachedRasterizationCanvas}rasterizeJSONResource(r){switch(r.type){case"dash":{const e=or(r.dashTemplate),[t,s,i]=Xi(e);return{size:[s,i],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case"fill-style":{const[e,t,s,i]=ji(this._canvas,r,Et);return{size:[t,s],image:new Uint32Array(e.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case"sdf":return qt(r);case"CIMHatchFill":case"CIMVectorMarker":case"CIMPictureMarker":return this._rasterizeCIMJSONResource(r)}}_rasterizeCIMJSONResource(r){switch(r.type){case"CIMHatchFill":{const e=le.fromCIMHatchFill(r,Et);return this._rasterizeCIMVectorMarker(e)}case"CIMPictureMarker":{const e=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(e)}case"CIMVectorMarker":{if(r.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"){const t=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(t)}const e=mi(r);return e&&!r.avoidSDFRasterization?qt(e):this._rasterizeCIMVectorMarker(r,!1,Si)}}}_rasterizeCIMVectorMarker(r,e=!0,t){const s=e?Kr.fromExtent(r.frame):null,[i,a,o,n,l]=le.rasterize(this._canvas,r,s,this._resourceManager,!0,t);return i?{size:[a,o],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!1,anchorX:n,anchorY:l}:null}rasterizeImageResource(r,e,t,s){this._canvas.width=r,this._canvas.height=e;const i=this._canvas.getContext("2d",{willReadFrequently:!0});t instanceof ImageData?i.putImageData(t,0,0):(t.setAttribute("width",`${r}px`),t.setAttribute("height",`${e}px`),i.drawImage(t,0,0,r,e));const a=i.getImageData(0,0,r,e),o=new Uint8Array(a.data);if(s){for(const d of s)if(d&&d.oldColor&&d.oldColor.length===4&&d.newColor&&d.newColor.length===4){const[p,_,m,y]=d.oldColor,[g,f,x,b]=d.newColor;if(p===g&&_===f&&m===x&&y===b)continue;for(let v=0;v=u||c>=u){const d=h/c;d>1?(h=u,c=Math.round(u/d)):(c=u,h=Math.round(u*d)),l=new Uint8Array(4*h*c);const p=new Uint8ClampedArray(l.buffer);di(o,r,e,p,h,c,!1)}return{size:[h,c],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};function qt(r){if(!r)return null;const{data:e,width:t,height:s,sdfPaddingRatio:i,sdfDecodeCoeff:a}=_i(r);return e?{size:[t,s],image:new Uint32Array(e.buffer),sdf:!0,simplePattern:!0,sdfPaddingRatio:i,sdfDecodeCoeff:a,anchorX:0,anchorY:0}:null}let ze=class{constructor(r,e){this._width=0,this._height=0,this._free=[],this._width=r,this._height=e,this._free.push(new H(0,0,r,e))}get width(){return this._width}get height(){return this._height}allocate(r,e){if(r>this._width||e>this._height)return new H;let t=null,s=-1;for(let i=0;ir&&this._free.push(new H(t.x+r,t.y,t.width-r,e)),t.height>e&&this._free.push(new H(t.x,t.y+e,t.width,t.height-e))):(t.width>r&&this._free.push(new H(t.x+r,t.y,t.width-r,t.height)),t.height>e&&this._free.push(new H(t.x,t.y+e,r,t.height-e))),new H(t.x,t.y,r,e))}release(r){for(let e=0;eMath.floor(r/256);function sa(r){const e=new Set;for(const t of r)e.add(ia(t));return e}function aa(r,e,t){return r.has(e)||r.set(e,t().then(()=>{r.delete(e)}).catch(s=>{r.delete(e),Nr(s)})),r.get(e)}const oa=r=>({rect:new H(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:r,sdf:!0});let na=class{constructor(r,e,t){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=r,this.height=e,this._glyphSource=t,this._binPack=new ze(r-4,e-4),this._glyphData.push(new Uint8Array(r*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const r of this._textures)r&&r.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const r=[117,149,181,207,207,181,149,117],e=[],t=[];for(let a=0;a=3&&a<5&&n>=3&&n<8?255:0;e.push(o),t.push(l)}}const s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},i={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)};this._recordGlyph(s),this._recordGlyph(i)}getTexture(r,e){if(!this._textures[e]){const t=new k;t.pixelFormat=A.ALPHA,t.wrapMode=F.CLAMP_TO_EDGE,t.width=this.width,t.height=this.height,this._textures[e]=new J(r,t,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(r,e,t){const s=this._getGlyphCache(r);return await this._fetchRanges(r,e,t),e.map(i=>this._getMosaicItem(s,r,i))}bind(r,e,t,s){const i=this.getTexture(r,t);i.setSamplingMode(e),r.bindTexture(i,s)}preloadASCIIGlyphCache(r){const e=this._preloadCache[r];if(e!=null)return e;const t=this._glyphSource.preloadASCIIRange(r).then(()=>{const s=this._getGlyphCache(r);for(let i=0;i<256;i++)this._getMosaicItem(s,r,i)});return this._preloadCache[r]=t,t}_getGlyphCache(r){return this._glyphCache[r]||(this._glyphCache[r]={}),this._glyphCache[r]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(r,e,t){const s=sa(e),i=[];s.forEach(a=>{i.push(this._fetchRange(r,a,t))}),await Promise.all(i)}async _fetchRange(r,e,t){if(e>ra)return;const s=r+e;return aa(this._rangePromises,s,()=>this._glyphSource.getRange(r,e,t))}_getMosaicItem(r,e,t){if(!r[t]){const s=this._glyphSource.getGlyph(e,t);if(!s?.metrics)return oa(t);const i=this._recordGlyph(s),a=this._currentPage,o=s.metrics;r[t]={rect:i,page:a,metrics:o,code:t,sdf:!0},this._invalidate()}return r[t]}_recordGlyph(r){const e=r.metrics;let t;if(e.width===0)t=new H(0,0,0,0);else{const s=e.width+6,i=e.height+2*3;t=this._binPack.allocate(s,i),t.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new ze(this.width-4,this.height-4),t=this._binPack.allocate(s,i));const a=this._glyphData[this._currentPage],o=r.bitmap;let n,l;if(o)for(let h=0;h{s.addRange(e,new jt(new Bt(new Uint8Array(n.data),new DataView(n.data))))})}async preloadASCIIRange(r){const e=this._getFontStack(r),t=0,s=255,i=this._baseURL.replace("{fontstack}",r).replace("{range}",t+"-"+s),a=await ge(i,{responseType:"array-buffer"}),o=new jt(new Bt(new Uint8Array(a.data),new DataView(a.data)));for(let n=t;n<=s;n++)e.getRange(n)||e.addRange(n,o)}getGlyph(r,e){const t=this._getFontStack(r);if(!t)return;const s=Math.floor(e/256),i=t.getRange(s);return i?{metrics:i.getMetrics(e),bitmap:i.getBitmap(e)}:void 0}_getFontStack(r){let e=this._glyphInfo[r];return e||(e=this._glyphInfo[r]=new la),e}};const me=1e20;let ca=class{constructor(r,e=2){this._textureSize=r,this._rasterizationScale=e,this._canvasSize=this._textureSize*this._rasterizationScale,this._svg=null;const{_canvasSize:t}=this,s=document.createElement("canvas");s.width=s.height=t,this._context=s.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(t*t),this._gridInner=new Float64Array(t*t),this._f=new Float64Array(t),this._d=new Float64Array(t),this._z=new Float64Array(t+1),this._v=new Int16Array(t)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg=Jr(this._svg)}draw(r,e,t){const{_canvasSize:s,_textureSize:i,_rasterizationScale:a}=this,o=i/4;this._initSVG();const n=this.createSVGString(r,e);return new Promise((l,h)=>{const c=new Image;c.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),c.onload=()=>{c.onload=null,this._context.clearRect(0,0,s,s),this._context.drawImage(c,0,0,s,s);const d=this._context.getImageData(0,0,s,s),p=new Uint8Array(i*i*4);for(let _=0;_h(Lr()))})}_initSVG(){return this._svg||(this._svg=Qr()),this._svg}createSVGString(r,e){const t=this._initSVG(),s=Zr("path");s.setAttribute("d",r),t.appendChild(s);const i=s.getBBox(),a=i.width/i.height,o=this._canvasSize/2;let n,l,h;if(a>1){n=o/i.width;const p=o*(1/a);l=this._canvasSize/4,h=o-p/2}else n=o/i.height,l=o-o*a/2,h=this._canvasSize/4;const c=-i.x*n+l,u=-i.y*n+h;s.setAttribute("style",`transform: matrix(${n}, 0, 0, ${n}, ${c}, ${u})`),s.setAttribute("stroke-width",""+.5/n);const d=`${t.innerHTML}`;return t.removeChild(s),d}_edt(r,e,t){const s=this._f,i=this._d,a=this._v,o=this._z;for(let n=0;n0&&(this._maxItemSize=s),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new ze(this._pageWidth,this._pageHeight);const i=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(i*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],s=t.mosaicsData;if(!te(t.mosaicsData))throw new fe("mapview-invalid-resource","unsuitable data type!");const i=e.spriteData,a=s.data;vr._copyBits(i,e.spriteSize[0],0,0,a,e.pageSize[0],e.rect.x+Z,e.rect.y+Z,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Z,t+=2*Z;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize{this._frameData=a,e.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=es(this._animation,t,s,i)}destroy(){this._playHandle.remove()}loadFrame(r){const e=this._frameData;if(e==null)return;const t="width"in e?e.width:e.codedWidth,s="height"in e?e.height:e.codedHeight;r.updateData(0,Z,Z,t,s,e),this._frameData=null}},ma=class{constructor(){this._entries=new fa,this._nodes=new Map,this._book=new ga}add(r){let e=this._entries.get(r);if(!e){const t=this._book.add(r),s=new Object;e={location:t,references:0,handle:s};const i=this._entries.set(r,e);this._nodes.set(s,i)}return e.references++,e}remove(r){const e=this._nodes.get(r.handle);e&&e.payload&&(e.payload.references--,e.payload.references===0&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(r.handle)))}getTexture(r,e){return this._book.getTexture(r,e)}destroy(){this._book.destroy()}},_a=class br{constructor(e,t){this.parent=e,this.key=t,this.payload=null,this._children=new Map}get(e){return this._children.get(e)}ensure(e){let t=this._children.get(e);return t||(t=new br(this,e),this._children.set(e,t)),t}delete(e){this._children.delete(e)}},fa=class{constructor(){this._root=new _a(null,NaN)}set(r,e){let t=this._root;for(const s of r)for(const i of s)t=t.ensure(i);return t.payload=e,t}delete(r){r.parent?.delete(r.key)}get(r){let e=this._root;for(const t of r)for(const s of t){const i=e.get(s);if(!i)return;e=i}return e.payload||void 0}},ga=class{constructor(){this._pages=[]}add(r){this._pages.length===0&&this._pages.push(new Yt);let e=this._pages.length-1,t=this._pages[e].add(r);if(t||(this._pages.push(new Yt),e=this._pages.length-1,t=this._pages[e].add(r)),!t)throw new Error("Data allocation failed.");return{...t,page:e}}remove(r){this._pages[r.page].remove(r)}getTexture(r,e){return this._pages[e].getTexture(r)}destroy(){}},Yt=class{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(r){if(r.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=r.length,e.column>=this._columns&&(e.column=r.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const t={...this._cursor};t.column-=r.length;let s=4*(t.row*this._columns+t.column);for(let i=0;ist.getLogger("esri.views.2d.engine.webgl.TextureManager"),re=(r,e,t)=>ya().error(new fe(r,e,t));let va=class wr{static fromMosaic(e,t){return new wr(e,t.page,t.sdf)}constructor(e,t,s){this.mosaicType=e,this.page=t,this.sdf=s}};class ba{constructor(e){this._requestRender=e,this._resourceManager=new Zs,this._invalidFontsMap=new Map,this._sdfConverter=new ca(Ne),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new ts({concurrency:10,process:async(t,s)=>{it(s);try{return await ge(t,{responseType:"image",signal:s})}catch(i){throw vt(i)?i:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,i)}}}),this.animationStore=new ma,this._spriteMosaic=new ua(2048,2048,500),this._glyphSource=new ha(`${Fr.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new na(1024,1024,this._glyphSource),this._rasterizer=new ta(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return re("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type==="animation-info"){const{resource:a}=e,o=this.animationStore.add(a),{location:n}=o;return{rect:new H(n.column,n.row,a.length,1),page:n.page,type:"sprite",width:a.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,sdfDecodeCoeff:1,simplePattern:!1}}if(e.type!=="cim-rasterization-info")return re("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:s}=e;if(s.type==="text"){const a=await this._rasterizeText(s,t);for(const o of a.glyphs)this._setTextureBinding(we.GLYPH,o);return a}const i=await this._rasterizeSprite(s,t);return i&&this._setTextureBinding(we.SPRITE,i),i}getMosaicInfo(e,t,s=!1){const i=this._getTextureBindingInfo(e,t,s);return i?{size:i.size,texture:{texture:i.texture,unit:i.type==="sprite"?gi:Ot}}:(re("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,s){const i=this._bindingInfos[t-1],a=i.page,o=s?q.LINEAR_MIPMAP_LINEAR:q.LINEAR;switch(i.mosaicType){case we.SPRITE:{const n=[this.sprites.getWidth(a),this.sprites.getHeight(a)],l=this._spriteMosaic.getTexture(e,a);return l.setSamplingMode(o),{type:"sprite",texture:l,size:n}}case we.GLYPH:{const n=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,a);return this._glyphMosaic.bind(e,o,a,Ot),l.setSamplingMode(o),{type:"glyph",texture:l,size:n}}default:return re("mapview-texture-manager",`Cannot handle unknown type ${i.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const s=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(s)){const i=va.fromMosaic(e,t),a=this._bindingInfos.length+1;this._hashToBindingIndex.set(s,a),this._bindingInfos.push(i)}t.textureBinding=this._hashToBindingIndex.get(s)}async _rasterizeText(e,t){const{font:s,textString:i}=e,a=jr(s),o=this._invalidFontsMap.has(a),[n,l]=Xr(i),h=Ji(n);try{const c=o?Kt:a;return K("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,h,t),isRightToLeft:l}}catch{return re("mapview-invalid-resource",`Couldn't find font ${a}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(a,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Kt,h,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${or(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(Qi(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const s=ir(this._hashSpriteResource(e));if(this._spriteMosaic.has(s))return this._spriteMosaic.getSpriteItem(s);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const i=[];le.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,i),i.length>0&&await Promise.all(i)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(s,e):this._handleAsyncResource(s,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(s,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(s,e)}}_rasterizeJSONResource(e,t){const s=this._rasterizer.rasterizeJSONResource(t);if(s){const{size:i,image:a,sdf:o,simplePattern:n,rasterizationScale:l,sdfPaddingRatio:h,sdfDecodeCoeff:c}=s;return this._addItemToMosaic(e,i,{type:"static",data:a},Se(t),o,n,l,h,c)}return null}async _handleAsyncResource(e,t,s){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let i;return i=t.type==="path"?this._handleSVG(t,e,s):this._handleImage(t,e,s),this._ongoingRasterizations.set(e,i),i.finally(()=>this._ongoingRasterizations.delete(e)),i}async _handleSVG(e,t,s){const i=[Ne,Ne],{asFill:a}=e,o=await this._sdfConverter.draw(e.path,a,s);return this._addItemToMosaic(t,i,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,s){const i=e.url,a=this.resourceManager.getResource(i);if(a==null)return null;const{width:o,height:n}=a;if(a instanceof HTMLImageElement){if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const d="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:p,sdf:_,image:m}=this._rasterizer.rasterizeImageResource(o,n,a,d);return this._addItemToMosaic(t,p,{type:"static",data:m},Se(e),_,!1)}let l,h,c;e.type==="animated"?(l=!1,h={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=Se(e),h={type:"CIMAnimatedSymbolProperties"},c=0);const u=new pa(a,this._requestRender,h,c);return this._addItemToMosaic(t,[u.width,u.height],{type:"animated",data:u},l,!1,!1)}async _handleImage(e,t,s){const i=e.url;if(xa(i)||Sa(i))return this._handleGIFOrPNG(e,t,s);if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let a;const o=this.resourceManager.getResource(i);if(o!=null&&o instanceof HTMLImageElement)a=o;else{const{data:p}=await this._imageRequestQueue.push(i,{...s});a=p}if(Zi(i)){if("width"in e&&"height"in e)a.width=se(e.width),a.height=se(e.height);else if("cim"in e){const p=e;a.width=se(p.width??p.scaleX*p.size),a.height=se(p.size)}}if(!a.width||!a.height)return null;const n=a.width,l=a.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:u,image:d}=this._rasterizer.rasterizeImageResource(n,l,a,h);return this._addItemToMosaic(t,c,{type:"static",data:d},Se(e),u,!1)}catch(a){throw vt(a)?a:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${i}. ${a.message}`)}}_addItemToMosaic(e,t,s,i,a,o,n,l,h){return this._spriteMosaic.addSpriteItem(e,t,s,i,a,o,n,l,h)}}function Se(r){switch(r.type){case"CIMVectorMarker":case"CIMPictureMarker":return Pa(r);default:return!0}}const wa=r=>r!=null&&r.startsWith("data:image/gif"),xa=r=>r&&(r.includes(".gif")||wa(r)),Ma=r=>r!=null&&r.startsWith("data:image/png"),Sa=r=>r&&(r.includes(".png")||Ma(r)),Pa=r=>r&&"markerPlacement"in r&&r.markerPlacement&&r.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Ca=class{constructor(r){this._queue=[],this._refreshable=r}destroy(){this._queue=[]}enqueueTextureUpdate(r,e){const t=kr(),s=r,i=Pi,a=Math.ceil(s.height/i);it(e);for(let o=0;ot.reject(o)),t.promise}upload(){let r=0;for(;this._queue.length;){const e=performance.now(),t=this._queue.shift();if(t){if(t.options.signal!=null&&t.options.signal.aborted)continue;switch(t.type){case"chunk":this._uploadChunk(t);break;case"no-chunk":this._uploadNoChunk(t)}const s=performance.now()-e;if(r+=s,r+s>=yi)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(r){const{request:e,resolver:t,chunkOffset:s,chunkIsLast:i,destHeight:a}=r,{data:o,texture:n,width:l}=e;o!=null&&(n.updateData(0,0,s,l,a,o,s),i&&t.resolve())}_uploadNoChunk(r){const{request:e,resolver:t}=r,{data:s,texture:i}=e;i.setData(s),t.resolve()}};const Oa=ns(-.5,-.5);class Ta{constructor(){this._centerNdc=Be(),this._pxToNdc=Be(),this._worldDimensionsPx=Be(),this._mat3=Fe(),this._initialized=!1}dispose(){this._program=z(this._program),this._quad=z(this._quad)}render(e,t,s){const{context:i}=e,a=this._updateGeometry(e,s);if(t!=null){const{r:o,g:n,b:l,a:h}=t;i.setClearColor(h*o/255,h*n/255,h*l/255,h)}else i.setClearColor(0,0,0,0);if(i.setStencilFunction(tt.ALWAYS,0,255),i.setStencilWriteMask(255),!a)return i.setClearStencil(et),void i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT);i.setClearStencil(vi),i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(Ve.KEEP,Ve.KEEP,Ve.REPLACE),i.setStencilFunction(tt.ALWAYS,et,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.bind(),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=Ee(e,Li);t&&(this._program=t,this._quad=new ye(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:s,pixelRatio:i}=e,{size:a,rotation:o}=s,n=Math.round(a[0]*i),l=Math.round(a[1]*i);if(!s.spatialReference.isWrappable)return!1;const h=rs(o),c=Math.abs(Math.cos(h)),u=Math.abs(Math.sin(h)),d=Math.round(n*c+l*u),p=Math.round(i*s.worldScreenWidth);if(d<=p)return!1;const _=n*u+l*c,m=(t.left-t.right)*i/n,y=(t.bottom-t.top)*i/l;Ge(this._worldDimensionsPx,p,_,1),Ge(this._pxToNdc,2/n,-2/l,1),Ge(this._centerNdc,m,y,1);const g=this._mat3;return as(g,this._centerNdc),Dt(g,g,this._pxToNdc),o!==0&&pr(g,g,h),Dt(g,g,this._worldDimensionsPx),dr(g,g,Oa),!0}}let Ra=class extends ot{constructor(){super(...arguments),this.type=at.Blend,this._backBufferTexture=null,this.shaders={blend:new Ni,opacity:new Ui}}shutdown(){super.shutdown(),this._backBufferTexture!==null&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(r,e){const{context:t,state:s,pixelRatio:i,inFadeTransition:a,painter:o}=r,{size:n}=s,l=t.getBoundFramebufferObject();let h,c;l!=null?(h=l.width,c=l.height):(h=Math.round(i*n[0]),c=Math.round(i*n[1]));const{blendMode:u}=e;if(u==="normal"){const y={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:e.colorTexture,unit:0},opacity:e.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return o.setPipelineState(nt),void o.submitDrawMesh(t,y,o.quadMesh)}const d=this._createOrResizeTexture(r,h,c);l.copyToTexture(0,0,h,c,0,0,d);const p={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:w.ONE,dstRGB:w.ZERO,srcAlpha:w.ONE,dstAlpha:w.ZERO}},depth:!1,stencil:!1};o.setPipelineState(p);const _={backbufferTexture:{texture:d,unit:0},layerTexture:{texture:e.colorTexture,unit:1},inFadeOpacity:a?1:0,...e.config},m={shader:this.shaders.blend,uniforms:{config:_},defines:{blendMode:u},optionalAttributes:null,useComputeBuffer:!1};o.submitDrawMesh(t,m,o.quadMesh)}_createOrResizeTexture(r,e,t){const{context:s}=r;if(this._backBufferTexture!==null&&this._backBufferTexture.descriptor?.width===e&&this._backBufferTexture.descriptor?.height===t)return this._backBufferTexture;if(this._backBufferTexture===null){const i=new k;i.internalFormat=A.RGBA,i.wrapMode=F.CLAMP_TO_EDGE,i.width=e,i.height=t,this._backBufferTexture=new J(s,i)}else this._backBufferTexture.resize(e,t);return this._backBufferTexture}},Ea=class{constructor(){this._blendTechnique=new Ra}dispose(r){this._blendTechnique?.shutdown()}draw(r,e,t,s,i){this._blendTechnique.render(r,{colorTexture:e,config:{opacity:i,samplingMode:t},blendMode:s})}},ut=class{constructor(){this.name=this.constructor.name}createOptions(r,e){return null}},Jt=class extends ut{constructor(r){super(),this.name=this.constructor.name,this.defines=[r]}dispose(){}bind({context:r,painter:e}){this._prev=r.getBoundFramebufferObject();const t=e.getFbos().effect0;r.bindFramebuffer(t),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(r.gl.COLOR_BUFFER_BIT)}unbind(){}draw(r,e){const{context:t,painter:s}=r,i=s.getPostProcessingEffects(e),a=t.getBoundFramebufferObject();for(const{postProcessingEffect:o,effect:n}of i)o.draw(r,a,n);t.bindFramebuffer(this._prev),t.setStencilTestEnabled(!1),s.blitTexture(t,a.colorTexture,q.NEAREST),t.setStencilTestEnabled(!0)}},za=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",$r),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}finalBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Hr),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}renderHighlight(r,e,t){r.bindTexture(e,pe),r.useProgram(this._resources.highlightProgram),t.applyHighlightOptions(r,this._resources.highlightProgram),r.bindVAO(this._resources.quadVAO),r.setBlendingEnabled(!0),r.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}_initialize(r,e,t){this._width=e,this._height=t;const s=hr.createVertex(r,cr.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),i=new ur(r,new Map([["a_position",0],["a_texcoord",1]]),new Map([["geometry",[new Lt("a_position",2,It.BYTE,0,4),new Lt("a_texcoord",2,It.UNSIGNED_BYTE,2,4)]]]),new Map([["geometry",s]])),a=Ee(r,Vi),o=Ee(r,Gi);r.useProgram(a),a.setUniform1i("u_texture",pe),a.setUniform1i("u_shade",Ci),a.setUniform1f("u_sigma",bt),r.useProgram(o),o.setUniform1i("u_texture",pe),o.setUniform1f("u_sigma",bt),this._resources={quadGeometry:s,quadVAO:i,highlightProgram:a,blurProgram:o}}setup(r,e,t){this._resources?(this._width=e,this._height=t):this._initialize(r,e,t)}};function Qt(r,e,t){const s=new k(e,t);return s.wrapMode=F.CLAMP_TO_EDGE,new X(r,s,new ct(lt.STENCIL_INDEX8,e,t))}let Fa=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,t){this._width=e,this._height=t;const s=Qt(r,e,t),i=Qt(r,e,t);this._resources={sharedBlur1Fbo:s,sharedBlur2Fbo:i}}setup(r,e,t){!this._resources||this._width===e&&this._height===t||this.dispose(),this._resources||this._initialize(r,e,t)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const ie=4,Pe=4/ie;let ka=class extends ut{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new za,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Fa,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new yr}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(r){const{context:e,painter:t}=r,{width:s,height:i}=e.getViewport(),a=t.getFbos().effect0;this.setup(r,s,i),e.bindFramebuffer(a),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:r},e,t){this._width=e,this._height=t;const s=e%ie,i=t%ie;e+=sl.resolve([]));const a=i.getFBO(t),o=new Uint8Array(a.width*a.height*4);try{await a.readPixelsAsync(0,0,a.width,a.height,A.RGBA,ht.UNSIGNED_BYTE,o)}catch{return void e.forEach(l=>l.resolve([]))}const n=[];for(let l=0;ll.resolve(n))}};const Xe=5,Ia=[1,0],Ba=[0,1],Da=[1,.8,.6,.4,.2],La=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Na=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(Xe),this._nMips=Xe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=z(this._quad),this._intensityFBO=z(this._intensityFBO),this._compositeFBO=z(this._compositeFBO),this._mipsFBOs){for(let r=0;rnew $a,blur:()=>new Ga,bloom:()=>new Na,opacity:()=>new ja,"drop-shadow":()=>new qa};let Ka=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(r=>r.dispose()),this._effectMap.clear()}getPostProcessingEffects(r){if(!r||r.length===0)return[];const e=[];for(const t of r){const s=Xa(t.type);let i=this._effectMap.get(s);i||(i=Ya[s](),this._effectMap.set(s,i)),e.push({postProcessingEffect:i,effect:t})}return e}},Ja=class{constructor(r,e){this.brushes=r,this.name=e.name,this.drawPhase=e.drawPhase||W.MAP,this._targetFn=e.target,this.effects=e.effects||[],this.enableDefaultDraw=e.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!e.forceDrawByDisplayOrder}render(r){const{context:e,profiler:t}=r,s=this._targetFn(),i=this.drawPhase&r.drawPhase;if(t.recordPassStart(this.name),i){this.enableDefaultDraw()&&this._doRender(r,s),t.recordPassEnd();for(const a of this.effects){if(!a.enable())continue;const o=a.apply,n=a.args?.(),l=e.getViewport(),h=e.getBoundFramebufferObject(),c=r.passOptions;this._bindEffect(r,o,n),this._doRender(r,s,o.defines),this._drawAndUnbindEffect(r,o,l,h,c,n)}}}_doRender(r,e,t){if(e==null)return;const{profiler:s,context:i}=r;for(const a of this.brushes){if(s.recordBrushStart(a.name),a.brushEffect!=null){const o=i.getViewport(),n=i.getBoundFramebufferObject(),l=r.passOptions;this._bindEffect(r,a.brushEffect),this._drawWithBrush(a,r,e,t),this._drawAndUnbindEffect(r,a.brushEffect,o,n,l)}else this._drawWithBrush(a,r,e,t);s.recordBrushEnd()}}_drawWithBrush(r,e,t,s){Ir(t)?(r.prepareState(e,s),r.drawMany(e,t,s)):t.visible&&(r.prepareState(e,s),r.draw(e,t,s))}_bindEffect(r,e,t){const{profiler:s}=r;s.recordPassStart(this.name+"."+e.name),e.bind(r,t);const i=e.createOptions(r,t);r.passOptions=i}_drawAndUnbindEffect(r,e,t,s,i,a){const{profiler:o,context:n}=r;r.passOptions=i,o.recordBrushStart(e.name),e.draw(r,a),e.unbind(r,a),n.bindFramebuffer(s);const{x:l,y:h,width:c,height:u}=t;n.setViewport(l,h,c,u),o.recordBrushEnd(),o.recordPassEnd()}};class Zt{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,s,i,a){const o=e.getShaderKey(t,s,i,a);let n=this._programCache.get(o);return n||(n=e.getProgram(t,s,i,a),this._programCache.set(o,n)),n}}let Qa=class{constructor(r,e){this.context=r,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new yr,this._worldExtentRenderer=new Ta,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Js,this._blendEffect=new Ea,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new ka,hittest:new Aa,insideEffect:new Jt("inside"),outsideEffect:new Jt("outside")},this._programCache=new Zt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Qs(r),this.textureManager=new ba(e),this.textureUploadManager=new Ca(e),this._effectsManager=new Ka,this._quadMesh=ri.fromVertexStream(r,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=z(this._blitRenderer),this._worldExtentRenderer=z(this._worldExtentRenderer),this._quadMesh=rt(this._quadMesh),this._brushCache&&(this._brushCache.forEach(r=>r.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let r;for(r in this._fbos)this._fbos[r]&&this._fbos[r].dispose()}for(const r of this._fboPool)r.dispose();if(this._fboPool.length=0,this.effects){let r;for(r in this.effects)this.effects[r]&&this.effects[r].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=z(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new Zt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(r,e){let t;if(this._fboPool.length>0)t=this._fboPool.pop();else{const s=new k(r,e);s.samplingMode=q.NEAREST,s.wrapMode=F.CLAMP_TO_EDGE,t=new X(this.context,s,this._stencilBuf)}return t.width===r&&t.height===e||t.resize(r,e),t}releaseFbo(r){this._fboPool.push(r)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(r,e,t){const{context:s}=r;this._worldExtentRenderer.render(r,e,t);const{width:i,height:a}=s.getViewport();if(this.updateFBOs(i,a),this._prevFBO=s.getBoundFramebufferObject(),s.bindFramebuffer(this.getFbos().output),s.setColorMask(!0,!0,!0,!0),e!=null){const{r:o,g:n,b:l,a:h}=e;s.setClearColor(h*o/255,h*n/255,h*l/255,h)}else s.setClearColor(0,0,0,0);s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}afterRenderPhases(r){const{context:e}=r;e.bindFramebuffer(this._prevFBO),e.setStencilFunction(tt.EQUAL,et,255),e.setStencilTestEnabled(!0),e.setDepthTestEnabled(!1),this.blitTexture(e,this.getFbos().output.colorTexture,q.NEAREST)}beforeRenderLayer(r,e,t){const{context:s,blendMode:i,effects:a,drawPhase:o,requireFBO:n}=r;if(n||er(o,i,a,t)){const l=s.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(l);const{width:h,height:c}=s.getViewport(),u=this.acquireFbo(h,c);s.bindFramebuffer(u),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}s.setDepthWriteEnabled(!1),s.setDepthTestEnabled(!1),s.setStencilTestEnabled(!0),s.setClearStencil(e),s.setStencilWriteMask(255),s.clear(s.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(r,e){const{context:t,blendMode:s,effects:i,requireFBO:a,drawPhase:o}=r;if(a||er(o,s,i,e)){const n=t.getBoundFramebufferObject();i!=null&&i.length>0&&o===W.MAP&&(t.setColorMask(!0,!0,!0,!0),this._applyEffects(r,i,n)),t.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),t.setStencilTestEnabled(!1),t.setStencilWriteMask(0),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const l=s==null||o===W.HIGHLIGHT||o===W.LABEL?"normal":s;this._blendEffect.draw(r,n.colorTexture,q.NEAREST,l,e),this.releaseFbo(n)}}renderObject(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.prepareState(r),a.draw(r,e,s)}renderObjects(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.drawMany(r,e,s)}registerRenderPass(r){const e=r.brushes.map(t=>(this._brushCache.has(t)||this._brushCache.set(t,new t),this._brushCache.get(t)));return new Ja(e,r)}blitTexture(r,e,t,s=1){r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(r,e,t,s),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(r){return this._effectsManager.getPostProcessingEffects(r)}updateFBOs(r,e){if(r!==this._lastWidth||e!==this._lastHeight){if(this._lastWidth=r,this._lastHeight=e,this._fbos){let i;for(i in this._fbos)this._fbos[i].resize(r,e);return}const t=new k(r,e);t.samplingMode=q.NEAREST,t.wrapMode=F.CLAMP_TO_EDGE;const s=new ct(lt.DEPTH_STENCIL,r,e);this._stencilBuf=new ls(this.context,s),this._fbos={output:new X(this.context,t,this._stencilBuf),effect0:new X(this.context,t,this._stencilBuf)}}}_applyEffects(r,e,t){const{context:s}=r,i=this._effectsManager.getPostProcessingEffects(e);for(const{postProcessingEffect:a,effect:o}of i)s.bindFramebuffer(t),a.draw(r,t,o);this._currentPipelineStateNeedsUpdate=!0}setShader(r){this._shaderState.shader=r.shader,this._shaderState.uniforms=r.uniforms,this._shaderState.defines=r.defines,this._shaderState.optionalAttributes=r.optionalAttributes,this._shaderState.useComputeBuffer=r.useComputeBuffer??!1}setPipelineState(r){r!==this._currentPipelineState&&(this._currentPipelineState=r,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(r,e){const{shader:t,uniforms:s,defines:i,optionalAttributes:a}=this._shaderState,o=r.context,n=e.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(t,n,s,i??{},a??{});return l.setUniforms(s),l.bind(o),this.updatePipelineState(o),this.setStencilRef(o,e),e.draw(r,t.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(r,e,t,s){this.submitDrawMeshUntyped(r,e,t,s)}submitDrawMeshUntyped(r,e,t,s){this.setShader(e);const{shader:i,uniforms:a,defines:o,optionalAttributes:n}=this._shaderState,l=this._programCache.getProgram(i,{},a,o??{},n??{});if(l.setUniforms(a),l.bind(r),this.updatePipelineState(r),s)for(const h of s)t.bind(r,h),t.draw(r);else for(let h=0;h0)}let Za=class{constructor(){this._candidateTiles=[]}schedule(r){this._candidateTiles.includes(r)||this._candidateTiles.push(r)}reshuffle(r){const e=[];for(const t of this._candidateTiles)r>0?(t.reshuffle(),r--):e.push(t);this._candidateTiles=e}};const eo=2e3;class Rl extends Oi{constructor(e,t){super(),this.meshWriterRegistry=new hs,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=Ur(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new Za,this._canvas=new Us(e),this.context=new Hi(this._canvas.gl,t.contextOptions??{}),this.painter=new Qa(this.context,this),this._cimAnalyzer=new Bs(this.painter.textureManager.resourceManager),K("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const s=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new Vr,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new Ii(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return s()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=xr({render:i=>this.renderFrame(i)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",i=>this.emit("webgl-error",{error:new fe("webgl-context-lost",i.statusMessage)})),this._bufferPool=new Fi,ei()}destroy(){ti(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=dt(this._taskHandle),this._lostWebGLContextHandle=dt(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=eo,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Fe()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(fi),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=W.MAP;for(const i of e)i.processRender(t);if(this.children.some(i=>i.hasHighlight)){t.drawPhase=W.HIGHLIGHT;for(const i of e)i.processRender(t)}if(this.children.some(i=>i.hasLabels)){t.drawPhase=W.LABEL;for(const i of e)i.processRender(t)}if(K("esri-tiles-debug")){t.drawPhase=W.DEBUG;for(const i of e)i.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo()}doRender(e){const t=this.context,{state:s,pixelRatio:i}=e;this._canvas.resize(e),t.setViewport(0,0,i*s.size[0],i*s.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,s,i){const a=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,l=this.context,h=this._state.clone();if(i!=null){const f=h.viewpoint;h.viewpoint.rotation=i,h.viewpoint=f}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:s},u=new k(a,o);u.wrapMode=F.CLAMP_TO_EDGE,u.internalFormat=$i.RGBA8,u.isImmutable=!0;const d=new X(l,u,new ct(lt.DEPTH_STENCIL,a,o)),p=l.getBoundFramebufferObject(),_=l.getViewport();l.bindFramebuffer(d),l.setViewport(0,0,a,o),this._renderChildren(t??this.children,c);const m=this._readbackScreenshot(d,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(p),l.setViewport(_.x,_.y,_.width,_.height),this.requestRender();const y=await m;let g;return e.outputScale===1?g=y:(g=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),(await Te(()=>import("./MapView-BGOJJ8ch-MH2z-up5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(f=>f.U)).resampleHermite(y,g,!0)),d.dispose(),g}async _readbackScreenshot(e,t){const s=(await Te(()=>import("./MapView-BGOJJ8ch-MH2z-up5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(i=>i.U)).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,A.RGBA,ht.UNSIGNED_BYTE,new Uint8Array(s.data.buffer)),s}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}let to=class extends ot{constructor(){super(...arguments),this.type=at.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new Bi}}updateResources(r,e,t,s){r.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(r,e,t,s);const{context:i,pixelRatio:a}=r,{factor:o,offset:n,position:l}=s,{size:h}=r.state,c=s.size*a,u=1/o,d=Math.ceil(u*c);this._readbackTexture.resize(d,d);const p=a*h[0],_=a*h[1],m=.5*d,y=.5*d,g=mt(a*l.x,m,p-m-1),f=mt(_-a*l.y,y,_-y-1),x=g-m,b=f-y,v=this._readbackTexture;i.bindTexture(v,0),i.gl.copyTexImage2D(v.descriptor.target,0,v.descriptor.pixelFormat,x,b,d,d,0);const M=(g+n.x*a)/p*2-1,C=(f-n.y*a)/_*2-1,T=c/p*2,G=c/_*2;this._position[0]=M,this._position[1]=C,this._position[2]=T,this._position[3]=G}render(r,e){const{context:t,painter:s}=r;s.setPipelineState(nt);const i={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...e};s.submitDrawMesh(t,{shader:this.shaders.magnifier,uniforms:{config:i},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(r,e,t,s){const i=r.context;this._resourcePixelRatio=r.pixelRatio;const a=Math.ceil(s.size*r.pixelRatio);t.width=a,t.height=a;const o=new k;o.internalFormat=A.RGBA,o.wrapMode=F.CLAMP_TO_EDGE,o.samplingMode=q.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!Rr(t.src)||!r.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new J(i,o,t),e.width=a,e.height=a,o.pixelFormat=o.internalFormat=A.ALPHA,this._maskTexture=new J(i,o,e);const n=1/s.factor;o.pixelFormat=o.internalFormat=A.RGBA,o.width=o.height=Math.ceil(n*a),o.samplingMode=q.LINEAR,o.flipped=!1,this._readbackTexture=new J(i,o)}_destroyResources(){z(this._maskTexture),z(this._overlayTexture),z(this._readbackTexture)}};async function ro(r){const e=Te(()=>import("./mask-svg-DxA9o6hM-cNit2NTT.js"),[],import.meta.url),t=Te(()=>import("./overlay-svg-C7fxD_NX-DioSRl-7.js"),[],import.meta.url),s=Nt((await e).default,{signal:r}),i=Nt((await t).default,{signal:r}),a={mask:await s,overlay:await i};return it(r),a}class El extends lr{constructor(){super(),this._handles=new rr,this._magnifierTechnique=new to,this.updatingHandles=new cs,this.visible=!1}destroy(){this._handles=rt(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=Mr(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([_e(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},Ke),_e(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),_e(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==W.MAP||!this._canRender())return;const t=this._magnifier;if(t.position==null)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,t);const s=this.backgroundColor,i=s?[s.a*s.r/255,s.a*s.g/255,s.a*s.b/255,s.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:t.maskEnabled?1:0,overlayEnabled:t.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=Sr(async s=>{const i=e==null||t==null?ro(s):null,a=e!=null?ge(e,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.mask),o=t!=null?ge(t,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.overlay),[n,l]=await Promise.all([a,o]);this._mask=n,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}class io extends ot{constructor(){super(...arguments),this.type=at.Grid,this.shaders={grid:new Di}}render(e,t){const{context:s,painter:i}=e;i.setPipelineState(nt),i.submitDrawMesh(s,{shader:this.shaders.grid,uniforms:t,defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh)}}const so=50,ao=5;function oo(r,e){return Math.log(r)/Math.log(e)}function no(r,e,t){const s=r===1?10:r;return s**(t?Math.round(oo(so/e,s)):0)}function lo(r){const{isGeographic:e,isWebMercator:t}=r;return!e&&!t}function ho(r,e,t){const s=typeof r=="number"?null:r,i=s?.spatialReference;if(i==null||!Er(i)||lo(i))return _t(i);let a=s?.x??r,o=s?.y??e;const n=1/Math.sqrt(2);let l=a+n,h=o+n;const{isWebMercator:c,isGeographic:u}=i;let d=u&&!gs(i)?ft.WGS84:i;if(c){let y=new gt({x:a,y:o,spatialReference:i});yt(y,!0,y),a=y.x,o=y.y,y=new gt({x:l,y:h,spatialReference:i}),yt(y,!0,y),l=y.x,h=y.y,d=ft.WGS84}const p=new zr({paths:[[[a,o],[l,h]]],spatialReference:d}),_=_s(p,10);let m;try{[m]=ys([_],"meters")}catch{return _t(i)}return m}const Ye=os();class zl extends lr{constructor(){super(),this._handles=new rr,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new io,this._grid=null,this.visible=!0}destroy(){this._handles=rt(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([_e(()=>e?.center,()=>{this._projectedCenter=null},Ke),_e(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),Ke)])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(e.drawPhase!==W.MAP||this.grid==null||!this.visible)return;const{spacing:t,units:s,majorLineInterval:i,dynamicScaling:a,majorLineColor:o,minorLineColor:n}=this.grid;if(t===0||(this._updateDerivedValues(e),this._projectedCenter==null||this._metersPerSRUnit==null))return;const{scale:l,spatialReference:h}=e.state,c=Pr(t,s,"meters"),u=this._metersPerSRUnit*fs(l,h),d=c/u;if(!a&&da/255);return[e*i,t*i,s*i,i]}export{Nl as GraphicContainer,Dl as GraphicsView2D,zl as GridView2D,Al as LabelManager,El as MagnifierView2D,Il as MapViewNavigation,Rl as Stage}; diff --git a/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-DCOylsgg.js b/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-DCOylsgg.js new file mode 100644 index 00000000..003d981b --- /dev/null +++ b/custom-toc-separator/assets/mapViewDeps-CUVU8gUp-DCOylsgg.js @@ -0,0 +1,438 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MapView-BGOJJ8ch-Dabu63Ao.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-DT1Ep1ux.js","./story-BJ0ejR9b.css","./Cyclical-C_9rKUUQ-DFuI-YVz.js","./CollectionFlattener-DkHuHn5E-CzgMTVk8.js","./workers-PiCjreoO-DrDY4oeh.js","./projection-BA9M1R7d-DTN1X2Bt.js","./projectBuffer-CvCBvJ6W-CMjj6oJy.js","./TileInfo-CWIRDhZl-C54e75zw.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-ft6XZIJI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./UpdatingHandles-CUu3u1ms-CobdaRul.js","./signal-CETehA7D-o0XgAOKb.js","./Map-1zd11DKO-BRm_14ZF.js","./Basemap-BEqqSTw9-1Mix6R1G.js","./loadAll-e978YItg-EK1YwFYX.js","./PortalItem-CctGdnxF-C39Ug2k8.js","./writeUtils-D5qlLkwk-BD0oSm_9.js","./compilerUtils-CV1QYWI8-BsFCPQiC.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-Zkv0UFc1.js","./Layer-ChoECxvZ-ocw70508.js","./TimeExtent-Cn0Jofqr-BFc609ot.js","./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js","./HeightModelInfo-C5vFqzyF-Cjdad0g3.js","./ReactiveMap-CFk6jPfN-DUyzE86P.js","./Query-BrwMGK8U-FWeI_AU8.js","./Field-C6hA1tZj-aKnzhZ32.js","./fieldType-CD2CL2hr-B2sVi9me.js","./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-XRkD8ADC.js","./TileKey-C5IL-JBr-Do29X9ef.js","./QueueProcessor-DbfV9fLy-Cd63xfTl.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-CU9ui3_0.js","./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js","./utils-9sQxfkoa-CwJW9dca.js","./utils-Bq23Xwmj-Csxw19qV.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-xYmcMbo2.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-B6HwLstV.js","./imageUtils-BA2D6Uf1-CX2rR9bn.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-CGLbrkRD.js","./ColorBackground-gVZldRLm-uZSN6aFO.js"])))=>i.map(i=>d[i]); +import{_ as Te}from"./main-BTdHgocv.js";import{K,aZ as xr,o as fe,al as dt,au as rr,aA as rt,aW as Mr,ah as _e,aL as Ke,ay as Sr,f as ge,di as Pr,aC as pt,bj as Je,hm as ir,P as sr,et as se,I as Cr,bo as Or,L as Tr,hT as z,ae as mt,iV as Rr,$ as it,aY as Er,p as _t,J as ft,w as gt,d6 as yt,m as zr,a1 as st,aU as vt,C as Fr,b as kr,cW as Ar,dg as Be,hX as Ir,es as Br,E as Dr,aS as Lr,bt as Nr}from"./story-DT1Ep1ux.js";import{o as Ur}from"./signal-CETehA7D-o0XgAOKb.js";import{y as Vr,e as Fe,E as W,u as Gr,A as we,v as $r,w as Hr,x as bt}from"./MapView-BGOJJ8ch-Dabu63Ao.js";import{x as Wr}from"./colorUtils-Cthpxcks-DXg8vX2o.js";import{B as qr,k as le,D as at,l as Ce,H as jr,m as Xr,n as Yr,o as Kr,p as Jr,q as Qr,r as Zr}from"./UpdateTracking2D-Du_WIf4G-DP9rSN0d.js";import{q as ei,$ as ti,M as ri,T as ot,s as nt,t as wt}from"./FeatureCommandQueue-DzV-HBIG-CKd5KyoT.js";import{Y as ii,T as N,g as ar,N as si,l as xe,n as S,k as De,O as Le,i as ne,E as xt,A as ai,G as Mt,m as oi,M as ni,y as li,C as hi,R as ci,x as ui,P as O,a as St,w as R,D as or,Q as di}from"./utils-SPbpQbmm-BKynsqQg.js";import{r as Re,c as Qe,s as nr}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{Y as Ze,H as Pt,E as pi,V as mi,K as _i}from"./SDFHelper-B6k8Ig6R-Df5Aqi8X.js";import{c as de}from"./OverrideHelper-DWRbVlj1-BuRN6WEb.js";import{Y as Ct}from"./PieChartMeshWriter-C5yLDFwp-kVZoVKBA.js";import{R as fi,y as et,H as Ne,m as gi,F as Ot,Q as yi,s as vi,h as Tt,j as bi,k as wi,q as xi,a as Rt,M as Mi,J as Si,I as Et,n as Z,N as Pi,p as pe,u as Ci}from"./definitions-DJSdSb77-DkoRHaVx.js";import{x as Oi,T as lr}from"./Container-BcuL1ZEG-Cg9V4YKU.js";import{G as Ti,t as Ri,e as Ei,i as zi}from"./Tile-D75RMC64-XRkD8ADC.js";import{m as Fi,n as ki,F as ye,s as zt,R as Ft}from"./WGLContainer-LxgEo4I_-CgyWo1Fc.js";import{N as U}from"./enums-qHpGJ28Q-CmnLAccm.js";import{d as Ee,c as Ai}from"./ProgramTemplate-DQOm6Omy-BId56203.js";import{glslifyDefineMap as ke}from"./webglDeps-Bgavuh0h-Dmz76NKn.js";import{d as Ii,E as Bi,r as Di,a as kt,b as Li,t as Ni,T as Ui,c as Vi,m as Gi}from"./GridShader-75bC4UUM-DlEO67jH.js";import{j as Al,F as Il}from"./GridShader-75bC4UUM-DlEO67jH.js";import{r as hr}from"./BufferObject-BM_7mcDb-D5jPRgIi.js";import{G as F,B as $i,H as lt,U as A,F as ht,M as q,L as tt,A as w,N as At,C as Ue,T as Oe,n as cr,D as Ve,I as It}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as ur}from"./VertexArrayObject-M4iRGGoi-C6eC7r1-.js";import{U as Hi,p as Wi}from"./RenderingContext-DbCVbtGZ-oCO5F2l_.js";import{T as qi}from"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import{z as ji,D as Xi}from"./rasterizingUtils-BmlDdKBf-CKukuAVJ.js";import{a as H}from"./Rect-DD6XS68q-D_hsV3ag.js";import{H as k,V as J,G as Yi}from"./Texture-BCt2hphT-B6HwLstV.js";import{o as Bt}from"./pbf-D-y3_eZO-CKuZ8F1K.js";import{l as Ki}from"./floatRGBA-4pIJN00G-BOmhq_GU.js";import{X as Ji,$ as Qi,W as Zi}from"./LabelMetric-BeluzH3o-wKRDKh4R.js";import{T as es}from"./utils-Dcs650Ic-DV1FVDdT.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-Cd63xfTl.js";import{r as rs}from"./common-CYWrYyJl-E8-sukrT.js";import{J as is,C as dr,D as pr,H as ss,I as as,G as Dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as os,e as ns}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{_ as Ge}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{n as Lt}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{G as X,E as ct,a as ls}from"./Program-DLVwTiPA-D0v5nxXn.js";import{d as hs}from"./MeshWriterRegistry-CIC9Yk_f-D-N28B04.js";import{X as Dl}from"./GraphicsView2D-C4wYE2ut-CfB0sBaU.js";import{d as Nl}from"./GraphicContainer-DuOHUciE-CTSNq0lD.js";import{i as cs}from"./UpdatingHandles-CUu3u1ms-CobdaRul.js";import{r as Nt}from"./requestImageUtils-Ut4YcoNU-CZrsQx74.js";import{m as Ut,T as us,v as $e,P as He}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{f as We}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{B as ds,K as ps}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{c as ms,D as _s}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{f as fs}from"./scaleUtils-DxsfQwK1-BDJMc0pY.js";import{P as gs,c as ys}from"./geodesicUtils-B8mFUfTk-CbCbq6vS.js";import"./Cyclical-C_9rKUUQ-DFuI-YVz.js";import"./CollectionFlattener-DkHuHn5E-CzgMTVk8.js";import"./workers-PiCjreoO-DrDY4oeh.js";import"./TileInfo-CWIRDhZl-C54e75zw.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-ft6XZIJI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-BRm_14ZF.js";import"./Basemap-BEqqSTw9-1Mix6R1G.js";import"./loadAll-e978YItg-EK1YwFYX.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./writeUtils-D5qlLkwk-BD0oSm_9.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./TablesMixin-C8RojhYs-Zkv0UFc1.js";import"./Layer-ChoECxvZ-ocw70508.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./GraphicsCollection-CWTXNZOX-BtcJ4z0g.js";import"./HeightModelInfo-C5vFqzyF-Cjdad0g3.js";import"./ReactiveMap-CFk6jPfN-DUyzE86P.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-xYmcMbo2.js";import"./TileKey-C5IL-JBr-Do29X9ef.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-CGLbrkRD.js";import"./ColorBackground-gVZldRLm-uZSN6aFO.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-pNmv8Kbm.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./quantizationUtils-bJy1cRwp-FGsT2dwo.js";import"./TurboLine-CIlsAy5m-BHDUzrZk.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./parser-DyDJ-rlI-BVBmjSW8.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-jQxKeF5T.js";import"./AttributeStore-DjyP9U7y-C9jFBUTt.js";import"./TimeOnly-DSMefxKy-52VbaSQ6.js";import"./UnknownTimeZone-C--TOcPG-BFI0PL8S.js";import"./timeSupport-jPViR5jn-CHDjIIE2.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-B_97vWvS.js";import"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import"./diffUtils-Cz3Fi8Xb-DpL4XxiB.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./grouping-RwmXkHDc-DhZ3sGff.js";import"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import"./AGraphicContainer-LUCT6Gle-1jMRt52t.js";import"./TechniqueInstance-DGTKoOL6-0VdCfDO3.js";import"./TileContainer-D48pXXgL-B6YzhmFG.js";function Me(r,e,t){return{transform:Ps(r,e,t.transform),fromColor:Cs(r,e,t.fromColor),toColor:Os(r,e,t.toColor),colorMix:Ts(r,e,t.colorMix),toOpacity:Rs(r,e,t.toOpacity),opacityMix:Es(r,e,t.opacityMix),hasAnimations:t.hasAnimations||!!e.animations&&e.animations.length>0}}function mr(r){return!wt.forceStaticPath&&(wt.forceAnimatedPath||r.hasAnimations)}function vs(r,e,t){if(e.type==="CIMCharacterMarker")return st.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),t;const s=O(r,e,"OffsetX"),i=O(r,e,"OffsetY");if(e.type==="CIMPictureMarker")return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([s,i]),rotation:P(0),scale:P(O(r,e,"Size")),parent:t.transform}};const a=e.frame,o=a.ymax-a.ymin;return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([s,i]),rotation:P(0),scale:P({type:"Process",op:"Divide",left:O(r,e,"Size"),right:o}),parent:t.transform}}}function _r(r,e){let t=0,s=0;const i=r.anchorPointUnits!=="Absolute";return r.anchorPoint&&(t=-r.anchorPoint.x,s=-r.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:P([t,s]),rotation:P(0),scale:P(1),parent:e.transform}}}function bs(r,e){return r.anchorPointUnits==="Absolute"?e:_r(r,e)}function ws(r,e){return r.anchorPointUnits!=="Absolute"?e:_r(r,e)}function xs(r,e,t){return{...r,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([e,t]),rotation:P(0),scale:P(1),parent:r.transform}}}function Ms(r,e){const t=e?.5*-(e.xmin+e.xmax):0,s=e?.5*-(e.ymin+e.ymax):0;let i=0,a=0;if("x"in r&&"y"in r)i=r.x+t,a=r.y+s;else{const o=Ze(r);o&&(i=(o[0]+o[2])/2+t,a=(o[1]+o[3])/2+s)}return[i,a]}function Ss(r,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return O(r,e,"Rotation")}return 0}function fr(r,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return O(r,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return O(r,e,"TintColor")}return[1,1,1,1]}function Ps(r,e,t){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:Fs(r,e),rotation:ks(r,e),scale:zs(r,e),parent:t}}function Cs(r,e,t){return{type:"AnimatedColor",color:P(fr(r,e)),opacity:P(1),parent:t}}function Os(r,e,t){const{animations:s}=e;let i=fr(r,e);const a=s?.filter(o=>o.type==="CIMSymbolAnimationColor")[0];return a&&(i=O(r,a,"ToColor")),{type:"AnimatedColor",color:P(i),opacity:P(1),parent:t}}function Ts(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationColor")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function Rs(r,e,t){const{animations:s}=e;let i=P(1);const a=s?.filter(o=>o.type==="CIMSymbolAnimationTransparency")[0];return a&&(i=P({type:"Process",op:"Transparency",value:O(r,a,"ToTransparency")})),{type:"AnimatedColor",color:P([1,1,1,1]),opacity:i,parent:t}}function Es(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationTransparency")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function he(r,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0};const t=O(r,e,"Duration");let s;O(r,e,"RandomizeStartTime")?s={type:"Process",op:"Random",min:0,max:t,seed:O(r,e,"RandomizeStartSeed")}:s=O(r,e,"StartTimeOffset");const i=O(r,e,"RepeatDelay"),a=O(r,e,"PlayAnimation"),o=O(r,e,"ReverseAnimation"),n=St(e.repeatType,R.CIMAnimatedSymbolProperties.repeattype);return{duration:t,startTimeOffset:s,repeatDelay:i,timeOriginSelector:n===Qe.None?Ce.Local:Ce.Global,repeatType:n,easing:St(e.easing,R.CIMAnimatedSymbolProperties.easing),playAnimation:a,reverseAnimation:o}}function zs(r,e){const{animations:t}=e;if(e.type!=="CIMPictureMarker"&&e.type!=="CIMVectorMarker"&&e.type!=="CIMPointSymbol")return P(1);let s;s=e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"?O(r,e,"Size"):ar(e)||10;const i=t?.filter(a=>a.type==="CIMSymbolAnimationScale")[0];if(!i){const a=t?.filter(o=>o.type==="CIMSymbolAnimationSize")[0];return a?{from:1,to:{type:"Process",op:"Divide",left:O(r,a,"ToSize"),right:s},timing:he(r,a.animatedSymbolProperties)}:P(1)}return{from:1,to:O(r,i,"ScaleFactor"),timing:he(r,i.animatedSymbolProperties)}}function Fs(r,e){const{animations:t}=e,s=t?.filter(i=>i.type==="CIMSymbolAnimationOffset")[0];return s?{from:[0,0],to:[O(r,s,"OffsetX"),O(r,s,"OffsetY")],timing:he(r,s.animatedSymbolProperties)}:P([0,0])}function ks(r,e){const{animations:t}=e,s=Ss(r,e),i=t?.filter(a=>a.type==="CIMSymbolAnimationRotation")[0];return i?{from:s,to:O(r,i,"ToRotation"),timing:he(r,i.animatedSymbolProperties)}:P(s)}function P(r){return{from:r,to:r,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0}}}function gr(r){if(r==null||typeof r!="object")return!1;if(r.animations&&Array.isArray(r.animations)&&r.animations.length>0)return!0;for(const e in r)if(gr(r[e]))return!0;return!1}const As=()=>st.getLogger("esri.symbols.cim.cimAnalyzer");function Is(r){const e=r.markerPlacement;return e&&e.angleToLine?Re.MAP:Re.SCREEN}class Bs{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,s){if(this._cimLayers=s??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const i of this._primitiveOverrides){const a=i.valueExpressionInfo;if(a)this._setPoMap(i.primitiveName,i.propertyName,a);else if(i.value!=null){let o=i.value;i.propertyName.includes("Color")&&(Wr(o)&&(o=ii(o)),o=N(o)),this._setPoMap(i.primitiveName,i.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const s=e?.symbolLayers;if(!s)return;const i=e.effects;let a=Re.SCREEN;const o=ar(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=Re.MAP);let n={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],hasAnimations:gr(e)};n=Me(this._poMap,e,n);const l=e.type==="CIMPolygonSymbol";let h=s.length;for(;h--;){const c=s[h];if(!c||c.enable===!1)continue;let u;i?.length&&(u=[...i]);const d=c.effects;d?.length&&(i?u.push(...d):u=[...d]);let p=null;if(u){p=[];for(const m of u){const y=de.findEffectOverrides(m,this._primitiveOverrides);y&&p.push(y)}}const _=[];switch(de.findApplicableOverrides(c,this._primitiveOverrides,_),c.type){case"CIMSolidFill":this._analyzeSolidFill(c,p);break;case"CIMPictureFill":this._analyzePictureFill(c,p);break;case"CIMHatchFill":this._analyzeHatchFill(c,p);break;case"CIMGradientFill":this._analyzeGradientFill(c,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(c,p,l,o);break;case"CIMPictureStroke":this._analyzePictureStroke(c,p,l,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(c,p,l,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=Is(c));const m=[],y=c.primitiveName;y&&m.push(y);const g=l&&si(c.markerPlacement);this._analyzeMarker(c,p,null,m,a,o,t,[],n,!1,g);break}default:As().error("Cannot analyze CIM layer",c.type)}}}_analyzeSolidFill(e,t){const{primitiveName:s,type:i}=e,a=N(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,s,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:s,type:i}=e,a=xe(e),o=S(e.height,R.CIMPictureFill.height);let n=S(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const h=e.width;let c=1;const u=this._resourceManager.getResource(e.url);u!=null&&(c=u.width/u.height),n/=c*(o/h)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,s,"TintColor",a),height:this._getValueOrOverrideExpression(i,s,"Height",o),scaleX:this._getValueOrOverrideExpression(i,s,"ScaleX",n),angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:s,type:i}=e,a=this._analyzeMaterialOverrides(s,["Rotation","OffsetX","OffsetY"]),o=De(a);let n=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const u=c.primitiveName??s;l||!u||c.colorLocked||this._poMap[u]?.Color==null&&this._poMap[u]?.StrokeColor==null||(n=N(c.color),n=this._maybeGetValueOrOverrideExpression(u,"StrokeColor")??this._getValueOrOverrideExpression(i,u,"Color",n),l=!0);const d=this._maybeGetValueOrOverrideExpression(u,"StrokeWidth");if(d){let p=null,_=null;typeof d=="number"?p=d:_=d.valueExpressionInfo;let m=o.find(y=>y.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:u,propertyName:"width",valueExpressionInfo:_,value:p,defaultValue:Le(i,"width")},o.push(m))}}const h={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(i,s,"Separation",S(e.separation,R.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=N(e.color),l=S(e.width,R.CIMSolidStroke.width),h=ne(e.capStyle,R.CIMSolidStroke.capstyle),c=ne(e.joinStyle,R.CIMSolidStroke.joinstyle),u=e.miterLimit;let d,p,_,m,y=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(y=this._getPrimitiveMaterialOverrides(a,o)),t&&Array.isArray(t)&&t.length>0){const f=t[t.length-1].effect;f&&f.type==="CIMGeometricEffectDashes"&&f.lineDashEnding==="NoConstraint"&&(d=f.dashTemplate,p=f.scaleDash,_=f.offsetAlongLine,m=f.primitiveName,(t=[...t]).pop())}m!=null&&y.push(...this._getPrimitiveMaterialOverrides(m,o).filter(f=>f.propertyName==="dashTemplate"));const g=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:m},overrides:y}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"Color",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(m,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(o,m,"OffsetAlongLine",_??0),scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=xe(e),l=S(e.width,R.CIMPictureStroke.width),h=ne(e.capStyle,R.CIMPictureStroke.capstyle),c=ne(e.joinStyle,R.CIMPictureStroke.joinstyle),u=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"TintColor",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=S(e.width,R.CIMSolidStroke.width),l=ne(e.capStyle,R.CIMGradientStroke.capstyle),h=ne(e.joinStyle,R.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,a,"Width",n),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",l),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(o,a,"MiterLimit",c),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,s,i,a,o,n,l,h,c=!1,u=!1){if(c||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,c))return;const d=S(e.size,R.CIMVectorMarker.size),p=S(e.rotation),_=S(e.offsetX),m=S(e.offsetY),{primitiveName:y,type:g}=e,f=this._getValueOrOverrideExpression(g,y,"Size",d),x=this._getValueOrOverrideExpression(g,y,"Rotation",p),b=this._getValueOrOverrideExpression(g,y,"OffsetX",_),v=this._getValueOrOverrideExpression(g,y,"OffsetY",m);let M=h;switch(M=ws(e,M),M=vs(this._poMap,e,M),M=bs(e,M),M=Me(this._poMap,e,M),e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,s,i,a,o,f,x,b,v,l,M,c,u);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,s,i,a,o,f,x,b,v,l,M,n,c,u)}}_analyzeMarkerInsidePolygon(e,t,s){const{markerPlacement:i,type:a}=e;if(!i||i.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=i.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const m of _){const{symbol:y}=m;if(y?.type==="CIMPolygonSymbol"&&y.symbolLayers){const{symbolLayers:g}=y;for(const f of g)if(f.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const o=Math.abs(i.stepX),n=Math.abs(i.stepY);if(o===0||n===0)return!0;let l,h;if(i.gridType==="Random"){const d=Br(Mi),p=Math.max(Math.floor(d/o),1);l=n*Math.max(Math.floor(d/n),1),h=p*o/l}else i.shiftOddRows?(l=2*n,h=o/n*.5):(l=n,h=o/n);const c=xe(e),u=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:s,effects:t,color:c,height:l,scaleX:h,angle:i.gridAngle,offsetX:S(i.offsetX),offsetY:S(i.offsetY),applyRandomOffset:i.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_){const{animatedSymbolProperties:m,primitiveName:y,type:g}=e;let f=S(e.scaleX,1);const x=xe(e);s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const b=this._createGIFAnimatedSymbolPropertiesOverrideExpression(m),v=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const B=e.width;let $=1;const I=this._resourceManager.getResource(e.url);I!=null&&($=I.width/I.height),f/=$*(S(e.size)/B)}const M=[...i];let C;e.primitiveName&&M.push(e.primitiveName),m||b?C={type:"animated",url:e.url,urlHash:"H"+ir(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=sr(e),C.markerPlacement=null);const T={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(M,g)};b&&T.overrides.push(...b.overrides);const G=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:T,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(g,y,"ScaleX",f),rotation:l,offsetX:h,offsetY:c,transform:{type:"cim-marker-transform-param",params:u},color:this._getValueOrOverrideExpression(g,y,"TintColor",x),anchorPoint:{x:v.x,y:v.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:_,markerPlacement:s,animationParams:je(d),baseSize:G})}_analyzeVectorMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_,m){const y=e.markerGraphics;if(!y)return;const g=e.frame;let f=0;f=g?g.ymax-g.ymin:o;const x=!!e.scaleSymbolsProportionally;if(f){const b={offsetX:h,offsetY:c,rotation:l,size:n,frameHeight:f,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:x};u=[...u,b]}s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const b of y)if(b){const v=b.symbol;if(!v)continue;const M=b.primitiveName;M&&i.push(M);let C,T=d;if((v.type==="CIMPointSymbol"||v.type==="CIMTextSymbol")&&g){let I=0,E=0;const Y=b.geometry;"x"in Y&&"y"in Y&&(I+=Y.x-.5*(g.xmin+g.xmax),E+=Y.y-.5*(g.ymin+g.ymax));const D=e.anchorPoint;let ee=!1;D&&(e.anchorPointUnits==="Absolute"?(I-=D.x,E-=D.y,ee=!0):g&&(I-=(g.xmax-g.xmin)*D.x,E-=(g.ymax-g.ymin)*D.y));const ae={offsetX:I,offsetY:E,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:ee,scaleSymbolsProportionally:x};C=[...u,ae]}const G=b.geometry,[B,$]=Ms(G,g);switch(B===0&&$===0||(T=xs(T,B,$)),v.type==="CIMPointSymbol"&&(T=Me(this._poMap,v,T)),v.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||Ns(v)?(T={...T,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([0,0]),rotation:P(0),scale:P(f),parent:d.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,s,b,i,a,o,C??u,T,f,_,m)):this._analyzeMultiLayerGraphic(e,t,s,b,i,a,o,C??u,T,f,_,m);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,s,b,i,a,o,C??u,_)}M&&i.pop()}}_analyzeMultiLayerGraphic(e,t,s,i,a,o,n,l,h,c,u,d){const p=i.symbol,_=p.symbolLayers;if(!_)return;let m=_.length;if(Ls(_)&&!mr(h))return void this._analyzeCompositeMarkerGraphic(e,t,s,i,_,o,n,l,c,u,d);const y=this._resourceManager.geometryEngine,g=Ct.applyEffects(p.effects,i.geometry,y);if(g)for(;m--;){const f=_[m];if(!f||f.enable===!1)continue;const x=f.primitiveName;switch(x&&a.push(x),f.type){case"CIMSolidFill":case"CIMSolidStroke":{const b=Ct.applyEffects(f.effects,g,y),v=Ze(b);if(!v)continue;const M=e.anchorPointUnits!=="Relative",C=xt(f)??0,{frameSizeRatio:T,anchorX:G,anchorY:B,widthRatio:$,sdfPaddingRatio:I}=Pt(v,e.frame,e.size,e.anchorPoint,M,C,e.scaleSymbolsProportionally),E=f.type==="CIMSolidFill",Y={type:"sdf",geom:b,sdfPaddingRatio:I,asFill:E},{path:D}=f,ee=E?N(ai(f)):D==null?N(Mt(f)):[0,0,0,0],ae=E?[0,0,0,0]:N(Mt(f));if(!E&&!C)break;const oe=i.primitiveName;let ce=null;E&&!f.colorLocked&&(ce=this._maybeGetValueOrOverrideExpression(oe,"FillColor"));let ue=null;E||f.colorLocked||(ue=this._maybeGetValueOrOverrideExpression(oe,"StrokeColor"));const ve=ce??this._getValueOrOverrideExpression(f.type,x,"Color",ee),Ae=ue??this._getValueOrOverrideExpression(f.type,x,"Color",ae),be=this._maybeGetValueOrOverrideExpression(oe,"StrokeWidth")??this._getValueOrOverrideExpression(f.type,x,"Width",C),Ie=D?{type:"sprite-rasterization-param",resource:{type:"path",path:D,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:Y,overrides:[]},L=Me(this._poMap,f,h),j=S(e.size,R.CIMVectorMarker.size),Q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",j);this._cimLayers.push({type:"marker",spriteRasterizationParam:Ie,colorLocked:!!f.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:G,y:B},isAbsoluteAnchorPoint:M,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:$,rotateClockwise:!1,referenceSize:n,sizeRatio:T,color:ve,outlineColor:Ae,outlineWidth:be,isOutline:d,markerPlacement:s,animationParams:je(L),isStroke:f.type!=="CIMSolidFill",baseSize:Q,...pi(b,I)});break}case"CIMPictureMarker":case"CIMVectorMarker":f.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d):this._analyzeMarker(f,t,s,a,o,n,!1,l,h,u,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d)}x&&a.pop()}}_analyzeTextGraphic(e,t,s,i,a,o,n,l){const h=[];de.findApplicableOverrides(s,this._primitiveOverrides,h);const c=s.geometry;if(!("x"in c)||!("y"in c))return;const u=s.symbol,d=oi(u),p=ni(u.fontStyleName),_=qr(u.fontFamilyName);u.font={family:_,decoration:d,...p};const m=S(u.height,R.CIMTextSymbol.height),y=S(u.angle),g=S(u.offsetX),f=S(u.offsetY),{haloSymbol:x}=u,b=S(u.haloSize,0);let v=[0,0,0,0];if(x?.symbolLayers?.length){const L=x.symbolLayers;for(const j of L)if(j.color){v=this._getValueOrOverrideExpression(u?.haloSymbol?.type??"CIMPolygonSymbol",j.primitiveName,"Color",N(j.color));break}}const M=s.primitiveName;let C=[0,0,0,1],T=[0,0,0,0],G=0,B=!1;if(u.symbol?.symbolLayers)for(const L of u.symbol.symbolLayers){const j=L.primitiveName;if(L.type==="CIMSolidStroke")T=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Color",N(L.color)),G=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Width",xt(L)??0);else if(L.type==="CIMSolidFill"){const Q=N(L.color);B=B??!!L.colorLocked,C=this._getValueOrOverrideExpression("CIMSolidFill",j??M,"Color",Q)}}let $=null,I=null,E=null,Y=null,D=null;M&&($=this._maybeGetValueOrOverrideExpression(M,"TextSize"),I=this._maybeGetValueOrOverrideExpression(M,"TextAngle"),E=this._maybeGetValueOrOverrideExpression(M,"TextOffsetX"),Y=this._maybeGetValueOrOverrideExpression(M,"TextOffsetY"),B||(D=this._maybeGetValueOrOverrideExpression(M,"FillColor")));const ee=D??C;let ae=null,oe=null,ce=0;if(u.callout&&u.callout.type==="CIMBackgroundCallout"){const L=u.callout;if(L.backgroundSymbol){const j=L.backgroundSymbol.symbolLayers;if(j)for(const Q of j)Q.type==="CIMSolidFill"?ae=N(Q.color):Q.type==="CIMSolidStroke"&&(oe=N(Q.color),ce=S(Q.width,R.CIMSolidStroke.width))}}const ue=this._getValueOrOverrideExpression(u.type,s.primitiveName,"TextString",s.textString??"");if(ue==null)return;const{fontStyleName:ve}=u,Ae=_+(ve?"-"+ve.toLowerCase():"-regular"),be=this._getMaterialOverrides(i,u.type);be.push(...this._getPrimitiveMaterialOverrides(s.primitiveName,u.type));const Ie={type:"text-rasterization-param",resource:{type:"text",textString:s.textString??"",font:u.font,symbol:u,primitiveName:s.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:u.lineWidth,textRasterizationParam:Ie,colorLocked:!!l||!!B,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:Ae,decoration:d,haloSize:b,haloColor:v,weight:p.weight,style:p.style,size:$??m,angle:I??y,offsetX:E??g,offsetY:Y??f,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:li(u.horizontalAlignment),verticalAlignment:hi(u.verticalAlignment),text:ue,color:ee,outlineColor:T,outlineSize:G,backgroundColor:ae,borderLineColor:oe,borderLineWidth:ce,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,u,d){const p=Ds(e,i),_=e.primitiveName,m=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),y=De(m),[g,f,x]=le.getTextureAnchor(p,this._resourceManager),b=this._getMaterialOverrides(a,e.type);b.push(...y);const v={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:b},M=S(e.size,R.CIMVectorMarker.size),C=this._getValueOrOverrideExpression(e.type,_,"Size",M);this._cimLayers.push({type:"marker",spriteRasterizationParam:v,colorLocked:u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:g,y:f},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:n,sizeRatio:x/se(e.size),isOutline:d,markerPlacement:s,animationParams:je(h),baseSize:C})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:Vt(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:Vt(t)}}_analyzeCompositeMarkerGraphic(e,t,s,i,a,o,n,l,h,c,u){const d=i.geometry,p=a[0],_=a[1],m=Ze(d);if(!m)return;const y=e.anchorPointUnits!=="Relative",g=S(p.width,R.CIMSolidStroke.width),{frameSizeRatio:f,anchorX:x,anchorY:b,widthRatio:v,sdfPaddingRatio:M}=Pt(m,e.frame,e.size,e.anchorPoint,y,g,e.scaleSymbolsProportionally),{path:C}=_,T=_.primitiveName,G=p.primitiveName,B=i.primitiveName;let $=null;_.colorLocked||c||($=this._maybeGetValueOrOverrideExpression(B,"FillColor"));const I=$??this._getValueOrOverrideExpression(_.type,T,"Color",N(_.color));let E=null;p.colorLocked||c||(E=this._maybeGetValueOrOverrideExpression(B,"StrokeColor"));const Y=E??this._getValueOrOverrideExpression(p.type,G,"Color",N(p.color)),D=this._maybeGetValueOrOverrideExpression(B,"StrokeWidth")??this._getValueOrOverrideExpression(p.type,G,"Width",g),ee={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:d,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:ee,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x,y:b},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:v,rotateClockwise:!1,referenceSize:n,sizeRatio:f,color:I,outlineColor:Y,outlineWidth:D,isOutline:u,markerPlacement:s})}_setPoMap(e,t,s){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=s}_maybeGetValueOrOverrideExpression(e,t,s){return this._getValueOrOverrideExpression("",e,t,s,!1)}_getValueOrOverrideExpression(e,t,s,i,a=!0){if(a&&!ci(i)&&(i=Le(e,s.toLowerCase())),t==null)return i;const o=this._poMap[t];if(o==null)return i;const n=o[s];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,s,i){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if(a?.overrides.length>0)return!0}if(s!=null){for(const a of s)if(a?.overrides.length>0)return!0}if(i!=null){for(const a of i)if(a?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const s=[];for(const i of e)s.push(...this._getPrimitiveMaterialOverrides(i,t));return s}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const s=De(this._primitiveOverrides.filter(i=>i.primitiveName===e));return s.forEach(i=>i.defaultValue=Le(t,i.propertyName.toLowerCase())),s}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(s=>s.primitiveName!==e||!t.includes(s.propertyName))}}function Ds(r,e){return{type:r.type,enable:!0,name:r.name,colorLocked:r.colorLocked,primitiveName:r.primitiveName,anchorPoint:r.anchorPoint,anchorPointUnits:r.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:r.rotateClockwise,rotation:0,size:r.size,billboardMode3D:r.billboardMode3D,depth3D:r.depth3D,frame:r.frame,markerGraphics:[e],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function qe(r){if(r&&r.indexOf("Level_")===0){const e=parseInt(r.slice(6),10);if(!isNaN(e))return e}return 0}const Ls=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&r[0].path==null&&r[1].path==null&&!r[0].effects&&!r[1].effects&&!r[0].animations&&!r[1].animations;function Ns(r){const e=r.symbolLayers;if(!e)return!1;const t=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectDashes"&&a.dashTemplate!=null)),s=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!s}function Vt(r){return sr(r).map(e=>({...e,propertyName:ui(e.propertyName)}))}function je(r){return mr(r)?{type:"animation-params",params:r}:null}let Us=class{constructor(r){this.events=new Cr,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const e={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};r.appendChild(this._canvas);let t=this._canvas.getContext("webgl2",e);t||(t=this._canvas.getContext("webgl2",{...e,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=t,this._handles=Or([Tr(this._canvas,"webglcontextlost",s=>this.events.emit("webgl-context-lost",s))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(r,e){if(this._hasMajorPerformanceCaveat||K("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=K("esri-performance-mode-frames-between-render")&&(e(),this._lastRenderViewState=r.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,s,i,a,o,n]=this._computeViewTransform(this._lastRenderViewState,r.state);this._canvas.style.transform=`matrix(${t}, ${s}, ${i}, ${a}, ${o}, ${n})`}}else e()}resize(r){const e=this._canvas,t=e.style,{state:{size:s},pixelRatio:i}=r,a=s[0],o=s[1],n=Math.round(a*i),l=Math.round(o*i);e.width===n&&e.height===l||(e.width=n,e.height=l),t.width=a+"px",t.height=o+"px"}_computeViewTransform(r,e){const[t,s]=r.center,[i,a]=e.center,[o,n]=r.toScreen([0,0],i,a),[l,h]=r.toScreen([0,0],t,s),c=l-o,u=h-n,d=r.scale/e.scale,p=e.rotation-r.rotation,_=Gr();return Ti(_),Ri(_,_,[d,d]),Ei(_,_,Je(p)),zi(_,_,[c,u]),_}};const Vs={background:{"background.frag":`#ifdef PATTERN +uniform lowp float u_opacity; +uniform lowp sampler2D u_texture; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_tileTextureCoord; +#else +uniform lowp vec4 u_color; +#endif +void main() { +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = u_opacity * color; +#else +gl_FragColor = u_color; +#endif +}`,"background.vert":`precision mediump float; +attribute vec2 a_pos; +uniform highp mat3 u_dvsMat3; +uniform mediump float u_coord_range; +uniform mediump float u_depth; +#ifdef PATTERN +uniform mediump mat3 u_pattern_matrix; +varying mediump vec2 v_tileTextureCoord; +uniform mediump vec4 u_tlbr; +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +#endif +void main() { +gl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0); +#ifdef PATTERN +v_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy; +v_tlbr = u_tlbr / u_mosaicSize.xyxy; +#endif +}`},circle:{"circle.frag":`precision lowp float; +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +void main() +{ +mediump float dist = length(v_offset); +mediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0); +lowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width)); +gl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio); +}`,"circle.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_circleTranslation; +uniform mediump float u_depth; +uniform mediump float u_antialiasingWidth; +void main() +{ +#pragma main +v_color = color * opacity; +v_stroke_color = stroke_color * stroke_opacity; +v_stroke_width = stroke_width; +v_radius = radius; +v_blur = max(blur, u_antialiasingWidth / (radius + stroke_width)); +mediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); +v_offset = offset; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},fill:{"fill.frag":`precision lowp float; +#ifdef PATTERN +uniform lowp sampler2D u_texture; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +varying lowp vec4 v_color; +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = v_color[3] * color; +#else +gl_FragColor = v_color; +#endif +}`,"fill.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump float u_depth; +uniform mediump vec2 u_fillTranslation; +#ifdef PATTERN +#include +uniform mediump vec2 u_mosaicSize; +uniform mediump float u_patternFactor; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +varying lowp vec4 v_color; +void main() +{ +#pragma main +v_color = color * opacity; +#ifdef PATTERN +float patternWidth = nextPOT(tlbr.z - tlbr.x); +float patternHeight = nextPOT(tlbr.w - tlbr.y); +float scaleX = 1.0 / (patternWidth * u_patternFactor); +float scaleY = 1.0 / (patternHeight * u_patternFactor); +mat3 patterMat = mat3(scaleX, 0.0, 0.0, +0.0, -scaleY, 0.0, +0.0, 0.0, 1.0); +v_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy; +v_tlbr = tlbr / u_mosaicSize.xyxy; +#endif +vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},icon:{"icon.frag":`precision mediump float; +uniform lowp sampler2D u_texture; +#ifdef SDF +uniform lowp vec4 u_color; +uniform lowp vec4 u_outlineColor; +#endif +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +varying lowp vec4 v_color; +#ifdef SDF +varying mediump flaot v_halo_width; +#endif +#include +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef SDF +lowp vec4 fillPixelColor = v_color; +float d = rgba2float(texture2D(u_texture, v_tex)) - 0.5; +const float softEdgeRatio = 0.248062016; +float size = max(v_size.x, v_size.y); +float dist = d * softEdgeRatio * size; +fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); +if (v_halo_width > 0.25) { +lowp vec4 outlinePixelColor = u_outlineColor; +const float outlineLimitRatio = (16.0 / 86.0); +float clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y)); +outlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0); +gl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor); +} +else { +gl_FragColor = v_opacity * fillPixelColor; +} +#else +lowp vec4 texColor = texture2D(u_texture, v_tex); +gl_FragColor = v_opacity * texColor; +#endif +}`,"icon.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +varying lowp vec4 v_color; +#ifdef SDF +varying mediump float v_halo_width; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_iconTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +const float C_OFFSET_PRECISION = 1.0 / 8.0; +const float C_256_TO_RAD = 3.14159265359 / 128.0; +const float C_DEG_TO_RAD = 3.14159265359 / 180.0; +const float tileCoordRatio = 1.0 / 8.0; +uniform highp float u_time; +void main() +{ +#pragma main +v_color = color; +v_opacity = opacity; +#ifdef SDF +v_halo_width = halo_width; +#endif +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_opacity *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float delta_z = 0.0; +mediump float rotated = mod(a_angle + u_mapRotation, 256.0); +delta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated)); +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_opacity, 0.0); +vec2 offset = C_OFFSET_PRECISION * a_vertexOffset; +v_size = abs(offset); +#ifdef SDF +offset = (120.0 / 86.0) * offset; +#endif +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +v_tex = a_tex.xy / u_mosaicSize; +}`},line:{"line.frag":`precision lowp float; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +varying mediump float v_lineHalfWidth; +varying lowp vec4 v_color; +varying mediump float v_blur; +#if defined (PATTERN) || defined(SDF) +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +uniform sampler2D u_texture; +uniform mediump float u_antialiasing; +#endif +#ifdef SDF +#include +#endif +void main() +{ +mediump float fragDist = length(v_normal) * v_lineHalfWidth; +lowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0); +#ifdef PATTERN +mediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio); +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +lowp vec4 color = texture2D(u_texture, texCoord); +gl_FragColor = alpha * v_color[3] * color; +#elif defined(SDF) +mediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + 0.25 * v_normal.y; +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; +float dist = d * (v_lineHalfWidth + u_antialiasing / 2.0); +gl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color; +#else +gl_FragColor = alpha * v_color; +#endif +}`,"line.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec4 a_extrude_offset; +attribute vec4 a_dir_normal; +attribute vec2 a_accumulatedDistance; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump float u_zoomFactor; +uniform mediump vec2 u_lineTranslation; +uniform mediump float u_antialiasing; +uniform mediump float u_depth; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +const float scale = 1.0 / 31.0; +const mediump float tileCoordRatio = 8.0; +#if defined (SDF) +const mediump float sdfPatternHalfWidth = 15.5; +#endif +#if defined (PATTERN) || defined(SDF) +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +#endif +varying lowp vec4 v_color; +varying mediump float v_lineHalfWidth; +varying mediump float v_blur; +void main() +{ +#pragma main +v_color = color * opacity; +v_blur = blur + u_antialiasing; +v_normal = a_dir_normal.zw * scale; +#if defined (PATTERN) || defined(SDF) +v_tlbr = tlbr / u_mosaicSize.xyxy; +v_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w); +#if defined (PATTERN) +v_widthRatio = width / v_patternSize.y; +#else +v_widthRatio = width / sdfPatternHalfWidth / 2.0; +#endif +#endif +v_lineHalfWidth = (width + u_antialiasing) * 0.5; +mediump vec2 dir = a_dir_normal.xy * scale; +mediump vec2 offset_ = a_extrude_offset.zw * scale * offset; +mediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +#if defined (PATTERN) || defined(SDF) +v_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_); +#endif +}`},outline:{"outline.frag":`varying lowp vec4 v_color; +varying mediump vec2 v_normal; +void main() +{ +lowp float dist = abs(v_normal.y); +lowp float alpha = smoothstep(1.0, 0.0, dist); +gl_FragColor = alpha * v_color; +}`,"outline.vert":`attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_xnormal; +#pragma header +varying lowp vec4 v_color; +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_fillTranslation; +uniform mediump float u_depth; +uniform mediump float u_outline_width; +varying lowp vec2 v_normal; +const float scale = 1.0 / 15.0; +void main() +{ +#pragma main +v_color = color * opacity; +v_normal = a_xnormal; +mediump vec2 dist = u_outline_width * scale * a_offset; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},text:{"text.frag":`uniform lowp sampler2D u_texture; +varying lowp vec2 v_tex; +varying lowp vec4 v_color; +varying mediump float v_edgeWidth; +varying mediump float v_edgeDistance; +void main() +{ +lowp float dist = texture2D(u_texture, v_tex).a; +mediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist); +gl_FragColor = alpha * v_color; +}`,"text.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +varying lowp vec4 v_color; +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_textTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying lowp vec2 v_tex; +const float offsetPrecision = 1.0 / 8.0; +const mediump float edgePos = 0.75; +uniform mediump float u_antialiasingWidth; +varying mediump float v_edgeDistance; +varying mediump float v_edgeWidth; +uniform lowp float u_halo; +const float sdfFontScale = 1.0 / 24.0; +const float sdfPixel = 3.0; +uniform highp float u_time; +void main() +{ +#pragma main +if (u_halo > 0.5) +{ +v_color = halo_color * opacity; +halo_width *= sdfPixel; +halo_blur *= sdfPixel; +} +else +{ +v_color = color * opacity; +halo_width = 0.0; +halo_blur = 0.0; +} +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_color *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float a_visMinAngle = a_texAngleRange.z; +mediump float a_visMaxAngle = a_texAngleRange.w; +mediump float delta_z = 0.0; +mediump float angle = mod(a_angle + u_mapRotation, 256.0); +if (a_visMinAngle < a_visMaxAngle) +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle))); +} +else +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle))); +} +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_color[3], 0.0); +v_tex = a_tex.xy / u_mosaicSize; +v_edgeDistance = edgePos - halo_width / size; +v_edgeWidth = (u_antialiasingWidth + halo_blur) / size; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +}`},util:{"encoding.glsl":`const vec4 rgba2float_factors = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, rgba2float_factors); +}`,"util.glsl":`float nextPOT(in float x) { +return pow(2.0, ceil(log2(abs(x)))); +}`}};function Gs(r){let e=Vs;return r.split("/").forEach(t=>{e&&(e=e[t])}),e}const $s=new Ai(Gs);function V(r){return $s.resolveIncludes(r)}const Gt=r=>ke({PATTERN:r.pattern}),Hs={shaders:r=>({vertexShader:Gt(r)+V("background/background.vert"),fragmentShader:Gt(r)+V("background/background.frag")})},Ws={shaders:r=>({vertexShader:V("circle/circle.vert"),fragmentShader:V("circle/circle.frag")})},$t=r=>ke({PATTERN:r.pattern}),qs={shaders:r=>({vertexShader:$t(r)+V("fill/fill.vert"),fragmentShader:$t(r)+V("fill/fill.frag")})},js={shaders:r=>({vertexShader:V("outline/outline.vert"),fragmentShader:V("outline/outline.frag")})},Ht=r=>ke({SDF:r.sdf}),Xs={shaders:r=>({vertexShader:Ht(r)+V("icon/icon.vert"),fragmentShader:Ht(r)+V("icon/icon.frag")})},Wt=r=>ke({PATTERN:r.pattern,SDF:r.sdf}),Ys={shaders:r=>({vertexShader:Wt(r)+V("line/line.vert"),fragmentShader:Wt(r)+V("line/line.frag")})},Ks={shaders:r=>({vertexShader:V("text/text.vert"),fragmentShader:V("text/text.frag")})};let Js=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(r=>r.dispose()),this._programByKey.clear()}getMaterialProgram(r,e,t){const s=e.key<<3|this._getMaterialOptionsValue(e.type,t);if(this._programByKey.has(s))return this._programByKey.get(s);const i=this._getProgramTemplate(e.type),{shaders:a}=i,{vertexShader:o,fragmentShader:n}=a(t),l=e.getShaderHeader(),h=e.getShaderMain(),c=o.replace("#pragma header",l).replace("#pragma main",h),u=r.programCache.acquire(c,n,e.getAttributeLocations());return this._programByKey.set(s,u),u}_getMaterialOptionsValue(r,e){switch(r){case U.BACKGROUND:return(e.pattern?1:0)<<1;case U.FILL:return(e.pattern?1:0)<<1;case U.OUTLINE:return 0;case U.LINE:{const t=e;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1}case U.ICON:return(e.sdf?1:0)<<1;case U.CIRCLE:case U.TEXT:default:return 0}}_getProgramTemplate(r){switch(r){case U.BACKGROUND:return Hs;case U.CIRCLE:return Ws;case U.FILL:return qs;case U.ICON:return Xs;case U.LINE:return Ys;case U.OUTLINE:return js;case U.TEXT:return Ks;default:return null}}},yr=class{constructor(){this._initialized=!1}dispose(){this._program=z(this._program),this._vertexArrayObject=z(this._vertexArrayObject)}render(r,e,t,s){r&&(this._initialized||this._initialize(r),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.bindVAO(this._vertexArrayObject),r.useProgram(this._program),e.setSamplingMode(t),r.bindTexture(e,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindTexture(null,0),r.bindVAO())}_initialize(r){if(this._initialized)return!0;const e=Ee(r,kt);if(!e)return!1;const t=new Int8Array(16);t[0]=-1,t[1]=-1,t[2]=0,t[3]=0,t[4]=1,t[5]=-1,t[6]=1,t[7]=0,t[8]=-1,t[9]=1,t[10]=0,t[11]=1,t[12]=1,t[13]=1,t[14]=1,t[15]=1;const s=kt.attributes,i=new ur(r,s,ki,new Map([["geometry",hr.createVertex(r,cr.STATIC_DRAW,t)]]));return this._program=e,this._vertexArrayObject=i,this._initialized=!0,!0}};class Qs{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const s=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(s))return this._programByKey.get(s);const i={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,u)=>({...c,[u.name]:u.value}),{})},{vsPath:a,fsPath:o,attributes:n}=e,l=Wi(a,o,n,i),h=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!h)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(s,h),h}}let Zs=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(r){return this._resourceMap.get(r)??null}async fetchResource(r,e){const t=this._resourceMap.get(r);if(t)return{width:t.width,height:t.height};let s=this._inFlightResourceMap.get(r);return s?s.then(i=>({width:i.width,height:i.height})):(s=qi(r,e),this._inFlightResourceMap.set(r,s),s.then(i=>(this._inFlightResourceMap.delete(r),this._resourceMap.set(r,i),{width:i.width,height:i.height}),()=>({width:0,height:0})))}deleteResource(r){this._inFlightResourceMap.delete(r),this._resourceMap.delete(r)}loadFont(r){return Yr(r)}};const ea=512;let ta=class{constructor(r){this._resourceManager=r,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||(this._cachedRasterizationCanvas=document.createElement("canvas")),this._cachedRasterizationCanvas}rasterizeJSONResource(r){switch(r.type){case"dash":{const e=or(r.dashTemplate),[t,s,i]=Xi(e);return{size:[s,i],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case"fill-style":{const[e,t,s,i]=ji(this._canvas,r,Et);return{size:[t,s],image:new Uint32Array(e.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case"sdf":return qt(r);case"CIMHatchFill":case"CIMVectorMarker":case"CIMPictureMarker":return this._rasterizeCIMJSONResource(r)}}_rasterizeCIMJSONResource(r){switch(r.type){case"CIMHatchFill":{const e=le.fromCIMHatchFill(r,Et);return this._rasterizeCIMVectorMarker(e)}case"CIMPictureMarker":{const e=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(e)}case"CIMVectorMarker":{if(r.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"){const t=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(t)}const e=mi(r);return e&&!r.avoidSDFRasterization?qt(e):this._rasterizeCIMVectorMarker(r,!1,Si)}}}_rasterizeCIMVectorMarker(r,e=!0,t){const s=e?Kr.fromExtent(r.frame):null,[i,a,o,n,l]=le.rasterize(this._canvas,r,s,this._resourceManager,!0,t);return i?{size:[a,o],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!1,anchorX:n,anchorY:l}:null}rasterizeImageResource(r,e,t,s){this._canvas.width=r,this._canvas.height=e;const i=this._canvas.getContext("2d",{willReadFrequently:!0});t instanceof ImageData?i.putImageData(t,0,0):(t.setAttribute("width",`${r}px`),t.setAttribute("height",`${e}px`),i.drawImage(t,0,0,r,e));const a=i.getImageData(0,0,r,e),o=new Uint8Array(a.data);if(s){for(const d of s)if(d&&d.oldColor&&d.oldColor.length===4&&d.newColor&&d.newColor.length===4){const[p,_,m,y]=d.oldColor,[g,f,x,b]=d.newColor;if(p===g&&_===f&&m===x&&y===b)continue;for(let v=0;v=u||c>=u){const d=h/c;d>1?(h=u,c=Math.round(u/d)):(c=u,h=Math.round(u*d)),l=new Uint8Array(4*h*c);const p=new Uint8ClampedArray(l.buffer);di(o,r,e,p,h,c,!1)}return{size:[h,c],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};function qt(r){if(!r)return null;const{data:e,width:t,height:s,sdfPaddingRatio:i,sdfDecodeCoeff:a}=_i(r);return e?{size:[t,s],image:new Uint32Array(e.buffer),sdf:!0,simplePattern:!0,sdfPaddingRatio:i,sdfDecodeCoeff:a,anchorX:0,anchorY:0}:null}let ze=class{constructor(r,e){this._width=0,this._height=0,this._free=[],this._width=r,this._height=e,this._free.push(new H(0,0,r,e))}get width(){return this._width}get height(){return this._height}allocate(r,e){if(r>this._width||e>this._height)return new H;let t=null,s=-1;for(let i=0;ir&&this._free.push(new H(t.x+r,t.y,t.width-r,e)),t.height>e&&this._free.push(new H(t.x,t.y+e,t.width,t.height-e))):(t.width>r&&this._free.push(new H(t.x+r,t.y,t.width-r,t.height)),t.height>e&&this._free.push(new H(t.x,t.y+e,r,t.height-e))),new H(t.x,t.y,r,e))}release(r){for(let e=0;eMath.floor(r/256);function sa(r){const e=new Set;for(const t of r)e.add(ia(t));return e}function aa(r,e,t){return r.has(e)||r.set(e,t().then(()=>{r.delete(e)}).catch(s=>{r.delete(e),Nr(s)})),r.get(e)}const oa=r=>({rect:new H(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:r,sdf:!0});let na=class{constructor(r,e,t){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=r,this.height=e,this._glyphSource=t,this._binPack=new ze(r-4,e-4),this._glyphData.push(new Uint8Array(r*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const r of this._textures)r&&r.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const r=[117,149,181,207,207,181,149,117],e=[],t=[];for(let a=0;a=3&&a<5&&n>=3&&n<8?255:0;e.push(o),t.push(l)}}const s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},i={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)};this._recordGlyph(s),this._recordGlyph(i)}getTexture(r,e){if(!this._textures[e]){const t=new k;t.pixelFormat=A.ALPHA,t.wrapMode=F.CLAMP_TO_EDGE,t.width=this.width,t.height=this.height,this._textures[e]=new J(r,t,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(r,e,t){const s=this._getGlyphCache(r);return await this._fetchRanges(r,e,t),e.map(i=>this._getMosaicItem(s,r,i))}bind(r,e,t,s){const i=this.getTexture(r,t);i.setSamplingMode(e),r.bindTexture(i,s)}preloadASCIIGlyphCache(r){const e=this._preloadCache[r];if(e!=null)return e;const t=this._glyphSource.preloadASCIIRange(r).then(()=>{const s=this._getGlyphCache(r);for(let i=0;i<256;i++)this._getMosaicItem(s,r,i)});return this._preloadCache[r]=t,t}_getGlyphCache(r){return this._glyphCache[r]||(this._glyphCache[r]={}),this._glyphCache[r]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(r,e,t){const s=sa(e),i=[];s.forEach(a=>{i.push(this._fetchRange(r,a,t))}),await Promise.all(i)}async _fetchRange(r,e,t){if(e>ra)return;const s=r+e;return aa(this._rangePromises,s,()=>this._glyphSource.getRange(r,e,t))}_getMosaicItem(r,e,t){if(!r[t]){const s=this._glyphSource.getGlyph(e,t);if(!s?.metrics)return oa(t);const i=this._recordGlyph(s),a=this._currentPage,o=s.metrics;r[t]={rect:i,page:a,metrics:o,code:t,sdf:!0},this._invalidate()}return r[t]}_recordGlyph(r){const e=r.metrics;let t;if(e.width===0)t=new H(0,0,0,0);else{const s=e.width+6,i=e.height+2*3;t=this._binPack.allocate(s,i),t.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new ze(this.width-4,this.height-4),t=this._binPack.allocate(s,i));const a=this._glyphData[this._currentPage],o=r.bitmap;let n,l;if(o)for(let h=0;h{s.addRange(e,new jt(new Bt(new Uint8Array(n.data),new DataView(n.data))))})}async preloadASCIIRange(r){const e=this._getFontStack(r),t=0,s=255,i=this._baseURL.replace("{fontstack}",r).replace("{range}",t+"-"+s),a=await ge(i,{responseType:"array-buffer"}),o=new jt(new Bt(new Uint8Array(a.data),new DataView(a.data)));for(let n=t;n<=s;n++)e.getRange(n)||e.addRange(n,o)}getGlyph(r,e){const t=this._getFontStack(r);if(!t)return;const s=Math.floor(e/256),i=t.getRange(s);return i?{metrics:i.getMetrics(e),bitmap:i.getBitmap(e)}:void 0}_getFontStack(r){let e=this._glyphInfo[r];return e||(e=this._glyphInfo[r]=new la),e}};const me=1e20;let ca=class{constructor(r,e=2){this._textureSize=r,this._rasterizationScale=e,this._canvasSize=this._textureSize*this._rasterizationScale,this._svg=null;const{_canvasSize:t}=this,s=document.createElement("canvas");s.width=s.height=t,this._context=s.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(t*t),this._gridInner=new Float64Array(t*t),this._f=new Float64Array(t),this._d=new Float64Array(t),this._z=new Float64Array(t+1),this._v=new Int16Array(t)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg=Jr(this._svg)}draw(r,e,t){const{_canvasSize:s,_textureSize:i,_rasterizationScale:a}=this,o=i/4;this._initSVG();const n=this.createSVGString(r,e);return new Promise((l,h)=>{const c=new Image;c.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),c.onload=()=>{c.onload=null,this._context.clearRect(0,0,s,s),this._context.drawImage(c,0,0,s,s);const d=this._context.getImageData(0,0,s,s),p=new Uint8Array(i*i*4);for(let _=0;_h(Lr()))})}_initSVG(){return this._svg||(this._svg=Qr()),this._svg}createSVGString(r,e){const t=this._initSVG(),s=Zr("path");s.setAttribute("d",r),t.appendChild(s);const i=s.getBBox(),a=i.width/i.height,o=this._canvasSize/2;let n,l,h;if(a>1){n=o/i.width;const p=o*(1/a);l=this._canvasSize/4,h=o-p/2}else n=o/i.height,l=o-o*a/2,h=this._canvasSize/4;const c=-i.x*n+l,u=-i.y*n+h;s.setAttribute("style",`transform: matrix(${n}, 0, 0, ${n}, ${c}, ${u})`),s.setAttribute("stroke-width",""+.5/n);const d=`${t.innerHTML}`;return t.removeChild(s),d}_edt(r,e,t){const s=this._f,i=this._d,a=this._v,o=this._z;for(let n=0;n0&&(this._maxItemSize=s),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new ze(this._pageWidth,this._pageHeight);const i=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(i*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],s=t.mosaicsData;if(!te(t.mosaicsData))throw new fe("mapview-invalid-resource","unsuitable data type!");const i=e.spriteData,a=s.data;vr._copyBits(i,e.spriteSize[0],0,0,a,e.pageSize[0],e.rect.x+Z,e.rect.y+Z,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Z,t+=2*Z;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize{this._frameData=a,e.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=es(this._animation,t,s,i)}destroy(){this._playHandle.remove()}loadFrame(r){const e=this._frameData;if(e==null)return;const t="width"in e?e.width:e.codedWidth,s="height"in e?e.height:e.codedHeight;r.updateData(0,Z,Z,t,s,e),this._frameData=null}},ma=class{constructor(){this._entries=new fa,this._nodes=new Map,this._book=new ga}add(r){let e=this._entries.get(r);if(!e){const t=this._book.add(r),s=new Object;e={location:t,references:0,handle:s};const i=this._entries.set(r,e);this._nodes.set(s,i)}return e.references++,e}remove(r){const e=this._nodes.get(r.handle);e&&e.payload&&(e.payload.references--,e.payload.references===0&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(r.handle)))}getTexture(r,e){return this._book.getTexture(r,e)}destroy(){this._book.destroy()}},_a=class br{constructor(e,t){this.parent=e,this.key=t,this.payload=null,this._children=new Map}get(e){return this._children.get(e)}ensure(e){let t=this._children.get(e);return t||(t=new br(this,e),this._children.set(e,t)),t}delete(e){this._children.delete(e)}},fa=class{constructor(){this._root=new _a(null,NaN)}set(r,e){let t=this._root;for(const s of r)for(const i of s)t=t.ensure(i);return t.payload=e,t}delete(r){r.parent?.delete(r.key)}get(r){let e=this._root;for(const t of r)for(const s of t){const i=e.get(s);if(!i)return;e=i}return e.payload||void 0}},ga=class{constructor(){this._pages=[]}add(r){this._pages.length===0&&this._pages.push(new Yt);let e=this._pages.length-1,t=this._pages[e].add(r);if(t||(this._pages.push(new Yt),e=this._pages.length-1,t=this._pages[e].add(r)),!t)throw new Error("Data allocation failed.");return{...t,page:e}}remove(r){this._pages[r.page].remove(r)}getTexture(r,e){return this._pages[e].getTexture(r)}destroy(){}},Yt=class{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(r){if(r.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=r.length,e.column>=this._columns&&(e.column=r.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const t={...this._cursor};t.column-=r.length;let s=4*(t.row*this._columns+t.column);for(let i=0;ist.getLogger("esri.views.2d.engine.webgl.TextureManager"),re=(r,e,t)=>ya().error(new fe(r,e,t));let va=class wr{static fromMosaic(e,t){return new wr(e,t.page,t.sdf)}constructor(e,t,s){this.mosaicType=e,this.page=t,this.sdf=s}};class ba{constructor(e){this._requestRender=e,this._resourceManager=new Zs,this._invalidFontsMap=new Map,this._sdfConverter=new ca(Ne),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new ts({concurrency:10,process:async(t,s)=>{it(s);try{return await ge(t,{responseType:"image",signal:s})}catch(i){throw vt(i)?i:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,i)}}}),this.animationStore=new ma,this._spriteMosaic=new ua(2048,2048,500),this._glyphSource=new ha(`${Fr.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new na(1024,1024,this._glyphSource),this._rasterizer=new ta(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return re("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type==="animation-info"){const{resource:a}=e,o=this.animationStore.add(a),{location:n}=o;return{rect:new H(n.column,n.row,a.length,1),page:n.page,type:"sprite",width:a.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,sdfDecodeCoeff:1,simplePattern:!1}}if(e.type!=="cim-rasterization-info")return re("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:s}=e;if(s.type==="text"){const a=await this._rasterizeText(s,t);for(const o of a.glyphs)this._setTextureBinding(we.GLYPH,o);return a}const i=await this._rasterizeSprite(s,t);return i&&this._setTextureBinding(we.SPRITE,i),i}getMosaicInfo(e,t,s=!1){const i=this._getTextureBindingInfo(e,t,s);return i?{size:i.size,texture:{texture:i.texture,unit:i.type==="sprite"?gi:Ot}}:(re("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,s){const i=this._bindingInfos[t-1],a=i.page,o=s?q.LINEAR_MIPMAP_LINEAR:q.LINEAR;switch(i.mosaicType){case we.SPRITE:{const n=[this.sprites.getWidth(a),this.sprites.getHeight(a)],l=this._spriteMosaic.getTexture(e,a);return l.setSamplingMode(o),{type:"sprite",texture:l,size:n}}case we.GLYPH:{const n=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,a);return this._glyphMosaic.bind(e,o,a,Ot),l.setSamplingMode(o),{type:"glyph",texture:l,size:n}}default:return re("mapview-texture-manager",`Cannot handle unknown type ${i.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const s=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(s)){const i=va.fromMosaic(e,t),a=this._bindingInfos.length+1;this._hashToBindingIndex.set(s,a),this._bindingInfos.push(i)}t.textureBinding=this._hashToBindingIndex.get(s)}async _rasterizeText(e,t){const{font:s,textString:i}=e,a=jr(s),o=this._invalidFontsMap.has(a),[n,l]=Xr(i),h=Ji(n);try{const c=o?Kt:a;return K("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,h,t),isRightToLeft:l}}catch{return re("mapview-invalid-resource",`Couldn't find font ${a}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(a,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Kt,h,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${or(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(Qi(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const s=ir(this._hashSpriteResource(e));if(this._spriteMosaic.has(s))return this._spriteMosaic.getSpriteItem(s);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const i=[];le.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,i),i.length>0&&await Promise.all(i)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(s,e):this._handleAsyncResource(s,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(s,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(s,e)}}_rasterizeJSONResource(e,t){const s=this._rasterizer.rasterizeJSONResource(t);if(s){const{size:i,image:a,sdf:o,simplePattern:n,rasterizationScale:l,sdfPaddingRatio:h,sdfDecodeCoeff:c}=s;return this._addItemToMosaic(e,i,{type:"static",data:a},Se(t),o,n,l,h,c)}return null}async _handleAsyncResource(e,t,s){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let i;return i=t.type==="path"?this._handleSVG(t,e,s):this._handleImage(t,e,s),this._ongoingRasterizations.set(e,i),i.finally(()=>this._ongoingRasterizations.delete(e)),i}async _handleSVG(e,t,s){const i=[Ne,Ne],{asFill:a}=e,o=await this._sdfConverter.draw(e.path,a,s);return this._addItemToMosaic(t,i,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,s){const i=e.url,a=this.resourceManager.getResource(i);if(a==null)return null;const{width:o,height:n}=a;if(a instanceof HTMLImageElement){if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const d="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:p,sdf:_,image:m}=this._rasterizer.rasterizeImageResource(o,n,a,d);return this._addItemToMosaic(t,p,{type:"static",data:m},Se(e),_,!1)}let l,h,c;e.type==="animated"?(l=!1,h={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=Se(e),h={type:"CIMAnimatedSymbolProperties"},c=0);const u=new pa(a,this._requestRender,h,c);return this._addItemToMosaic(t,[u.width,u.height],{type:"animated",data:u},l,!1,!1)}async _handleImage(e,t,s){const i=e.url;if(xa(i)||Sa(i))return this._handleGIFOrPNG(e,t,s);if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let a;const o=this.resourceManager.getResource(i);if(o!=null&&o instanceof HTMLImageElement)a=o;else{const{data:p}=await this._imageRequestQueue.push(i,{...s});a=p}if(Zi(i)){if("width"in e&&"height"in e)a.width=se(e.width),a.height=se(e.height);else if("cim"in e){const p=e;a.width=se(p.width??p.scaleX*p.size),a.height=se(p.size)}}if(!a.width||!a.height)return null;const n=a.width,l=a.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:u,image:d}=this._rasterizer.rasterizeImageResource(n,l,a,h);return this._addItemToMosaic(t,c,{type:"static",data:d},Se(e),u,!1)}catch(a){throw vt(a)?a:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${i}. ${a.message}`)}}_addItemToMosaic(e,t,s,i,a,o,n,l,h){return this._spriteMosaic.addSpriteItem(e,t,s,i,a,o,n,l,h)}}function Se(r){switch(r.type){case"CIMVectorMarker":case"CIMPictureMarker":return Pa(r);default:return!0}}const wa=r=>r!=null&&r.startsWith("data:image/gif"),xa=r=>r&&(r.includes(".gif")||wa(r)),Ma=r=>r!=null&&r.startsWith("data:image/png"),Sa=r=>r&&(r.includes(".png")||Ma(r)),Pa=r=>r&&"markerPlacement"in r&&r.markerPlacement&&r.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Ca=class{constructor(r){this._queue=[],this._refreshable=r}destroy(){this._queue=[]}enqueueTextureUpdate(r,e){const t=kr(),s=r,i=Pi,a=Math.ceil(s.height/i);it(e);for(let o=0;ot.reject(o)),t.promise}upload(){let r=0;for(;this._queue.length;){const e=performance.now(),t=this._queue.shift();if(t){if(t.options.signal!=null&&t.options.signal.aborted)continue;switch(t.type){case"chunk":this._uploadChunk(t);break;case"no-chunk":this._uploadNoChunk(t)}const s=performance.now()-e;if(r+=s,r+s>=yi)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(r){const{request:e,resolver:t,chunkOffset:s,chunkIsLast:i,destHeight:a}=r,{data:o,texture:n,width:l}=e;o!=null&&(n.updateData(0,0,s,l,a,o,s),i&&t.resolve())}_uploadNoChunk(r){const{request:e,resolver:t}=r,{data:s,texture:i}=e;i.setData(s),t.resolve()}};const Oa=ns(-.5,-.5);class Ta{constructor(){this._centerNdc=Be(),this._pxToNdc=Be(),this._worldDimensionsPx=Be(),this._mat3=Fe(),this._initialized=!1}dispose(){this._program=z(this._program),this._quad=z(this._quad)}render(e,t,s){const{context:i}=e,a=this._updateGeometry(e,s);if(t!=null){const{r:o,g:n,b:l,a:h}=t;i.setClearColor(h*o/255,h*n/255,h*l/255,h)}else i.setClearColor(0,0,0,0);if(i.setStencilFunction(tt.ALWAYS,0,255),i.setStencilWriteMask(255),!a)return i.setClearStencil(et),void i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT);i.setClearStencil(vi),i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(Ve.KEEP,Ve.KEEP,Ve.REPLACE),i.setStencilFunction(tt.ALWAYS,et,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.bind(),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=Ee(e,Li);t&&(this._program=t,this._quad=new ye(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:s,pixelRatio:i}=e,{size:a,rotation:o}=s,n=Math.round(a[0]*i),l=Math.round(a[1]*i);if(!s.spatialReference.isWrappable)return!1;const h=rs(o),c=Math.abs(Math.cos(h)),u=Math.abs(Math.sin(h)),d=Math.round(n*c+l*u),p=Math.round(i*s.worldScreenWidth);if(d<=p)return!1;const _=n*u+l*c,m=(t.left-t.right)*i/n,y=(t.bottom-t.top)*i/l;Ge(this._worldDimensionsPx,p,_,1),Ge(this._pxToNdc,2/n,-2/l,1),Ge(this._centerNdc,m,y,1);const g=this._mat3;return as(g,this._centerNdc),Dt(g,g,this._pxToNdc),o!==0&&pr(g,g,h),Dt(g,g,this._worldDimensionsPx),dr(g,g,Oa),!0}}let Ra=class extends ot{constructor(){super(...arguments),this.type=at.Blend,this._backBufferTexture=null,this.shaders={blend:new Ni,opacity:new Ui}}shutdown(){super.shutdown(),this._backBufferTexture!==null&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(r,e){const{context:t,state:s,pixelRatio:i,inFadeTransition:a,painter:o}=r,{size:n}=s,l=t.getBoundFramebufferObject();let h,c;l!=null?(h=l.width,c=l.height):(h=Math.round(i*n[0]),c=Math.round(i*n[1]));const{blendMode:u}=e;if(u==="normal"){const y={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:e.colorTexture,unit:0},opacity:e.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return o.setPipelineState(nt),void o.submitDrawMesh(t,y,o.quadMesh)}const d=this._createOrResizeTexture(r,h,c);l.copyToTexture(0,0,h,c,0,0,d);const p={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:w.ONE,dstRGB:w.ZERO,srcAlpha:w.ONE,dstAlpha:w.ZERO}},depth:!1,stencil:!1};o.setPipelineState(p);const _={backbufferTexture:{texture:d,unit:0},layerTexture:{texture:e.colorTexture,unit:1},inFadeOpacity:a?1:0,...e.config},m={shader:this.shaders.blend,uniforms:{config:_},defines:{blendMode:u},optionalAttributes:null,useComputeBuffer:!1};o.submitDrawMesh(t,m,o.quadMesh)}_createOrResizeTexture(r,e,t){const{context:s}=r;if(this._backBufferTexture!==null&&this._backBufferTexture.descriptor?.width===e&&this._backBufferTexture.descriptor?.height===t)return this._backBufferTexture;if(this._backBufferTexture===null){const i=new k;i.internalFormat=A.RGBA,i.wrapMode=F.CLAMP_TO_EDGE,i.width=e,i.height=t,this._backBufferTexture=new J(s,i)}else this._backBufferTexture.resize(e,t);return this._backBufferTexture}},Ea=class{constructor(){this._blendTechnique=new Ra}dispose(r){this._blendTechnique?.shutdown()}draw(r,e,t,s,i){this._blendTechnique.render(r,{colorTexture:e,config:{opacity:i,samplingMode:t},blendMode:s})}},ut=class{constructor(){this.name=this.constructor.name}createOptions(r,e){return null}},Jt=class extends ut{constructor(r){super(),this.name=this.constructor.name,this.defines=[r]}dispose(){}bind({context:r,painter:e}){this._prev=r.getBoundFramebufferObject();const t=e.getFbos().effect0;r.bindFramebuffer(t),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(r.gl.COLOR_BUFFER_BIT)}unbind(){}draw(r,e){const{context:t,painter:s}=r,i=s.getPostProcessingEffects(e),a=t.getBoundFramebufferObject();for(const{postProcessingEffect:o,effect:n}of i)o.draw(r,a,n);t.bindFramebuffer(this._prev),t.setStencilTestEnabled(!1),s.blitTexture(t,a.colorTexture,q.NEAREST),t.setStencilTestEnabled(!0)}},za=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",$r),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}finalBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Hr),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}renderHighlight(r,e,t){r.bindTexture(e,pe),r.useProgram(this._resources.highlightProgram),t.applyHighlightOptions(r,this._resources.highlightProgram),r.bindVAO(this._resources.quadVAO),r.setBlendingEnabled(!0),r.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}_initialize(r,e,t){this._width=e,this._height=t;const s=hr.createVertex(r,cr.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),i=new ur(r,new Map([["a_position",0],["a_texcoord",1]]),new Map([["geometry",[new Lt("a_position",2,It.BYTE,0,4),new Lt("a_texcoord",2,It.UNSIGNED_BYTE,2,4)]]]),new Map([["geometry",s]])),a=Ee(r,Vi),o=Ee(r,Gi);r.useProgram(a),a.setUniform1i("u_texture",pe),a.setUniform1i("u_shade",Ci),a.setUniform1f("u_sigma",bt),r.useProgram(o),o.setUniform1i("u_texture",pe),o.setUniform1f("u_sigma",bt),this._resources={quadGeometry:s,quadVAO:i,highlightProgram:a,blurProgram:o}}setup(r,e,t){this._resources?(this._width=e,this._height=t):this._initialize(r,e,t)}};function Qt(r,e,t){const s=new k(e,t);return s.wrapMode=F.CLAMP_TO_EDGE,new X(r,s,new ct(lt.STENCIL_INDEX8,e,t))}let Fa=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,t){this._width=e,this._height=t;const s=Qt(r,e,t),i=Qt(r,e,t);this._resources={sharedBlur1Fbo:s,sharedBlur2Fbo:i}}setup(r,e,t){!this._resources||this._width===e&&this._height===t||this.dispose(),this._resources||this._initialize(r,e,t)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const ie=4,Pe=4/ie;let ka=class extends ut{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new za,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Fa,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new yr}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(r){const{context:e,painter:t}=r,{width:s,height:i}=e.getViewport(),a=t.getFbos().effect0;this.setup(r,s,i),e.bindFramebuffer(a),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:r},e,t){this._width=e,this._height=t;const s=e%ie,i=t%ie;e+=sl.resolve([]));const a=i.getFBO(t),o=new Uint8Array(a.width*a.height*4);try{await a.readPixelsAsync(0,0,a.width,a.height,A.RGBA,ht.UNSIGNED_BYTE,o)}catch{return void e.forEach(l=>l.resolve([]))}const n=[];for(let l=0;ll.resolve(n))}};const Xe=5,Ia=[1,0],Ba=[0,1],Da=[1,.8,.6,.4,.2],La=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Na=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(Xe),this._nMips=Xe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=z(this._quad),this._intensityFBO=z(this._intensityFBO),this._compositeFBO=z(this._compositeFBO),this._mipsFBOs){for(let r=0;rnew $a,blur:()=>new Ga,bloom:()=>new Na,opacity:()=>new ja,"drop-shadow":()=>new qa};let Ka=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(r=>r.dispose()),this._effectMap.clear()}getPostProcessingEffects(r){if(!r||r.length===0)return[];const e=[];for(const t of r){const s=Xa(t.type);let i=this._effectMap.get(s);i||(i=Ya[s](),this._effectMap.set(s,i)),e.push({postProcessingEffect:i,effect:t})}return e}},Ja=class{constructor(r,e){this.brushes=r,this.name=e.name,this.drawPhase=e.drawPhase||W.MAP,this._targetFn=e.target,this.effects=e.effects||[],this.enableDefaultDraw=e.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!e.forceDrawByDisplayOrder}render(r){const{context:e,profiler:t}=r,s=this._targetFn(),i=this.drawPhase&r.drawPhase;if(t.recordPassStart(this.name),i){this.enableDefaultDraw()&&this._doRender(r,s),t.recordPassEnd();for(const a of this.effects){if(!a.enable())continue;const o=a.apply,n=a.args?.(),l=e.getViewport(),h=e.getBoundFramebufferObject(),c=r.passOptions;this._bindEffect(r,o,n),this._doRender(r,s,o.defines),this._drawAndUnbindEffect(r,o,l,h,c,n)}}}_doRender(r,e,t){if(e==null)return;const{profiler:s,context:i}=r;for(const a of this.brushes){if(s.recordBrushStart(a.name),a.brushEffect!=null){const o=i.getViewport(),n=i.getBoundFramebufferObject(),l=r.passOptions;this._bindEffect(r,a.brushEffect),this._drawWithBrush(a,r,e,t),this._drawAndUnbindEffect(r,a.brushEffect,o,n,l)}else this._drawWithBrush(a,r,e,t);s.recordBrushEnd()}}_drawWithBrush(r,e,t,s){Ir(t)?(r.prepareState(e,s),r.drawMany(e,t,s)):t.visible&&(r.prepareState(e,s),r.draw(e,t,s))}_bindEffect(r,e,t){const{profiler:s}=r;s.recordPassStart(this.name+"."+e.name),e.bind(r,t);const i=e.createOptions(r,t);r.passOptions=i}_drawAndUnbindEffect(r,e,t,s,i,a){const{profiler:o,context:n}=r;r.passOptions=i,o.recordBrushStart(e.name),e.draw(r,a),e.unbind(r,a),n.bindFramebuffer(s);const{x:l,y:h,width:c,height:u}=t;n.setViewport(l,h,c,u),o.recordBrushEnd(),o.recordPassEnd()}};class Zt{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,s,i,a){const o=e.getShaderKey(t,s,i,a);let n=this._programCache.get(o);return n||(n=e.getProgram(t,s,i,a),this._programCache.set(o,n)),n}}let Qa=class{constructor(r,e){this.context=r,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new yr,this._worldExtentRenderer=new Ta,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Js,this._blendEffect=new Ea,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new ka,hittest:new Aa,insideEffect:new Jt("inside"),outsideEffect:new Jt("outside")},this._programCache=new Zt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Qs(r),this.textureManager=new ba(e),this.textureUploadManager=new Ca(e),this._effectsManager=new Ka,this._quadMesh=ri.fromVertexStream(r,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=z(this._blitRenderer),this._worldExtentRenderer=z(this._worldExtentRenderer),this._quadMesh=rt(this._quadMesh),this._brushCache&&(this._brushCache.forEach(r=>r.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let r;for(r in this._fbos)this._fbos[r]&&this._fbos[r].dispose()}for(const r of this._fboPool)r.dispose();if(this._fboPool.length=0,this.effects){let r;for(r in this.effects)this.effects[r]&&this.effects[r].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=z(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new Zt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(r,e){let t;if(this._fboPool.length>0)t=this._fboPool.pop();else{const s=new k(r,e);s.samplingMode=q.NEAREST,s.wrapMode=F.CLAMP_TO_EDGE,t=new X(this.context,s,this._stencilBuf)}return t.width===r&&t.height===e||t.resize(r,e),t}releaseFbo(r){this._fboPool.push(r)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(r,e,t){const{context:s}=r;this._worldExtentRenderer.render(r,e,t);const{width:i,height:a}=s.getViewport();if(this.updateFBOs(i,a),this._prevFBO=s.getBoundFramebufferObject(),s.bindFramebuffer(this.getFbos().output),s.setColorMask(!0,!0,!0,!0),e!=null){const{r:o,g:n,b:l,a:h}=e;s.setClearColor(h*o/255,h*n/255,h*l/255,h)}else s.setClearColor(0,0,0,0);s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}afterRenderPhases(r){const{context:e}=r;e.bindFramebuffer(this._prevFBO),e.setStencilFunction(tt.EQUAL,et,255),e.setStencilTestEnabled(!0),e.setDepthTestEnabled(!1),this.blitTexture(e,this.getFbos().output.colorTexture,q.NEAREST)}beforeRenderLayer(r,e,t){const{context:s,blendMode:i,effects:a,drawPhase:o,requireFBO:n}=r;if(n||er(o,i,a,t)){const l=s.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(l);const{width:h,height:c}=s.getViewport(),u=this.acquireFbo(h,c);s.bindFramebuffer(u),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}s.setDepthWriteEnabled(!1),s.setDepthTestEnabled(!1),s.setStencilTestEnabled(!0),s.setClearStencil(e),s.setStencilWriteMask(255),s.clear(s.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(r,e){const{context:t,blendMode:s,effects:i,requireFBO:a,drawPhase:o}=r;if(a||er(o,s,i,e)){const n=t.getBoundFramebufferObject();i!=null&&i.length>0&&o===W.MAP&&(t.setColorMask(!0,!0,!0,!0),this._applyEffects(r,i,n)),t.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),t.setStencilTestEnabled(!1),t.setStencilWriteMask(0),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const l=s==null||o===W.HIGHLIGHT||o===W.LABEL?"normal":s;this._blendEffect.draw(r,n.colorTexture,q.NEAREST,l,e),this.releaseFbo(n)}}renderObject(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.prepareState(r),a.draw(r,e,s)}renderObjects(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.drawMany(r,e,s)}registerRenderPass(r){const e=r.brushes.map(t=>(this._brushCache.has(t)||this._brushCache.set(t,new t),this._brushCache.get(t)));return new Ja(e,r)}blitTexture(r,e,t,s=1){r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(r,e,t,s),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(r){return this._effectsManager.getPostProcessingEffects(r)}updateFBOs(r,e){if(r!==this._lastWidth||e!==this._lastHeight){if(this._lastWidth=r,this._lastHeight=e,this._fbos){let i;for(i in this._fbos)this._fbos[i].resize(r,e);return}const t=new k(r,e);t.samplingMode=q.NEAREST,t.wrapMode=F.CLAMP_TO_EDGE;const s=new ct(lt.DEPTH_STENCIL,r,e);this._stencilBuf=new ls(this.context,s),this._fbos={output:new X(this.context,t,this._stencilBuf),effect0:new X(this.context,t,this._stencilBuf)}}}_applyEffects(r,e,t){const{context:s}=r,i=this._effectsManager.getPostProcessingEffects(e);for(const{postProcessingEffect:a,effect:o}of i)s.bindFramebuffer(t),a.draw(r,t,o);this._currentPipelineStateNeedsUpdate=!0}setShader(r){this._shaderState.shader=r.shader,this._shaderState.uniforms=r.uniforms,this._shaderState.defines=r.defines,this._shaderState.optionalAttributes=r.optionalAttributes,this._shaderState.useComputeBuffer=r.useComputeBuffer??!1}setPipelineState(r){r!==this._currentPipelineState&&(this._currentPipelineState=r,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(r,e){const{shader:t,uniforms:s,defines:i,optionalAttributes:a}=this._shaderState,o=r.context,n=e.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(t,n,s,i??{},a??{});return l.setUniforms(s),l.bind(o),this.updatePipelineState(o),this.setStencilRef(o,e),e.draw(r,t.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(r,e,t,s){this.submitDrawMeshUntyped(r,e,t,s)}submitDrawMeshUntyped(r,e,t,s){this.setShader(e);const{shader:i,uniforms:a,defines:o,optionalAttributes:n}=this._shaderState,l=this._programCache.getProgram(i,{},a,o??{},n??{});if(l.setUniforms(a),l.bind(r),this.updatePipelineState(r),s)for(const h of s)t.bind(r,h),t.draw(r);else for(let h=0;h0)}let Za=class{constructor(){this._candidateTiles=[]}schedule(r){this._candidateTiles.includes(r)||this._candidateTiles.push(r)}reshuffle(r){const e=[];for(const t of this._candidateTiles)r>0?(t.reshuffle(),r--):e.push(t);this._candidateTiles=e}};const eo=2e3;class Rl extends Oi{constructor(e,t){super(),this.meshWriterRegistry=new hs,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=Ur(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new Za,this._canvas=new Us(e),this.context=new Hi(this._canvas.gl,t.contextOptions??{}),this.painter=new Qa(this.context,this),this._cimAnalyzer=new Bs(this.painter.textureManager.resourceManager),K("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const s=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new Vr,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new Ii(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return s()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=xr({render:i=>this.renderFrame(i)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",i=>this.emit("webgl-error",{error:new fe("webgl-context-lost",i.statusMessage)})),this._bufferPool=new Fi,ei()}destroy(){ti(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=dt(this._taskHandle),this._lostWebGLContextHandle=dt(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=eo,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Fe()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(fi),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=W.MAP;for(const i of e)i.processRender(t);if(this.children.some(i=>i.hasHighlight)){t.drawPhase=W.HIGHLIGHT;for(const i of e)i.processRender(t)}if(this.children.some(i=>i.hasLabels)){t.drawPhase=W.LABEL;for(const i of e)i.processRender(t)}if(K("esri-tiles-debug")){t.drawPhase=W.DEBUG;for(const i of e)i.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo()}doRender(e){const t=this.context,{state:s,pixelRatio:i}=e;this._canvas.resize(e),t.setViewport(0,0,i*s.size[0],i*s.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,s,i){const a=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,l=this.context,h=this._state.clone();if(i!=null){const f=h.viewpoint;h.viewpoint.rotation=i,h.viewpoint=f}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:s},u=new k(a,o);u.wrapMode=F.CLAMP_TO_EDGE,u.internalFormat=$i.RGBA8,u.isImmutable=!0;const d=new X(l,u,new ct(lt.DEPTH_STENCIL,a,o)),p=l.getBoundFramebufferObject(),_=l.getViewport();l.bindFramebuffer(d),l.setViewport(0,0,a,o),this._renderChildren(t??this.children,c);const m=this._readbackScreenshot(d,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(p),l.setViewport(_.x,_.y,_.width,_.height),this.requestRender();const y=await m;let g;return e.outputScale===1?g=y:(g=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),(await Te(()=>import("./MapView-BGOJJ8ch-Dabu63Ao.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(f=>f.U)).resampleHermite(y,g,!0)),d.dispose(),g}async _readbackScreenshot(e,t){const s=(await Te(()=>import("./MapView-BGOJJ8ch-Dabu63Ao.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(i=>i.U)).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,A.RGBA,ht.UNSIGNED_BYTE,new Uint8Array(s.data.buffer)),s}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}let to=class extends ot{constructor(){super(...arguments),this.type=at.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new Bi}}updateResources(r,e,t,s){r.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(r,e,t,s);const{context:i,pixelRatio:a}=r,{factor:o,offset:n,position:l}=s,{size:h}=r.state,c=s.size*a,u=1/o,d=Math.ceil(u*c);this._readbackTexture.resize(d,d);const p=a*h[0],_=a*h[1],m=.5*d,y=.5*d,g=mt(a*l.x,m,p-m-1),f=mt(_-a*l.y,y,_-y-1),x=g-m,b=f-y,v=this._readbackTexture;i.bindTexture(v,0),i.gl.copyTexImage2D(v.descriptor.target,0,v.descriptor.pixelFormat,x,b,d,d,0);const M=(g+n.x*a)/p*2-1,C=(f-n.y*a)/_*2-1,T=c/p*2,G=c/_*2;this._position[0]=M,this._position[1]=C,this._position[2]=T,this._position[3]=G}render(r,e){const{context:t,painter:s}=r;s.setPipelineState(nt);const i={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...e};s.submitDrawMesh(t,{shader:this.shaders.magnifier,uniforms:{config:i},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(r,e,t,s){const i=r.context;this._resourcePixelRatio=r.pixelRatio;const a=Math.ceil(s.size*r.pixelRatio);t.width=a,t.height=a;const o=new k;o.internalFormat=A.RGBA,o.wrapMode=F.CLAMP_TO_EDGE,o.samplingMode=q.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!Rr(t.src)||!r.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new J(i,o,t),e.width=a,e.height=a,o.pixelFormat=o.internalFormat=A.ALPHA,this._maskTexture=new J(i,o,e);const n=1/s.factor;o.pixelFormat=o.internalFormat=A.RGBA,o.width=o.height=Math.ceil(n*a),o.samplingMode=q.LINEAR,o.flipped=!1,this._readbackTexture=new J(i,o)}_destroyResources(){z(this._maskTexture),z(this._overlayTexture),z(this._readbackTexture)}};async function ro(r){const e=Te(()=>import("./mask-svg-DxA9o6hM-cNit2NTT.js"),[],import.meta.url),t=Te(()=>import("./overlay-svg-C7fxD_NX-DioSRl-7.js"),[],import.meta.url),s=Nt((await e).default,{signal:r}),i=Nt((await t).default,{signal:r}),a={mask:await s,overlay:await i};return it(r),a}class El extends lr{constructor(){super(),this._handles=new rr,this._magnifierTechnique=new to,this.updatingHandles=new cs,this.visible=!1}destroy(){this._handles=rt(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=Mr(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([_e(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},Ke),_e(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),_e(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==W.MAP||!this._canRender())return;const t=this._magnifier;if(t.position==null)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,t);const s=this.backgroundColor,i=s?[s.a*s.r/255,s.a*s.g/255,s.a*s.b/255,s.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:t.maskEnabled?1:0,overlayEnabled:t.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=Sr(async s=>{const i=e==null||t==null?ro(s):null,a=e!=null?ge(e,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.mask),o=t!=null?ge(t,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.overlay),[n,l]=await Promise.all([a,o]);this._mask=n,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}class io extends ot{constructor(){super(...arguments),this.type=at.Grid,this.shaders={grid:new Di}}render(e,t){const{context:s,painter:i}=e;i.setPipelineState(nt),i.submitDrawMesh(s,{shader:this.shaders.grid,uniforms:t,defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh)}}const so=50,ao=5;function oo(r,e){return Math.log(r)/Math.log(e)}function no(r,e,t){const s=r===1?10:r;return s**(t?Math.round(oo(so/e,s)):0)}function lo(r){const{isGeographic:e,isWebMercator:t}=r;return!e&&!t}function ho(r,e,t){const s=typeof r=="number"?null:r,i=s?.spatialReference;if(i==null||!Er(i)||lo(i))return _t(i);let a=s?.x??r,o=s?.y??e;const n=1/Math.sqrt(2);let l=a+n,h=o+n;const{isWebMercator:c,isGeographic:u}=i;let d=u&&!gs(i)?ft.WGS84:i;if(c){let y=new gt({x:a,y:o,spatialReference:i});yt(y,!0,y),a=y.x,o=y.y,y=new gt({x:l,y:h,spatialReference:i}),yt(y,!0,y),l=y.x,h=y.y,d=ft.WGS84}const p=new zr({paths:[[[a,o],[l,h]]],spatialReference:d}),_=_s(p,10);let m;try{[m]=ys([_],"meters")}catch{return _t(i)}return m}const Ye=os();class zl extends lr{constructor(){super(),this._handles=new rr,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new io,this._grid=null,this.visible=!0}destroy(){this._handles=rt(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([_e(()=>e?.center,()=>{this._projectedCenter=null},Ke),_e(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),Ke)])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(e.drawPhase!==W.MAP||this.grid==null||!this.visible)return;const{spacing:t,units:s,majorLineInterval:i,dynamicScaling:a,majorLineColor:o,minorLineColor:n}=this.grid;if(t===0||(this._updateDerivedValues(e),this._projectedCenter==null||this._metersPerSRUnit==null))return;const{scale:l,spatialReference:h}=e.state,c=Pr(t,s,"meters"),u=this._metersPerSRUnit*fs(l,h),d=c/u;if(!a&&da/255);return[e*i,t*i,s*i,i]}export{Nl as GraphicContainer,Dl as GraphicsView2D,zl as GridView2D,Al as LabelManager,El as MagnifierView2D,Il as MapViewNavigation,Rl as Stage}; diff --git a/custom-toc-separator/assets/mat4-DX7gBViE-B27FdgMD.js b/custom-toc-separator/assets/mat4-DX7gBViE-B27FdgMD.js new file mode 100644 index 00000000..c3e37ce8 --- /dev/null +++ b/custom-toc-separator/assets/mat4-DX7gBViE-B27FdgMD.js @@ -0,0 +1 @@ +import{dg as C}from"./story-DT1Ep1ux.js";import{n as Z}from"./common-CYWrYyJl-E8-sukrT.js";function E(n,s){return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function G(n,s,e,o,M,h,u,c,f,i,b,r,l,m,p,d,x){return n[0]=s,n[1]=e,n[2]=o,n[3]=M,n[4]=h,n[5]=u,n[6]=c,n[7]=f,n[8]=i,n[9]=b,n[10]=r,n[11]=l,n[12]=m,n[13]=p,n[14]=d,n[15]=x,n}function k(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function H(n,s){if(n===s){const e=s[1],o=s[2],M=s[3],h=s[6],u=s[7],c=s[11];n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=e,n[6]=s[9],n[7]=s[13],n[8]=o,n[9]=h,n[11]=s[14],n[12]=M,n[13]=u,n[14]=c}else n[0]=s[0],n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=s[1],n[5]=s[5],n[6]=s[9],n[7]=s[13],n[8]=s[2],n[9]=s[6],n[10]=s[10],n[11]=s[14],n[12]=s[3],n[13]=s[7],n[14]=s[11],n[15]=s[15];return n}function J(n,s){return N(n,s)||k(n),n}function N(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15],v=e*c-o*u,y=e*f-M*u,g=e*i-h*u,S=o*f-M*c,R=o*i-h*c,_=M*i-h*f,P=b*d-r*p,T=b*x-l*p,D=b*q-m*p,j=r*x-l*d,A=r*q-m*d,w=l*q-m*x;let I=v*w-y*A+g*j+S*D-R*T+_*P;return I?(I=1/I,n[0]=(c*w-f*A+i*j)*I,n[1]=(M*A-o*w-h*j)*I,n[2]=(d*_-x*R+q*S)*I,n[3]=(l*R-r*_-m*S)*I,n[4]=(f*D-u*w-i*T)*I,n[5]=(e*w-M*D+h*T)*I,n[6]=(x*g-p*_-q*y)*I,n[7]=(b*_-l*g+m*y)*I,n[8]=(u*A-c*D+i*P)*I,n[9]=(o*D-e*A-h*P)*I,n[10]=(p*R-d*g+q*v)*I,n[11]=(r*g-b*R-m*v)*I,n[12]=(c*T-u*j-f*P)*I,n[13]=(e*j-o*T+M*P)*I,n[14]=(d*y-p*S-x*v)*I,n[15]=(b*S-r*y+l*v)*I,n):null}function K(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15];return n[0]=c*(l*q-m*x)-r*(f*q-i*x)+d*(f*m-i*l),n[1]=-(o*(l*q-m*x)-r*(M*q-h*x)+d*(M*m-h*l)),n[2]=o*(f*q-i*x)-c*(M*q-h*x)+d*(M*i-h*f),n[3]=-(o*(f*m-i*l)-c*(M*m-h*l)+r*(M*i-h*f)),n[4]=-(u*(l*q-m*x)-b*(f*q-i*x)+p*(f*m-i*l)),n[5]=e*(l*q-m*x)-b*(M*q-h*x)+p*(M*m-h*l),n[6]=-(e*(f*q-i*x)-u*(M*q-h*x)+p*(M*i-h*f)),n[7]=e*(f*m-i*l)-u*(M*m-h*l)+b*(M*i-h*f),n[8]=u*(r*q-m*d)-b*(c*q-i*d)+p*(c*m-i*r),n[9]=-(e*(r*q-m*d)-b*(o*q-h*d)+p*(o*m-h*r)),n[10]=e*(c*q-i*d)-u*(o*q-h*d)+p*(o*i-h*c),n[11]=-(e*(c*m-i*r)-u*(o*m-h*r)+b*(o*i-h*c)),n[12]=-(u*(r*x-l*d)-b*(c*x-f*d)+p*(c*l-f*r)),n[13]=e*(r*x-l*d)-b*(o*x-M*d)+p*(o*l-M*r),n[14]=-(e*(c*x-f*d)-u*(o*x-M*d)+p*(o*f-M*c)),n[15]=e*(c*l-f*r)-u*(o*l-M*r)+b*(o*f-M*c),n}function L(n){const s=n[0],e=n[1],o=n[2],M=n[3],h=n[4],u=n[5],c=n[6],f=n[7],i=n[8],b=n[9],r=n[10],l=n[11],m=n[12],p=n[13],d=n[14],x=n[15];return(s*u-e*h)*(r*x-l*d)-(s*c-o*h)*(b*x-l*p)+(s*f-M*h)*(b*d-r*p)+(e*c-o*u)*(i*x-l*m)-(e*f-M*u)*(i*d-r*m)+(o*f-M*c)*(i*p-b*m)}function V(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=s[8],l=s[9],m=s[10],p=s[11],d=s[12],x=s[13],q=s[14],v=s[15];let y=e[0],g=e[1],S=e[2],R=e[3];return n[0]=y*o+g*c+S*r+R*d,n[1]=y*M+g*f+S*l+R*x,n[2]=y*h+g*i+S*m+R*q,n[3]=y*u+g*b+S*p+R*v,y=e[4],g=e[5],S=e[6],R=e[7],n[4]=y*o+g*c+S*r+R*d,n[5]=y*M+g*f+S*l+R*x,n[6]=y*h+g*i+S*m+R*q,n[7]=y*u+g*b+S*p+R*v,y=e[8],g=e[9],S=e[10],R=e[11],n[8]=y*o+g*c+S*r+R*d,n[9]=y*M+g*f+S*l+R*x,n[10]=y*h+g*i+S*m+R*q,n[11]=y*u+g*b+S*p+R*v,y=e[12],g=e[13],S=e[14],R=e[15],n[12]=y*o+g*c+S*r+R*d,n[13]=y*M+g*f+S*l+R*x,n[14]=y*h+g*i+S*m+R*q,n[15]=y*u+g*b+S*p+R*v,n}function U(n,s,e){const o=e[0],M=e[1],h=e[2];if(s===n)n[12]=s[0]*o+s[4]*M+s[8]*h+s[12],n[13]=s[1]*o+s[5]*M+s[9]*h+s[13],n[14]=s[2]*o+s[6]*M+s[10]*h+s[14],n[15]=s[3]*o+s[7]*M+s[11]*h+s[15];else{const u=s[0],c=s[1],f=s[2],i=s[3],b=s[4],r=s[5],l=s[6],m=s[7],p=s[8],d=s[9],x=s[10],q=s[11];n[0]=u,n[1]=c,n[2]=f,n[3]=i,n[4]=b,n[5]=r,n[6]=l,n[7]=m,n[8]=p,n[9]=d,n[10]=x,n[11]=q,n[12]=u*o+b*M+p*h+s[12],n[13]=c*o+r*M+d*h+s[13],n[14]=f*o+l*M+x*h+s[14],n[15]=i*o+m*M+q*h+s[15]}return n}function W(n,s,e){const o=e[0],M=e[1],h=e[2];return n[0]=s[0]*o,n[1]=s[1]*o,n[2]=s[2]*o,n[3]=s[3]*o,n[4]=s[4]*M,n[5]=s[5]*M,n[6]=s[6]*M,n[7]=s[7]*M,n[8]=s[8]*h,n[9]=s[9]*h,n[10]=s[10]*h,n[11]=s[11]*h,n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function $(n,s,e,o){let M=o[0],h=o[1],u=o[2],c=Math.sqrt(M*M+h*h+u*u);if(c<=Z())return void E(n,s);c=1/c,M*=c,h*=c,u*=c;const f=Math.sin(e),i=Math.cos(e),b=1-i,r=s[0],l=s[1],m=s[2],p=s[3],d=s[4],x=s[5],q=s[6],v=s[7],y=s[8],g=s[9],S=s[10],R=s[11],_=M*M*b+i,P=h*M*b+u*f,T=u*M*b-h*f,D=M*h*b-u*f,j=h*h*b+i,A=u*h*b+M*f,w=M*u*b+h*f,I=h*u*b-M*f,F=u*u*b+i;n[0]=r*_+d*P+y*T,n[1]=l*_+x*P+g*T,n[2]=m*_+q*P+S*T,n[3]=p*_+v*P+R*T,n[4]=r*D+d*j+y*A,n[5]=l*D+x*j+g*A,n[6]=m*D+q*j+S*A,n[7]=p*D+v*j+R*A,n[8]=r*w+d*I+y*F,n[9]=l*w+x*I+g*F,n[10]=m*w+q*I+S*F,n[11]=p*w+v*I+R*F,s!==n&&(n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15])}function a(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[4],u=s[5],c=s[6],f=s[7],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[4]=h*M+i*o,n[5]=u*M+b*o,n[6]=c*M+r*o,n[7]=f*M+l*o,n[8]=i*M-h*o,n[9]=b*M-u*o,n[10]=r*M-c*o,n[11]=l*M-f*o,n}function t(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M-i*o,n[1]=u*M-b*o,n[2]=c*M-r*o,n[3]=f*M-l*o,n[8]=h*o+i*M,n[9]=u*o+b*M,n[10]=c*o+r*M,n[11]=f*o+l*M,n}function n1(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[4],b=s[5],r=s[6],l=s[7];return s!==n&&(n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M+i*o,n[1]=u*M+b*o,n[2]=c*M+r*o,n[3]=f*M+l*o,n[4]=i*M-h*o,n[5]=b*M-u*o,n[6]=r*M-c*o,n[7]=l*M-f*o,n}function s1(n,s){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=s[0],n[13]=s[1],n[14]=s[2],n[15]=1,n}function o1(n,s){return n[0]=s[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=s[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e1(n,s,e){if(s===0)return k(n);let o=e[0],M=e[1],h=e[2],u=Math.sqrt(o*o+M*M+h*h);if(u<=Z())return null;u=1/u,o*=u,M*=u,h*=u;const c=Math.sin(s),f=Math.cos(s),i=1-f;return n[0]=o*o*i+f,n[1]=M*o*i+h*c,n[2]=h*o*i-M*c,n[3]=0,n[4]=o*M*i-h*c,n[5]=M*M*i+f,n[6]=h*M*i+o*c,n[7]=0,n[8]=o*h*i+M*c,n[9]=M*h*i-o*c,n[10]=h*h*i+f,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function M1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function h1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function u1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Y(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=o+o,f=M+M,i=h+h,b=o*c,r=o*f,l=o*i,m=M*f,p=M*i,d=h*i,x=u*c,q=u*f,v=u*i;return n[0]=1-(m+d),n[1]=r+v,n[2]=l-q,n[3]=0,n[4]=r-v,n[5]=1-(b+d),n[6]=p+x,n[7]=0,n[8]=l+q,n[9]=p-x,n[10]=1-(b+m),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function i1(n,s){const e=c1,o=-s[0],M=-s[1],h=-s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=o*o+M*M+h*h+u*u;return r>0?(e[0]=2*(c*u+b*o+f*h-i*M)/r,e[1]=2*(f*u+b*M+i*o-c*h)/r,e[2]=2*(i*u+b*h+c*M-f*o)/r):(e[0]=2*(c*u+b*o+f*h-i*M),e[1]=2*(f*u+b*M+i*o-c*h),e[2]=2*(i*u+b*h+c*M-f*o)),Y(n,s,e),n}const c1=C();function f1(n,s){return n[0]=s[12],n[1]=s[13],n[2]=s[14],n}function r1(n,s){const e=s[0],o=s[1],M=s[2],h=s[4],u=s[5],c=s[6],f=s[8],i=s[9],b=s[10];return n[0]=Math.sqrt(e*e+o*o+M*M),n[1]=Math.sqrt(h*h+u*u+c*c),n[2]=Math.sqrt(f*f+i*i+b*b),n}function b1(n,s){const e=s[0]+s[5]+s[10];let o=0;return e>0?(o=2*Math.sqrt(e+1),n[3]=.25*o,n[0]=(s[6]-s[9])/o,n[1]=(s[8]-s[2])/o,n[2]=(s[1]-s[4])/o):s[0]>s[5]&&s[0]>s[10]?(o=2*Math.sqrt(1+s[0]-s[5]-s[10]),n[3]=(s[6]-s[9])/o,n[0]=.25*o,n[1]=(s[1]+s[4])/o,n[2]=(s[8]+s[2])/o):s[5]>s[10]?(o=2*Math.sqrt(1+s[5]-s[0]-s[10]),n[3]=(s[8]-s[2])/o,n[0]=(s[1]+s[4])/o,n[1]=.25*o,n[2]=(s[6]+s[9])/o):(o=2*Math.sqrt(1+s[10]-s[0]-s[5]),n[3]=(s[1]-s[4])/o,n[0]=(s[8]+s[2])/o,n[1]=(s[6]+s[9])/o,n[2]=.25*o),n}function l1(n,s,e,o){const M=s[0],h=s[1],u=s[2],c=s[3],f=M+M,i=h+h,b=u+u,r=M*f,l=M*i,m=M*b,p=h*i,d=h*b,x=u*b,q=c*f,v=c*i,y=c*b,g=o[0],S=o[1],R=o[2];return n[0]=(1-(p+x))*g,n[1]=(l+y)*g,n[2]=(m-v)*g,n[3]=0,n[4]=(l-y)*S,n[5]=(1-(r+x))*S,n[6]=(d+q)*S,n[7]=0,n[8]=(m+v)*R,n[9]=(d-q)*R,n[10]=(1-(r+p))*R,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function m1(n,s,e,o,M){const h=s[0],u=s[1],c=s[2],f=s[3],i=h+h,b=u+u,r=c+c,l=h*i,m=h*b,p=h*r,d=u*b,x=u*r,q=c*r,v=f*i,y=f*b,g=f*r,S=o[0],R=o[1],_=o[2],P=M[0],T=M[1],D=M[2],j=(1-(d+q))*S,A=(m+g)*S,w=(p-y)*S,I=(m-g)*R,F=(1-(l+q))*R,Q=(x+v)*R,X=(p+y)*_,O=(x-v)*_,z=(1-(l+d))*_;return n[0]=j,n[1]=A,n[2]=w,n[3]=0,n[4]=I,n[5]=F,n[6]=Q,n[7]=0,n[8]=X,n[9]=O,n[10]=z,n[11]=0,n[12]=e[0]+P-(j*P+I*T+X*D),n[13]=e[1]+T-(A*P+F*T+O*D),n[14]=e[2]+D-(w*P+Q*T+z*D),n[15]=1,n}function x1(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=e+e,c=o+o,f=M+M,i=e*u,b=o*u,r=o*c,l=M*u,m=M*c,p=M*f,d=h*u,x=h*c,q=h*f;return n[0]=1-r-p,n[1]=b+q,n[2]=l-x,n[3]=0,n[4]=b-q,n[5]=1-i-p,n[6]=m+d,n[7]=0,n[8]=l+x,n[9]=m-d,n[10]=1-i-r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function d1(n,s,e,o,M,h,u){const c=1/(e-s),f=1/(M-o),i=1/(h-u);return n[0]=2*h*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2*h*f,n[6]=0,n[7]=0,n[8]=(e+s)*c,n[9]=(M+o)*f,n[10]=(u+h)*i,n[11]=-1,n[12]=0,n[13]=0,n[14]=u*h*2*i,n[15]=0,n}function q1(n,s,e,o,M){const h=1/Math.tan(s/2);let u;return n[0]=h/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,M!=null&&M!==1/0?(u=1/(o-M),n[10]=(M+o)*u,n[14]=2*M*o*u):(n[10]=-1,n[14]=-2*o),n}function p1(n,s,e,o){const M=Math.tan(s.upDegrees*Math.PI/180),h=Math.tan(s.downDegrees*Math.PI/180),u=Math.tan(s.leftDegrees*Math.PI/180),c=Math.tan(s.rightDegrees*Math.PI/180),f=2/(u+c),i=2/(M+h);return n[0]=f,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=-(u-c)*f*.5,n[9]=(M-h)*i*.5,n[10]=o/(e-o),n[11]=-1,n[12]=0,n[13]=0,n[14]=o*e/(e-o),n[15]=0,n}function g1(n,s,e,o,M,h,u){const c=1/(s-e),f=1/(o-M),i=1/(h-u);return n[0]=-2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*i,n[11]=0,n[12]=(s+e)*c,n[13]=(M+o)*f,n[14]=(u+h)*i,n[15]=1,n}function y1(n,s,e,o){const M=s[0],h=s[1],u=s[2];let c=M-e[0],f=h-e[1],i=u-e[2];const b=Z();if(Math.abs(c)0&&(m=1/Math.sqrt(m),b*=m,r*=m,l*=m);let p=f*l-i*r,d=i*b-c*l,x=c*r-f*b;return m=p*p+d*d+x*x,m>0&&(m=1/Math.sqrt(m),p*=m,d*=m,x*=m),n[0]=p,n[1]=d,n[2]=x,n[3]=0,n[4]=r*x-l*d,n[5]=l*p-b*x,n[6]=b*d-r*p,n[7]=0,n[8]=b,n[9]=r,n[10]=l,n[11]=0,n[12]=M,n[13]=h,n[14]=u,n[15]=1,n}function R1(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function v1(n){return Math.sqrt(n[0]**2+n[1]**2+n[2]**2+n[3]**2+n[4]**2+n[5]**2+n[6]**2+n[7]**2+n[8]**2+n[9]**2+n[10]**2+n[11]**2+n[12]**2+n[13]**2+n[14]**2+n[15]**2)}function I1(n,s,e){return n[0]=s[0]+e[0],n[1]=s[1]+e[1],n[2]=s[2]+e[2],n[3]=s[3]+e[3],n[4]=s[4]+e[4],n[5]=s[5]+e[5],n[6]=s[6]+e[6],n[7]=s[7]+e[7],n[8]=s[8]+e[8],n[9]=s[9]+e[9],n[10]=s[10]+e[10],n[11]=s[11]+e[11],n[12]=s[12]+e[12],n[13]=s[13]+e[13],n[14]=s[14]+e[14],n[15]=s[15]+e[15],n}function B(n,s,e){return n[0]=s[0]-e[0],n[1]=s[1]-e[1],n[2]=s[2]-e[2],n[3]=s[3]-e[3],n[4]=s[4]-e[4],n[5]=s[5]-e[5],n[6]=s[6]-e[6],n[7]=s[7]-e[7],n[8]=s[8]-e[8],n[9]=s[9]-e[9],n[10]=s[10]-e[10],n[11]=s[11]-e[11],n[12]=s[12]-e[12],n[13]=s[13]-e[13],n[14]=s[14]-e[14],n[15]=s[15]-e[15],n}function O1(n,s,e){return n[0]=s[0]*e,n[1]=s[1]*e,n[2]=s[2]*e,n[3]=s[3]*e,n[4]=s[4]*e,n[5]=s[5]*e,n[6]=s[6]*e,n[7]=s[7]*e,n[8]=s[8]*e,n[9]=s[9]*e,n[10]=s[10]*e,n[11]=s[11]*e,n[12]=s[12]*e,n[13]=s[13]*e,n[14]=s[14]*e,n[15]=s[15]*e,n}function P1(n,s,e,o){return n[0]=s[0]+e[0]*o,n[1]=s[1]+e[1]*o,n[2]=s[2]+e[2]*o,n[3]=s[3]+e[3]*o,n[4]=s[4]+e[4]*o,n[5]=s[5]+e[5]*o,n[6]=s[6]+e[6]*o,n[7]=s[7]+e[7]*o,n[8]=s[8]+e[8]*o,n[9]=s[9]+e[9]*o,n[10]=s[10]+e[10]*o,n[11]=s[11]+e[11]*o,n[12]=s[12]+e[12]*o,n[13]=s[13]+e[13]*o,n[14]=s[14]+e[14]*o,n[15]=s[15]+e[15]*o,n}function T1(n,s){return n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]&&n[3]===s[3]&&n[4]===s[4]&&n[5]===s[5]&&n[6]===s[6]&&n[7]===s[7]&&n[8]===s[8]&&n[9]===s[9]&&n[10]===s[10]&&n[11]===s[11]&&n[12]===s[12]&&n[13]===s[13]&&n[14]===s[14]&&n[15]===s[15]}function D1(n,s){if(n===s)return!0;const e=n[0],o=n[1],M=n[2],h=n[3],u=n[4],c=n[5],f=n[6],i=n[7],b=n[8],r=n[9],l=n[10],m=n[11],p=n[12],d=n[13],x=n[14],q=n[15],v=s[0],y=s[1],g=s[2],S=s[3],R=s[4],_=s[5],P=s[6],T=s[7],D=s[8],j=s[9],A=s[10],w=s[11],I=s[12],F=s[13],Q=s[14],X=s[15],O=Z();return Math.abs(e-v)<=O*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-y)<=O*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(M-g)<=O*Math.max(1,Math.abs(M),Math.abs(g))&&Math.abs(h-S)<=O*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-R)<=O*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-_)<=O*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(f-P)<=O*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(i-T)<=O*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(b-D)<=O*Math.max(1,Math.abs(b),Math.abs(D))&&Math.abs(r-j)<=O*Math.max(1,Math.abs(r),Math.abs(j))&&Math.abs(l-A)<=O*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(m-w)<=O*Math.max(1,Math.abs(m),Math.abs(w))&&Math.abs(p-I)<=O*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-F)<=O*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(x-Q)<=O*Math.max(1,Math.abs(x),Math.abs(Q))&&Math.abs(q-X)<=O*Math.max(1,Math.abs(q),Math.abs(X))}function _1(n){const s=Z(),e=n[0],o=n[1],M=n[2],h=n[4],u=n[5],c=n[6],f=n[8],i=n[9],b=n[10];return Math.abs(1-(e*e+h*h+f*f))<=s&&Math.abs(1-(o*o+u*u+i*i))<=s&&Math.abs(1-(M*M+c*c+b*b))<=s}function j1(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[4]===0&&n[5]===1&&n[6]===0&&n[8]===0&&n[9]===0&&n[10]===1}const A1=V,w1=B;Object.freeze(Object.defineProperty({__proto__:null,add:I1,adjoint:K,copy:E,determinant:L,equals:D1,exactEquals:T1,frob:v1,fromQuat:x1,fromQuat2:i1,fromRotation:e1,fromRotationTranslation:Y,fromRotationTranslationScale:l1,fromRotationTranslationScaleOrigin:m1,fromScaling:o1,fromTranslation:s1,fromXRotation:M1,fromYRotation:h1,fromZRotation:u1,frustum:d1,getRotation:b1,getScaling:r1,getTranslation:f1,hasIdentityRotation:j1,identity:k,invert:N,invertOrIdentity:J,isOrthoNormal:_1,lookAt:y1,mul:A1,multiply:V,multiplyScalar:O1,multiplyScalarAndAdd:P1,ortho:g1,perspective:q1,perspectiveFromFieldOfView:p1,rotate:$,rotateX:a,rotateY:t,rotateZ:n1,scale:W,set:G,str:R1,sub:w1,subtract:B,targetTo:S1,translate:U,transpose:H},Symbol.toStringTag,{value:"Module"}));export{r1 as $,V as B,G as E,H as G,U as H,s1 as J,e1 as K,M1 as L,D1 as M,W as N,$ as V,f1 as W,k as Z,d1 as a,_1 as c,j1 as i,E as k,y1 as n,l1 as o,b1 as s,m1 as t,T1 as u,N as z}; diff --git a/custom-toc-separator/assets/mat4-DX7gBViE-d6nV0_rZ.js b/custom-toc-separator/assets/mat4-DX7gBViE-d6nV0_rZ.js deleted file mode 100644 index a6245516..00000000 --- a/custom-toc-separator/assets/mat4-DX7gBViE-d6nV0_rZ.js +++ /dev/null @@ -1 +0,0 @@ -import{dg as C}from"./story-OUarUCIt.js";import{n as Z}from"./common-CYWrYyJl-E8-sukrT.js";function E(n,s){return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function G(n,s,e,o,M,h,u,c,f,i,b,r,l,m,p,d,x){return n[0]=s,n[1]=e,n[2]=o,n[3]=M,n[4]=h,n[5]=u,n[6]=c,n[7]=f,n[8]=i,n[9]=b,n[10]=r,n[11]=l,n[12]=m,n[13]=p,n[14]=d,n[15]=x,n}function k(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function H(n,s){if(n===s){const e=s[1],o=s[2],M=s[3],h=s[6],u=s[7],c=s[11];n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=e,n[6]=s[9],n[7]=s[13],n[8]=o,n[9]=h,n[11]=s[14],n[12]=M,n[13]=u,n[14]=c}else n[0]=s[0],n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=s[1],n[5]=s[5],n[6]=s[9],n[7]=s[13],n[8]=s[2],n[9]=s[6],n[10]=s[10],n[11]=s[14],n[12]=s[3],n[13]=s[7],n[14]=s[11],n[15]=s[15];return n}function J(n,s){return N(n,s)||k(n),n}function N(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15],v=e*c-o*u,y=e*f-M*u,g=e*i-h*u,S=o*f-M*c,R=o*i-h*c,_=M*i-h*f,P=b*d-r*p,T=b*x-l*p,D=b*q-m*p,j=r*x-l*d,A=r*q-m*d,w=l*q-m*x;let I=v*w-y*A+g*j+S*D-R*T+_*P;return I?(I=1/I,n[0]=(c*w-f*A+i*j)*I,n[1]=(M*A-o*w-h*j)*I,n[2]=(d*_-x*R+q*S)*I,n[3]=(l*R-r*_-m*S)*I,n[4]=(f*D-u*w-i*T)*I,n[5]=(e*w-M*D+h*T)*I,n[6]=(x*g-p*_-q*y)*I,n[7]=(b*_-l*g+m*y)*I,n[8]=(u*A-c*D+i*P)*I,n[9]=(o*D-e*A-h*P)*I,n[10]=(p*R-d*g+q*v)*I,n[11]=(r*g-b*R-m*v)*I,n[12]=(c*T-u*j-f*P)*I,n[13]=(e*j-o*T+M*P)*I,n[14]=(d*y-p*S-x*v)*I,n[15]=(b*S-r*y+l*v)*I,n):null}function K(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15];return n[0]=c*(l*q-m*x)-r*(f*q-i*x)+d*(f*m-i*l),n[1]=-(o*(l*q-m*x)-r*(M*q-h*x)+d*(M*m-h*l)),n[2]=o*(f*q-i*x)-c*(M*q-h*x)+d*(M*i-h*f),n[3]=-(o*(f*m-i*l)-c*(M*m-h*l)+r*(M*i-h*f)),n[4]=-(u*(l*q-m*x)-b*(f*q-i*x)+p*(f*m-i*l)),n[5]=e*(l*q-m*x)-b*(M*q-h*x)+p*(M*m-h*l),n[6]=-(e*(f*q-i*x)-u*(M*q-h*x)+p*(M*i-h*f)),n[7]=e*(f*m-i*l)-u*(M*m-h*l)+b*(M*i-h*f),n[8]=u*(r*q-m*d)-b*(c*q-i*d)+p*(c*m-i*r),n[9]=-(e*(r*q-m*d)-b*(o*q-h*d)+p*(o*m-h*r)),n[10]=e*(c*q-i*d)-u*(o*q-h*d)+p*(o*i-h*c),n[11]=-(e*(c*m-i*r)-u*(o*m-h*r)+b*(o*i-h*c)),n[12]=-(u*(r*x-l*d)-b*(c*x-f*d)+p*(c*l-f*r)),n[13]=e*(r*x-l*d)-b*(o*x-M*d)+p*(o*l-M*r),n[14]=-(e*(c*x-f*d)-u*(o*x-M*d)+p*(o*f-M*c)),n[15]=e*(c*l-f*r)-u*(o*l-M*r)+b*(o*f-M*c),n}function L(n){const s=n[0],e=n[1],o=n[2],M=n[3],h=n[4],u=n[5],c=n[6],f=n[7],i=n[8],b=n[9],r=n[10],l=n[11],m=n[12],p=n[13],d=n[14],x=n[15];return(s*u-e*h)*(r*x-l*d)-(s*c-o*h)*(b*x-l*p)+(s*f-M*h)*(b*d-r*p)+(e*c-o*u)*(i*x-l*m)-(e*f-M*u)*(i*d-r*m)+(o*f-M*c)*(i*p-b*m)}function V(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=s[8],l=s[9],m=s[10],p=s[11],d=s[12],x=s[13],q=s[14],v=s[15];let y=e[0],g=e[1],S=e[2],R=e[3];return n[0]=y*o+g*c+S*r+R*d,n[1]=y*M+g*f+S*l+R*x,n[2]=y*h+g*i+S*m+R*q,n[3]=y*u+g*b+S*p+R*v,y=e[4],g=e[5],S=e[6],R=e[7],n[4]=y*o+g*c+S*r+R*d,n[5]=y*M+g*f+S*l+R*x,n[6]=y*h+g*i+S*m+R*q,n[7]=y*u+g*b+S*p+R*v,y=e[8],g=e[9],S=e[10],R=e[11],n[8]=y*o+g*c+S*r+R*d,n[9]=y*M+g*f+S*l+R*x,n[10]=y*h+g*i+S*m+R*q,n[11]=y*u+g*b+S*p+R*v,y=e[12],g=e[13],S=e[14],R=e[15],n[12]=y*o+g*c+S*r+R*d,n[13]=y*M+g*f+S*l+R*x,n[14]=y*h+g*i+S*m+R*q,n[15]=y*u+g*b+S*p+R*v,n}function U(n,s,e){const o=e[0],M=e[1],h=e[2];if(s===n)n[12]=s[0]*o+s[4]*M+s[8]*h+s[12],n[13]=s[1]*o+s[5]*M+s[9]*h+s[13],n[14]=s[2]*o+s[6]*M+s[10]*h+s[14],n[15]=s[3]*o+s[7]*M+s[11]*h+s[15];else{const u=s[0],c=s[1],f=s[2],i=s[3],b=s[4],r=s[5],l=s[6],m=s[7],p=s[8],d=s[9],x=s[10],q=s[11];n[0]=u,n[1]=c,n[2]=f,n[3]=i,n[4]=b,n[5]=r,n[6]=l,n[7]=m,n[8]=p,n[9]=d,n[10]=x,n[11]=q,n[12]=u*o+b*M+p*h+s[12],n[13]=c*o+r*M+d*h+s[13],n[14]=f*o+l*M+x*h+s[14],n[15]=i*o+m*M+q*h+s[15]}return n}function W(n,s,e){const o=e[0],M=e[1],h=e[2];return n[0]=s[0]*o,n[1]=s[1]*o,n[2]=s[2]*o,n[3]=s[3]*o,n[4]=s[4]*M,n[5]=s[5]*M,n[6]=s[6]*M,n[7]=s[7]*M,n[8]=s[8]*h,n[9]=s[9]*h,n[10]=s[10]*h,n[11]=s[11]*h,n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function $(n,s,e,o){let M=o[0],h=o[1],u=o[2],c=Math.sqrt(M*M+h*h+u*u);if(c<=Z())return void E(n,s);c=1/c,M*=c,h*=c,u*=c;const f=Math.sin(e),i=Math.cos(e),b=1-i,r=s[0],l=s[1],m=s[2],p=s[3],d=s[4],x=s[5],q=s[6],v=s[7],y=s[8],g=s[9],S=s[10],R=s[11],_=M*M*b+i,P=h*M*b+u*f,T=u*M*b-h*f,D=M*h*b-u*f,j=h*h*b+i,A=u*h*b+M*f,w=M*u*b+h*f,I=h*u*b-M*f,F=u*u*b+i;n[0]=r*_+d*P+y*T,n[1]=l*_+x*P+g*T,n[2]=m*_+q*P+S*T,n[3]=p*_+v*P+R*T,n[4]=r*D+d*j+y*A,n[5]=l*D+x*j+g*A,n[6]=m*D+q*j+S*A,n[7]=p*D+v*j+R*A,n[8]=r*w+d*I+y*F,n[9]=l*w+x*I+g*F,n[10]=m*w+q*I+S*F,n[11]=p*w+v*I+R*F,s!==n&&(n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15])}function a(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[4],u=s[5],c=s[6],f=s[7],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[4]=h*M+i*o,n[5]=u*M+b*o,n[6]=c*M+r*o,n[7]=f*M+l*o,n[8]=i*M-h*o,n[9]=b*M-u*o,n[10]=r*M-c*o,n[11]=l*M-f*o,n}function t(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M-i*o,n[1]=u*M-b*o,n[2]=c*M-r*o,n[3]=f*M-l*o,n[8]=h*o+i*M,n[9]=u*o+b*M,n[10]=c*o+r*M,n[11]=f*o+l*M,n}function n1(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[4],b=s[5],r=s[6],l=s[7];return s!==n&&(n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M+i*o,n[1]=u*M+b*o,n[2]=c*M+r*o,n[3]=f*M+l*o,n[4]=i*M-h*o,n[5]=b*M-u*o,n[6]=r*M-c*o,n[7]=l*M-f*o,n}function s1(n,s){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=s[0],n[13]=s[1],n[14]=s[2],n[15]=1,n}function o1(n,s){return n[0]=s[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=s[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e1(n,s,e){if(s===0)return k(n);let o=e[0],M=e[1],h=e[2],u=Math.sqrt(o*o+M*M+h*h);if(u<=Z())return null;u=1/u,o*=u,M*=u,h*=u;const c=Math.sin(s),f=Math.cos(s),i=1-f;return n[0]=o*o*i+f,n[1]=M*o*i+h*c,n[2]=h*o*i-M*c,n[3]=0,n[4]=o*M*i-h*c,n[5]=M*M*i+f,n[6]=h*M*i+o*c,n[7]=0,n[8]=o*h*i+M*c,n[9]=M*h*i-o*c,n[10]=h*h*i+f,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function M1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function h1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function u1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Y(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=o+o,f=M+M,i=h+h,b=o*c,r=o*f,l=o*i,m=M*f,p=M*i,d=h*i,x=u*c,q=u*f,v=u*i;return n[0]=1-(m+d),n[1]=r+v,n[2]=l-q,n[3]=0,n[4]=r-v,n[5]=1-(b+d),n[6]=p+x,n[7]=0,n[8]=l+q,n[9]=p-x,n[10]=1-(b+m),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function i1(n,s){const e=c1,o=-s[0],M=-s[1],h=-s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=o*o+M*M+h*h+u*u;return r>0?(e[0]=2*(c*u+b*o+f*h-i*M)/r,e[1]=2*(f*u+b*M+i*o-c*h)/r,e[2]=2*(i*u+b*h+c*M-f*o)/r):(e[0]=2*(c*u+b*o+f*h-i*M),e[1]=2*(f*u+b*M+i*o-c*h),e[2]=2*(i*u+b*h+c*M-f*o)),Y(n,s,e),n}const c1=C();function f1(n,s){return n[0]=s[12],n[1]=s[13],n[2]=s[14],n}function r1(n,s){const e=s[0],o=s[1],M=s[2],h=s[4],u=s[5],c=s[6],f=s[8],i=s[9],b=s[10];return n[0]=Math.sqrt(e*e+o*o+M*M),n[1]=Math.sqrt(h*h+u*u+c*c),n[2]=Math.sqrt(f*f+i*i+b*b),n}function b1(n,s){const e=s[0]+s[5]+s[10];let o=0;return e>0?(o=2*Math.sqrt(e+1),n[3]=.25*o,n[0]=(s[6]-s[9])/o,n[1]=(s[8]-s[2])/o,n[2]=(s[1]-s[4])/o):s[0]>s[5]&&s[0]>s[10]?(o=2*Math.sqrt(1+s[0]-s[5]-s[10]),n[3]=(s[6]-s[9])/o,n[0]=.25*o,n[1]=(s[1]+s[4])/o,n[2]=(s[8]+s[2])/o):s[5]>s[10]?(o=2*Math.sqrt(1+s[5]-s[0]-s[10]),n[3]=(s[8]-s[2])/o,n[0]=(s[1]+s[4])/o,n[1]=.25*o,n[2]=(s[6]+s[9])/o):(o=2*Math.sqrt(1+s[10]-s[0]-s[5]),n[3]=(s[1]-s[4])/o,n[0]=(s[8]+s[2])/o,n[1]=(s[6]+s[9])/o,n[2]=.25*o),n}function l1(n,s,e,o){const M=s[0],h=s[1],u=s[2],c=s[3],f=M+M,i=h+h,b=u+u,r=M*f,l=M*i,m=M*b,p=h*i,d=h*b,x=u*b,q=c*f,v=c*i,y=c*b,g=o[0],S=o[1],R=o[2];return n[0]=(1-(p+x))*g,n[1]=(l+y)*g,n[2]=(m-v)*g,n[3]=0,n[4]=(l-y)*S,n[5]=(1-(r+x))*S,n[6]=(d+q)*S,n[7]=0,n[8]=(m+v)*R,n[9]=(d-q)*R,n[10]=(1-(r+p))*R,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function m1(n,s,e,o,M){const h=s[0],u=s[1],c=s[2],f=s[3],i=h+h,b=u+u,r=c+c,l=h*i,m=h*b,p=h*r,d=u*b,x=u*r,q=c*r,v=f*i,y=f*b,g=f*r,S=o[0],R=o[1],_=o[2],P=M[0],T=M[1],D=M[2],j=(1-(d+q))*S,A=(m+g)*S,w=(p-y)*S,I=(m-g)*R,F=(1-(l+q))*R,Q=(x+v)*R,X=(p+y)*_,O=(x-v)*_,z=(1-(l+d))*_;return n[0]=j,n[1]=A,n[2]=w,n[3]=0,n[4]=I,n[5]=F,n[6]=Q,n[7]=0,n[8]=X,n[9]=O,n[10]=z,n[11]=0,n[12]=e[0]+P-(j*P+I*T+X*D),n[13]=e[1]+T-(A*P+F*T+O*D),n[14]=e[2]+D-(w*P+Q*T+z*D),n[15]=1,n}function x1(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=e+e,c=o+o,f=M+M,i=e*u,b=o*u,r=o*c,l=M*u,m=M*c,p=M*f,d=h*u,x=h*c,q=h*f;return n[0]=1-r-p,n[1]=b+q,n[2]=l-x,n[3]=0,n[4]=b-q,n[5]=1-i-p,n[6]=m+d,n[7]=0,n[8]=l+x,n[9]=m-d,n[10]=1-i-r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function d1(n,s,e,o,M,h,u){const c=1/(e-s),f=1/(M-o),i=1/(h-u);return n[0]=2*h*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2*h*f,n[6]=0,n[7]=0,n[8]=(e+s)*c,n[9]=(M+o)*f,n[10]=(u+h)*i,n[11]=-1,n[12]=0,n[13]=0,n[14]=u*h*2*i,n[15]=0,n}function q1(n,s,e,o,M){const h=1/Math.tan(s/2);let u;return n[0]=h/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,M!=null&&M!==1/0?(u=1/(o-M),n[10]=(M+o)*u,n[14]=2*M*o*u):(n[10]=-1,n[14]=-2*o),n}function p1(n,s,e,o){const M=Math.tan(s.upDegrees*Math.PI/180),h=Math.tan(s.downDegrees*Math.PI/180),u=Math.tan(s.leftDegrees*Math.PI/180),c=Math.tan(s.rightDegrees*Math.PI/180),f=2/(u+c),i=2/(M+h);return n[0]=f,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=-(u-c)*f*.5,n[9]=(M-h)*i*.5,n[10]=o/(e-o),n[11]=-1,n[12]=0,n[13]=0,n[14]=o*e/(e-o),n[15]=0,n}function g1(n,s,e,o,M,h,u){const c=1/(s-e),f=1/(o-M),i=1/(h-u);return n[0]=-2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*i,n[11]=0,n[12]=(s+e)*c,n[13]=(M+o)*f,n[14]=(u+h)*i,n[15]=1,n}function y1(n,s,e,o){const M=s[0],h=s[1],u=s[2];let c=M-e[0],f=h-e[1],i=u-e[2];const b=Z();if(Math.abs(c)0&&(m=1/Math.sqrt(m),b*=m,r*=m,l*=m);let p=f*l-i*r,d=i*b-c*l,x=c*r-f*b;return m=p*p+d*d+x*x,m>0&&(m=1/Math.sqrt(m),p*=m,d*=m,x*=m),n[0]=p,n[1]=d,n[2]=x,n[3]=0,n[4]=r*x-l*d,n[5]=l*p-b*x,n[6]=b*d-r*p,n[7]=0,n[8]=b,n[9]=r,n[10]=l,n[11]=0,n[12]=M,n[13]=h,n[14]=u,n[15]=1,n}function R1(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function v1(n){return Math.sqrt(n[0]**2+n[1]**2+n[2]**2+n[3]**2+n[4]**2+n[5]**2+n[6]**2+n[7]**2+n[8]**2+n[9]**2+n[10]**2+n[11]**2+n[12]**2+n[13]**2+n[14]**2+n[15]**2)}function I1(n,s,e){return n[0]=s[0]+e[0],n[1]=s[1]+e[1],n[2]=s[2]+e[2],n[3]=s[3]+e[3],n[4]=s[4]+e[4],n[5]=s[5]+e[5],n[6]=s[6]+e[6],n[7]=s[7]+e[7],n[8]=s[8]+e[8],n[9]=s[9]+e[9],n[10]=s[10]+e[10],n[11]=s[11]+e[11],n[12]=s[12]+e[12],n[13]=s[13]+e[13],n[14]=s[14]+e[14],n[15]=s[15]+e[15],n}function B(n,s,e){return n[0]=s[0]-e[0],n[1]=s[1]-e[1],n[2]=s[2]-e[2],n[3]=s[3]-e[3],n[4]=s[4]-e[4],n[5]=s[5]-e[5],n[6]=s[6]-e[6],n[7]=s[7]-e[7],n[8]=s[8]-e[8],n[9]=s[9]-e[9],n[10]=s[10]-e[10],n[11]=s[11]-e[11],n[12]=s[12]-e[12],n[13]=s[13]-e[13],n[14]=s[14]-e[14],n[15]=s[15]-e[15],n}function O1(n,s,e){return n[0]=s[0]*e,n[1]=s[1]*e,n[2]=s[2]*e,n[3]=s[3]*e,n[4]=s[4]*e,n[5]=s[5]*e,n[6]=s[6]*e,n[7]=s[7]*e,n[8]=s[8]*e,n[9]=s[9]*e,n[10]=s[10]*e,n[11]=s[11]*e,n[12]=s[12]*e,n[13]=s[13]*e,n[14]=s[14]*e,n[15]=s[15]*e,n}function P1(n,s,e,o){return n[0]=s[0]+e[0]*o,n[1]=s[1]+e[1]*o,n[2]=s[2]+e[2]*o,n[3]=s[3]+e[3]*o,n[4]=s[4]+e[4]*o,n[5]=s[5]+e[5]*o,n[6]=s[6]+e[6]*o,n[7]=s[7]+e[7]*o,n[8]=s[8]+e[8]*o,n[9]=s[9]+e[9]*o,n[10]=s[10]+e[10]*o,n[11]=s[11]+e[11]*o,n[12]=s[12]+e[12]*o,n[13]=s[13]+e[13]*o,n[14]=s[14]+e[14]*o,n[15]=s[15]+e[15]*o,n}function T1(n,s){return n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]&&n[3]===s[3]&&n[4]===s[4]&&n[5]===s[5]&&n[6]===s[6]&&n[7]===s[7]&&n[8]===s[8]&&n[9]===s[9]&&n[10]===s[10]&&n[11]===s[11]&&n[12]===s[12]&&n[13]===s[13]&&n[14]===s[14]&&n[15]===s[15]}function D1(n,s){if(n===s)return!0;const e=n[0],o=n[1],M=n[2],h=n[3],u=n[4],c=n[5],f=n[6],i=n[7],b=n[8],r=n[9],l=n[10],m=n[11],p=n[12],d=n[13],x=n[14],q=n[15],v=s[0],y=s[1],g=s[2],S=s[3],R=s[4],_=s[5],P=s[6],T=s[7],D=s[8],j=s[9],A=s[10],w=s[11],I=s[12],F=s[13],Q=s[14],X=s[15],O=Z();return Math.abs(e-v)<=O*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-y)<=O*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(M-g)<=O*Math.max(1,Math.abs(M),Math.abs(g))&&Math.abs(h-S)<=O*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-R)<=O*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-_)<=O*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(f-P)<=O*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(i-T)<=O*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(b-D)<=O*Math.max(1,Math.abs(b),Math.abs(D))&&Math.abs(r-j)<=O*Math.max(1,Math.abs(r),Math.abs(j))&&Math.abs(l-A)<=O*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(m-w)<=O*Math.max(1,Math.abs(m),Math.abs(w))&&Math.abs(p-I)<=O*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-F)<=O*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(x-Q)<=O*Math.max(1,Math.abs(x),Math.abs(Q))&&Math.abs(q-X)<=O*Math.max(1,Math.abs(q),Math.abs(X))}function _1(n){const s=Z(),e=n[0],o=n[1],M=n[2],h=n[4],u=n[5],c=n[6],f=n[8],i=n[9],b=n[10];return Math.abs(1-(e*e+h*h+f*f))<=s&&Math.abs(1-(o*o+u*u+i*i))<=s&&Math.abs(1-(M*M+c*c+b*b))<=s}function j1(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[4]===0&&n[5]===1&&n[6]===0&&n[8]===0&&n[9]===0&&n[10]===1}const A1=V,w1=B;Object.freeze(Object.defineProperty({__proto__:null,add:I1,adjoint:K,copy:E,determinant:L,equals:D1,exactEquals:T1,frob:v1,fromQuat:x1,fromQuat2:i1,fromRotation:e1,fromRotationTranslation:Y,fromRotationTranslationScale:l1,fromRotationTranslationScaleOrigin:m1,fromScaling:o1,fromTranslation:s1,fromXRotation:M1,fromYRotation:h1,fromZRotation:u1,frustum:d1,getRotation:b1,getScaling:r1,getTranslation:f1,hasIdentityRotation:j1,identity:k,invert:N,invertOrIdentity:J,isOrthoNormal:_1,lookAt:y1,mul:A1,multiply:V,multiplyScalar:O1,multiplyScalarAndAdd:P1,ortho:g1,perspective:q1,perspectiveFromFieldOfView:p1,rotate:$,rotateX:a,rotateY:t,rotateZ:n1,scale:W,set:G,str:R1,sub:w1,subtract:B,targetTo:S1,translate:U,transpose:H},Symbol.toStringTag,{value:"Module"}));export{r1 as $,V as B,G as E,H as G,U as H,s1 as J,e1 as K,M1 as L,D1 as M,W as N,$ as V,f1 as W,k as Z,d1 as a,_1 as c,j1 as i,E as k,y1 as n,l1 as o,b1 as s,m1 as t,T1 as u,N as z}; diff --git a/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-CELfFdQZ.js b/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-CELfFdQZ.js deleted file mode 100644 index f501e93e..00000000 --- a/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-CELfFdQZ.js +++ /dev/null @@ -1 +0,0 @@ -import{C as c,D as y}from"./utils-BVWK2jiA-Bnz0n_UG.js";import{i as f}from"./jsonContext-BA8GHqVk-CN6VxGdq.js";import{S as d,l as v,E as x}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import{T as o}from"./resourceUtils-BmW6QqlX-DTC51C_z.js";import"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-DgukgleB.js";import"./saveUtils-CIYk-dsQ-BafA6Tfo.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-LGtMSbcd.js";const i="Media Layer",E="media-layer-save",T="media-layer-save-as",s=["media-layer:unsupported-source"];function n(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return f(e,"portal-item",!0)}function p(e){return Promise.resolve(e.layerJSON)}async function u(e,r){r.extent=e.fullExtent?await d(e.fullExtent):null}async function I(e,r){r.title||=e.title,await u(e,r),v(r,x.METADATA)}async function b(e,r){return c({layer:e,itemType:i,validateLayer:n,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:E,supplementalUnsupportedErrors:s,setItemProperties:u,saveResources:(t,a)=>o(e.resourceReferences,a)},r)}async function g(e,r,t){return y({layer:e,itemType:i,validateLayer:n,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:T,supplementalUnsupportedErrors:s,newItem:r,setItemProperties:I,saveResources:(a,l)=>o(e.resourceReferences,l)},t)}export{b as save,g as saveAs}; diff --git a/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-DyuMgcxq.js b/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-DyuMgcxq.js new file mode 100644 index 00000000..382ebaaf --- /dev/null +++ b/custom-toc-separator/assets/mediaLayerUtils-CasWezAG-DyuMgcxq.js @@ -0,0 +1 @@ +import{C as c,D as y}from"./utils-BVWK2jiA-inSV67A_.js";import{i as f}from"./jsonContext-BA8GHqVk-Q4gT-eB4.js";import{S as d,l as v,E as x}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import{T as o}from"./resourceUtils-BmW6QqlX-DJoDGZfh.js";import"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C39Ug2k8.js";import"./saveUtils-CIYk-dsQ-LlVI_Glz.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-DwzNb5YY.js";const i="Media Layer",E="media-layer-save",T="media-layer-save-as",s=["media-layer:unsupported-source"];function n(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return f(e,"portal-item",!0)}function p(e){return Promise.resolve(e.layerJSON)}async function u(e,r){r.extent=e.fullExtent?await d(e.fullExtent):null}async function I(e,r){r.title||=e.title,await u(e,r),v(r,x.METADATA)}async function b(e,r){return c({layer:e,itemType:i,validateLayer:n,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:E,supplementalUnsupportedErrors:s,setItemProperties:u,saveResources:(t,a)=>o(e.resourceReferences,a)},r)}async function g(e,r,t){return y({layer:e,itemType:i,validateLayer:n,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:T,supplementalUnsupportedErrors:s,newItem:r,setItemProperties:I,saveResources:(a,l)=>o(e.resourceReferences,l)},t)}export{b as save,g as saveAs}; diff --git a/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-BHZn4_tO.js b/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-BHZn4_tO.js new file mode 100644 index 00000000..88dd23e0 --- /dev/null +++ b/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-BHZn4_tO.js @@ -0,0 +1 @@ +import{w as n}from"./story-DT1Ep1ux.js";import{V as r}from"./MeshTransform-C--IG09w-DmlAOJ8b.js";function l(t,a,i=o){return new n({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:a})}function c(t,a=o){return new r({translation:[t[a.translationX],-t[a.translationZ],t[a.translationY]],rotationAxis:[t[a.rotationX],-t[a.rotationZ],t[a.rotationY]],rotationAngle:t[a.rotationDeg],scale:[t[a.scaleX],t[a.scaleZ],t[a.scaleY]]})}const o={originX:"originX",originY:"originY",originZ:"originZ",translationX:"translationX",translationY:"translationY",translationZ:"translationZ",scaleX:"scaleX",scaleY:"scaleY",scaleZ:"scaleZ",rotationX:"rotationX",rotationY:"rotationY",rotationZ:"rotationZ",rotationDeg:"rotationDeg"};export{c as e,l as s}; diff --git a/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js b/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js deleted file mode 100644 index 659b8ec3..00000000 --- a/custom-toc-separator/assets/meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js +++ /dev/null @@ -1 +0,0 @@ -import{w as n}from"./story-OUarUCIt.js";import{V as r}from"./MeshTransform-C--IG09w-mx7xOTc-.js";function l(t,a,i=o){return new n({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:a})}function c(t,a=o){return new r({translation:[t[a.translationX],-t[a.translationZ],t[a.translationY]],rotationAxis:[t[a.rotationX],-t[a.rotationZ],t[a.rotationY]],rotationAngle:t[a.rotationDeg],scale:[t[a.scaleX],t[a.scaleZ],t[a.scaleY]]})}const o={originX:"originX",originY:"originY",originZ:"originZ",translationX:"translationX",translationY:"translationY",translationZ:"translationZ",scaleX:"scaleX",scaleY:"scaleY",scaleZ:"scaleZ",rotationX:"rotationX",rotationY:"rotationY",rotationZ:"rotationZ",rotationDeg:"rotationDeg"};export{c as e,l as s}; diff --git a/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cv4LZ_Ov.js b/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cv4LZ_Ov.js deleted file mode 100644 index 4b4090dc..00000000 --- a/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cv4LZ_Ov.js +++ /dev/null @@ -1 +0,0 @@ -import{J as S,bi as d,n as y,an as l,a1 as F}from"./story-OUarUCIt.js";import{F as h}from"./Mesh-DLzjDUIO-BlTrUdFo.js";import{v as N,i as g}from"./External-D_wl4XAw-BzQ8-YjD.js";import{b as D}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{O as M}from"./FeatureSet-BkVNthuN-C5Zta7rI.js";import{s as O,e as T}from"./meshFeatureAttributes-BwKR5odo-Bq4ik5bG.js";import"./main-lj2zzr_L.js";import"./MeshTransform-C--IG09w-mx7xOTc-.js";import"./mat4-DX7gBViE-d6nV0_rZ.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-rtvarRV-.js";import"./MeshVertexAttributes-CbNpPur2-D4N2Tcxt.js";import"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";import"./meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-Bin5_zrY.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-DsVnH-8X.js";import"./projectPointToVector-B2UUY9SE-fNIw44OG.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./vertexSpaceConversion-CiKaVq_u-CTDTk8sB.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import"./vec3-BazNroeq-C58EAHFm.js";import"./BufferView-PQoE3GL7-B_xfzNdr.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CF_vNE3j.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";const L=()=>F.getLogger("esri.rest.support.meshFeatureSet");function dt(t,o,r){const e=r.features;r.features=[],delete r.geometryType;const s=M.fromJSON(r);if(s.geometryType="mesh",!r.assetMaps)return s;const n=I(o,r.assetMaps),a=t.sourceSpatialReference??S.WGS84,u=r.globalIdFieldName,{outFields:i}=t,f=i!=null&&i.length>0?b(i.includes("*")?null:new Set(i)):()=>({});for(const m of e){const p=w(m,u,a,o,n);s.features.push(new d({geometry:p,attributes:f(m)}))}return s}function b(t){return({attributes:o})=>{if(!o)return{};if(!t)return o;for(const r in o)t.has(r)||delete o[r];return o}}function w(t,o,r,e,s){const n=t.attributes[o],a=s.get(n);if(a==null||!t.geometry)return null;const u=O(t.attributes,r,e.transformFieldRoles),i=y.fromJSON(t.geometry);i.spatialReference=r;const f=T(t.attributes,e.transformFieldRoles),m=r.isGeographic?"local":"georeferenced",p=v(a);return p?h.createWithExternalSource(u,p,{extent:i,transform:f,vertexSpace:m,unitConversionDisabled:!0}):h.createIncomplete(u,{extent:i,transform:f,vertexSpace:m})}var c;function I(t,o){const r=new Map;for(const e of o){const s=e.parentGlobalId;if(s==null)continue;const n=e.assetName,a=e.assetType,u=e.assetHash,i=e.assetURL,f=e.conversionStatus,m=e.seqNo,p=D(a,t.supportedFormats);if(!p){L().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${a}, but it does not list it as a supported type`);continue}const E=l(r,s,()=>({files:new Map}));l(E.files,n,()=>({name:n,type:a,mimeType:p,status:P(f),parts:[]})).parts[m]={hash:u,url:i}}return r}function v(t){const o=Array.from(t.files.values()),r=new Array;for(const e of o){if(e.status!==c.COMPLETED)return null;const s=new Array;for(const n of e.parts){if(!n)return null;s.push(new N(n.url,n.hash))}r.push(new g(e.name,e.mimeType,s))}return r}function P(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{I as assetMapFromAssetMapsJSON,w as extractMesh,dt as meshFeatureSetFromJSON}; diff --git a/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cwvie_FU.js b/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cwvie_FU.js new file mode 100644 index 00000000..8537f888 --- /dev/null +++ b/custom-toc-separator/assets/meshFeatureSet-zeR2pNmE-Cwvie_FU.js @@ -0,0 +1 @@ +import{J as S,bi as d,n as y,an as l,a1 as F}from"./story-DT1Ep1ux.js";import{F as h}from"./Mesh-DLzjDUIO-BGFhxEuV.js";import{v as N,i as g}from"./External-D_wl4XAw-CF3XmPYl.js";import{b as D}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{O as M}from"./FeatureSet-BkVNthuN-CvGbjjZL.js";import{s as O,e as T}from"./meshFeatureAttributes-BwKR5odo-BHZn4_tO.js";import"./main-BTdHgocv.js";import"./MeshTransform-C--IG09w-DmlAOJ8b.js";import"./mat4-DX7gBViE-B27FdgMD.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-CX2rR9bn.js";import"./MeshVertexAttributes-CbNpPur2-DdH7wX9r.js";import"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";import"./meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BChBDP40.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-UtmvndF2.js";import"./projectPointToVector-B2UUY9SE-XbfUb3dm.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./vertexSpaceConversion-CiKaVq_u-DrhxUrr7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";import"./vec3-BazNroeq-xVxXS26y.js";import"./BufferView-PQoE3GL7-Dv7NCnc6.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-CEZkOwEl.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";const L=()=>F.getLogger("esri.rest.support.meshFeatureSet");function dt(t,o,r){const e=r.features;r.features=[],delete r.geometryType;const s=M.fromJSON(r);if(s.geometryType="mesh",!r.assetMaps)return s;const n=I(o,r.assetMaps),a=t.sourceSpatialReference??S.WGS84,u=r.globalIdFieldName,{outFields:i}=t,f=i!=null&&i.length>0?b(i.includes("*")?null:new Set(i)):()=>({});for(const m of e){const p=w(m,u,a,o,n);s.features.push(new d({geometry:p,attributes:f(m)}))}return s}function b(t){return({attributes:o})=>{if(!o)return{};if(!t)return o;for(const r in o)t.has(r)||delete o[r];return o}}function w(t,o,r,e,s){const n=t.attributes[o],a=s.get(n);if(a==null||!t.geometry)return null;const u=O(t.attributes,r,e.transformFieldRoles),i=y.fromJSON(t.geometry);i.spatialReference=r;const f=T(t.attributes,e.transformFieldRoles),m=r.isGeographic?"local":"georeferenced",p=v(a);return p?h.createWithExternalSource(u,p,{extent:i,transform:f,vertexSpace:m,unitConversionDisabled:!0}):h.createIncomplete(u,{extent:i,transform:f,vertexSpace:m})}var c;function I(t,o){const r=new Map;for(const e of o){const s=e.parentGlobalId;if(s==null)continue;const n=e.assetName,a=e.assetType,u=e.assetHash,i=e.assetURL,f=e.conversionStatus,m=e.seqNo,p=D(a,t.supportedFormats);if(!p){L().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${a}, but it does not list it as a supported type`);continue}const E=l(r,s,()=>({files:new Map}));l(E.files,n,()=>({name:n,type:a,mimeType:p,status:P(f),parts:[]})).parts[m]={hash:u,url:i}}return r}function v(t){const o=Array.from(t.files.values()),r=new Array;for(const e of o){if(e.status!==c.COMPLETED)return null;const s=new Array;for(const n of e.parts){if(!n)return null;s.push(new N(n.url,n.hash))}r.push(new g(e.name,e.mimeType,s))}return r}function P(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{I as assetMapFromAssetMapsJSON,w as extractMesh,dt as meshFeatureSetFromJSON}; diff --git a/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js b/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js new file mode 100644 index 00000000..a890973d --- /dev/null +++ b/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-BEjLBuDi.js @@ -0,0 +1 @@ +import{o as e,p as u}from"./story-DT1Ep1ux.js";import{V as p}from"./MeshTransform-C--IG09w-DmlAOJ8b.js";const t="upload-assets",r=()=>new Error;class c extends e{constructor(){super(`${t}:unsupported`,"Layer does not support asset uploads.",r())}}let l=class extends e{constructor(){super(`${t}:no-glb-support`,"Layer does not support glb.",r())}};class i extends e{constructor(){super(`${t}:no-supported-source`,"No supported external source found",r())}}class m extends e{constructor(){super(`${t}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class f extends e{constructor(){super(`${t}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class $ extends e{constructor(o,n){super(`${t}:bad-response`,`Bad response. Uploaded ${o} items and received ${n} results.`,r())}}class x extends e{constructor(o,n){super(`${t}-layer:upload-failed`,`Failed to upload mesh file ${o}. Error code: ${n?.code??"-1"}. Error message: ${n?.messages??"unknown"}`,r())}}class b extends e{constructor(o){super(`${t}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${o}, but it does not list it in its supported formats.`,r())}}class v extends e{constructor(){super(`${t}:convert3D-failed`,"convert3D failed.")}}class g extends e{constructor(){super("invalid-input:no-model","No supported model found")}}class w extends e{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}function y(s){const o=1/u(s,1);return o!==1?new p({scale:[o,o,o]}):void 0}export{b as $,g as b,i as c,l as d,x as f,y as g,f as i,m as l,$ as m,c as p,w as v,v as x}; diff --git a/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js b/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js deleted file mode 100644 index c547995e..00000000 --- a/custom-toc-separator/assets/meshSpatialReferenceScaleUtils-B1zR72Os-C9cphFRx.js +++ /dev/null @@ -1 +0,0 @@ -import{o as e,p as u}from"./story-OUarUCIt.js";import{V as p}from"./MeshTransform-C--IG09w-mx7xOTc-.js";const t="upload-assets",r=()=>new Error;class c extends e{constructor(){super(`${t}:unsupported`,"Layer does not support asset uploads.",r())}}let l=class extends e{constructor(){super(`${t}:no-glb-support`,"Layer does not support glb.",r())}};class i extends e{constructor(){super(`${t}:no-supported-source`,"No supported external source found",r())}}class m extends e{constructor(){super(`${t}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class f extends e{constructor(){super(`${t}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class $ extends e{constructor(o,n){super(`${t}:bad-response`,`Bad response. Uploaded ${o} items and received ${n} results.`,r())}}class x extends e{constructor(o,n){super(`${t}-layer:upload-failed`,`Failed to upload mesh file ${o}. Error code: ${n?.code??"-1"}. Error message: ${n?.messages??"unknown"}`,r())}}class b extends e{constructor(o){super(`${t}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${o}, but it does not list it in its supported formats.`,r())}}class v extends e{constructor(){super(`${t}:convert3D-failed`,"convert3D failed.")}}class g extends e{constructor(){super("invalid-input:no-model","No supported model found")}}class w extends e{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}function y(s){const o=1/u(s,1);return o!==1?new p({scale:[o,o,o]}):void 0}export{b as $,g as b,i as c,l as d,x as f,y as g,f as i,m as l,$ as m,c as p,w as v,v as x}; diff --git a/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js b/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js deleted file mode 100644 index 6fcea398..00000000 --- a/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-DLOCasfl.js +++ /dev/null @@ -1 +0,0 @@ -import{w as p,hl as u,a1 as l}from"./story-OUarUCIt.js";import{R as s}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{d as f,y as d}from"./MeshLocalVertexSpace-BqgocsoS-xQE2J8G5.js";function c(){return l.getLogger("esri.geometry.Mesh")}function a(e){return e.origin!=null}function w(e){return a(e.vertexSpace)}function S(e,n){if(!a(e))return null;const[r,i,o]=e.origin;return new p({x:r,y:i,z:o,spatialReference:n})}function R(e,n){const{x:r,y:i,z:o,spatialReference:g}=e,t=[r,i,o??0];return n?.geographic!==void 0&&(u(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")),(n?.vertexSpace??m(n?.geographic)??h(g))==="local"?new f({origin:t}):new d({origin:t})}function h(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function m(e){return e==null?void 0:e?"local":"georeferenced"}function z(e,n){return e.type===n.type&&(e.origin===n.origin||e.origin!=null&&n.origin!=null&&s(e.origin,n.origin))}export{z as S,w as d,S as m,a as t,R as x}; diff --git a/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js b/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js new file mode 100644 index 00000000..c93fe60f --- /dev/null +++ b/custom-toc-separator/assets/meshVertexSpaceUtils-B4l_Zo0M-qDwYuRGL.js @@ -0,0 +1 @@ +import{w as p,hl as u,a1 as l}from"./story-DT1Ep1ux.js";import{R as s}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{d as f,y as d}from"./MeshLocalVertexSpace-BqgocsoS-Cdoa-n4q.js";function c(){return l.getLogger("esri.geometry.Mesh")}function a(e){return e.origin!=null}function w(e){return a(e.vertexSpace)}function S(e,n){if(!a(e))return null;const[r,i,o]=e.origin;return new p({x:r,y:i,z:o,spatialReference:n})}function R(e,n){const{x:r,y:i,z:o,spatialReference:g}=e,t=[r,i,o??0];return n?.geographic!==void 0&&(u(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")),(n?.vertexSpace??m(n?.geographic)??h(g))==="local"?new f({origin:t}):new d({origin:t})}function h(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function m(e){return e==null?void 0:e?"local":"georeferenced"}function z(e,n){return e.type===n.type&&(e.origin===n.origin||e.origin!=null&&n.origin!=null&&s(e.origin,n.origin))}export{z as S,w as d,S as m,a as t,R as x}; diff --git a/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DCwX6ZId.js b/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DCwX6ZId.js deleted file mode 100644 index c831dae1..00000000 --- a/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DCwX6ZId.js +++ /dev/null @@ -1 +0,0 @@ -import{v as d,S as v,eD as h,i as x,e as U,P as k,aq as Y}from"./story-OUarUCIt.js";var y;let c=y=class extends U{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};d([v({type:String,json:{write:!0}})],c.prototype,"variableName",void 0),d([v({type:String,json:{write:!0}})],c.prototype,"dimensionName",void 0),d([v({type:h.array(h.oneOf([h.native(Number),h.array(h.native(Number))])),json:{write:!0}})],c.prototype,"values",void 0),d([v({type:Boolean,json:{write:!0}})],c.prototype,"isSlice",void 0),c=y=d([x("esri.layers.support.DimensionalDefinition")],c);const D=c;function p(e,n,i){const s=n.shift();if(i.length===0){const t=[];i.push({sliceId:-1,multidimensionalDefinition:t})}const a=i.length;for(let t=0;t{i.push({sliceId:-1,multidimensionalDefinition:[...r,{variableName:e,dimensionName:s.name,values:[l]}]})})}n.length&&p(e,n,i)}function j(e,n){const i=[];let s=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],r=[...a.dimensions].sort((l,m)=>l.name>m.name?-1:1);p(a.name,r,t),t.forEach(l=>{i.push({...l,sliceId:s++})})}),i}function L(e,n,i){let s=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(s=s.filter(l=>{const m=l.multidimensionalDefinition.find(o=>o.dimensionName===a);if(m==null)return!1;const u=m.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(o=>o[0]<=u&&o[1]>=u):typeof t[0]=="number"?t.some(o=>u[0]<=o&&u[1]>=o):r?t.some(o=>o[0]===u[0]&&o[0]===u[1]):t.some(o=>o[0]>=u[0]&&o[0]<=u[1]||o[1]>=u[0]&&o[1]<=u[1]||o[0]u[1])}))}),s.length&&i?.start!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),r=s[0].multidimensionalDefinition.findIndex(l=>l.dimensionName==="StdTime");r>-1&&(s=s.filter(l=>{const m=l.multidimensionalDefinition[r].values[0];return a<=m&&t>=m}))}return s.map(a=>a.sliceId)}function w(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function A(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function S(e,n,i){if(!n?.subsetDefinitions?.length)return e;let s;if(i){const{variables:r}=n;if(r.length&&!r.includes(i))return null;const l=n.subsetDefinitions.find(m=>m.dimensionName===e.name&&m.variableName===i);if(!l?.values?.length)return e;s=M(l.values)}else s=n.dimensions.find(({name:r})=>r===e.name)?.extent;const a=s;if(!a?.length)return e;const t=e.values.filter(r=>w(r,a));return{...e,extent:[...a],values:t}}function C(e,n,i){if(!n?.subsetDefinitions?.length)return!1;const{variables:s}=n;if(s.length&&e.some(({variableName:a})=>a&&!s.includes(a)))return!0;for(let a=0;a(t.variableName===""||l.variableName===t.variableName)&&l.dimensionName===t.dimensionName);if(r?.values.length){const l=M(r.values);if(!t.isSlice&&t.values.length===2&&!Array.isArray(t.values[0])&&t.values[0]!==t.values[1]&&i){if(!A(t.values,l))return!0}else if(t.values.some(m=>!w(m,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:s,multidimensionalDefinition:a}=n;let t=null;if(s!=null&&(t=F(e,s),t==null))return{isOutside:!0};const{areaOfInterest:r}=e;if(r&&i){const l=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(l&&!r.contains(l))return{isOutside:!0}}return a!=null&&a.length&&C(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function F(e,n){const i=e.dimensions.find(({name:r})=>r==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:s,end:a}=n.toJSON(),t=s===a?[s]:s!=null&&a!=null?[s,a]:[s??a];return t.length===2&&i?.extent.length&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(o))),m?u.find(({name:o})=>o===m)??u[0]:u[0]}function z(e,n={}){const i=I(e,n);if(!i)return null;const s=[],{dimensions:a,name:t}=i;if(a.length===0)return[new D({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let r=0;r{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function J(e,n){if(n==null||e==null)return null;let i=n.variables.map(s=>({...s}));return e?.variables?.length&&(i=i.filter(({name:s})=>e.variables.includes(s)),i.forEach(s=>{s.dimensions=s.dimensions.map(a=>S(a,e,s.name)).filter(Y)})),i}function O(e,n){const{values:i}=n;if(i?.length){const l=Array.isArray(i[0]),m=Array.isArray(e);return l!==m?-1:l&&m?i.findIndex(u=>u[0]===e[0]&&u[1]===e[1]):i.indexOf(e)}const{extent:s}=n;if(Array.isArray(e)||!s||es[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-s[0])/a);const t=s[0];let r=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":r=Math.round((e-t)/1e3/a);break;case"minutes":r=Math.round((e-t)/6e4/a);break;case"hours":r=Math.round((e-t)/36e5/a);break;case"days":r=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),m=new Date(t).getUTCMonth(),u=new Date(e).getUTCMonth();r=l===0?u-m:u+11-m+12*(l-1)}break;case"years":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return r}function N(e){let n=e.values?.length;if(n)return n;const{extent:i,unit:s}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(s!=="ISO8601")return Math.round(t/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":if(i){const r=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),l=new Date(i[0]).getUTCMonth(),m=new Date(i[1]).getUTCMonth();n=r===0?m-l+1:m+11-l+12*(r-1)+1}else n=0;break;case"years":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a):0;break;case"decades":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function P(e,n){let i=0;const s=e[0].variableName,a=[...n.variables].sort((t,r)=>t.name>r.name?1:-1);for(let t=0;to.name>f.name?-1:1);if(r.name!==s){i+=l.map(o=>N(o)).reduce((o,f)=>o*f);continue}const m=l.map(o=>N(o)),u=l.length;for(let o=0;ob.dimensionName===l[o].name);if(f==null)return null;const g=O(f.values[0],l[o]);if(g===-1)return null;m.shift(),i+=o===u-1?g:g*m.reduce((b,T)=>b*T)}break}return i}export{R as E,L as I,P as J,B as R,I as T,j as Y,D as g,z as j,C as p,J as z}; diff --git a/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DEZ_-aFn.js b/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DEZ_-aFn.js new file mode 100644 index 00000000..0a25ef19 --- /dev/null +++ b/custom-toc-separator/assets/multidimensionalUtils-BwTugeu7-DEZ_-aFn.js @@ -0,0 +1 @@ +import{v as d,S as v,eD as h,i as x,e as U,P as k,aq as Y}from"./story-DT1Ep1ux.js";var y;let c=y=class extends U{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};d([v({type:String,json:{write:!0}})],c.prototype,"variableName",void 0),d([v({type:String,json:{write:!0}})],c.prototype,"dimensionName",void 0),d([v({type:h.array(h.oneOf([h.native(Number),h.array(h.native(Number))])),json:{write:!0}})],c.prototype,"values",void 0),d([v({type:Boolean,json:{write:!0}})],c.prototype,"isSlice",void 0),c=y=d([x("esri.layers.support.DimensionalDefinition")],c);const D=c;function p(e,n,i){const s=n.shift();if(i.length===0){const t=[];i.push({sliceId:-1,multidimensionalDefinition:t})}const a=i.length;for(let t=0;t{i.push({sliceId:-1,multidimensionalDefinition:[...r,{variableName:e,dimensionName:s.name,values:[l]}]})})}n.length&&p(e,n,i)}function j(e,n){const i=[];let s=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],r=[...a.dimensions].sort((l,m)=>l.name>m.name?-1:1);p(a.name,r,t),t.forEach(l=>{i.push({...l,sliceId:s++})})}),i}function L(e,n,i){let s=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(s=s.filter(l=>{const m=l.multidimensionalDefinition.find(o=>o.dimensionName===a);if(m==null)return!1;const u=m.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(o=>o[0]<=u&&o[1]>=u):typeof t[0]=="number"?t.some(o=>u[0]<=o&&u[1]>=o):r?t.some(o=>o[0]===u[0]&&o[0]===u[1]):t.some(o=>o[0]>=u[0]&&o[0]<=u[1]||o[1]>=u[0]&&o[1]<=u[1]||o[0]u[1])}))}),s.length&&i?.start!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),r=s[0].multidimensionalDefinition.findIndex(l=>l.dimensionName==="StdTime");r>-1&&(s=s.filter(l=>{const m=l.multidimensionalDefinition[r].values[0];return a<=m&&t>=m}))}return s.map(a=>a.sliceId)}function w(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function A(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function S(e,n,i){if(!n?.subsetDefinitions?.length)return e;let s;if(i){const{variables:r}=n;if(r.length&&!r.includes(i))return null;const l=n.subsetDefinitions.find(m=>m.dimensionName===e.name&&m.variableName===i);if(!l?.values?.length)return e;s=M(l.values)}else s=n.dimensions.find(({name:r})=>r===e.name)?.extent;const a=s;if(!a?.length)return e;const t=e.values.filter(r=>w(r,a));return{...e,extent:[...a],values:t}}function C(e,n,i){if(!n?.subsetDefinitions?.length)return!1;const{variables:s}=n;if(s.length&&e.some(({variableName:a})=>a&&!s.includes(a)))return!0;for(let a=0;a(t.variableName===""||l.variableName===t.variableName)&&l.dimensionName===t.dimensionName);if(r?.values.length){const l=M(r.values);if(!t.isSlice&&t.values.length===2&&!Array.isArray(t.values[0])&&t.values[0]!==t.values[1]&&i){if(!A(t.values,l))return!0}else if(t.values.some(m=>!w(m,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:s,multidimensionalDefinition:a}=n;let t=null;if(s!=null&&(t=F(e,s),t==null))return{isOutside:!0};const{areaOfInterest:r}=e;if(r&&i){const l=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(l&&!r.contains(l))return{isOutside:!0}}return a!=null&&a.length&&C(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function F(e,n){const i=e.dimensions.find(({name:r})=>r==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:s,end:a}=n.toJSON(),t=s===a?[s]:s!=null&&a!=null?[s,a]:[s??a];return t.length===2&&i?.extent.length&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(o))),m?u.find(({name:o})=>o===m)??u[0]:u[0]}function z(e,n={}){const i=I(e,n);if(!i)return null;const s=[],{dimensions:a,name:t}=i;if(a.length===0)return[new D({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let r=0;r{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function J(e,n){if(n==null||e==null)return null;let i=n.variables.map(s=>({...s}));return e?.variables?.length&&(i=i.filter(({name:s})=>e.variables.includes(s)),i.forEach(s=>{s.dimensions=s.dimensions.map(a=>S(a,e,s.name)).filter(Y)})),i}function O(e,n){const{values:i}=n;if(i?.length){const l=Array.isArray(i[0]),m=Array.isArray(e);return l!==m?-1:l&&m?i.findIndex(u=>u[0]===e[0]&&u[1]===e[1]):i.indexOf(e)}const{extent:s}=n;if(Array.isArray(e)||!s||es[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-s[0])/a);const t=s[0];let r=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":r=Math.round((e-t)/1e3/a);break;case"minutes":r=Math.round((e-t)/6e4/a);break;case"hours":r=Math.round((e-t)/36e5/a);break;case"days":r=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),m=new Date(t).getUTCMonth(),u=new Date(e).getUTCMonth();r=l===0?u-m:u+11-m+12*(l-1)}break;case"years":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return r}function N(e){let n=e.values?.length;if(n)return n;const{extent:i,unit:s}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(s!=="ISO8601")return Math.round(t/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":if(i){const r=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),l=new Date(i[0]).getUTCMonth(),m=new Date(i[1]).getUTCMonth();n=r===0?m-l+1:m+11-l+12*(r-1)+1}else n=0;break;case"years":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a):0;break;case"decades":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function P(e,n){let i=0;const s=e[0].variableName,a=[...n.variables].sort((t,r)=>t.name>r.name?1:-1);for(let t=0;to.name>f.name?-1:1);if(r.name!==s){i+=l.map(o=>N(o)).reduce((o,f)=>o*f);continue}const m=l.map(o=>N(o)),u=l.length;for(let o=0;ob.dimensionName===l[o].name);if(f==null)return null;const g=O(f.values[0],l[o]);if(g===-1)return null;m.shift(),i+=o===u-1?g:g*m.reduce((b,T)=>b*T)}break}return i}export{R as E,L as I,P as J,B as R,I as T,j as Y,D as g,z as j,C as p,J as z}; diff --git a/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-CU9ui3_0.js b/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-CU9ui3_0.js new file mode 100644 index 00000000..b545d249 --- /dev/null +++ b/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-CU9ui3_0.js @@ -0,0 +1 @@ +import{C as _,aG as D,m as P,b7 as O,bM as X,bK as k,f as H,g as B,a as G,l as z,a1 as K,d6 as V,o as Z}from"./story-DT1Ep1ux.js";import{f as L,t as A,p as R,u as U}from"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import{y as E}from"./utils-9sQxfkoa-CwJW9dca.js";import{p as Q,f as Y}from"./utils-Bq23Xwmj-Csxw19qV.js";async function $(e,t,l,s){const n=E(e),i=t[0].spatialReference,r={...s,responseType:"json",query:{...n.query,f:"json",sr:X(i),target:JSON.stringify({geometryType:k(t[0]),geometries:t}),cutter:JSON.stringify(l)}},o=await H(n.path+"/cut",r),{cutIndexes:c,geometries:a=[]}=o.data;return{cutIndexes:c,geometries:a.map(u=>{const m=B(u);return m.spatialReference=i,m})}}async function ee(e,t,l){const s=typeof e=="string"?G(e):e,n=t[0].spatialReference,i=k(t[0]),r={...l,query:{...s.query,f:"json",sr:X(n),geometries:JSON.stringify(Q(t))}},{data:o}=await H(s.path+"/simplify",r);return Y(o.geometries,i,n)}const W=()=>K.getLogger("esri.geometry.support.normalizeUtils");function ne(e){return e.type==="polygon"}function te(e){return e[0].type==="polygon"}function se(e){return e[0].type==="polyline"}function C(e){const t=[];let l=0,s=0;for(let n=0;n1){for(let N=1;N<=g-1;N++){const S=N*t,f=d*S+o,h=p*S+c;i.push([f,h])}const b=(m+Math.floor(g-1)*t)/2,j=d*b+o,F=p*b+c;i.push([j,F])}i.push([a,u])}}return ne(e)?new z({rings:s,spatialReference:e.spatialReference}):new P({paths:s,spatialReference:e.spatialReference})}function J(e,t,l){if(t){const s=oe(e,1e6);e=V(s,!0)}return l&&(e=U(e,l)),e}function T(e,t,l){if(Array.isArray(e)){const s=e[0];if(s>t){const n=R(s,t);e[0]=s+n*(-2*t)}else if(st){const n=R(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s{if(a[0]<180)return!0;{let u=0;for(let p=0;pu?d:u}u=Number(u.toFixed(9));const m=-360*R(u,180);for(let p=0;pT(x,o,c)),g.push(h)}else if(f.type==="extent"){const h=f.clone()._normalize(!1,!1,i);g.push(h.rings?new z(h):h)}else if(f.extent){const h=f.extent,x=R(h.xmin,c)*(2*o);let M=x===0?f.clone():U(f.clone(),x);h.offset(x,0);let{xmin:w,xmax:y}=h;w=Number(w.toFixed(9)),y=Number(y.toFixed(9)),h.intersects(u)&&y!==o?(p=y>p?y:p,M=J(M,r),d.push(M),g.push("cut")):h.intersects(m)&&w!==c?(p=y*(2*o)>p?y*(2*o):p,M=J(M,r,360),d.push(M),g.push("cut")):g.push(M)}else g.push(f.clone());else g.push(f);else g.push(f);let b=R(p,o),j=-90;const F=b,N=new P;for(;b>0;){const f=360*b-180;N.addPath([[f,j],[f,-1*j]]),j*=-1,b--}if(d.length>0&&F>0){const f=re(d,await $(s,d,N,l)),h=[],x=[];for(let y=0;y1&&I.rings.length>=v.rings.length?(h.push(I),x.push("simplify")):x.push(r?O(I):I)}}if(!h.length)return x;const M=await ee(s,h,l),w=[];for(let y=0;yi||cn)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=C(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=C(e.paths);break;case"multipoint":o=e.points}const u=t.clone();for(let m=0;mi?o=Math.ceil(Math.abs(t-i)/r):ti?c=Math.ceil(Math.abs(e-i)/r):ei?a-=r:un)for(;e>n;)e-=i}return e}export{ie as B,oe as D,ue as a,pe as c,he as l}; diff --git a/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-DaA_UEnd.js b/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-DaA_UEnd.js deleted file mode 100644 index 642da862..00000000 --- a/custom-toc-separator/assets/normalizeUtils-Bxmy9MNI-DaA_UEnd.js +++ /dev/null @@ -1 +0,0 @@ -import{C as _,aG as D,m as P,b7 as O,bM as X,bK as k,f as H,g as B,a as G,l as z,a1 as K,d6 as V,o as Z}from"./story-OUarUCIt.js";import{f as L,t as A,p as R,u as U}from"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import{y as E}from"./utils-9sQxfkoa-Djr5L7DU.js";import{p as Q,f as Y}from"./utils-Bq23Xwmj-CIl5z47y.js";async function $(e,t,l,s){const n=E(e),i=t[0].spatialReference,r={...s,responseType:"json",query:{...n.query,f:"json",sr:X(i),target:JSON.stringify({geometryType:k(t[0]),geometries:t}),cutter:JSON.stringify(l)}},o=await H(n.path+"/cut",r),{cutIndexes:c,geometries:a=[]}=o.data;return{cutIndexes:c,geometries:a.map(u=>{const m=B(u);return m.spatialReference=i,m})}}async function ee(e,t,l){const s=typeof e=="string"?G(e):e,n=t[0].spatialReference,i=k(t[0]),r={...l,query:{...s.query,f:"json",sr:X(n),geometries:JSON.stringify(Q(t))}},{data:o}=await H(s.path+"/simplify",r);return Y(o.geometries,i,n)}const W=()=>K.getLogger("esri.geometry.support.normalizeUtils");function ne(e){return e.type==="polygon"}function te(e){return e[0].type==="polygon"}function se(e){return e[0].type==="polyline"}function C(e){const t=[];let l=0,s=0;for(let n=0;n1){for(let N=1;N<=g-1;N++){const S=N*t,f=d*S+o,h=p*S+c;i.push([f,h])}const b=(m+Math.floor(g-1)*t)/2,j=d*b+o,F=p*b+c;i.push([j,F])}i.push([a,u])}}return ne(e)?new z({rings:s,spatialReference:e.spatialReference}):new P({paths:s,spatialReference:e.spatialReference})}function J(e,t,l){if(t){const s=oe(e,1e6);e=V(s,!0)}return l&&(e=U(e,l)),e}function T(e,t,l){if(Array.isArray(e)){const s=e[0];if(s>t){const n=R(s,t);e[0]=s+n*(-2*t)}else if(st){const n=R(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s{if(a[0]<180)return!0;{let u=0;for(let p=0;pu?d:u}u=Number(u.toFixed(9));const m=-360*R(u,180);for(let p=0;pT(x,o,c)),g.push(h)}else if(f.type==="extent"){const h=f.clone()._normalize(!1,!1,i);g.push(h.rings?new z(h):h)}else if(f.extent){const h=f.extent,x=R(h.xmin,c)*(2*o);let M=x===0?f.clone():U(f.clone(),x);h.offset(x,0);let{xmin:w,xmax:y}=h;w=Number(w.toFixed(9)),y=Number(y.toFixed(9)),h.intersects(u)&&y!==o?(p=y>p?y:p,M=J(M,r),d.push(M),g.push("cut")):h.intersects(m)&&w!==c?(p=y*(2*o)>p?y*(2*o):p,M=J(M,r,360),d.push(M),g.push("cut")):g.push(M)}else g.push(f.clone());else g.push(f);else g.push(f);let b=R(p,o),j=-90;const F=b,N=new P;for(;b>0;){const f=360*b-180;N.addPath([[f,j],[f,-1*j]]),j*=-1,b--}if(d.length>0&&F>0){const f=re(d,await $(s,d,N,l)),h=[],x=[];for(let y=0;y1&&I.rings.length>=v.rings.length?(h.push(I),x.push("simplify")):x.push(r?O(I):I)}}if(!h.length)return x;const M=await ee(s,h,l),w=[];for(let y=0;yi||cn)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=C(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=C(e.paths);break;case"multipoint":o=e.points}const u=t.clone();for(let m=0;mi?o=Math.ceil(Math.abs(t-i)/r):ti?c=Math.ceil(Math.abs(e-i)/r):ei?a-=r:un)for(;e>n;)e-=i}return e}export{ie as B,oe as D,ue as a,pe as c,he as l}; diff --git a/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js b/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js new file mode 100644 index 00000000..de69b77e --- /dev/null +++ b/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js @@ -0,0 +1 @@ +import{m as t,J as a,ca as o}from"./story-DT1Ep1ux.js";const f={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new t({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator}),minus180Line:new t({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new t({paths:[[[180,-180],[180,180]]],spatialReference:a.WGS84}),minus180Line:new t({paths:[[[-180,-180],[-180,180]]],spatialReference:a.WGS84})}};function u(e,n){return Math.ceil((e-n)/(2*n))}function m(e,n){const r=c(e);for(const s of r)for(const i of s)i[0]+=n;return e}function c(e){return o(e)?e.rings:e.paths}export{f,u as p,c as t,m as u}; diff --git a/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js b/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js deleted file mode 100644 index a561c985..00000000 --- a/custom-toc-separator/assets/normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js +++ /dev/null @@ -1 +0,0 @@ -import{m as t,J as a,ca as o}from"./story-OUarUCIt.js";const f={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new t({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator}),minus180Line:new t({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new t({paths:[[[180,-180],[180,180]]],spatialReference:a.WGS84}),minus180Line:new t({paths:[[[-180,-180],[-180,180]]],spatialReference:a.WGS84})}};function u(e,n){return Math.ceil((e-n)/(2*n))}function m(e,n){const r=c(e);for(const s of r)for(const i of s)i[0]+=n;return e}function c(e){return o(e)?e.rings:e.paths}export{f,u as p,c as t,m as u}; diff --git a/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js b/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js deleted file mode 100644 index 207a158d..00000000 --- a/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js +++ /dev/null @@ -1 +0,0 @@ -import{bh as H,aG as X,co as G,dd as N,c9 as W,cc as $,eQ as j,ca as z,cb as b,g_ as J,j0 as K}from"./story-OUarUCIt.js";import{f as T,u as Q,p}from"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";function D(t){return k(t,!0)}function E(t){return k(t,!1)}function k(t,s){if(t==null)return null;const i=t.spatialReference,n=X(i),e=G(t)?t.toJSON():t;if(!n)return e;const h=N(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(W(e))return S(e,u,x);if($(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(j(e))return R(e,n);if(z(e)||b(e)){const o=J(Y,e),_={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},r=p(_.xmin,x)*(2*u),m=r===0?e:Q(e,r);return _.xmin+=r,_.xmax+=r,_.xmax>u?L(m,u,s):_.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*_){const v={xmin:hc||A?i.push(new l({xmin:r,ymin:n,xmax:_,ymax:e},[m]),new l({xmin:o,ymin:n,xmax:c,ymax:e},[a])):i.push(new l({xmin:r,ymin:n,xmax:c,ymax:e},[m]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!b(t);if(n&&K(t),i)return new Z().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const r=[];for(const m of _)r.push([m[0]+x,m[1]]);e.push(r)}}return n?t.rings=e:t.paths=e,t}class l{constructor(s,i){this.extent=s,this.frameIds=i}}const Y=H();class Z{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;n.push(h)}return this._closed?s.rings=n:s.paths=n,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(M(this._lineIn,n<=0?s:this._xCut,i),M(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function M(t,s,i){const n=t.length;n>1&&t[n-1][0]===s&&t[n-2][0]===s?t[n-1][1]=i:t.push([s,i])}export{D as G,E as H}; diff --git a/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js b/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js new file mode 100644 index 00000000..279f1a5c --- /dev/null +++ b/custom-toc-separator/assets/normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js @@ -0,0 +1 @@ +import{bh as H,aG as X,co as G,dd as N,c9 as W,cc as $,eQ as j,ca as z,cb as b,g_ as J,j0 as K}from"./story-DT1Ep1ux.js";import{f as T,u as Q,p}from"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";function D(t){return k(t,!0)}function E(t){return k(t,!1)}function k(t,s){if(t==null)return null;const i=t.spatialReference,n=X(i),e=G(t)?t.toJSON():t;if(!n)return e;const h=N(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(W(e))return S(e,u,x);if($(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(j(e))return R(e,n);if(z(e)||b(e)){const o=J(Y,e),_={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},r=p(_.xmin,x)*(2*u),m=r===0?e:Q(e,r);return _.xmin+=r,_.xmax+=r,_.xmax>u?L(m,u,s):_.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*_){const v={xmin:hc||A?i.push(new l({xmin:r,ymin:n,xmax:_,ymax:e},[m]),new l({xmin:o,ymin:n,xmax:c,ymax:e},[a])):i.push(new l({xmin:r,ymin:n,xmax:c,ymax:e},[m]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!b(t);if(n&&K(t),i)return new Z().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const r=[];for(const m of _)r.push([m[0]+x,m[1]]);e.push(r)}}return n?t.rings=e:t.paths=e,t}class l{constructor(s,i){this.extent=s,this.frameIds=i}}const Y=H();class Z{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;n.push(h)}return this._closed?s.rings=n:s.paths=n,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(M(this._lineIn,n<=0?s:this._xCut,i),M(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function M(t,s,i){const n=t.length;n>1&&t[n-1][0]===s&&t[n-2][0]===s?t[n-1][1]=i:t.push([s,i])}export{D as G,E as H}; diff --git a/custom-toc-separator/assets/number-eRKYXfX9-BO7ByyLZ.js b/custom-toc-separator/assets/number-eRKYXfX9-BO7ByyLZ.js new file mode 100644 index 00000000..0363bd3a --- /dev/null +++ b/custom-toc-separator/assets/number-eRKYXfX9-BO7ByyLZ.js @@ -0,0 +1 @@ +import{h as N,c6 as S}from"./story-DT1Ep1ux.js";const h={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function b(e=N()){let n=(e=e.toLowerCase())in h;if(!n){const s=e.split("-");s.length>1&&s[0]in h&&(e=s[0],n=!0),n||(e="en")}const[t,r,l="#,##0.###"]=h[e];return{decimal:t,group:r,pattern:l}}function M(e,n){const t=b((n={...n}).locale);n.customs=t;const r=n.pattern||t.pattern;return isNaN(e)||Math.abs(e)===1/0?null:E(e,r,n)}const w=/[#0,]*[#0](?:\.0*#*)?/;function E(e,n,t){const r=(t=t||{}).customs.group,l=t.customs.decimal,s=n.split(";"),a=s[0];if((n=s[e<0?1:0]||"-"+a).includes("%"))e*=100;else if(n.includes("‰"))e*=1e3;else{if(n.includes("¤"))throw new Error("currency notation not supported");if(n.includes("E"))throw new Error("exponential notation not supported")}const d=w,f=a.match(d);if(!f)throw new Error("unable to find a number expression in pattern: "+n);return t.fractional===!1&&(t.places=0),n.replace(d,z(e,f[0],{decimal:l,group:r,places:t.places,round:t.round}))}function z(e,n,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=n.split("."),l=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;l?s=t.places.slice(l+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(e=Number(e.toFixed(Number(s))));const a=String(Math.abs(e)).split("."),d=a[1]||"";if(r[1]||t.places){l&&(t.places=t.places.slice(0,Math.max(0,l)));const o=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+o>d.length&&(a[1]=d.padEnd(Number(o),"0")),+sa[0].length&&(a[0]=a[0].padStart(i,"0")),f.includes("#")||(a[0]=a[0].slice(-i)));let p,c,u=r[0].lastIndexOf(",");if(u!==-1){p=r[0].length-u-1;const o=r[0].slice(0,u);u=o.lastIndexOf(","),u!==-1&&(c=o.length-u-1)}const m=[];for(let o=a[0];o;){const x=o.length-p;m.push(x>0?o.slice(Math.max(0,x)):o),o=x>0?o.slice(0,x):"",c&&(p=c,c=void 0)}return a[0]=m.reverse().join(t.group||","),a.join(t.decimal||".")}function v(e){const n=b((e=e||{}).locale),t=e.pattern||n.pattern,r=n.group,l=n.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const a=t.split(";");return a.length===1&&a.push("-"+a[0]),{regexp:g(a,d=>(d="(?:"+S(d,".")+")").replace(w,f=>{const i={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:l,exponent:!1},p=f.split(".");let c=e.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||c===0?i.fractional=!1:(c===void 0&&(c=e.pattern?p[1].lastIndexOf("0")+1:1/0),c&&e.fractional==null&&(i.fractional=!0),!e.places&&+c1&&(i.groupSize=u.pop().length,u.length>1&&(i.groupSize2=u.pop().length)),"("+y(i)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:l,factor:s}}function j(e,n){const t=v(n),r=new RegExp("^"+t.regexp+"$").exec(e);if(!r)return NaN;let l=r[1];if(!r[1]){if(!r[2])return NaN;l=r[2],t.factor*=-1}return l=l.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(l)*t.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const n=A(e),t=g(e.fractional,l=>{let s="";return l&&e.places!==0&&(s="\\"+e.decimal,e.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+e.places+"}"),s},!0);let r=n+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+g(e.exponent,l=>l?"([eE]"+A({signed:e.eSigned})+")":"")}function A(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",g(e.signed,n=>n?"[-+]":"",!0)+g(e.separator,n=>{if(!n)return"(?:\\d+)";(n=S(n))===" "?n="\\s":n===" "&&(n="\\s\\xa0");const t=e.groupSize,r=e.groupSize2;if(r){const l="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*["+n+"]\\d{"+t+"})";return t-r>0?"(?:"+l+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":l}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+n+"]\\d{"+t+"})*)"},!0)}const g=(e,n,t)=>{if(!Array.isArray(e))return n(e);const r=[];for(let l=0;l"("+(n?"?:":"")+e+")";export{j as M,v as N,M as z}; diff --git a/custom-toc-separator/assets/number-eRKYXfX9-DRLtE8-p.js b/custom-toc-separator/assets/number-eRKYXfX9-DRLtE8-p.js deleted file mode 100644 index 96791857..00000000 --- a/custom-toc-separator/assets/number-eRKYXfX9-DRLtE8-p.js +++ /dev/null @@ -1 +0,0 @@ -import{h as N,c6 as S}from"./story-OUarUCIt.js";const h={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function b(e=N()){let n=(e=e.toLowerCase())in h;if(!n){const s=e.split("-");s.length>1&&s[0]in h&&(e=s[0],n=!0),n||(e="en")}const[t,r,l="#,##0.###"]=h[e];return{decimal:t,group:r,pattern:l}}function M(e,n){const t=b((n={...n}).locale);n.customs=t;const r=n.pattern||t.pattern;return isNaN(e)||Math.abs(e)===1/0?null:E(e,r,n)}const w=/[#0,]*[#0](?:\.0*#*)?/;function E(e,n,t){const r=(t=t||{}).customs.group,l=t.customs.decimal,s=n.split(";"),a=s[0];if((n=s[e<0?1:0]||"-"+a).includes("%"))e*=100;else if(n.includes("‰"))e*=1e3;else{if(n.includes("¤"))throw new Error("currency notation not supported");if(n.includes("E"))throw new Error("exponential notation not supported")}const d=w,f=a.match(d);if(!f)throw new Error("unable to find a number expression in pattern: "+n);return t.fractional===!1&&(t.places=0),n.replace(d,z(e,f[0],{decimal:l,group:r,places:t.places,round:t.round}))}function z(e,n,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=n.split("."),l=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;l?s=t.places.slice(l+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(e=Number(e.toFixed(Number(s))));const a=String(Math.abs(e)).split("."),d=a[1]||"";if(r[1]||t.places){l&&(t.places=t.places.slice(0,Math.max(0,l)));const o=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+o>d.length&&(a[1]=d.padEnd(Number(o),"0")),+sa[0].length&&(a[0]=a[0].padStart(i,"0")),f.includes("#")||(a[0]=a[0].slice(-i)));let p,c,u=r[0].lastIndexOf(",");if(u!==-1){p=r[0].length-u-1;const o=r[0].slice(0,u);u=o.lastIndexOf(","),u!==-1&&(c=o.length-u-1)}const m=[];for(let o=a[0];o;){const x=o.length-p;m.push(x>0?o.slice(Math.max(0,x)):o),o=x>0?o.slice(0,x):"",c&&(p=c,c=void 0)}return a[0]=m.reverse().join(t.group||","),a.join(t.decimal||".")}function v(e){const n=b((e=e||{}).locale),t=e.pattern||n.pattern,r=n.group,l=n.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const a=t.split(";");return a.length===1&&a.push("-"+a[0]),{regexp:g(a,d=>(d="(?:"+S(d,".")+")").replace(w,f=>{const i={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:l,exponent:!1},p=f.split(".");let c=e.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||c===0?i.fractional=!1:(c===void 0&&(c=e.pattern?p[1].lastIndexOf("0")+1:1/0),c&&e.fractional==null&&(i.fractional=!0),!e.places&&+c1&&(i.groupSize=u.pop().length,u.length>1&&(i.groupSize2=u.pop().length)),"("+y(i)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:l,factor:s}}function j(e,n){const t=v(n),r=new RegExp("^"+t.regexp+"$").exec(e);if(!r)return NaN;let l=r[1];if(!r[1]){if(!r[2])return NaN;l=r[2],t.factor*=-1}return l=l.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(l)*t.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const n=A(e),t=g(e.fractional,l=>{let s="";return l&&e.places!==0&&(s="\\"+e.decimal,e.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+e.places+"}"),s},!0);let r=n+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+g(e.exponent,l=>l?"([eE]"+A({signed:e.eSigned})+")":"")}function A(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",g(e.signed,n=>n?"[-+]":"",!0)+g(e.separator,n=>{if(!n)return"(?:\\d+)";(n=S(n))===" "?n="\\s":n===" "&&(n="\\s\\xa0");const t=e.groupSize,r=e.groupSize2;if(r){const l="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*["+n+"]\\d{"+t+"})";return t-r>0?"(?:"+l+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":l}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+n+"]\\d{"+t+"})*)"},!0)}const g=(e,n,t)=>{if(!Array.isArray(e))return n(e);const r=[];for(let l=0;l"("+(n?"?:":"")+e+")";export{j as M,v as N,M as z}; diff --git a/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-Bby0r4W1.js b/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-Bby0r4W1.js deleted file mode 100644 index b46d4c74..00000000 --- a/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-Bby0r4W1.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loader-CkLCe-E_-C05zTnsA.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-5qCYzF4G.js","./mat4-DX7gBViE-d6nV0_rZ.js","./common-CYWrYyJl-E8-sukrT.js","./quat-BODLR7mS-BrN0ZBC_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-iWg2zFa3.js","./vec42-D8CJyqHG-DnfLTeQH.js","./BufferView-PQoE3GL7-B_xfzNdr.js","./vec2-tHZ6OaOy-xCj1obDt.js","./resourceUtils-Ds65naCv-CrS2VhCe.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js"])))=>i.map(i=>d[i]); -import{_ as Mt}from"./main-lj2zzr_L.js";import{m as _t}from"./devEnvironmentUtils-CxrVv3RG-CX5aoxVE.js";import{is as dt,it as W,hf as st,k3 as Ot,b6 as ft,f as Rt,W as pt,o as Bt,il as it,dg as U,a1 as Pt,hB as Ct}from"./story-OUarUCIt.js";import{U as Et,P as St,E as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as gt,o as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{z as Lt}from"./mat4-DX7gBViE-d6nV0_rZ.js";import{t as Nt,u as nt,o as Ft}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{l as Ut}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{Y as tt,r as Gt,x as at,b as $t,l as kt,X as qt,_ as L,j as C,L as N,B as jt}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{ab as Dt,ac as Ht,g as X,ad as Vt,a3 as zt,aa as H,s as Wt,ae as V,a9 as Xt,a4 as Qt,p as xt}from"./AttributeArray-BWXEft_i-Bq20cXL-.js";import{X as Kt,L as bt,C as Zt,l as yt,g as Jt,M as Yt}from"./BufferView-PQoE3GL7-B_xfzNdr.js";import{b as te,z as ee,O as ut,j as lt}from"./vec3-BazNroeq-C58EAHFm.js";import{L as re,P as ct}from"./vec4-DWDdg1fj-CF_vNE3j.js";import{U as se,k as $,E as ie,c as oe,y as ne,d as ae}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-D3GULH3C.js";import{f as Y}from"./resourceUtils-Ds65naCv-CrS2VhCe.js";import{f as ue,l as le}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{s as ce}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{m as wt}from"./Version-CoKzbupV-5qCYzF4G.js";import{w as me,A as vt}from"./Indices-DEr2HrWx-Bin5_zrY.js";import{r as he}from"./requestImageUtils-Ut4YcoNU-BuJzHX4v.js";import{M as q}from"./orientedBoundingBox-oHezdpWm-BMbvjED3.js";import{N as O,s as de,e as et,u as fe}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{_ as pe}from"./triangle-hqU-Tc1X-DnaZZmrr.js";import{h as ge}from"./Util-BjGjeg6f-08Szkf4F.js";import{T}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{G as mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as ht}from"./NormalAttribute.glsl-axtNsUxo-YrdLJlX4.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Texture-BCt2hphT-Bv29bzNX.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./InterleavedLayout-DXzw3B2n-BGmZ7EU1.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./compilerUtils-CV1QYWI8-yV6K-awH.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-DGqkTDRl.js";import"./sphere-BenPORjV-CkV41Bdd.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./plane-Dt8R0KeE-DlxNxa6f.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CznIGfdF.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./lengthUtils-DKpMe5qR-BJJJQeiz.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./quat-BODLR7mS-BrN0ZBC_.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";function xe(i,t){if(!i)return!1;const{size:e,data:r,indices:l}=i;L(t,0,0,0),L(v,0,0,0);let u=0,o=0;for(let a=0;a1&&N(t,t,1/o),o>0}function ye(i,t,e){if(!i)return!1;L(e,0,0,0),L(v,0,0,0);let r=0,l=0;const{size:u,data:o,indices:a}=i,c=a.length-1,s=c+(t?2:0);for(let n=0;n0?(C(e,e,N(g,g,h)),r+=h):r===0&&(C(v,v,g),l++)}return r!==0?(N(e,e,1/r),!0):l!==0&&(N(e,v,1/l),!0)}const g=U(),E=U(),z=U(),v=U();class we{constructor(){this.uid=Ct()}}class ve extends we{constructor(t){super(),this.highlightGroupName=t,this.channel=fe.Highlight}}class Q extends Wt{constructor(t,e,r=null,l=V.Mesh,u=null,o=-1){super(),this.material=t,this.mapPositions=r,this.type=l,this.objectAndLayerIdColor=u,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightGroupCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,c]of e)this._attributes.set(a,{...c,indices:me(c.indices)}),a===T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(t={}){const e=new Q(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,l)=>{r.exclusive=!1,e._attributes.set(l,r)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}get attributes(){return this._attributes}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:Xt(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const r=this._attributes.get(t);r&&this._attributes.set(t,{...r,exclusive:!0,data:e})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===V.Mesh?this._computeAttachmentOriginTriangles(t):this.type===V.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(this._transformation!=null&&tt(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const e=this.attributes.get(T.POSITION);return xe(e,t)}_computeAttachmentOriginLines(t){const e=this.attributes.get(T.POSITION);return ye(e,Te(this.material.parameters,e),t)}_computeAttachmentOriginPoints(t){const e=this.attributes.get(T.POSITION);return be(e,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(T.POSITION);if(!t||t.indices.length===0)return null;const e=this.type===V.Mesh?3:1;ge(t.indices.length%e==0,"Indexing error: "+t.indices.length+" not divisible by "+e);const r=vt(t.indices.length/e);return new Qt(r,e,t)}get transformation(){return this._transformation??nt}set transformation(t){this._transformation=t&&t!==nt?Ft(t):null}get highlightGroups(){return this._highlightGroupCounts}get hasHighlights(){return this._highlightGroupCounts.size>0}foreachHighlightGroup(t){this._highlightGroupCounts.forEach((e,r)=>t(r))}allocateIdAndHighlight(t){const e=new ve(t);return this.addHighlight(e)}addHighlight(t){this.highlights.add(t);const{highlightGroupName:e}=t,r=(this._highlightGroupCounts.get(e)??0)+1;return this._highlightGroupCounts.set(e,r),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightGroupName:e}=t,r=this._highlightGroupCounts.get(e)??0;r<=1?this._highlightGroupCounts.delete(e):this._highlightGroupCounts.set(e,r-1)}}}function Te(i,t){return!(!("isClosed"in i)||!i.isClosed)&&t.indices.length>2}function j(i){if(i==null)return null;const t=i.offset!=null?i.offset:ue,e=i.rotation!=null?i.rotation:0,r=i.scale!=null?i.scale:le,l=J(1,0,0,0,1,0,t[0],t[1],1),u=J(Math.cos(e),-Math.sin(e),0,Math.sin(e),Math.cos(e),0,0,0,1),o=J(r[0],0,0,0,r[1],0,0,0,1),a=gt();return ot(a,u,o),ot(a,l,a),a}class Ie{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class Ae{constructor(t,e,r){this.name=t,this.lodThreshold=e,this.pivotOffset=r,this.stageResources=new Ie,this.numberOfVertices=0}}const P=()=>Pt.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");async function Me(i,t){const e=await _e(i,t),r=await Ce(e.textureDefinitions??{},t);let l=0;for(const u in r)if(r.hasOwnProperty(u)){const o=r[u];l+=o?.image?o.image.width*o.image.height*4:0}return{resource:e,textures:r,size:l+Ot(e)}}async function _e(i,t){const e=t?.streamDataRequester;if(e)return Oe(i,e,t);const r=await ft(Rt(i,t));if(r.ok===!0)return r.value.data;pt(r.error),Tt(r.error)}async function Oe(i,t,e){const r=await ft(t.request(i,"json",e));if(r.ok===!0)return r.value;pt(r.error),Tt(r.error.details.url)}function Tt(i){throw new Bt("",`Request for object resource failed: ${i}`)}function Re(i){const t=i.params,e=t.topology;let r=!0;switch(t.vertexAttributes||(P().warn("Geometry must specify vertex attributes"),r=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const u=t.faces;if(u){if(t.vertexAttributes)for(const o in t.vertexAttributes){const a=u[o];a?.values?(a.valueType!=null&&a.valueType!=="UInt32"&&(P().warn(`Unsupported indexed geometry indices type '${a.valueType}', only UInt32 is currently supported`),r=!1),a.valuesPerElement!=null&&a.valuesPerElement!==1&&(P().warn(`Unsupported indexed geometry values per element '${a.valuesPerElement}', only 1 is currently supported`),r=!1)):(P().warn(`Indexed geometry does not specify face indices for '${o}' attribute`),r=!1)}}else P().warn("Indexed geometries must specify faces"),r=!1;break}default:P().warn(`Unsupported topology '${e}'`),r=!1}i.params.material||(P().warn("Geometry requires material"),r=!1);const l=i.params.vertexAttributes;for(const u in l)l[u].values||(P().warn("Geometries with externally defined attributes are not yet supported"),r=!1);return r}function Be(i,t){const e=new Array,r=new Array,l=new Array,u=new ce,o=i.resource,a=wt.parse(o.version||"1.0","wosr");Se.validate(a);const c=o.model.name,s=o.model.geometries,n=o.materialDefinitions??{},m=i.textures;let d=0;const f=new Map;for(let h=0;h{if(p.params.topology==="PerAttributeArray")return null;const _=p.params.faces;for(const B in _)if(B===x)return _[B].values;return null},G=I[T.POSITION],D=G.values.length/G.valuesPerElement;for(const x in I){const _=I[x],B=_.values,Z=A(x)??vt(D);M.push([x,new q(B,Z,_.valuesPerElement,!0)])}const R=b.texture,y=m&&m[R];if(y&&!f.has(R)){const{image:x,parameters:_}=y,B=new xt(x,_);r.push(B),f.set(R,B)}const F=f.get(R),K=F?F.id:void 0,S=b.material;let w=u.get(S,R);if(w==null){const x=n[S.slice(S.lastIndexOf("/")+1)].params;x.transparency===1&&(x.transparency=0);const _=y&&y.alphaChannelUsage,B=x.transparency>0||_==="transparency"||_==="maskAndTransparency",Z=y?It(y.alphaChannelUsage):void 0,rt={ambient:it(x.diffuse),diffuse:it(x.diffuse),opacity:1-(x.transparency||0),transparent:B,textureAlphaMode:Z,textureAlphaCutoff:.33,textureId:K,initTextureTransparent:!0,doubleSided:!0,cullFace:et.None,colorMixMode:x.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(rt,t.materialParameters),w=new X(rt,t),u.set(S,R,w)}l.push(w);const At=new Q(w,M);d+=M.find(x=>x[0]===T.POSITION)?.[1]?.indices.length??0,e.push(At)}return{engineResources:[{name:c,stageResources:{textures:r,materials:l,geometries:e},pivotOffset:o.model.pivotOffset,numberOfVertices:d,lodThreshold:null}],referenceBoundingBox:Pe(e)}}function Pe(i){const t=dt();return i.forEach(e=>{const r=e.boundingInfo;r!=null&&(W(t,r.bbMin),W(t,r.bbMax))}),t}async function Ce(i,t){const e=new Array;for(const u in i){const o=i[u],a=o.images[0].data;if(!a){P().warn("Externally referenced texture data is not yet supported");continue}const c=o.encoding+";base64,"+a,s="/textureDefinitions/"+u,n=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:mt.REPEAT,t:mt.REPEAT},preMultiplyAlpha:It(n)!==O.Opaque},d=t?.disableTextures?Promise.resolve(null):he(c,t);e.push(d.then(f=>({refId:s,image:f,parameters:m,alphaChannelUsage:n})))}const r=await Promise.all(e),l={};for(const u of r)l[u.refId]=u;return l}function It(i){switch(i){case"mask":return O.Mask;case"maskAndTransparency":return O.MaskBlend;case"none":return O.Opaque;default:return O.Blend}}function Ee(i){const t=i.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Se=new wt(1,2,"wosr");async function Ur(i,t){const e=Le(_t(i));if(e.fileType==="wosr"){const m=await(t.cache?t.cache.loadWOSR(e.url,t):Me(e.url,t)),{engineResources:d,referenceBoundingBox:f}=Be(m,t);return{lods:d,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}let r;if(t.cache)r=await t.cache.loadGLTF(e.url,t,!!t.usePBR);else{const{loadGLTF:m}=await Mt(()=>import("./loader-CkLCe-E_-C05zTnsA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);r=await m(new se(t.streamDataRequester),e.url,t,t.usePBR)}const l=r.model.meta?.ESRI_proxyEllipsoid,u=r.meta.isEsriSymbolResource&&l!=null&&r.meta.ESRI_webstyle==="EsriRealisticTreesStyle";u&&!r.customMeta.esriTreeRendering&&(r.customMeta.esriTreeRendering=!0,$e(r,l));const o=!!t.usePBR,a=r.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:u,mrrFactors:Dt}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:Ht},c={...t.materialParameters,treeRendering:u},{engineResources:s,referenceBoundingBox:n}=Ne(r,a,c,t,e.specifiedLodIndex);return{lods:s,referenceBoundingBox:n,isEsriSymbolResource:r.meta.isEsriSymbolResource,isWosr:!1}}function Le(i){const t=i.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:t[4]!=null?Number(t[4]):null}:i.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:i,specifiedLodIndex:null}:{fileType:"unknown",url:i,specifiedLodIndex:null}}function Ne(i,t,e,r,l){const u=i.model,o=new Array,a=new Map,c=new Map,s=u.lods.length,n=dt();return u.lods.forEach((m,d)=>{const f=r.skipHighLods===!0&&(s>1&&d===0||s>3&&d===1)||r.skipHighLods===!1&&l!=null&&d!==l;if(f&&d!==0)return;const h=new Ae(m.name,m.lodThreshold,[0,0,0]);m.parts.forEach(p=>{const b=f?new X({},r):Fe(u,p,h,t,e,a,c,r),{geometry:I,vertexCount:M}=Ue(p,b??new X({},r)),A=I.boundingInfo;A!=null&&d===0&&(W(n,A.bbMin),W(n,A.bbMax)),b!=null&&(h.stageResources.geometries.push(I),h.numberOfVertices+=M)}),f||o.push(h)}),{engineResources:o,referenceBoundingBox:n}}function Fe(i,t,e,r,l,u,o,a){const c=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),s=i.materials.get(t.material),n=t.attributes.texCoord0!=null,m=t.attributes.normal!=null;if(s==null)return null;const d=Ge(s.alphaMode);if(!u.has(c)){if(n){const y=(F,K=!1)=>{if(F!=null&&!o.has(F)){const S=i.textures.get(F);if(S!=null){const w=S.data;o.set(F,new xt(Y(w)?w.data:w,{...S.parameters,preMultiplyAlpha:!Y(w)&&K,encoding:Y(w)&&w.encoding!=null?w.encoding:void 0}))}}};y(s.textureColor,d!==O.Opaque),y(s.textureNormal),y(s.textureOcclusion),y(s.textureEmissive),y(s.textureMetallicRoughness)}const h=s.color[0]**(1/$),p=s.color[1]**(1/$),b=s.color[2]**(1/$),I=s.emissiveFactor[0]**(1/$),M=s.emissiveFactor[1]**(1/$),A=s.emissiveFactor[2]**(1/$),G=s.textureColor!=null&&n?o.get(s.textureColor):null,D=Vt({normalTexture:s.textureNormal,metallicRoughnessTexture:s.textureMetallicRoughness,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,emissiveTexture:s.textureEmissive,emissiveFactor:s.emissiveFactor,occlusionTexture:s.textureOcclusion}),R=s.normalTextureTransform?.scale!=null?s.normalTextureTransform?.scale:Ut;u.set(c,new X({...r,transparent:d===O.Blend,customDepthTest:de.Lequal,textureAlphaMode:d,textureAlphaCutoff:s.alphaCutoff,diffuse:[h,p,b],ambient:[h,p,b],opacity:s.opacity,doubleSided:s.doubleSided,doubleSidedType:"winding-order",cullFace:s.doubleSided?et.None:et.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?ht.Attribute:ht.ScreenDerivative,castShadows:!0,receiveShadows:s.receiveShadows,receiveAmbientOcclusion:s.receiveAmbientOcclustion,textureId:G?.id,colorMixMode:s.colorMixMode,normalTextureId:s.textureNormal!=null&&n?o.get(s.textureNormal).id:void 0,textureAlphaPremultiplied:G!=null&&!!G.parameters.preMultiplyAlpha,occlusionTextureId:s.textureOcclusion!=null&&n?o.get(s.textureOcclusion).id:void 0,emissiveTextureId:s.textureEmissive!=null&&n?o.get(s.textureEmissive).id:void 0,metallicRoughnessTextureId:s.textureMetallicRoughness!=null&&n?o.get(s.textureMetallicRoughness).id:void 0,emissiveFactor:[I,M,A],mrrFactors:D?zt:[s.metallicFactor,s.roughnessFactor,r.mrrFactors[2]],isSchematic:D,colorTextureTransformMatrix:j(s.colorTextureTransform),normalTextureTransformMatrix:j(s.normalTextureTransform),scale:[R[0],R[1]],occlusionTextureTransformMatrix:j(s.occlusionTextureTransform),emissiveTextureTransformMatrix:j(s.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:j(s.metallicRoughnessTextureTransform),...l},a))}const f=u.get(c);if(e.stageResources.materials.push(f),n){const h=p=>{p!=null&&e.stageResources.textures.push(o.get(p))};h(s.textureColor),h(s.textureNormal),h(s.textureOcclusion),h(s.textureEmissive),h(s.textureMetallicRoughness)}return f}function Ue(i,t){const e=i.attributes.position.count,r=ie(i.indices||e,i.primitiveType),l=H(3*e),{typedBuffer:u,typedBufferStride:o}=i.attributes.position;te(l,u,i.transform,3,o);const a=[[T.POSITION,new q(l,r,3,!0)]];if(i.attributes.normal!=null){const s=H(3*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.normal;Et(k,i.transform),ee(s,n,k,3,m),st(k)&&ut(s,s),a.push([T.NORMAL,new q(s,r,3,!0)])}if(i.attributes.tangent!=null){const s=H(4*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.tangent;St(k,i.transform),re(s,n,k,4,m),st(k)&&ut(s,s,4),a.push([T.TANGENT,new q(s,r,4,!0)])}if(i.attributes.texCoord0!=null){const s=H(2*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.texCoord0;oe(s,n,2,m),a.push([T.UV0,new q(s,r,2,!0)])}const c=i.attributes.color;if(c!=null){const s=new Uint8Array(4*e);c.elementCount===4?c instanceof Kt?ct(s,c,255):c instanceof bt?ne(s,c):c instanceof Zt&&ct(s,c,1/256):(s.fill(255),c instanceof yt?lt(s,c.typedBuffer,255,4,c.typedBufferStride):i.attributes.color instanceof Jt?ae(s,c.typedBuffer,4,i.attributes.color.typedBufferStride):i.attributes.color instanceof Yt&<(s,c.typedBuffer,1/256,4,c.typedBufferStride)),a.push([T.COLOR,new q(s,r,4,!0)])}return{geometry:new Q(t,a),vertexCount:e}}const k=gt();function Ge(i){switch(i){case"BLEND":return O.Blend;case"MASK":return O.Mask;case"OPAQUE":case null:case void 0:return O.Opaque}}function $e(i,t){for(let e=0;e1&&qt(n,n,c,I>-1?.2:Math.min(-4*I-3.8,1)),d[h]=n[0],d[h+1]=n[1],d[h+2]=n[2],h+=3,m[p]=255*A,m[p+1]=255*A,m[p+2]=255*A,m[p+3]=255,p+=4}l.attributes.normal=new yt(d),l.attributes.color=new bt(m)}}}export{Ur as fetch,Le as parseUrl}; diff --git a/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-WxPBOyFX.js b/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-WxPBOyFX.js new file mode 100644 index 00000000..680fea84 --- /dev/null +++ b/custom-toc-separator/assets/objectResourceUtils-CelAKRU2-WxPBOyFX.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loader-CkLCe-E_-CzV-xLxU.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-CGLbrkRD.js","./mat4-DX7gBViE-B27FdgMD.js","./common-CYWrYyJl-E8-sukrT.js","./quat-BODLR7mS-Cqne66qw.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BgEUcZRJ.js","./vec42-D8CJyqHG-DnfLTeQH.js","./BufferView-PQoE3GL7-Dv7NCnc6.js","./vec2-tHZ6OaOy-xCj1obDt.js","./resourceUtils-Ds65naCv-C_KiPREG.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js"])))=>i.map(i=>d[i]); +import{_ as Mt}from"./main-BTdHgocv.js";import{m as _t}from"./devEnvironmentUtils-CxrVv3RG-CX5aoxVE.js";import{is as dt,it as W,hf as st,k3 as Ot,b6 as ft,f as Rt,W as pt,o as Bt,il as it,dg as U,a1 as Pt,hB as Ct}from"./story-DT1Ep1ux.js";import{U as Et,P as St,E as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as gt,o as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{z as Lt}from"./mat4-DX7gBViE-B27FdgMD.js";import{t as Nt,u as nt,o as Ft}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{l as Ut}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{Y as tt,r as Gt,x as at,b as $t,l as kt,X as qt,_ as L,j as C,L as N,B as jt}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{ab as Dt,ac as Ht,g as X,ad as Vt,a3 as zt,aa as H,s as Wt,ae as V,a9 as Xt,a4 as Qt,p as xt}from"./AttributeArray-BWXEft_i-CbK4QVOn.js";import{X as Kt,L as bt,C as Zt,l as yt,g as Jt,M as Yt}from"./BufferView-PQoE3GL7-Dv7NCnc6.js";import{b as te,z as ee,O as ut,j as lt}from"./vec3-BazNroeq-xVxXS26y.js";import{L as re,P as ct}from"./vec4-DWDdg1fj-CEZkOwEl.js";import{U as se,k as $,E as ie,c as oe,y as ne,d as ae}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-nxYNdxWd.js";import{f as Y}from"./resourceUtils-Ds65naCv-C_KiPREG.js";import{f as ue,l as le}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{s as ce}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{m as wt}from"./Version-CoKzbupV-CGLbrkRD.js";import{w as me,A as vt}from"./Indices-DEr2HrWx-BChBDP40.js";import{r as he}from"./requestImageUtils-Ut4YcoNU-CZrsQx74.js";import{M as q}from"./orientedBoundingBox-oHezdpWm-DTZDb9tw.js";import{N as O,s as de,e as et,u as fe}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{_ as pe}from"./triangle-hqU-Tc1X-XgXaXzy3.js";import{h as ge}from"./Util-BjGjeg6f-08Szkf4F.js";import{T}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{G as mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as ht}from"./NormalAttribute.glsl-axtNsUxo-BZHIleWw.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Texture-BCt2hphT-B6HwLstV.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./InterleavedLayout-DXzw3B2n-Bgcehm8b.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./compilerUtils-CV1QYWI8-BsFCPQiC.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-D5uXMAZI.js";import"./sphere-BenPORjV-B4r28WKg.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./plane-Dt8R0KeE-CP4TXD5k.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CJhaINhC.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./lengthUtils-DKpMe5qR-C4JQidi_.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./quat-BODLR7mS-Cqne66qw.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-DGSQpeMj.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CGkubPrT.js";function xe(i,t){if(!i)return!1;const{size:e,data:r,indices:l}=i;L(t,0,0,0),L(v,0,0,0);let u=0,o=0;for(let a=0;a1&&N(t,t,1/o),o>0}function ye(i,t,e){if(!i)return!1;L(e,0,0,0),L(v,0,0,0);let r=0,l=0;const{size:u,data:o,indices:a}=i,c=a.length-1,s=c+(t?2:0);for(let n=0;n0?(C(e,e,N(g,g,h)),r+=h):r===0&&(C(v,v,g),l++)}return r!==0?(N(e,e,1/r),!0):l!==0&&(N(e,v,1/l),!0)}const g=U(),E=U(),z=U(),v=U();class we{constructor(){this.uid=Ct()}}class ve extends we{constructor(t){super(),this.highlightGroupName=t,this.channel=fe.Highlight}}class Q extends Wt{constructor(t,e,r=null,l=V.Mesh,u=null,o=-1){super(),this.material=t,this.mapPositions=r,this.type=l,this.objectAndLayerIdColor=u,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightGroupCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,c]of e)this._attributes.set(a,{...c,indices:me(c.indices)}),a===T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(t={}){const e=new Q(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,l)=>{r.exclusive=!1,e._attributes.set(l,r)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}get attributes(){return this._attributes}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:Xt(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const r=this._attributes.get(t);r&&this._attributes.set(t,{...r,exclusive:!0,data:e})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===V.Mesh?this._computeAttachmentOriginTriangles(t):this.type===V.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(this._transformation!=null&&tt(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const e=this.attributes.get(T.POSITION);return xe(e,t)}_computeAttachmentOriginLines(t){const e=this.attributes.get(T.POSITION);return ye(e,Te(this.material.parameters,e),t)}_computeAttachmentOriginPoints(t){const e=this.attributes.get(T.POSITION);return be(e,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(T.POSITION);if(!t||t.indices.length===0)return null;const e=this.type===V.Mesh?3:1;ge(t.indices.length%e==0,"Indexing error: "+t.indices.length+" not divisible by "+e);const r=vt(t.indices.length/e);return new Qt(r,e,t)}get transformation(){return this._transformation??nt}set transformation(t){this._transformation=t&&t!==nt?Ft(t):null}get highlightGroups(){return this._highlightGroupCounts}get hasHighlights(){return this._highlightGroupCounts.size>0}foreachHighlightGroup(t){this._highlightGroupCounts.forEach((e,r)=>t(r))}allocateIdAndHighlight(t){const e=new ve(t);return this.addHighlight(e)}addHighlight(t){this.highlights.add(t);const{highlightGroupName:e}=t,r=(this._highlightGroupCounts.get(e)??0)+1;return this._highlightGroupCounts.set(e,r),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightGroupName:e}=t,r=this._highlightGroupCounts.get(e)??0;r<=1?this._highlightGroupCounts.delete(e):this._highlightGroupCounts.set(e,r-1)}}}function Te(i,t){return!(!("isClosed"in i)||!i.isClosed)&&t.indices.length>2}function j(i){if(i==null)return null;const t=i.offset!=null?i.offset:ue,e=i.rotation!=null?i.rotation:0,r=i.scale!=null?i.scale:le,l=J(1,0,0,0,1,0,t[0],t[1],1),u=J(Math.cos(e),-Math.sin(e),0,Math.sin(e),Math.cos(e),0,0,0,1),o=J(r[0],0,0,0,r[1],0,0,0,1),a=gt();return ot(a,u,o),ot(a,l,a),a}class Ie{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class Ae{constructor(t,e,r){this.name=t,this.lodThreshold=e,this.pivotOffset=r,this.stageResources=new Ie,this.numberOfVertices=0}}const P=()=>Pt.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");async function Me(i,t){const e=await _e(i,t),r=await Ce(e.textureDefinitions??{},t);let l=0;for(const u in r)if(r.hasOwnProperty(u)){const o=r[u];l+=o?.image?o.image.width*o.image.height*4:0}return{resource:e,textures:r,size:l+Ot(e)}}async function _e(i,t){const e=t?.streamDataRequester;if(e)return Oe(i,e,t);const r=await ft(Rt(i,t));if(r.ok===!0)return r.value.data;pt(r.error),Tt(r.error)}async function Oe(i,t,e){const r=await ft(t.request(i,"json",e));if(r.ok===!0)return r.value;pt(r.error),Tt(r.error.details.url)}function Tt(i){throw new Bt("",`Request for object resource failed: ${i}`)}function Re(i){const t=i.params,e=t.topology;let r=!0;switch(t.vertexAttributes||(P().warn("Geometry must specify vertex attributes"),r=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const u=t.faces;if(u){if(t.vertexAttributes)for(const o in t.vertexAttributes){const a=u[o];a?.values?(a.valueType!=null&&a.valueType!=="UInt32"&&(P().warn(`Unsupported indexed geometry indices type '${a.valueType}', only UInt32 is currently supported`),r=!1),a.valuesPerElement!=null&&a.valuesPerElement!==1&&(P().warn(`Unsupported indexed geometry values per element '${a.valuesPerElement}', only 1 is currently supported`),r=!1)):(P().warn(`Indexed geometry does not specify face indices for '${o}' attribute`),r=!1)}}else P().warn("Indexed geometries must specify faces"),r=!1;break}default:P().warn(`Unsupported topology '${e}'`),r=!1}i.params.material||(P().warn("Geometry requires material"),r=!1);const l=i.params.vertexAttributes;for(const u in l)l[u].values||(P().warn("Geometries with externally defined attributes are not yet supported"),r=!1);return r}function Be(i,t){const e=new Array,r=new Array,l=new Array,u=new ce,o=i.resource,a=wt.parse(o.version||"1.0","wosr");Se.validate(a);const c=o.model.name,s=o.model.geometries,n=o.materialDefinitions??{},m=i.textures;let d=0;const f=new Map;for(let h=0;h{if(p.params.topology==="PerAttributeArray")return null;const _=p.params.faces;for(const B in _)if(B===x)return _[B].values;return null},G=I[T.POSITION],D=G.values.length/G.valuesPerElement;for(const x in I){const _=I[x],B=_.values,Z=A(x)??vt(D);M.push([x,new q(B,Z,_.valuesPerElement,!0)])}const R=b.texture,y=m&&m[R];if(y&&!f.has(R)){const{image:x,parameters:_}=y,B=new xt(x,_);r.push(B),f.set(R,B)}const F=f.get(R),K=F?F.id:void 0,S=b.material;let w=u.get(S,R);if(w==null){const x=n[S.slice(S.lastIndexOf("/")+1)].params;x.transparency===1&&(x.transparency=0);const _=y&&y.alphaChannelUsage,B=x.transparency>0||_==="transparency"||_==="maskAndTransparency",Z=y?It(y.alphaChannelUsage):void 0,rt={ambient:it(x.diffuse),diffuse:it(x.diffuse),opacity:1-(x.transparency||0),transparent:B,textureAlphaMode:Z,textureAlphaCutoff:.33,textureId:K,initTextureTransparent:!0,doubleSided:!0,cullFace:et.None,colorMixMode:x.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(rt,t.materialParameters),w=new X(rt,t),u.set(S,R,w)}l.push(w);const At=new Q(w,M);d+=M.find(x=>x[0]===T.POSITION)?.[1]?.indices.length??0,e.push(At)}return{engineResources:[{name:c,stageResources:{textures:r,materials:l,geometries:e},pivotOffset:o.model.pivotOffset,numberOfVertices:d,lodThreshold:null}],referenceBoundingBox:Pe(e)}}function Pe(i){const t=dt();return i.forEach(e=>{const r=e.boundingInfo;r!=null&&(W(t,r.bbMin),W(t,r.bbMax))}),t}async function Ce(i,t){const e=new Array;for(const u in i){const o=i[u],a=o.images[0].data;if(!a){P().warn("Externally referenced texture data is not yet supported");continue}const c=o.encoding+";base64,"+a,s="/textureDefinitions/"+u,n=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:mt.REPEAT,t:mt.REPEAT},preMultiplyAlpha:It(n)!==O.Opaque},d=t?.disableTextures?Promise.resolve(null):he(c,t);e.push(d.then(f=>({refId:s,image:f,parameters:m,alphaChannelUsage:n})))}const r=await Promise.all(e),l={};for(const u of r)l[u.refId]=u;return l}function It(i){switch(i){case"mask":return O.Mask;case"maskAndTransparency":return O.MaskBlend;case"none":return O.Opaque;default:return O.Blend}}function Ee(i){const t=i.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Se=new wt(1,2,"wosr");async function Ur(i,t){const e=Le(_t(i));if(e.fileType==="wosr"){const m=await(t.cache?t.cache.loadWOSR(e.url,t):Me(e.url,t)),{engineResources:d,referenceBoundingBox:f}=Be(m,t);return{lods:d,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}let r;if(t.cache)r=await t.cache.loadGLTF(e.url,t,!!t.usePBR);else{const{loadGLTF:m}=await Mt(()=>import("./loader-CkLCe-E_-CzV-xLxU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);r=await m(new se(t.streamDataRequester),e.url,t,t.usePBR)}const l=r.model.meta?.ESRI_proxyEllipsoid,u=r.meta.isEsriSymbolResource&&l!=null&&r.meta.ESRI_webstyle==="EsriRealisticTreesStyle";u&&!r.customMeta.esriTreeRendering&&(r.customMeta.esriTreeRendering=!0,$e(r,l));const o=!!t.usePBR,a=r.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:u,mrrFactors:Dt}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:Ht},c={...t.materialParameters,treeRendering:u},{engineResources:s,referenceBoundingBox:n}=Ne(r,a,c,t,e.specifiedLodIndex);return{lods:s,referenceBoundingBox:n,isEsriSymbolResource:r.meta.isEsriSymbolResource,isWosr:!1}}function Le(i){const t=i.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:t[4]!=null?Number(t[4]):null}:i.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:i,specifiedLodIndex:null}:{fileType:"unknown",url:i,specifiedLodIndex:null}}function Ne(i,t,e,r,l){const u=i.model,o=new Array,a=new Map,c=new Map,s=u.lods.length,n=dt();return u.lods.forEach((m,d)=>{const f=r.skipHighLods===!0&&(s>1&&d===0||s>3&&d===1)||r.skipHighLods===!1&&l!=null&&d!==l;if(f&&d!==0)return;const h=new Ae(m.name,m.lodThreshold,[0,0,0]);m.parts.forEach(p=>{const b=f?new X({},r):Fe(u,p,h,t,e,a,c,r),{geometry:I,vertexCount:M}=Ue(p,b??new X({},r)),A=I.boundingInfo;A!=null&&d===0&&(W(n,A.bbMin),W(n,A.bbMax)),b!=null&&(h.stageResources.geometries.push(I),h.numberOfVertices+=M)}),f||o.push(h)}),{engineResources:o,referenceBoundingBox:n}}function Fe(i,t,e,r,l,u,o,a){const c=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),s=i.materials.get(t.material),n=t.attributes.texCoord0!=null,m=t.attributes.normal!=null;if(s==null)return null;const d=Ge(s.alphaMode);if(!u.has(c)){if(n){const y=(F,K=!1)=>{if(F!=null&&!o.has(F)){const S=i.textures.get(F);if(S!=null){const w=S.data;o.set(F,new xt(Y(w)?w.data:w,{...S.parameters,preMultiplyAlpha:!Y(w)&&K,encoding:Y(w)&&w.encoding!=null?w.encoding:void 0}))}}};y(s.textureColor,d!==O.Opaque),y(s.textureNormal),y(s.textureOcclusion),y(s.textureEmissive),y(s.textureMetallicRoughness)}const h=s.color[0]**(1/$),p=s.color[1]**(1/$),b=s.color[2]**(1/$),I=s.emissiveFactor[0]**(1/$),M=s.emissiveFactor[1]**(1/$),A=s.emissiveFactor[2]**(1/$),G=s.textureColor!=null&&n?o.get(s.textureColor):null,D=Vt({normalTexture:s.textureNormal,metallicRoughnessTexture:s.textureMetallicRoughness,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,emissiveTexture:s.textureEmissive,emissiveFactor:s.emissiveFactor,occlusionTexture:s.textureOcclusion}),R=s.normalTextureTransform?.scale!=null?s.normalTextureTransform?.scale:Ut;u.set(c,new X({...r,transparent:d===O.Blend,customDepthTest:de.Lequal,textureAlphaMode:d,textureAlphaCutoff:s.alphaCutoff,diffuse:[h,p,b],ambient:[h,p,b],opacity:s.opacity,doubleSided:s.doubleSided,doubleSidedType:"winding-order",cullFace:s.doubleSided?et.None:et.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?ht.Attribute:ht.ScreenDerivative,castShadows:!0,receiveShadows:s.receiveShadows,receiveAmbientOcclusion:s.receiveAmbientOcclustion,textureId:G?.id,colorMixMode:s.colorMixMode,normalTextureId:s.textureNormal!=null&&n?o.get(s.textureNormal).id:void 0,textureAlphaPremultiplied:G!=null&&!!G.parameters.preMultiplyAlpha,occlusionTextureId:s.textureOcclusion!=null&&n?o.get(s.textureOcclusion).id:void 0,emissiveTextureId:s.textureEmissive!=null&&n?o.get(s.textureEmissive).id:void 0,metallicRoughnessTextureId:s.textureMetallicRoughness!=null&&n?o.get(s.textureMetallicRoughness).id:void 0,emissiveFactor:[I,M,A],mrrFactors:D?zt:[s.metallicFactor,s.roughnessFactor,r.mrrFactors[2]],isSchematic:D,colorTextureTransformMatrix:j(s.colorTextureTransform),normalTextureTransformMatrix:j(s.normalTextureTransform),scale:[R[0],R[1]],occlusionTextureTransformMatrix:j(s.occlusionTextureTransform),emissiveTextureTransformMatrix:j(s.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:j(s.metallicRoughnessTextureTransform),...l},a))}const f=u.get(c);if(e.stageResources.materials.push(f),n){const h=p=>{p!=null&&e.stageResources.textures.push(o.get(p))};h(s.textureColor),h(s.textureNormal),h(s.textureOcclusion),h(s.textureEmissive),h(s.textureMetallicRoughness)}return f}function Ue(i,t){const e=i.attributes.position.count,r=ie(i.indices||e,i.primitiveType),l=H(3*e),{typedBuffer:u,typedBufferStride:o}=i.attributes.position;te(l,u,i.transform,3,o);const a=[[T.POSITION,new q(l,r,3,!0)]];if(i.attributes.normal!=null){const s=H(3*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.normal;Et(k,i.transform),ee(s,n,k,3,m),st(k)&&ut(s,s),a.push([T.NORMAL,new q(s,r,3,!0)])}if(i.attributes.tangent!=null){const s=H(4*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.tangent;St(k,i.transform),re(s,n,k,4,m),st(k)&&ut(s,s,4),a.push([T.TANGENT,new q(s,r,4,!0)])}if(i.attributes.texCoord0!=null){const s=H(2*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.texCoord0;oe(s,n,2,m),a.push([T.UV0,new q(s,r,2,!0)])}const c=i.attributes.color;if(c!=null){const s=new Uint8Array(4*e);c.elementCount===4?c instanceof Kt?ct(s,c,255):c instanceof bt?ne(s,c):c instanceof Zt&&ct(s,c,1/256):(s.fill(255),c instanceof yt?lt(s,c.typedBuffer,255,4,c.typedBufferStride):i.attributes.color instanceof Jt?ae(s,c.typedBuffer,4,i.attributes.color.typedBufferStride):i.attributes.color instanceof Yt&<(s,c.typedBuffer,1/256,4,c.typedBufferStride)),a.push([T.COLOR,new q(s,r,4,!0)])}return{geometry:new Q(t,a),vertexCount:e}}const k=gt();function Ge(i){switch(i){case"BLEND":return O.Blend;case"MASK":return O.Mask;case"OPAQUE":case null:case void 0:return O.Opaque}}function $e(i,t){for(let e=0;e1&&qt(n,n,c,I>-1?.2:Math.min(-4*I-3.8,1)),d[h]=n[0],d[h+1]=n[1],d[h+2]=n[2],h+=3,m[p]=255*A,m[p+1]=255*A,m[p+2]=255*A,m[p+3]=255,p+=4}l.attributes.normal=new yt(d),l.attributes.color=new bt(m)}}}export{Ur as fetch,Le as parseUrl}; diff --git a/custom-toc-separator/assets/observers-BigwqTsw-BCNzxmob.js b/custom-toc-separator/assets/observers-BigwqTsw-BCNzxmob.js deleted file mode 100644 index 79315bf3..00000000 --- a/custom-toc-separator/assets/observers-BigwqTsw-BCNzxmob.js +++ /dev/null @@ -1 +0,0 @@ -import{c as i}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";function a(t,n,o){if(!i())return;const e=c(t);return new e(n,o)}function c(t){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,r){return this.observedEntry.push({target:e,options:r}),super.observe(e,r)}unobserve(e){const r=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),r.forEach(s=>this.observe(s.target,s.options))}}return function(){return t==="intersection"?window.IntersectionObserver:t==="mutation"?n:window.ResizeObserver}()}export{a as c}; diff --git a/custom-toc-separator/assets/observers-BigwqTsw-C0_AGNdr.js b/custom-toc-separator/assets/observers-BigwqTsw-C0_AGNdr.js new file mode 100644 index 00000000..d4034aa9 --- /dev/null +++ b/custom-toc-separator/assets/observers-BigwqTsw-C0_AGNdr.js @@ -0,0 +1 @@ +import{c as i}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";function a(t,n,o){if(!i())return;const e=c(t);return new e(n,o)}function c(t){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,r){return this.observedEntry.push({target:e,options:r}),super.observe(e,r)}unobserve(e){const r=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),r.forEach(s=>this.observe(s.target,s.options))}}return function(){return t==="intersection"?window.IntersectionObserver:t==="mutation"?n:window.ResizeObserver}()}export{a as c}; diff --git a/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js b/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js deleted file mode 100644 index bc5b5d57..00000000 --- a/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-C-BU5Oo5.js +++ /dev/null @@ -1 +0,0 @@ -import{o as j,Y as q,y as ee,f as x,cl as ne,J as k,b8 as J,eS as te,a as A,a1 as ie}from"./story-OUarUCIt.js";import{U as ae,n as se,z as re}from"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import{t as oe}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import{X as le,Y as ce,_ as ue}from"./geojson-CNt_qtQf-DAI1_86C.js";import{d as de}from"./clientSideDefaults-BqqayPct-BCK_HM0i.js";import{F as fe}from"./sourceUtils-BMeqkJ5g-DGf5w49d.js";import{o as z}from"./FieldsIndex-HmzMbJQG-Bc4ZGZOb.js";import{i as me}from"./fieldType-CD2CL2hr-D-1zqE7t.js";const G=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),U="startindex",ge=new Set([U,"offset"]),Y="http://www.opengis.net/def/crs/",Oe=`${Y}OGC/1.3/CRS84`;var l;async function $e(e,t,n={},i=5){const{links:a}=e,o=g(a,"items",l.geojson)||g(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:m}=n,p=q(o.href,e.landingPage.url),T={limit:i,...d,token:u},S=ee(p,T),W={accept:l.geojson},{data:v}=await x(S,{signal:m,headers:W}),N=Ie(S,i,v.links)??U;le(v);const f=ce(v,{geometryType:t.geometryType}),h=t.fields||f.fields||[],R=t.hasZ!=null?t.hasZ:f.hasZ,y=f.geometryType,w=t.objectIdField||f.objectIdFieldName||"OBJECTID";let r=t.timeInfo;const P=h.find(({name:s})=>s===w);if(P)P.editable=!1,P.nullable=!1;else{if(!f.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");h.unshift({name:w,alias:w,type:f.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(w!==f.objectIdFieldName){const s=h.find(({name:c})=>c===f.objectIdFieldName);s&&(s.type="esriFieldTypeInteger")}h===f.fields&&f.unknownFields.length>0&&G().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:f.unknownFields}});for(const s of h){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"&&(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable),!s.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:s});if(!me.jsonValues.includes(s.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}if(r){const s=new z(h);if(r.startTimeField){const c=s.get(r.startTimeField);c?(r.startTimeField=c.name,c.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const c=s.get(r.endTimeField);c?(r.endTimeField=c.name,c.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const c=s.get(r.trackIdField);c?r.trackIdField=c.name:(r.trackIdField=null,G().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.timeReference||={timeZoneIANA:ne},r.startTimeField||r.endTimeField||(G().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=void 0)}return{drawingInfo:y?de(y):null,extent:Fe(e),geometryType:y,fields:h,hasZ:!!R,objectIdField:w,paginationParameter:N,timeInfo:r}}async function qe(e,t={}){const{links:n,url:i}=e,a=g(n,"data",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});for(const T of p.collections)T.landingPage=e;return p}async function Ce(e,t={}){const{links:n,url:i}=e,a=g(n,"conformance",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});return p}async function Ge(e,t={}){const{apiKey:n,customParameters:i,signal:a}=t,{data:o}=await x(e,{signal:a,headers:{accept:l.json},query:{...i,token:n}});return o.url=e,o}async function We(e,t={}){const{links:n,url:i}=e,a=g(n,"service-desc",l.openapi);if(a==null)return G().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.openapi},query:{...u,token:o}});return p}function Re(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:a}=n;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return k.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return k.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function De(e,t,n){const i=await pe(e,t,n);return ae(i)}async function pe(e,t,n){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:u,queryParameters:{apiKey:d,customParameters:m},spatialReference:p,supportedCrs:T}=e,S=g(i,"items",l.geojson)||g(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(S==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:W,num:v,start:N,timeExtent:f,where:h}=t;if(t.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const R=k.fromJSON(p),y=t.outSpatialReference??R,w=y.isWGS84?null:E(y,T),r=he(W,T),P=we(f),s=be(h),c=v??(N==null?u:10),Q=N===0?void 0:N,{fields:K,geometryType:C,hasZ:D,objectIdField:O,paginationParameter:V}=o,X=q(S.href,a),{data:L}=await x(X,{...n,query:{...m,...r,crs:w,datetime:P,query:s,limit:c,[V]:Q,token:d},headers:{accept:l.geojson}}),$=ue(L,{geometryType:C,hasZ:D,objectIdField:O}),B=$.length===c&&!!g(L.links??[],"next",l.geojson),_=new z(K);for(const b of $){const I={};fe(_,I,b.attributes,!0);for(const M of _.fields)M.nullable&&!(M.name in I)&&(I[M.name]=null);I[O]=b.attributes[O],b.attributes=I}if(!w&&y.isWebMercator){for(const b of $)if(b.geometry!=null&&C!=null){const I=se(b.geometry,C,D,!1);I.spatialReference=k.WGS84,b.geometry=re(J(I,y))}}for(const b of $)b.objectId=b.attributes[O];const H=w||!w&&y.isWebMercator?y.toJSON():te,F=new oe;return F.exceededTransferLimit=B,F.features=$,F.fields=K,F.geometryType=C,F.hasZ=D,F.objectIdFieldName=O,F.spatialReference=H,F}function ye(e){return e!=null&&e.type==="extent"}function E(e,t){const{isWebMercator:n,wkid:i}=e;if(!i)return null;const a=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return a?`${Y}${a}`:null}function Z(e){if(e==null)return"";const{xmin:t,ymin:n,xmax:i,ymax:a}=e;return`${t},${n},${i},${a}`}function we(e){if(e==null)return null;const{start:t,end:n}=e;return`${t!=null?t.toISOString():".."}/${n!=null?n.toISOString():".."}`}function be(e){return e!=null&&e&&e!=="1=1"?e:null}function he(e,t){if(!ye(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:Z(e)};const i=E(n,t);return i!=null?{bbox:Z(e),"bbox-crs":i}:n.isWebMercator?{bbox:Z(J(e,k.WGS84))}:null}function Fe(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=n.length===4,[a,o]=n,u=i?void 0:n[2];return{xmin:a,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:u,zmax:i?void 0:n[5],spatialReference:k.WGS84.toJSON()}}function g(e,t,n){return e.find(({rel:i,type:a})=>i===t&&a===n)??e.find(({rel:i,type:a})=>i===t&&!a)}function Ie(e,t,n){if(!n)return;const i=g(n,"next",l.geojson),a=A(i?.href)?.query;if(!a)return;const o=A(e).query,u=Object.keys(o??{});return Object.entries(a).filter(([d])=>!u.includes(d)).find(([d,m])=>ge.has(d.toLowerCase())&&Number.parseInt(m,10)===t)?.[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{We as F,Ge as I,Y as M,De as T,pe as _,qe as b,Ce as h,Re as j,$e as w,Oe as y}; diff --git a/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js b/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js new file mode 100644 index 00000000..d5f6f1fa --- /dev/null +++ b/custom-toc-separator/assets/ogcFeatureUtils-Bs12bZY3-DfqKA9YB.js @@ -0,0 +1 @@ +import{o as j,Y as q,y as ee,f as x,cl as ne,J as k,b8 as J,eS as te,a as A,a1 as ie}from"./story-DT1Ep1ux.js";import{U as ae,n as se,z as re}from"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import{t as oe}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import{X as le,Y as ce,_ as ue}from"./geojson-CNt_qtQf-DS1EMYq7.js";import{d as de}from"./clientSideDefaults-BqqayPct-B1aankCm.js";import{F as fe}from"./sourceUtils-BMeqkJ5g-BF0o3_jy.js";import{o as z}from"./FieldsIndex-HmzMbJQG-C6g_2n4m.js";import{i as me}from"./fieldType-CD2CL2hr-B2sVi9me.js";const G=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),U="startindex",ge=new Set([U,"offset"]),Y="http://www.opengis.net/def/crs/",Oe=`${Y}OGC/1.3/CRS84`;var l;async function $e(e,t,n={},i=5){const{links:a}=e,o=g(a,"items",l.geojson)||g(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:m}=n,p=q(o.href,e.landingPage.url),T={limit:i,...d,token:u},S=ee(p,T),W={accept:l.geojson},{data:v}=await x(S,{signal:m,headers:W}),N=Ie(S,i,v.links)??U;le(v);const f=ce(v,{geometryType:t.geometryType}),h=t.fields||f.fields||[],R=t.hasZ!=null?t.hasZ:f.hasZ,y=f.geometryType,w=t.objectIdField||f.objectIdFieldName||"OBJECTID";let r=t.timeInfo;const P=h.find(({name:s})=>s===w);if(P)P.editable=!1,P.nullable=!1;else{if(!f.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");h.unshift({name:w,alias:w,type:f.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(w!==f.objectIdFieldName){const s=h.find(({name:c})=>c===f.objectIdFieldName);s&&(s.type="esriFieldTypeInteger")}h===f.fields&&f.unknownFields.length>0&&G().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:f.unknownFields}});for(const s of h){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"&&(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable),!s.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:s});if(!me.jsonValues.includes(s.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}if(r){const s=new z(h);if(r.startTimeField){const c=s.get(r.startTimeField);c?(r.startTimeField=c.name,c.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const c=s.get(r.endTimeField);c?(r.endTimeField=c.name,c.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const c=s.get(r.trackIdField);c?r.trackIdField=c.name:(r.trackIdField=null,G().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.timeReference||={timeZoneIANA:ne},r.startTimeField||r.endTimeField||(G().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=void 0)}return{drawingInfo:y?de(y):null,extent:Fe(e),geometryType:y,fields:h,hasZ:!!R,objectIdField:w,paginationParameter:N,timeInfo:r}}async function qe(e,t={}){const{links:n,url:i}=e,a=g(n,"data",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});for(const T of p.collections)T.landingPage=e;return p}async function Ce(e,t={}){const{links:n,url:i}=e,a=g(n,"conformance",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});return p}async function Ge(e,t={}){const{apiKey:n,customParameters:i,signal:a}=t,{data:o}=await x(e,{signal:a,headers:{accept:l.json},query:{...i,token:n}});return o.url=e,o}async function We(e,t={}){const{links:n,url:i}=e,a=g(n,"service-desc",l.openapi);if(a==null)return G().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.openapi},query:{...u,token:o}});return p}function Re(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:a}=n;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return k.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return k.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function De(e,t,n){const i=await pe(e,t,n);return ae(i)}async function pe(e,t,n){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:u,queryParameters:{apiKey:d,customParameters:m},spatialReference:p,supportedCrs:T}=e,S=g(i,"items",l.geojson)||g(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(S==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:W,num:v,start:N,timeExtent:f,where:h}=t;if(t.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const R=k.fromJSON(p),y=t.outSpatialReference??R,w=y.isWGS84?null:E(y,T),r=he(W,T),P=we(f),s=be(h),c=v??(N==null?u:10),Q=N===0?void 0:N,{fields:K,geometryType:C,hasZ:D,objectIdField:O,paginationParameter:V}=o,X=q(S.href,a),{data:L}=await x(X,{...n,query:{...m,...r,crs:w,datetime:P,query:s,limit:c,[V]:Q,token:d},headers:{accept:l.geojson}}),$=ue(L,{geometryType:C,hasZ:D,objectIdField:O}),B=$.length===c&&!!g(L.links??[],"next",l.geojson),_=new z(K);for(const b of $){const I={};fe(_,I,b.attributes,!0);for(const M of _.fields)M.nullable&&!(M.name in I)&&(I[M.name]=null);I[O]=b.attributes[O],b.attributes=I}if(!w&&y.isWebMercator){for(const b of $)if(b.geometry!=null&&C!=null){const I=se(b.geometry,C,D,!1);I.spatialReference=k.WGS84,b.geometry=re(J(I,y))}}for(const b of $)b.objectId=b.attributes[O];const H=w||!w&&y.isWebMercator?y.toJSON():te,F=new oe;return F.exceededTransferLimit=B,F.features=$,F.fields=K,F.geometryType=C,F.hasZ=D,F.objectIdFieldName=O,F.spatialReference=H,F}function ye(e){return e!=null&&e.type==="extent"}function E(e,t){const{isWebMercator:n,wkid:i}=e;if(!i)return null;const a=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return a?`${Y}${a}`:null}function Z(e){if(e==null)return"";const{xmin:t,ymin:n,xmax:i,ymax:a}=e;return`${t},${n},${i},${a}`}function we(e){if(e==null)return null;const{start:t,end:n}=e;return`${t!=null?t.toISOString():".."}/${n!=null?n.toISOString():".."}`}function be(e){return e!=null&&e&&e!=="1=1"?e:null}function he(e,t){if(!ye(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:Z(e)};const i=E(n,t);return i!=null?{bbox:Z(e),"bbox-crs":i}:n.isWebMercator?{bbox:Z(J(e,k.WGS84))}:null}function Fe(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=n.length===4,[a,o]=n,u=i?void 0:n[2];return{xmin:a,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:u,zmax:i?void 0:n[5],spatialReference:k.WGS84.toJSON()}}function g(e,t,n){return e.find(({rel:i,type:a})=>i===t&&a===n)??e.find(({rel:i,type:a})=>i===t&&!a)}function Ie(e,t,n){if(!n)return;const i=g(n,"next",l.geojson),a=A(i?.href)?.query;if(!a)return;const o=A(e).query,u=Object.keys(o??{});return Object.entries(a).filter(([d])=>!u.includes(d)).find(([d,m])=>ge.has(d.toLowerCase())&&Number.parseInt(m,10)===t)?.[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{We as F,Ge as I,Y as M,De as T,pe as _,qe as b,Ce as h,Re as j,$e as w,Oe as y}; diff --git a/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-CRyJWWhi.js b/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-CRyJWWhi.js deleted file mode 100644 index 4621fc19..00000000 --- a/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-CRyJWWhi.js +++ /dev/null @@ -1 +0,0 @@ -import{A as o}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{F as r}from"./dom-N58V0tYi-DBU3jlah.js";const t=o;function e(n){return"opened"in n?n.opened:n.open}function s(n){t(()=>{n.transitionEl&&r(n.transitionEl,n.openTransitionProp,()=>{e(n)?n.onBeforeOpen():n.onBeforeClose()},()=>{e(n)?n.onOpen():n.onClose()})})}export{s as p}; diff --git a/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-DBDPUlOe.js b/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-DBDPUlOe.js new file mode 100644 index 00000000..e2dc399a --- /dev/null +++ b/custom-toc-separator/assets/openCloseComponent-BGQ6h7vg-DBDPUlOe.js @@ -0,0 +1 @@ +import{A as o}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{F as r}from"./dom-N58V0tYi-DBU3jlah.js";const t=o;function e(n){return"opened"in n?n.opened:n.open}function s(n){t(()=>{n.transitionEl&&r(n.transitionEl,n.openTransitionProp,()=>{e(n)?n.onBeforeOpen():n.onBeforeClose()},()=>{e(n)?n.onOpen():n.onClose()})})}export{s as p}; diff --git a/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js b/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js new file mode 100644 index 00000000..bb9fa0b6 --- /dev/null +++ b/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-CRTnXePn.js @@ -0,0 +1 @@ +import{n as r}from"./timeSupport-jPViR5jn-CHDjIIE2.js";import{i as o,c as i}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const s={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=r(new i,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{s}; diff --git a/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js b/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js deleted file mode 100644 index e67b153b..00000000 --- a/custom-toc-separator/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-zh1QeHlw.js +++ /dev/null @@ -1 +0,0 @@ -import{n as r}from"./timeSupport-jPViR5jn-BLBOCVnL.js";import{i as o,c as i}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const s={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=r(new i,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{s}; diff --git a/custom-toc-separator/assets/orientedBoundingBox-oHezdpWm-BMbvjED3.js b/custom-toc-separator/assets/orientedBoundingBox-oHezdpWm-BMbvjED3.js deleted file mode 100644 index 576eb478..00000000 --- a/custom-toc-separator/assets/orientedBoundingBox-oHezdpWm-BMbvjED3.js +++ /dev/null @@ -1 +0,0 @@ -import{K as $t,G as Jt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as Kt,o as Ut}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as ta}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{T as aa,v as U,_ as sa}from"./quat-BODLR7mS-BrN0ZBC_.js";import{n as Zt,e as xt}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{_ as k,w,I as mt,C as At,G as ia,Z as na,j as lt,k as Rt,E as ra,L as nt,D as ea,b as Ct,N as gt,P as oa,q as ha}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import{h_ as ca,dp as vt,dg as u,h$ as ua,i0 as fa,hZ as zt,i1 as Gt}from"./story-OUarUCIt.js";import{D as da}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as ma}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{x as _t}from"./spatialReferenceEllipsoidUtils-DUrKTvup-DB3epUuZ.js";import{G as la}from"./computeTranslationToOriginAndRotation-wF0y9WQG-BsArr4n4.js";import{n as St,G as Bt}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import{f as Ft,i as _a,N as It}from"./plane-Dt8R0KeE-DlxNxa6f.js";import{l as ga}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as ba}from"./vec2f64-CeODonrJ-CkkJCdRC.js";class yt{constructor(t,a,s=a){this.data=t,this.size=a,this.stride=s}}class ss extends yt{constructor(t,a,s,r=!1,n=s){super(t,s,n),this.indices=a,this.exclusive=r}}const rt=1e-6,et=u(),bt=u();function Ma(i,t){const{data:a,size:s}=i,r=a.length/s;if(r<=0)return;const n=new qa(i);qt(et,n.minProj,n.maxProj),ft(et,et,.5),y(bt,n.maxProj,n.minProj);const h=Nt(bt),e=new wa;e.quality=h,r<14&&(i=new yt(new Float64Array(n.buffer,112,42),3));const o=u(),f=u(),b=u(),l=u(),z=u(),A=u(),M=u();switch(Pa(n,i,M,o,f,b,l,z,A,e)){case 1:return void Yt(et,bt,t);case 2:return void $a(i,l,t)}ja(i,M,o,f,b,l,z,A,e),Ot(i,e.b0,e.b1,e.b2,at,st);const E=u();y(E,st,at),e.quality=Nt(E),e.qualitys&&(s=h,r=n)}p(t,i.minVert[r]),p(a,i.maxVert[r])}const q=[0,0,0];function Sa(i,t,a,s){const{data:r,size:n}=i;let h=Number.NEGATIVE_INFINITY,e=0;for(let o=0;oh&&(h=l,e=o)}return p(s,r,e),h}const _=ba();function pa(i,t,a,s,r){Ia(i,t,_,r,s);const n=Lt(a,t);_[1]-rt<=n&&(s[0]=void 0),_[0]+rt>=n&&(r[0]=void 0)}const Tt=u(),Et=u(),Qt=u(),L=u(),X=u(),Mt=u();function W(i,t,a,s,r,n){if(kt(t)a[1]&&(a[1]=o,p(r,n,e))}}function Yt(i,t,a){a.center=i,a.halfSize=nt(t,t,.5),a.quaternion=Zt}const Q=u(),J=u(),ct=u(),at=u(),st=u(),Dt=u();function $a(i,t,a){p(Q,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?Q[0]=0:Math.abs(t[1])>Math.abs(t[2])?Q[1]=0:Q[2]=0,kt(Q)this.maxProj[0]&&(this.maxProj[0]=o,r[0]=e),o=n[e+1],othis.maxProj[1]&&(this.maxProj[1]=o,r[1]=e),o=n[e+2],othis.maxProj[2]&&(this.maxProj[2]=o,r[2]=e),o=n[e]+n[e+1]+n[e+2],othis.maxProj[3]&&(this.maxProj[3]=o,r[3]=e),o=n[e]+n[e+1]-n[e+2],othis.maxProj[4]&&(this.maxProj[4]=o,r[4]=e),o=n[e]-n[e+1]+n[e+2],othis.maxProj[5]&&(this.maxProj[5]=o,r[5]=e),o=n[e]-n[e+1]-n[e+2],othis.maxProj[6]&&(this.maxProj[6]=o,r[6]=e)}for(let e=0;e0){const s=1/Math.sqrt(a);i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s}}function kt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function wt(i,t){const a=t[0]-i[0],s=t[1]-i[1],r=t[2]-i[2];return a*a+s*s+r*r}function Lt(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function ya(i,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);i[3]=.5*s,s=.5/s,i[0]=(t[5]-t[7])*s,i[1]=(t[6]-t[2])*s,i[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const r=(s+1)%3,n=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*n+n]+1);i[s]=.5*h,h=.5/h,i[3]=(t[3*r+n]-t[3*n+r])*h,i[r]=(t[3*r+s]+t[3*s+r])*h,i[n]=(t[3*n+s]+t[3*s+n])*h}return i}class dt{constructor(t=ca,a=Ya,s=Zt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new dt;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new dt;return a._data=t.slice(),a}static fromJSON(t){return new dt(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return k(Ft.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return k(Ft.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return aa(_a.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=m,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let r=0;r<8;++r){const n=t[r];n[0]=(1&r?-1:1)*s[3],n[1]=(2&r?-1:1)*s[4],n[2]=(4&r?-1:1)*s[5],w(n,n,a),n[0]+=s[0],n[1]+=s[1],n[2]+=s[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){c[0]=this._data[0]-t[0],c[1]=this._data[1]-t[1],c[2]=this._data[2]-t[2];const a=this.getQuaternion(D);return U(m,a),w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],this._data[3]),Y[1]=Math.min(c[1],this._data[4]),Y[2]=Math.min(c[2],this._data[5]),At(Y,c)n*n)&&(m[0]=-s[6],m[1]=-s[7],m[2]=-s[8],m[3]=s[9],w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],s[3]),Y[1]=Math.min(c[1],s[4]),Y[2]=Math.min(c[2],s[5]),At(Y,c)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const r=this._data,n=m;n[0]=-r[6],n[1]=-r[7],n[2]=-r[8],n[3]=r[9],c[0]=t[0]-r[0],c[1]=t[1]-r[1],c[2]=t[2]-r[2];const h=w(c,c,m),e=w(Y,a,m);let o=-1/0,f=1/0;const b=this.getHalfSize(it);for(let l=0;l<3;l++){const z=h[l],A=e[l],M=b[l]+s;if(Math.abs(A)>1e-6){const E=(M-z)/A,P=(-M-z)/A;o=Math.max(o,Math.min(E,P)),f=Math.min(f,Math.max(E,P))}else if(z>M||z<-M)return!1}return o<=f}projectedArea(t,a,s,r){const n=this.getQuaternion(D);U(m,n),c[0]=t[0]-this._data[0],c[1]=t[1]-this._data[1],c[2]=t[2]-this._data[2],w(c,c,m);const h=this.getHalfSize(it),e=c[0]<-h[0]?-1:c[0]>h[0]?1:0,o=c[1]<-h[1]?-1:c[1]>h[1]?1:0,f=c[2]<-h[2]?-1:c[2]>h[2]?1:0,b=Math.abs(e)+Math.abs(o)+Math.abs(f);if(b===0)return 1/0;const l=b===1?4:6,z=6*(e+3*o+9*f+13);$t(K,n),Jt(K,K,h);const A=this.getCenter(G);for(let P=0;P>1)-1),na(c,c,K),lt(O,A,c),O[3]=1,da(O,O,a);const Vt=1/Math.max(1e-6,O[3]);C[2*P]=O[0]*Vt,C[2*P+1]=O[1]*Vt}const M=2*l-2;let E=C[0]*(C[3]-C[M+1])+C[M]*(C[1]-C[M-1]);for(let P=2;P{const i=new Int8Array(162);let t=0;const a=s=>{for(let r=0;r0?1+t/f:1,l=o>0?1+a/o:1,z=(l+b)/2,A=(l-b)/2;nt(S,v,A),r.halfSize=gt(S,S,e,z),nt(S,v,z),gt(S,S,e,A),oa(d,d),ha(d,S,d);const M=i.getQuaternion(Va);r.center=w(d,d,M)}}else{r.center=gt(d,h,Gt,(a+t)/2);const o=w(d,Gt,m);mt(o,o),r.halfSize=gt(v,e,o,(a-t)/2)}return r}function va(i,t,a,s,r){t.getCenter(G),G[2]+=r;const n=_t(a);St(G,i,0,G,n,0),Xt(n,t,G,a,s)}function Ga(i,t,a,s,r){t.getCenter(G),G[2]+=r,Xt(i,t,G,a,s)}function Xt(i,t,a,s,r){const n=t.getQuaternion(D),h=$t(K,n),e=t.getHalfSize(it);for(let o=0;o<8;++o){for(let f=0;f<3;++f)T[f]=e[f]*(o&1<s&&(s=h,r=n)}p(t,i.minVert[r]),p(a,i.maxVert[r])}const q=[0,0,0];function Sa(i,t,a,s){const{data:r,size:n}=i;let h=Number.NEGATIVE_INFINITY,e=0;for(let o=0;oh&&(h=l,e=o)}return p(s,r,e),h}const _=ba();function pa(i,t,a,s,r){Ia(i,t,_,r,s);const n=Lt(a,t);_[1]-rt<=n&&(s[0]=void 0),_[0]+rt>=n&&(r[0]=void 0)}const Tt=u(),Et=u(),Qt=u(),L=u(),X=u(),Mt=u();function W(i,t,a,s,r,n){if(kt(t)a[1]&&(a[1]=o,p(r,n,e))}}function Yt(i,t,a){a.center=i,a.halfSize=nt(t,t,.5),a.quaternion=Zt}const Q=u(),J=u(),ct=u(),at=u(),st=u(),Dt=u();function $a(i,t,a){p(Q,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?Q[0]=0:Math.abs(t[1])>Math.abs(t[2])?Q[1]=0:Q[2]=0,kt(Q)this.maxProj[0]&&(this.maxProj[0]=o,r[0]=e),o=n[e+1],othis.maxProj[1]&&(this.maxProj[1]=o,r[1]=e),o=n[e+2],othis.maxProj[2]&&(this.maxProj[2]=o,r[2]=e),o=n[e]+n[e+1]+n[e+2],othis.maxProj[3]&&(this.maxProj[3]=o,r[3]=e),o=n[e]+n[e+1]-n[e+2],othis.maxProj[4]&&(this.maxProj[4]=o,r[4]=e),o=n[e]-n[e+1]+n[e+2],othis.maxProj[5]&&(this.maxProj[5]=o,r[5]=e),o=n[e]-n[e+1]-n[e+2],othis.maxProj[6]&&(this.maxProj[6]=o,r[6]=e)}for(let e=0;e0){const s=1/Math.sqrt(a);i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s}}function kt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function wt(i,t){const a=t[0]-i[0],s=t[1]-i[1],r=t[2]-i[2];return a*a+s*s+r*r}function Lt(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function ya(i,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);i[3]=.5*s,s=.5/s,i[0]=(t[5]-t[7])*s,i[1]=(t[6]-t[2])*s,i[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const r=(s+1)%3,n=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*n+n]+1);i[s]=.5*h,h=.5/h,i[3]=(t[3*r+n]-t[3*n+r])*h,i[r]=(t[3*r+s]+t[3*s+r])*h,i[n]=(t[3*n+s]+t[3*s+n])*h}return i}class dt{constructor(t=ca,a=Ya,s=Zt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new dt;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new dt;return a._data=t.slice(),a}static fromJSON(t){return new dt(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return k(Ft.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return k(Ft.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return aa(_a.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=m,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let r=0;r<8;++r){const n=t[r];n[0]=(1&r?-1:1)*s[3],n[1]=(2&r?-1:1)*s[4],n[2]=(4&r?-1:1)*s[5],w(n,n,a),n[0]+=s[0],n[1]+=s[1],n[2]+=s[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){c[0]=this._data[0]-t[0],c[1]=this._data[1]-t[1],c[2]=this._data[2]-t[2];const a=this.getQuaternion(D);return U(m,a),w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],this._data[3]),Y[1]=Math.min(c[1],this._data[4]),Y[2]=Math.min(c[2],this._data[5]),At(Y,c)n*n)&&(m[0]=-s[6],m[1]=-s[7],m[2]=-s[8],m[3]=s[9],w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],s[3]),Y[1]=Math.min(c[1],s[4]),Y[2]=Math.min(c[2],s[5]),At(Y,c)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const r=this._data,n=m;n[0]=-r[6],n[1]=-r[7],n[2]=-r[8],n[3]=r[9],c[0]=t[0]-r[0],c[1]=t[1]-r[1],c[2]=t[2]-r[2];const h=w(c,c,m),e=w(Y,a,m);let o=-1/0,f=1/0;const b=this.getHalfSize(it);for(let l=0;l<3;l++){const z=h[l],A=e[l],M=b[l]+s;if(Math.abs(A)>1e-6){const E=(M-z)/A,P=(-M-z)/A;o=Math.max(o,Math.min(E,P)),f=Math.min(f,Math.max(E,P))}else if(z>M||z<-M)return!1}return o<=f}projectedArea(t,a,s,r){const n=this.getQuaternion(D);U(m,n),c[0]=t[0]-this._data[0],c[1]=t[1]-this._data[1],c[2]=t[2]-this._data[2],w(c,c,m);const h=this.getHalfSize(it),e=c[0]<-h[0]?-1:c[0]>h[0]?1:0,o=c[1]<-h[1]?-1:c[1]>h[1]?1:0,f=c[2]<-h[2]?-1:c[2]>h[2]?1:0,b=Math.abs(e)+Math.abs(o)+Math.abs(f);if(b===0)return 1/0;const l=b===1?4:6,z=6*(e+3*o+9*f+13);$t(K,n),Jt(K,K,h);const A=this.getCenter(G);for(let P=0;P>1)-1),na(c,c,K),lt(O,A,c),O[3]=1,da(O,O,a);const Vt=1/Math.max(1e-6,O[3]);C[2*P]=O[0]*Vt,C[2*P+1]=O[1]*Vt}const M=2*l-2;let E=C[0]*(C[3]-C[M+1])+C[M]*(C[1]-C[M-1]);for(let P=2;P{const i=new Int8Array(162);let t=0;const a=s=>{for(let r=0;r0?1+t/f:1,l=o>0?1+a/o:1,z=(l+b)/2,A=(l-b)/2;nt(S,v,A),r.halfSize=gt(S,S,e,z),nt(S,v,z),gt(S,S,e,A),oa(d,d),ha(d,S,d);const M=i.getQuaternion(Va);r.center=w(d,d,M)}}else{r.center=gt(d,h,Gt,(a+t)/2);const o=w(d,Gt,m);mt(o,o),r.halfSize=gt(v,e,o,(a-t)/2)}return r}function va(i,t,a,s,r){t.getCenter(G),G[2]+=r;const n=_t(a);St(G,i,0,G,n,0),Xt(n,t,G,a,s)}function Ga(i,t,a,s,r){t.getCenter(G),G[2]+=r,Xt(i,t,G,a,s)}function Xt(i,t,a,s,r){const n=t.getQuaternion(D),h=$t(K,n),e=t.getHalfSize(it);for(let o=0;o<8;++o){for(let f=0;f<3;++f)T[f]=e[f]*(o&1<{const a=b("panel-screen");return f(),i(a,{panel:t.panel},{header:s(()=>e[2]||(e[2]=[o(" Gazebo/Panel 2/Screen A ")])),content:s(()=>[o(r(u(p)("gz.hello"))+" ",1),n("div",m,[n("button",{type:"button",onClick:e[0]||(e[0]=l=>t.panel.show({screen:"p-2-screen-2",props:{greeting:"Howdy?"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16 m-2"}," Go back to B "),n("button",{type:"button",onClick:e[1]||(e[1]=l=>t.panel.show("p-2-screen-3")),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," Go to C ")]),n("p",h,r(t.greeting),1)]),_:1},8,["panel"])}}});export{w as default}; diff --git a/custom-toc-separator/assets/p2-screen-1-CQoqpp13-DNRRGiVg.js b/custom-toc-separator/assets/p2-screen-1-CQoqpp13-DNRRGiVg.js deleted file mode 100644 index 1238b1b3..00000000 --- a/custom-toc-separator/assets/p2-screen-1-CQoqpp13-DNRRGiVg.js +++ /dev/null @@ -1 +0,0 @@ -import{eT as c,eX as g,e_ as b,e$ as f,f0 as i,f1 as s,fG as o,fg as r,f4 as u,f2 as n}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";const m={class:"flex flex-row justify-center items-center mt-16"},h={class:"mt-16"},w=c({__name:"p2-screen-1",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(t){const{t:p}=g();return(x,e)=>{const a=b("panel-screen");return f(),i(a,{panel:t.panel},{header:s(()=>e[2]||(e[2]=[o(" Gazebo/Panel 2/Screen A ")])),content:s(()=>[o(r(u(p)("gz.hello"))+" ",1),n("div",m,[n("button",{type:"button",onClick:e[0]||(e[0]=l=>t.panel.show({screen:"p-2-screen-2",props:{greeting:"Howdy?"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16 m-2"}," Go back to B "),n("button",{type:"button",onClick:e[1]||(e[1]=l=>t.panel.show("p-2-screen-3")),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," Go to C ")]),n("p",h,r(t.greeting),1)]),_:1},8,["panel"])}}});export{w as default}; diff --git a/custom-toc-separator/assets/panel-BK8-jMI_.js b/custom-toc-separator/assets/panel-BK8-jMI_.js deleted file mode 100644 index 62e51781..00000000 --- a/custom-toc-separator/assets/panel-BK8-jMI_.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";export{m as default}; diff --git a/custom-toc-separator/assets/panel-DRUEhsxp-DE_ZqRVb.js b/custom-toc-separator/assets/panel-DRUEhsxp-DE_ZqRVb.js deleted file mode 100644 index 663252dd..00000000 --- a/custom-toc-separator/assets/panel-DRUEhsxp-DE_ZqRVb.js +++ /dev/null @@ -1,11 +0,0 @@ -import{p as k,b as E,W as b,a as t,D as w}from"./themeUtils-YjM7iIiX-CpWzbU7H.js";import{G as r,V as C,g as z,A as x}from"./dom-N58V0tYi-DBU3jlah.js";import{l as H,p as F}from"./interactive-DqhNilgd-Bw4n2n3w.js";import{o as B,r as P,f as T}from"./loadable-DbNDKH4r-DyDwqoXd.js";import{c as M}from"./observers-BigwqTsw-BCNzxmob.js";import{_ as L,K as D,O,w as I}from"./action-menu-DTIJuZNc-CadEd7O7.js";import{K as j,q as K}from"./locale-Cn_GDVD_-CnEFMUdd.js";import{d as $,h as N,M as R,l as W}from"./t9n-C_hcZMZJ-DI6xkvhp.js";import{$ as _}from"./floating-ui-DKFFlLv3-elIRTcW0.js";import{m as U}from"./action-GCQoufcz-Db81jJpr.js";import{m as q}from"./icon-BXFbBbop-BKvGneFm.js";import{v as G}from"./loader-Ch7Jr16w-B4sW6aLS.js";import{c as V}from"./scrim-BscQh4v9-DzezRv_f.js";const n={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",contentBottom:"content-bottom",contentTop:"content-top",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer",footerContent:"footer-content",footerActions:"footer-actions",footerStart:"footer-start",footerEnd:"footer-end"},S={close:"close",collapse:"collapse"},g={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right",expand:"chevron-down",collapse:"chevron-up"},s={actionBar:"action-bar",alerts:"alerts",contentBottom:"content-bottom",contentTop:"content-top",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerEnd:"footer-end",footerStart:"footer-start",footerActions:"footer-actions"},X=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}:host([scale=s]){--calcite-internal-panel-default-padding:var(--calcite-spacing-sm);--calcite-internal-panel-header-vertical-padding:10px}:host([scale=s]) .header-content .heading{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .header-content .description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-panel-default-padding:var(--calcite-spacing-md);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-lg)}:host([scale=m]) .header-content .heading{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-panel-default-padding:var(--calcite-spacing-xl);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-xxl)}:host([scale=l]) .header-content .heading{font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .header-content .description{font-size:var(--calcite-font-size-0);line-height:1.25rem}.content-top,.content-bottom{display:flex;align-items:flex-start;align-self:stretch;border-block-start:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.container{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-color-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);border-block-end:var(--calcite-panel-header-border-block-end, 1px solid var(--calcite-color-border-3))}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-color-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{color:var(--calcite-color-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;outline-color:transparent;padding:var(--calcite-panel-content-space, 0);background:var(--calcite-panel-background-color, var(--calcite-color-background))}.content-wrapper:focus-visible{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( - -2px * - calc( - 1 - - 2 * clamp( - 0, - var(--calcite-offset-invert-focus), - 1 - ) - ) - )}.content-top,.content-bottom{padding:var(--calcite-internal-panel-default-padding)}.header-content{flex:1 1 auto;padding-block:var(--calcite-internal-panel-header-vertical-padding);padding-inline:var(--calcite-internal-panel-default-padding)}.footer{margin-block-start:auto;display:flex;flex-direction:row;align-content:space-between;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--2);line-height:1.375;border-block-start:1px solid var(--calcite-color-border-3);padding:var(--calcite-panel-footer-padding, var(--calcite-internal-panel-default-padding))}.footer-content{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:center}.footer-actions{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:space-evenly;gap:var(--calcite-internal-panel-default-padding)}.footer-start{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:flex-start;margin-inline-end:auto;gap:var(--calcite-internal-panel-default-padding)}.footer-end{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:flex-end;margin-inline-start:auto;gap:var(--calcite-internal-panel-default-padding)}.fab-container{position:sticky;inset-block-end:0px;z-index:var(--calcite-z-index-sticky);margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}:host([hidden]){display:none}[hidden]{display:none}`,Y=X,Z=k(class extends E{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=b(this,"calcitePanelClose",6),this.calcitePanelToggle=b(this,"calcitePanelToggle",6),this.calcitePanelScroll=b(this,"calcitePanelScroll",6),this.resizeObserver=M("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:e}=this;!e||typeof e.scrollHeight!="number"||typeof e.offsetHeight!="number"||(e.scrollHeight>e.offsetHeight?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex"))},this.setContainerRef=e=>{this.containerEl=e},this.panelKeyDownHandler=e=>{this.closable&&e.key==="Escape"&&!e.defaultPrevented&&(this.handleUserClose(),e.preventDefault())},this.handleUserClose=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.open=()=>{this.isClosed=!1},this.close=async()=>{const e=this.beforeClose??(()=>Promise.resolve());try{await e()}catch{requestAnimationFrame(()=>{this.closed=!1});return}this.isClosed=!0},this.collapse=()=>{this.collapsed=!this.collapsed,this.calcitePanelToggle.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=e=>{this.hasStartActions=r(e)},this.handleHeaderActionsEndSlotChange=e=>{this.hasEndActions=r(e)},this.handleHeaderMenuActionsSlotChange=e=>{this.hasMenuItems=r(e)},this.handleActionBarSlotChange=e=>{const o=C(e).filter(a=>a?.matches("calcite-action-bar"));o.forEach(a=>a.layout="horizontal"),this.hasActionBar=!!o.length},this.handleHeaderContentSlotChange=e=>{this.hasHeaderContent=r(e)},this.handleFabSlotChange=e=>{this.hasFab=r(e)},this.handleFooterActionsSlotChange=e=>{this.hasFooterActions=r(e)},this.handleFooterEndSlotChange=e=>{this.hasFooterEndContent=r(e)},this.handleFooterStartSlotChange=e=>{this.hasFooterStartContent=r(e)},this.handleFooterSlotChange=e=>{this.hasFooterContent=r(e)},this.contentBottomSlotChangeHandler=e=>{this.hasContentBottom=r(e)},this.contentTopSlotChangeHandler=e=>{this.hasContentTop=r(e)},this.setPanelScrollEl=e=>{this.panelScrollEl=e,this.resizeObserver?.disconnect(),e&&(this.resizeObserver?.observe(e),this.resizeHandler())},this.handleAlertsSlotChange=e=>{C(e)?.map(o=>{o.nodeName==="CALCITE-ALERT"&&(o.embedded=!0)})},this.beforeClose=void 0,this.closed=!1,this.disabled=!1,this.closable=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuFlipPlacements=void 0,this.menuOpen=!1,this.menuPlacement=_,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.isClosed=!1,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasActionBar=!1,this.hasContentBottom=!1,this.hasContentTop=!1,this.hasFab=!1,this.hasFooterActions=!1,this.hasFooterContent=!1,this.hasFooterEndContent=!1,this.hasFooterStartContent=!1,this.defaultMessages=void 0,this.effectiveLocale="",this.showHeaderContent=!1}toggleDialog(e){e?this.close():this.open()}onMessagesChange(){}connectedCallback(){j(this),$(this)}async componentWillLoad(){B(this),this.isClosed=this.closed,await N(this)}componentDidLoad(){P(this)}componentDidRender(){H(this)}disconnectedCallback(){K(this),R(this),this.resizeObserver?.disconnect()}effectiveLocaleChange(){W(this,this.effectiveLocale)}async setFocus(){await T(this),z(this.containerEl)}async scrollContentTo(e){this.panelScrollEl?.scrollTo(e)}renderHeaderContent(){const{heading:e,headingLevel:o,description:a,hasHeaderContent:i}=this,l=e?t(I,{class:n.heading,level:o},e):null,c=a?t("span",{class:n.description},a):null;return!i&&(l||c)?t("div",{class:n.headerContent,key:"header-content"},l,c):null}renderActionBar(){return t("div",{class:n.actionBarContainer,hidden:!this.hasActionBar},t("slot",{name:s.actionBar,onSlotchange:this.handleActionBarSlotChange}))}renderHeaderSlottedContent(){return t("div",{class:n.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},t("slot",{name:s.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:e}=this;return t("div",{class:{[n.headerActionsStart]:!0,[n.headerActions]:!0},hidden:!e,key:"header-actions-start"},t("slot",{name:s.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{hasEndActions:e,messages:o,closable:a,collapsed:i,collapseDirection:l,collapsible:c,hasMenuItems:p}=this,{collapse:d,expand:h,close:f}=o,m=[g.expand,g.collapse];l==="up"&&m.reverse();const u=c?t("calcite-action",{"aria-expanded":x(!i),"aria-label":d,icon:i?m[0]:m[1],id:S.collapse,onClick:this.collapse,scale:this.scale,text:d,title:i?h:d}):null,v=a?t("calcite-action",{"aria-label":f,icon:g.close,id:S.close,onClick:this.handleUserClose,scale:this.scale,text:f,title:f}):null,y=t("slot",{name:s.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),A=e||u||v||p;return t("div",{class:{[n.headerActionsEnd]:!0,[n.headerActions]:!0},hidden:!A,key:"header-actions-end"},y,this.renderMenu(),u,v)}renderMenu(){const{hasMenuItems:e,messages:o,menuOpen:a,menuFlipPlacements:i,menuPlacement:l}=this;return t("calcite-action-menu",{flipPlacements:i??["top","bottom"],hidden:!e,key:"menu",label:o.options,open:a,overlayPositioning:this.overlayPositioning,placement:l},t("calcite-action",{icon:g.menu,scale:this.scale,slot:L.trigger,text:o.options}),t("slot",{name:s.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:e,hasStartActions:o,hasEndActions:a,closable:i,collapsible:l,hasMenuItems:c,hasActionBar:p}=this,d=this.renderHeaderContent(),h=e||!!d||o||a||l||i||c;return this.showHeaderContent=h,t("header",{class:n.header,hidden:!(h||p)},t("div",{class:{[n.headerContainer]:!0,[n.headerContainerBorderEnd]:p},hidden:!h},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),d,this.renderHeaderActionsEnd()),this.renderActionBar(),this.renderContentTop())}renderFooterNode(){const{hasFooterEndContent:e,hasFooterStartContent:o,hasFooterContent:a,hasFooterActions:i}=this,l=o||e||a||i;return t("footer",{class:n.footer,hidden:!l},t("div",{class:n.footerContent,hidden:!a},t("slot",{name:s.footer,onSlotchange:this.handleFooterSlotChange})),t("div",{class:n.footerStart,hidden:a||!o},t("slot",{name:s.footerStart,onSlotchange:this.handleFooterStartSlotChange})),t("div",{class:n.footerEnd,hidden:a||!e},t("slot",{name:s.footerEnd,onSlotchange:this.handleFooterEndSlotChange})),t("div",{class:n.footerActions,hidden:a||!i},t("slot",{key:"footer-actions-slot",name:s.footerActions,onSlotchange:this.handleFooterActionsSlotChange})))}renderContent(){return t("div",{class:n.contentWrapper,hidden:this.collapsible&&this.collapsed,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},t("slot",null),this.renderFab())}renderContentBottom(){return t("div",{class:n.contentBottom,hidden:!this.hasContentBottom},t("slot",{name:s.contentBottom,onSlotchange:this.contentBottomSlotChangeHandler}))}renderContentTop(){return t("div",{class:n.contentTop,hidden:!this.hasContentTop},t("slot",{name:s.contentTop,onSlotchange:this.contentTopSlotChangeHandler}))}renderFab(){return t("div",{class:n.fabContainer,hidden:!this.hasFab},t("slot",{name:s.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{disabled:e,loading:o,isClosed:a}=this,i=t("article",{key:"0f439dffdca536eb6973ac386b0566091249aee3","aria-busy":x(o),class:n.container,hidden:a,ref:this.setContainerRef},this.renderHeaderNode(),this.renderContent(),this.renderContentBottom(),this.renderFooterNode(),t("slot",{key:"alerts",name:s.alerts,onSlotchange:this.handleAlertsSlotChange}));return t(w,{key:"6e5baec07ecb356871dea038ebc2d5ee2d8ed54f",onKeyDown:this.panelKeyDownHandler},t(F,{key:"924cda1799b359f1bb3fb119cebfff5a7349b72d",disabled:e},o?t("calcite-scrim",{loading:o}):null,i))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{closed:["toggleDialog"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Y}},[1,"calcite-panel",{beforeClose:[16],closed:[1540],disabled:[516],closable:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuFlipPlacements:[16],menuOpen:[516,"menu-open"],menuPlacement:[513,"menu-placement"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],isClosed:[32],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasActionBar:[32],hasContentBottom:[32],hasContentTop:[32],hasFab:[32],hasFooterActions:[32],hasFooterContent:[32],hasFooterEndContent:[32],hasFooterStartContent:[32],defaultMessages:[32],effectiveLocale:[32],showHeaderContent:[32],setFocus:[64],scrollContentTo:[64]},void 0,{closed:["toggleDialog"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function J(){typeof customElements>"u"||["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-panel":customElements.get(e)||customElements.define(e,Z);break;case"calcite-action":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||q();break;case"calcite-loader":customElements.get(e)||G();break;case"calcite-popover":customElements.get(e)||D();break;case"calcite-scrim":customElements.get(e)||V();break}})}J();export{s,J as y}; diff --git a/custom-toc-separator/assets/panel-DRUEhsxp-Gud9To6U.js b/custom-toc-separator/assets/panel-DRUEhsxp-Gud9To6U.js new file mode 100644 index 00000000..f79459f5 --- /dev/null +++ b/custom-toc-separator/assets/panel-DRUEhsxp-Gud9To6U.js @@ -0,0 +1,11 @@ +import{p as k,b as E,W as b,a as t,D as w}from"./themeUtils-YjM7iIiX-ft6XZIJI.js";import{G as r,V as C,g as z,A as x}from"./dom-N58V0tYi-DBU3jlah.js";import{l as H,p as F}from"./interactive-DqhNilgd-C3lhdKPd.js";import{o as B,r as P,f as T}from"./loadable-DbNDKH4r-BTu-x4Jk.js";import{c as M}from"./observers-BigwqTsw-C0_AGNdr.js";import{_ as L,K as D,O,w as I}from"./action-menu-DTIJuZNc-JfgVVBLH.js";import{K as j,q as K}from"./locale-Cn_GDVD_-Dy9CelfZ.js";import{d as $,h as N,M as R,l as W}from"./t9n-C_hcZMZJ-BBqL2zVj.js";import{$ as _}from"./floating-ui-DKFFlLv3-Bi8PSsgj.js";import{m as U}from"./action-GCQoufcz-CMRVbhl9.js";import{m as q}from"./icon-BXFbBbop-CoY6CcfD.js";import{v as G}from"./loader-Ch7Jr16w-DWxaqSJX.js";import{c as V}from"./scrim-BscQh4v9-BkfQZEPV.js";const n={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",contentBottom:"content-bottom",contentTop:"content-top",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer",footerContent:"footer-content",footerActions:"footer-actions",footerStart:"footer-start",footerEnd:"footer-end"},S={close:"close",collapse:"collapse"},g={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right",expand:"chevron-down",collapse:"chevron-up"},s={actionBar:"action-bar",alerts:"alerts",contentBottom:"content-bottom",contentTop:"content-top",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerEnd:"footer-end",footerStart:"footer-start",footerActions:"footer-actions"},X=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}:host([scale=s]){--calcite-internal-panel-default-padding:var(--calcite-spacing-sm);--calcite-internal-panel-header-vertical-padding:10px}:host([scale=s]) .header-content .heading{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .header-content .description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-panel-default-padding:var(--calcite-spacing-md);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-lg)}:host([scale=m]) .header-content .heading{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-panel-default-padding:var(--calcite-spacing-xl);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-xxl)}:host([scale=l]) .header-content .heading{font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .header-content .description{font-size:var(--calcite-font-size-0);line-height:1.25rem}.content-top,.content-bottom{display:flex;align-items:flex-start;align-self:stretch;border-block-start:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.container{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-color-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);border-block-end:var(--calcite-panel-header-border-block-end, 1px solid var(--calcite-color-border-3))}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-color-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{color:var(--calcite-color-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;outline-color:transparent;padding:var(--calcite-panel-content-space, 0);background:var(--calcite-panel-background-color, var(--calcite-color-background))}.content-wrapper:focus-visible{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-offset-invert-focus), + 1 + ) + ) + )}.content-top,.content-bottom{padding:var(--calcite-internal-panel-default-padding)}.header-content{flex:1 1 auto;padding-block:var(--calcite-internal-panel-header-vertical-padding);padding-inline:var(--calcite-internal-panel-default-padding)}.footer{margin-block-start:auto;display:flex;flex-direction:row;align-content:space-between;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--2);line-height:1.375;border-block-start:1px solid var(--calcite-color-border-3);padding:var(--calcite-panel-footer-padding, var(--calcite-internal-panel-default-padding))}.footer-content{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:center}.footer-actions{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:space-evenly;gap:var(--calcite-internal-panel-default-padding)}.footer-start{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:flex-start;margin-inline-end:auto;gap:var(--calcite-internal-panel-default-padding)}.footer-end{display:flex;flex:1 1 0%;flex-direction:row;align-items:center;justify-content:flex-end;margin-inline-start:auto;gap:var(--calcite-internal-panel-default-padding)}.fab-container{position:sticky;inset-block-end:0px;z-index:var(--calcite-z-index-sticky);margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}:host([hidden]){display:none}[hidden]{display:none}`,Y=X,Z=k(class extends E{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=b(this,"calcitePanelClose",6),this.calcitePanelToggle=b(this,"calcitePanelToggle",6),this.calcitePanelScroll=b(this,"calcitePanelScroll",6),this.resizeObserver=M("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:e}=this;!e||typeof e.scrollHeight!="number"||typeof e.offsetHeight!="number"||(e.scrollHeight>e.offsetHeight?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex"))},this.setContainerRef=e=>{this.containerEl=e},this.panelKeyDownHandler=e=>{this.closable&&e.key==="Escape"&&!e.defaultPrevented&&(this.handleUserClose(),e.preventDefault())},this.handleUserClose=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.open=()=>{this.isClosed=!1},this.close=async()=>{const e=this.beforeClose??(()=>Promise.resolve());try{await e()}catch{requestAnimationFrame(()=>{this.closed=!1});return}this.isClosed=!0},this.collapse=()=>{this.collapsed=!this.collapsed,this.calcitePanelToggle.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=e=>{this.hasStartActions=r(e)},this.handleHeaderActionsEndSlotChange=e=>{this.hasEndActions=r(e)},this.handleHeaderMenuActionsSlotChange=e=>{this.hasMenuItems=r(e)},this.handleActionBarSlotChange=e=>{const o=C(e).filter(a=>a?.matches("calcite-action-bar"));o.forEach(a=>a.layout="horizontal"),this.hasActionBar=!!o.length},this.handleHeaderContentSlotChange=e=>{this.hasHeaderContent=r(e)},this.handleFabSlotChange=e=>{this.hasFab=r(e)},this.handleFooterActionsSlotChange=e=>{this.hasFooterActions=r(e)},this.handleFooterEndSlotChange=e=>{this.hasFooterEndContent=r(e)},this.handleFooterStartSlotChange=e=>{this.hasFooterStartContent=r(e)},this.handleFooterSlotChange=e=>{this.hasFooterContent=r(e)},this.contentBottomSlotChangeHandler=e=>{this.hasContentBottom=r(e)},this.contentTopSlotChangeHandler=e=>{this.hasContentTop=r(e)},this.setPanelScrollEl=e=>{this.panelScrollEl=e,this.resizeObserver?.disconnect(),e&&(this.resizeObserver?.observe(e),this.resizeHandler())},this.handleAlertsSlotChange=e=>{C(e)?.map(o=>{o.nodeName==="CALCITE-ALERT"&&(o.embedded=!0)})},this.beforeClose=void 0,this.closed=!1,this.disabled=!1,this.closable=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuFlipPlacements=void 0,this.menuOpen=!1,this.menuPlacement=_,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.isClosed=!1,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasActionBar=!1,this.hasContentBottom=!1,this.hasContentTop=!1,this.hasFab=!1,this.hasFooterActions=!1,this.hasFooterContent=!1,this.hasFooterEndContent=!1,this.hasFooterStartContent=!1,this.defaultMessages=void 0,this.effectiveLocale="",this.showHeaderContent=!1}toggleDialog(e){e?this.close():this.open()}onMessagesChange(){}connectedCallback(){j(this),$(this)}async componentWillLoad(){B(this),this.isClosed=this.closed,await N(this)}componentDidLoad(){P(this)}componentDidRender(){H(this)}disconnectedCallback(){K(this),R(this),this.resizeObserver?.disconnect()}effectiveLocaleChange(){W(this,this.effectiveLocale)}async setFocus(){await T(this),z(this.containerEl)}async scrollContentTo(e){this.panelScrollEl?.scrollTo(e)}renderHeaderContent(){const{heading:e,headingLevel:o,description:a,hasHeaderContent:i}=this,l=e?t(I,{class:n.heading,level:o},e):null,c=a?t("span",{class:n.description},a):null;return!i&&(l||c)?t("div",{class:n.headerContent,key:"header-content"},l,c):null}renderActionBar(){return t("div",{class:n.actionBarContainer,hidden:!this.hasActionBar},t("slot",{name:s.actionBar,onSlotchange:this.handleActionBarSlotChange}))}renderHeaderSlottedContent(){return t("div",{class:n.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},t("slot",{name:s.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:e}=this;return t("div",{class:{[n.headerActionsStart]:!0,[n.headerActions]:!0},hidden:!e,key:"header-actions-start"},t("slot",{name:s.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{hasEndActions:e,messages:o,closable:a,collapsed:i,collapseDirection:l,collapsible:c,hasMenuItems:p}=this,{collapse:d,expand:h,close:f}=o,m=[g.expand,g.collapse];l==="up"&&m.reverse();const u=c?t("calcite-action",{"aria-expanded":x(!i),"aria-label":d,icon:i?m[0]:m[1],id:S.collapse,onClick:this.collapse,scale:this.scale,text:d,title:i?h:d}):null,v=a?t("calcite-action",{"aria-label":f,icon:g.close,id:S.close,onClick:this.handleUserClose,scale:this.scale,text:f,title:f}):null,y=t("slot",{name:s.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),A=e||u||v||p;return t("div",{class:{[n.headerActionsEnd]:!0,[n.headerActions]:!0},hidden:!A,key:"header-actions-end"},y,this.renderMenu(),u,v)}renderMenu(){const{hasMenuItems:e,messages:o,menuOpen:a,menuFlipPlacements:i,menuPlacement:l}=this;return t("calcite-action-menu",{flipPlacements:i??["top","bottom"],hidden:!e,key:"menu",label:o.options,open:a,overlayPositioning:this.overlayPositioning,placement:l},t("calcite-action",{icon:g.menu,scale:this.scale,slot:L.trigger,text:o.options}),t("slot",{name:s.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:e,hasStartActions:o,hasEndActions:a,closable:i,collapsible:l,hasMenuItems:c,hasActionBar:p}=this,d=this.renderHeaderContent(),h=e||!!d||o||a||l||i||c;return this.showHeaderContent=h,t("header",{class:n.header,hidden:!(h||p)},t("div",{class:{[n.headerContainer]:!0,[n.headerContainerBorderEnd]:p},hidden:!h},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),d,this.renderHeaderActionsEnd()),this.renderActionBar(),this.renderContentTop())}renderFooterNode(){const{hasFooterEndContent:e,hasFooterStartContent:o,hasFooterContent:a,hasFooterActions:i}=this,l=o||e||a||i;return t("footer",{class:n.footer,hidden:!l},t("div",{class:n.footerContent,hidden:!a},t("slot",{name:s.footer,onSlotchange:this.handleFooterSlotChange})),t("div",{class:n.footerStart,hidden:a||!o},t("slot",{name:s.footerStart,onSlotchange:this.handleFooterStartSlotChange})),t("div",{class:n.footerEnd,hidden:a||!e},t("slot",{name:s.footerEnd,onSlotchange:this.handleFooterEndSlotChange})),t("div",{class:n.footerActions,hidden:a||!i},t("slot",{key:"footer-actions-slot",name:s.footerActions,onSlotchange:this.handleFooterActionsSlotChange})))}renderContent(){return t("div",{class:n.contentWrapper,hidden:this.collapsible&&this.collapsed,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},t("slot",null),this.renderFab())}renderContentBottom(){return t("div",{class:n.contentBottom,hidden:!this.hasContentBottom},t("slot",{name:s.contentBottom,onSlotchange:this.contentBottomSlotChangeHandler}))}renderContentTop(){return t("div",{class:n.contentTop,hidden:!this.hasContentTop},t("slot",{name:s.contentTop,onSlotchange:this.contentTopSlotChangeHandler}))}renderFab(){return t("div",{class:n.fabContainer,hidden:!this.hasFab},t("slot",{name:s.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{disabled:e,loading:o,isClosed:a}=this,i=t("article",{key:"0f439dffdca536eb6973ac386b0566091249aee3","aria-busy":x(o),class:n.container,hidden:a,ref:this.setContainerRef},this.renderHeaderNode(),this.renderContent(),this.renderContentBottom(),this.renderFooterNode(),t("slot",{key:"alerts",name:s.alerts,onSlotchange:this.handleAlertsSlotChange}));return t(w,{key:"6e5baec07ecb356871dea038ebc2d5ee2d8ed54f",onKeyDown:this.panelKeyDownHandler},t(F,{key:"924cda1799b359f1bb3fb119cebfff5a7349b72d",disabled:e},o?t("calcite-scrim",{loading:o}):null,i))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{closed:["toggleDialog"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Y}},[1,"calcite-panel",{beforeClose:[16],closed:[1540],disabled:[516],closable:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuFlipPlacements:[16],menuOpen:[516,"menu-open"],menuPlacement:[513,"menu-placement"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],isClosed:[32],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasActionBar:[32],hasContentBottom:[32],hasContentTop:[32],hasFab:[32],hasFooterActions:[32],hasFooterContent:[32],hasFooterEndContent:[32],hasFooterStartContent:[32],defaultMessages:[32],effectiveLocale:[32],showHeaderContent:[32],setFocus:[64],scrollContentTo:[64]},void 0,{closed:["toggleDialog"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function J(){typeof customElements>"u"||["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-panel":customElements.get(e)||customElements.define(e,Z);break;case"calcite-action":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||O();break;case"calcite-icon":customElements.get(e)||q();break;case"calcite-loader":customElements.get(e)||G();break;case"calcite-popover":customElements.get(e)||D();break;case"calcite-scrim":customElements.get(e)||V();break}})}J();export{s,J as y}; diff --git a/custom-toc-separator/assets/panel-vBL5E4Ge.js b/custom-toc-separator/assets/panel-vBL5E4Ge.js new file mode 100644 index 00000000..1e5ca196 --- /dev/null +++ b/custom-toc-separator/assets/panel-vBL5E4Ge.js @@ -0,0 +1 @@ +import{_ as m}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";export{m as default}; diff --git a/custom-toc-separator/assets/parser-DyDJ-rlI-BVBmjSW8.js b/custom-toc-separator/assets/parser-DyDJ-rlI-BVBmjSW8.js new file mode 100644 index 00000000..461919b4 --- /dev/null +++ b/custom-toc-separator/assets/parser-DyDJ-rlI-BVBmjSW8.js @@ -0,0 +1,7 @@ +import{o as b,ew as Te,ex as De,ey as Ze,ez as Be,es as He,eA as Le}from"./story-DT1Ep1ux.js";import{o as $t}from"./mat4f32-CiZjBg9k-CUm34GoR.js";import{E as J,G as P}from"./mat4-DX7gBViE-B27FdgMD.js";const Ue=(r,n)=>{const u=J(r,n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1);return P(u,u)},Qe=(r,n)=>{const u=J(r,n,0,0,.5-.5*n,0,n,0,.5-.5*n,0,0,n,.5-.5*n,0,0,0,1);return P(u,u)},Ve=(r,n)=>{const u=1-n,e=J(r,.2126+.7874*u,.7152-.7152*u,.0722-.0722*u,0,.2126-.2126*u,.7152+.2848*u,.0722-.0722*u,0,.2126-.2126*u,.7152-.7152*u,.0722+.9278*u,0,0,0,0,1);return P(e,e)},We=(r,n)=>{const u=Math.sin(n*Math.PI/180),e=Math.cos(n*Math.PI/180),f=J(r,.213+.787*e-.213*u,.715-.715*e-.715*u,.072-.072*e+.928*u,0,.213-.213*e+.143*u,.715+.285*e+.14*u,.072-.072*e-.283*u,0,.213-.213*e-.787*u,.715-.715*e+.715*u,.072+.928*e+.072*u,0,0,0,0,1);return P(f,f)},Ke=(r,n)=>{const u=1-2*n,e=J(r,u,0,0,n,0,u,0,n,0,0,u,n,0,0,0,1);return P(e,e)},tr=(r,n)=>{const u=J(r,.213+.787*n,.715-.715*n,.072-.072*n,0,.213-.213*n,.715+.285*n,.072-.072*n,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,1);return P(u,u)},er=(r,n)=>{const u=1-n,e=J(r,.393+.607*u,.769-.769*u,.189-.189*u,0,.349-.349*u,.686+.314*u,.168-.168*u,0,.272-.272*u,.534-.534*u,.131+.869*u,0,0,0,0,1);return P(e,e)};class B{constructor(n,u,e){this.strength=n,this.radius=u,this.threshold=e,this.type="bloom"}interpolate(n,u,e){this.strength=M(n.strength,u.strength,e),this.radius=M(n.radius,u.radius,e),this.threshold=M(n.threshold,u.threshold,e)}clone(){return new B(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:z(this.radius),strength:this.strength,threshold:this.threshold}}}let Ft=class Ct{constructor(n){this.radius=n,this.type="blur"}interpolate(n,u,e){this.radius=Math.round(M(n.radius,u.radius,e))}clone(){return new Ct(this.radius)}toJSON(){return{type:"blur",radius:z(this.radius)}}};class G{constructor(n,u){this.type=n,this.amount=u,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e),this._updateMatrix()}clone(){return new G(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const n=this._colorMatrix||$t();switch(this.type){case"brightness":this._colorMatrix=Ue(n,this.amount);break;case"contrast":this._colorMatrix=Qe(n,this.amount);break;case"grayscale":this._colorMatrix=Ve(n,this.amount);break;case"invert":this._colorMatrix=Ke(n,this.amount);break;case"saturate":this._colorMatrix=tr(n,this.amount);break;case"sepia":this._colorMatrix=er(n,this.amount)}}}let Et=class Ot{constructor(n,u,e,f){this.offsetX=n,this.offsetY=u,this.blurRadius=e,this.color=f,this.type="drop-shadow"}interpolate(n,u,e){this.offsetX=M(n.offsetX,u.offsetX,e),this.offsetY=M(n.offsetY,u.offsetY,e),this.blurRadius=M(n.blurRadius,u.blurRadius,e),this.color[0]=Math.round(M(n.color[0],u.color[0],e)),this.color[1]=Math.round(M(n.color[1],u.color[1],e)),this.color[2]=Math.round(M(n.color[2],u.color[2],e)),this.color[3]=M(n.color[3],u.color[3],e)}clone(){return new Ot(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const n=[...this.color];return n[3]*=255,{type:"drop-shadow",xoffset:z(this.offsetX),yoffset:z(this.offsetY),blurRadius:z(this.blurRadius),color:n}}},_t=class Rt{constructor(n){this.angle=n,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.angle=M(n.angle,u.angle,e),this._updateMatrix()}clone(){return new Rt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const n=this._colorMatrix||$t();this._colorMatrix=We(n,this.angle)}};class H{constructor(n){this.amount=n,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e)}clone(){return new H(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function M(r,n,u){return r+(n-r)*u}function z(r){return Math.round(1e3*He(r))/1e3}function rr(r){switch(r.type){case"grayscale":case"sepia":case"invert":return new G(r.type,0);case"saturate":case"brightness":case"contrast":return new G(r.type,1);case"opacity":return new H(1);case"hue-rotate":return new _t(0);case"blur":return new Ft(0);case"drop-shadow":return new Et(0,0,0,[...Le("transparent")]);case"bloom":return new B(0,0,1)}}function nr(r,n){const u=r.length>n.length?r:n;return(r.length>n.length?n:r).every((e,f)=>e.type===u[f].type)}function or(r,n){const u=r.length>n.length?r:n,e=r.length>n.length?n:r;for(let f=e.length;fn?r:(n-=r.length,r+(u+=u.repeat(n)).slice(0,n))}function ar(r,n){var u,e={},f=(n=n!==void 0?n:{}).grammarSource,F={start:bt},k=bt,N="none",Y=")",p=",",d="(",C="%",v="px",et="cm",rt="mm",nt="in",ot="pt",ut="pc",at="deg",st="rad",it="grad",ct="turn",kt="#",Nt=".",Jt="e",lt=/^[ \t\n\r]/,ft=/^[a-z\-]/,ht=/^[0-9a-fA-F]/,pt=/^[+\-]/,R=/^[0-9]/,Pt=_("none"),Yt=w("none",!1),It=w(")",!1),mt=w(",",!1),Xt=_("whitespace"),gt=q([" "," ",` +`,"\r"],!1,!1),jt=_("function"),qt=w("(",!1),zt=_("identifier"),dt=q([["a","z"],"-"],!1,!1),Gt=_("percentage"),Tt=w("%",!1),Dt=_("length"),Zt=w("px",!1),Bt=w("cm",!1),Ht=w("mm",!1),Lt=w("in",!1),Ut=w("pt",!1),Qt=w("pc",!1),Vt=_("angle"),Wt=w("deg",!1),Kt=w("rad",!1),te=w("grad",!1),ee=w("turn",!1),re=_("number"),ne=_("color"),oe=w("#",!1),yt=q([["0","9"],["a","f"],["A","F"]],!1,!1),vt=q(["+","-"],!1,!1),S=q([["0","9"]],!1,!1),ue=w(".",!1),ae=w("e",!1),se=function(){return[]},ie=function(t,a){return{type:"function",name:t,parameters:a||[]}},ce=function(t,a){return a.length>0?Ge(t,a,3):[t]},le=function(t){return{type:"quantity",value:t.value,unit:t.unit}},fe=function(t){return{type:"color",colorType:t.type,value:t.value}},he=function(t){return t},pe=function(){return Z()},me=function(t){return{value:t,unit:"%"}},ge=function(t){return{value:t,unit:"px"}},de=function(t){return{value:t,unit:"cm"}},ye=function(t){return{value:t,unit:"mm"}},ve=function(t){return{value:t,unit:"in"}},we=function(t){return{value:t,unit:"pt"}},xe=function(t){return{value:t,unit:"pc"}},be=function(t){return{value:t,unit:"deg"}},Ae=function(t){return{value:t,unit:"rad"}},Me=function(t){return{value:t,unit:"grad"}},$e=function(t){return{value:t,unit:"turn"}},Fe=function(t){return{value:t,unit:null}},Ce=function(){return{type:"hex",value:Z()}},Ee=function(t){return{type:"function",value:t}},Oe=function(){return{type:"named",value:Z()}},_e=function(){return parseFloat(Z())},o=0|n.peg$currPos,m=o,I=[{line:1,column:1}],E=o,D=n.peg$maxFailExpected||[],i=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in F))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');k=F[n.startRule]}function Z(){return r.substring(m,o)}function w(t,a){return{type:"literal",text:t,ignoreCase:a}}function q(t,a,s){return{type:"class",parts:t,inverted:a,ignoreCase:s}}function Re(){return{type:"end"}}function _(t){return{type:"other",description:t}}function wt(t){var a,s=I[t];if(s)return s;if(t>=I.length)a=I.length-1;else for(a=t;!I[--a];);for(s={line:(s=I[a]).line,column:s.column};aE&&(E=o,D=[]),D.push(t))}function Se(t,a,s){return new X(X.buildMessage(t,a),t,a,s)}function bt(){var t;return(t=ke())===e&&(t=Ne()),t}function ke(){var t,a;return i++,t=o,x(),r.substr(o,4)===N?(a=N,o+=4):(a=e,i===0&&l(Yt)),a!==e?(x(),m=t,t=se()):(o=t,t=e),i--,t===e&&i===0&&l(Pt),t}function Ne(){var t,a;if(t=[],(a=U())!==e)for(;a!==e;)t.push(a),a=U();else t=e;return t}function U(){var t,a,s,c;return t=o,x(),(a=Pe())!==e?(x(),(s=Je())===e&&(s=null),x(),r.charCodeAt(o)===41?(c=Y,o++):(c=e,i===0&&l(It)),c!==e?(x(),m=t,t=ie(a,s)):(o=t,t=e)):(o=t,t=e),t}function Je(){var t,a,s,c,h,g,y,A;if(t=o,(a=Q())!==e){for(s=[],c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);c!==e;)s.push(c),c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);m=t,t=ce(a,s)}else o=t,t=e;return t}function Q(){var t,a;return t=o,(a=Ye())===e&&(a=Ie())===e&&(a=Xe())===e&&(a=je()),a!==e&&(m=t,a=le(a)),(t=a)===e&&(t=o,(a=qe())!==e&&(m=t,a=fe(a)),t=a),t}function x(){var t,a;for(i++,t=[],a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));a!==e;)t.push(a),a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));return i--,a=e,i===0&&l(Xt),t}function Pe(){var t,a,s;return i++,t=o,(a=At())!==e?(r.charCodeAt(o)===40?(s=d,o++):(s=e,i===0&&l(qt)),s!==e?(m=t,t=he(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&(a=e,i===0&&l(jt)),t}function At(){var t,a,s;if(i++,t=o,a=[],s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt)),s!==e)for(;s!==e;)a.push(s),s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt));else a=e;return a!==e&&(m=t,a=pe()),i--,(t=a)===e&&(a=e,i===0&&l(zt)),t}function Ye(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.charCodeAt(o)===37?(s=C,o++):(s=e,i===0&&l(Tt)),s!==e?(m=t,t=me(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&i===0&&l(Gt),t}function Ie(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.substr(o,2)===v?(s=v,o+=2):(s=e,i===0&&l(Zt)),s!==e?(m=t,t=ge(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===et?(s=et,o+=2):(s=e,i===0&&l(Bt)),s!==e?(m=t,t=de(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===rt?(s=rt,o+=2):(s=e,i===0&&l(Ht)),s!==e?(m=t,t=ye(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===nt?(s=nt,o+=2):(s=e,i===0&&l(Lt)),s!==e?(m=t,t=ve(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ot?(s=ot,o+=2):(s=e,i===0&&l(Ut)),s!==e?(m=t,t=we(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ut?(s=ut,o+=2):(s=e,i===0&&l(Qt)),s!==e?(m=t,t=xe(a)):(o=t,t=e)):(o=t,t=e)))))),i--,t===e&&i===0&&l(Dt),t}function Xe(){var t,a,s;return i++,t=o,(a=$())!==e?(r.substr(o,3)===at?(s=at,o+=3):(s=e,i===0&&l(Wt)),s!==e?(m=t,t=be(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,3)===st?(s=st,o+=3):(s=e,i===0&&l(Kt)),s!==e?(m=t,t=Ae(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===it?(s=it,o+=4):(s=e,i===0&&l(te)),s!==e?(m=t,t=Me(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===ct?(s=ct,o+=4):(s=e,i===0&&l(ee)),s!==e?(m=t,t=$e(a)):(o=t,t=e)):(o=t,t=e)))),i--,t===e&&(a=e,i===0&&l(Vt)),t}function je(){var t,a;return i++,t=o,x(),(a=$())!==e?(m=t,t=Fe(a)):(o=t,t=e),i--,t===e&&i===0&&l(re),t}function qe(){var t,a,s,c;if(i++,t=o,r.charCodeAt(o)===35?(a=kt,o++):(a=e,i===0&&l(oe)),a!==e){if(s=[],c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt));else s=e;s!==e?(m=t,t=Ce()):(o=t,t=e)}else o=t,t=e;return t===e&&(t=o,(a=U())!==e&&(m=t,a=Ee(a)),(t=a)===e&&(t=o,(a=At())!==e&&(m=t,a=Oe()),t=a)),i--,t===e&&(a=e,i===0&&l(ne)),t}function $(){var t,a,s,c,h,g,y,A;for(t=o,a=r.charAt(o),pt.test(a)?o++:(a=e,i===0&&l(vt)),a===e&&(a=null),s=o,c=[],h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));h!==e;)c.push(h),h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));if(r.charCodeAt(o)===46?(h=Nt,o++):(h=e,i===0&&l(ue)),h!==e){if(g=[],y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S)),y!==e)for(;y!==e;)g.push(y),y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S));else g=e;g!==e?s=c=[c,h,g]:(o=s,s=e)}else o=s,s=e;if(s===e)if(s=[],c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S));else s=e;if(s!==e){if(c=o,r.charCodeAt(o)===101?(h=Jt,o++):(h=e,i===0&&l(ae)),h!==e){if(g=r.charAt(o),pt.test(g)?o++:(g=e,i===0&&l(vt)),g===e&&(g=null),y=[],A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S)),A!==e)for(;A!==e;)y.push(A),A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S));else y=e;y!==e?c=h=[h,g,y]:(o=c,c=e)}else o=c,c=e;c===e&&(c=null),m=t,t=_e()}else o=t,t=e;return t}function ze(t,a){return t.map(function(s){return s[a]})}function Ge(t,a,s){return[t].concat(ze(a,s))}if(u=k(),n.peg$library)return{peg$result:u,peg$currPos:o,peg$FAILED:e,peg$maxFailExpected:D,peg$maxFailPos:E};if(u!==e&&o===r.length)return u;throw u!==e&&o{if(!Number.isFinite(u.scale)||u.scale<=0)throw new b("effect:invalid-scale","scale must be finite and greater than 0",{stop:u});return{scale:u.scale,effects:Mt(u.value)}});n.sort((u,e)=>e.effects.length-u.effects.length);for(let u=0;ue.scale-u.scale),n}function Mt(r){let n;if(!r)return[];try{n=ar(r)}catch(u){throw new b("effect:invalid-syntax","Invalid effect syntax",{value:r,error:u})}return n.map(u=>sr(u))}function sr(r){try{switch(r.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return ir(r);case"opacity":return cr(r);case"hue-rotate":return lr(r);case"blur":return fr(r);case"drop-shadow":return hr(r);case"bloom":return pr(r)}}catch(n){throw n.details.filter=r,n}throw new b("effect:unknown-effect",`Effect '${r.name}' is not supported`,{effect:r})}function ir(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new G(r.name,n)}function cr(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new H(n)}function lr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=wr(r.parameters[0])),new _t(n)}function fr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=tt(r.parameters[0]),T(n,r.parameters[0])),new Ft(n)}function hr(r){const n=[];let u=null;for(const e of r.parameters)if(e.type==="color"){if(n.length&&Object.freeze(n),u)throw new b("effect:type-error","Accepts only one color",{});u=xr(e)}else{const f=tt(e);if(Object.isFrozen(n))throw new b("effect:type-error"," parameters not consecutive",{lengths:n});n.push(f),n.length===3&&T(f,e)}if(n.length<2||n.length>3)throw new b("effect:type-error",`Expected {2,3}, Actual: {${n.length}}`,{lengths:n});return new Et(n[0],n[1],n[2]||0,u||St("black"))}function pr(r){let n=1,u=0,e=0;return j(r.parameters,3),r.parameters[0]&&(n=O(r.parameters[0])),r.parameters[1]&&(u=tt(r.parameters[1]),T(u,r.parameters[1])),r.parameters[2]&&(e=O(r.parameters[2])),new B(n,u,e)}function j(r,n){if(r.length>n)throw new b("effect:type-error",`Function supports up to ${n} parameters, Actual: ${r.length}`,{parameters:r})}function L(r){if(r.type==="color")return"";if(r.unit){if(r.unit in K)return"";if(r.unit in W)return"";if(r.unit==="%")return""}return""}function T(r,n){if(r<0)throw new b("effect:type-error",`Negative values are not allowed, Actual: ${r}`,{term:n})}function mr(r){if(r.type!=="quantity"||r.unit!==null)throw new b("effect:type-error",`Expected , Actual: ${L(r)}`,{term:r})}function gr(r){if(r.type!=="quantity"||r.unit!==null&&r.unit!=="%")throw new b("effect:type-error",`Expected or , Actual: ${L(r)}`,{term:r})}ur(X,Error),X.prototype.format=function(r){var n="Error: "+this.message;if(this.location){var u,e=null;for(u=0;u `+k+` +`+Y+` | +`+F.line+" | "+p+` +`+Y+" | "+V("",f.column-1," ")+V("",d,"^")}else n+=` + at `+k}return n},X.buildMessage=function(r,n){var u={literal:function(p){return'"'+f(p.text)+'"'},class:function(p){var d=p.parts.map(function(C){return Array.isArray(C)?F(C[0])+"-"+F(C[1]):F(C)});return"["+(p.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function e(p){return p.charCodeAt(0).toString(16).toUpperCase()}function f(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+e(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+e(d)})}function F(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+e(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+e(d)})}function k(p){return u[p.type](p)}function N(p){var d,C,v=p.map(k);if(v.sort(),v.length>0){for(d=1,C=1;d, Actual: ${L(r)}`,{term:r})}const K={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function yr(r){if(r.type!=="quantity"||!(r.value===0&&r.unit===null||r.unit&&K[r.unit]!=null))throw new b("effect:type-error",`Expected , Actual: ${L(r)}`,{term:r})}function O(r){gr(r);const n=r.value;return T(n,r),r.unit==="%"?.01*n:n}function vr(r){return mr(r),T(r.value,r),r.value}function wr(r){return dr(r),r.value*W[r.unit]||0}function tt(r){return yr(r),r.value*K[r.unit]||0}function xr(r){switch(r.colorType){case"hex":return Te(r.value);case"named":return St(r.value);case"function":return Mr(r.value)}}function St(r){if(!De(r))throw new b("effect:unknown-color",`color '${r}' isn't valid`,{namedColor:r});return Ze(r)}const br=/^rgba?/i,Ar=/^hsla?/i;function Mr(r){if(j(r.parameters,4),br.test(r.name))return[O(r.parameters[0]),O(r.parameters[1]),O(r.parameters[2]),r.parameters[3]?O(r.parameters[3]):1];if(Ar.test(r.name))return Be(vr(r.parameters[0]),O(r.parameters[1]),O(r.parameters[2]),r.parameters[3]?O(r.parameters[3]):1);throw new b("effect:syntax-error",`Invalid color function '${r.name}'`,{colorFunction:r})}export{nr as C,or as O,Er as a,Or as c}; diff --git a/custom-toc-separator/assets/parser-DyDJ-rlI-BZnJ9Tpt.js b/custom-toc-separator/assets/parser-DyDJ-rlI-BZnJ9Tpt.js deleted file mode 100644 index cd001f2e..00000000 --- a/custom-toc-separator/assets/parser-DyDJ-rlI-BZnJ9Tpt.js +++ /dev/null @@ -1,7 +0,0 @@ -import{o as b,ew as Te,ex as De,ey as Ze,ez as Be,es as He,eA as Le}from"./story-OUarUCIt.js";import{o as $t}from"./mat4f32-CiZjBg9k-CUm34GoR.js";import{E as J,G as P}from"./mat4-DX7gBViE-d6nV0_rZ.js";const Ue=(r,n)=>{const u=J(r,n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1);return P(u,u)},Qe=(r,n)=>{const u=J(r,n,0,0,.5-.5*n,0,n,0,.5-.5*n,0,0,n,.5-.5*n,0,0,0,1);return P(u,u)},Ve=(r,n)=>{const u=1-n,e=J(r,.2126+.7874*u,.7152-.7152*u,.0722-.0722*u,0,.2126-.2126*u,.7152+.2848*u,.0722-.0722*u,0,.2126-.2126*u,.7152-.7152*u,.0722+.9278*u,0,0,0,0,1);return P(e,e)},We=(r,n)=>{const u=Math.sin(n*Math.PI/180),e=Math.cos(n*Math.PI/180),f=J(r,.213+.787*e-.213*u,.715-.715*e-.715*u,.072-.072*e+.928*u,0,.213-.213*e+.143*u,.715+.285*e+.14*u,.072-.072*e-.283*u,0,.213-.213*e-.787*u,.715-.715*e+.715*u,.072+.928*e+.072*u,0,0,0,0,1);return P(f,f)},Ke=(r,n)=>{const u=1-2*n,e=J(r,u,0,0,n,0,u,0,n,0,0,u,n,0,0,0,1);return P(e,e)},tr=(r,n)=>{const u=J(r,.213+.787*n,.715-.715*n,.072-.072*n,0,.213-.213*n,.715+.285*n,.072-.072*n,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,1);return P(u,u)},er=(r,n)=>{const u=1-n,e=J(r,.393+.607*u,.769-.769*u,.189-.189*u,0,.349-.349*u,.686+.314*u,.168-.168*u,0,.272-.272*u,.534-.534*u,.131+.869*u,0,0,0,0,1);return P(e,e)};class B{constructor(n,u,e){this.strength=n,this.radius=u,this.threshold=e,this.type="bloom"}interpolate(n,u,e){this.strength=M(n.strength,u.strength,e),this.radius=M(n.radius,u.radius,e),this.threshold=M(n.threshold,u.threshold,e)}clone(){return new B(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:z(this.radius),strength:this.strength,threshold:this.threshold}}}let Ft=class Ct{constructor(n){this.radius=n,this.type="blur"}interpolate(n,u,e){this.radius=Math.round(M(n.radius,u.radius,e))}clone(){return new Ct(this.radius)}toJSON(){return{type:"blur",radius:z(this.radius)}}};class G{constructor(n,u){this.type=n,this.amount=u,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e),this._updateMatrix()}clone(){return new G(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const n=this._colorMatrix||$t();switch(this.type){case"brightness":this._colorMatrix=Ue(n,this.amount);break;case"contrast":this._colorMatrix=Qe(n,this.amount);break;case"grayscale":this._colorMatrix=Ve(n,this.amount);break;case"invert":this._colorMatrix=Ke(n,this.amount);break;case"saturate":this._colorMatrix=tr(n,this.amount);break;case"sepia":this._colorMatrix=er(n,this.amount)}}}let Et=class Ot{constructor(n,u,e,f){this.offsetX=n,this.offsetY=u,this.blurRadius=e,this.color=f,this.type="drop-shadow"}interpolate(n,u,e){this.offsetX=M(n.offsetX,u.offsetX,e),this.offsetY=M(n.offsetY,u.offsetY,e),this.blurRadius=M(n.blurRadius,u.blurRadius,e),this.color[0]=Math.round(M(n.color[0],u.color[0],e)),this.color[1]=Math.round(M(n.color[1],u.color[1],e)),this.color[2]=Math.round(M(n.color[2],u.color[2],e)),this.color[3]=M(n.color[3],u.color[3],e)}clone(){return new Ot(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const n=[...this.color];return n[3]*=255,{type:"drop-shadow",xoffset:z(this.offsetX),yoffset:z(this.offsetY),blurRadius:z(this.blurRadius),color:n}}},_t=class Rt{constructor(n){this.angle=n,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.angle=M(n.angle,u.angle,e),this._updateMatrix()}clone(){return new Rt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const n=this._colorMatrix||$t();this._colorMatrix=We(n,this.angle)}};class H{constructor(n){this.amount=n,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e)}clone(){return new H(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function M(r,n,u){return r+(n-r)*u}function z(r){return Math.round(1e3*He(r))/1e3}function rr(r){switch(r.type){case"grayscale":case"sepia":case"invert":return new G(r.type,0);case"saturate":case"brightness":case"contrast":return new G(r.type,1);case"opacity":return new H(1);case"hue-rotate":return new _t(0);case"blur":return new Ft(0);case"drop-shadow":return new Et(0,0,0,[...Le("transparent")]);case"bloom":return new B(0,0,1)}}function nr(r,n){const u=r.length>n.length?r:n;return(r.length>n.length?n:r).every((e,f)=>e.type===u[f].type)}function or(r,n){const u=r.length>n.length?r:n,e=r.length>n.length?n:r;for(let f=e.length;fn?r:(n-=r.length,r+(u+=u.repeat(n)).slice(0,n))}function ar(r,n){var u,e={},f=(n=n!==void 0?n:{}).grammarSource,F={start:bt},k=bt,N="none",Y=")",p=",",d="(",C="%",v="px",et="cm",rt="mm",nt="in",ot="pt",ut="pc",at="deg",st="rad",it="grad",ct="turn",kt="#",Nt=".",Jt="e",lt=/^[ \t\n\r]/,ft=/^[a-z\-]/,ht=/^[0-9a-fA-F]/,pt=/^[+\-]/,R=/^[0-9]/,Pt=_("none"),Yt=w("none",!1),It=w(")",!1),mt=w(",",!1),Xt=_("whitespace"),gt=q([" "," ",` -`,"\r"],!1,!1),jt=_("function"),qt=w("(",!1),zt=_("identifier"),dt=q([["a","z"],"-"],!1,!1),Gt=_("percentage"),Tt=w("%",!1),Dt=_("length"),Zt=w("px",!1),Bt=w("cm",!1),Ht=w("mm",!1),Lt=w("in",!1),Ut=w("pt",!1),Qt=w("pc",!1),Vt=_("angle"),Wt=w("deg",!1),Kt=w("rad",!1),te=w("grad",!1),ee=w("turn",!1),re=_("number"),ne=_("color"),oe=w("#",!1),yt=q([["0","9"],["a","f"],["A","F"]],!1,!1),vt=q(["+","-"],!1,!1),S=q([["0","9"]],!1,!1),ue=w(".",!1),ae=w("e",!1),se=function(){return[]},ie=function(t,a){return{type:"function",name:t,parameters:a||[]}},ce=function(t,a){return a.length>0?Ge(t,a,3):[t]},le=function(t){return{type:"quantity",value:t.value,unit:t.unit}},fe=function(t){return{type:"color",colorType:t.type,value:t.value}},he=function(t){return t},pe=function(){return Z()},me=function(t){return{value:t,unit:"%"}},ge=function(t){return{value:t,unit:"px"}},de=function(t){return{value:t,unit:"cm"}},ye=function(t){return{value:t,unit:"mm"}},ve=function(t){return{value:t,unit:"in"}},we=function(t){return{value:t,unit:"pt"}},xe=function(t){return{value:t,unit:"pc"}},be=function(t){return{value:t,unit:"deg"}},Ae=function(t){return{value:t,unit:"rad"}},Me=function(t){return{value:t,unit:"grad"}},$e=function(t){return{value:t,unit:"turn"}},Fe=function(t){return{value:t,unit:null}},Ce=function(){return{type:"hex",value:Z()}},Ee=function(t){return{type:"function",value:t}},Oe=function(){return{type:"named",value:Z()}},_e=function(){return parseFloat(Z())},o=0|n.peg$currPos,m=o,I=[{line:1,column:1}],E=o,D=n.peg$maxFailExpected||[],i=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in F))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');k=F[n.startRule]}function Z(){return r.substring(m,o)}function w(t,a){return{type:"literal",text:t,ignoreCase:a}}function q(t,a,s){return{type:"class",parts:t,inverted:a,ignoreCase:s}}function Re(){return{type:"end"}}function _(t){return{type:"other",description:t}}function wt(t){var a,s=I[t];if(s)return s;if(t>=I.length)a=I.length-1;else for(a=t;!I[--a];);for(s={line:(s=I[a]).line,column:s.column};aE&&(E=o,D=[]),D.push(t))}function Se(t,a,s){return new X(X.buildMessage(t,a),t,a,s)}function bt(){var t;return(t=ke())===e&&(t=Ne()),t}function ke(){var t,a;return i++,t=o,x(),r.substr(o,4)===N?(a=N,o+=4):(a=e,i===0&&l(Yt)),a!==e?(x(),m=t,t=se()):(o=t,t=e),i--,t===e&&i===0&&l(Pt),t}function Ne(){var t,a;if(t=[],(a=U())!==e)for(;a!==e;)t.push(a),a=U();else t=e;return t}function U(){var t,a,s,c;return t=o,x(),(a=Pe())!==e?(x(),(s=Je())===e&&(s=null),x(),r.charCodeAt(o)===41?(c=Y,o++):(c=e,i===0&&l(It)),c!==e?(x(),m=t,t=ie(a,s)):(o=t,t=e)):(o=t,t=e),t}function Je(){var t,a,s,c,h,g,y,A;if(t=o,(a=Q())!==e){for(s=[],c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);c!==e;)s.push(c),c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);m=t,t=ce(a,s)}else o=t,t=e;return t}function Q(){var t,a;return t=o,(a=Ye())===e&&(a=Ie())===e&&(a=Xe())===e&&(a=je()),a!==e&&(m=t,a=le(a)),(t=a)===e&&(t=o,(a=qe())!==e&&(m=t,a=fe(a)),t=a),t}function x(){var t,a;for(i++,t=[],a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));a!==e;)t.push(a),a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));return i--,a=e,i===0&&l(Xt),t}function Pe(){var t,a,s;return i++,t=o,(a=At())!==e?(r.charCodeAt(o)===40?(s=d,o++):(s=e,i===0&&l(qt)),s!==e?(m=t,t=he(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&(a=e,i===0&&l(jt)),t}function At(){var t,a,s;if(i++,t=o,a=[],s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt)),s!==e)for(;s!==e;)a.push(s),s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt));else a=e;return a!==e&&(m=t,a=pe()),i--,(t=a)===e&&(a=e,i===0&&l(zt)),t}function Ye(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.charCodeAt(o)===37?(s=C,o++):(s=e,i===0&&l(Tt)),s!==e?(m=t,t=me(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&i===0&&l(Gt),t}function Ie(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.substr(o,2)===v?(s=v,o+=2):(s=e,i===0&&l(Zt)),s!==e?(m=t,t=ge(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===et?(s=et,o+=2):(s=e,i===0&&l(Bt)),s!==e?(m=t,t=de(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===rt?(s=rt,o+=2):(s=e,i===0&&l(Ht)),s!==e?(m=t,t=ye(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===nt?(s=nt,o+=2):(s=e,i===0&&l(Lt)),s!==e?(m=t,t=ve(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ot?(s=ot,o+=2):(s=e,i===0&&l(Ut)),s!==e?(m=t,t=we(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ut?(s=ut,o+=2):(s=e,i===0&&l(Qt)),s!==e?(m=t,t=xe(a)):(o=t,t=e)):(o=t,t=e)))))),i--,t===e&&i===0&&l(Dt),t}function Xe(){var t,a,s;return i++,t=o,(a=$())!==e?(r.substr(o,3)===at?(s=at,o+=3):(s=e,i===0&&l(Wt)),s!==e?(m=t,t=be(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,3)===st?(s=st,o+=3):(s=e,i===0&&l(Kt)),s!==e?(m=t,t=Ae(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===it?(s=it,o+=4):(s=e,i===0&&l(te)),s!==e?(m=t,t=Me(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===ct?(s=ct,o+=4):(s=e,i===0&&l(ee)),s!==e?(m=t,t=$e(a)):(o=t,t=e)):(o=t,t=e)))),i--,t===e&&(a=e,i===0&&l(Vt)),t}function je(){var t,a;return i++,t=o,x(),(a=$())!==e?(m=t,t=Fe(a)):(o=t,t=e),i--,t===e&&i===0&&l(re),t}function qe(){var t,a,s,c;if(i++,t=o,r.charCodeAt(o)===35?(a=kt,o++):(a=e,i===0&&l(oe)),a!==e){if(s=[],c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt));else s=e;s!==e?(m=t,t=Ce()):(o=t,t=e)}else o=t,t=e;return t===e&&(t=o,(a=U())!==e&&(m=t,a=Ee(a)),(t=a)===e&&(t=o,(a=At())!==e&&(m=t,a=Oe()),t=a)),i--,t===e&&(a=e,i===0&&l(ne)),t}function $(){var t,a,s,c,h,g,y,A;for(t=o,a=r.charAt(o),pt.test(a)?o++:(a=e,i===0&&l(vt)),a===e&&(a=null),s=o,c=[],h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));h!==e;)c.push(h),h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));if(r.charCodeAt(o)===46?(h=Nt,o++):(h=e,i===0&&l(ue)),h!==e){if(g=[],y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S)),y!==e)for(;y!==e;)g.push(y),y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S));else g=e;g!==e?s=c=[c,h,g]:(o=s,s=e)}else o=s,s=e;if(s===e)if(s=[],c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S));else s=e;if(s!==e){if(c=o,r.charCodeAt(o)===101?(h=Jt,o++):(h=e,i===0&&l(ae)),h!==e){if(g=r.charAt(o),pt.test(g)?o++:(g=e,i===0&&l(vt)),g===e&&(g=null),y=[],A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S)),A!==e)for(;A!==e;)y.push(A),A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S));else y=e;y!==e?c=h=[h,g,y]:(o=c,c=e)}else o=c,c=e;c===e&&(c=null),m=t,t=_e()}else o=t,t=e;return t}function ze(t,a){return t.map(function(s){return s[a]})}function Ge(t,a,s){return[t].concat(ze(a,s))}if(u=k(),n.peg$library)return{peg$result:u,peg$currPos:o,peg$FAILED:e,peg$maxFailExpected:D,peg$maxFailPos:E};if(u!==e&&o===r.length)return u;throw u!==e&&o{if(!Number.isFinite(u.scale)||u.scale<=0)throw new b("effect:invalid-scale","scale must be finite and greater than 0",{stop:u});return{scale:u.scale,effects:Mt(u.value)}});n.sort((u,e)=>e.effects.length-u.effects.length);for(let u=0;ue.scale-u.scale),n}function Mt(r){let n;if(!r)return[];try{n=ar(r)}catch(u){throw new b("effect:invalid-syntax","Invalid effect syntax",{value:r,error:u})}return n.map(u=>sr(u))}function sr(r){try{switch(r.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return ir(r);case"opacity":return cr(r);case"hue-rotate":return lr(r);case"blur":return fr(r);case"drop-shadow":return hr(r);case"bloom":return pr(r)}}catch(n){throw n.details.filter=r,n}throw new b("effect:unknown-effect",`Effect '${r.name}' is not supported`,{effect:r})}function ir(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new G(r.name,n)}function cr(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new H(n)}function lr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=wr(r.parameters[0])),new _t(n)}function fr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=tt(r.parameters[0]),T(n,r.parameters[0])),new Ft(n)}function hr(r){const n=[];let u=null;for(const e of r.parameters)if(e.type==="color"){if(n.length&&Object.freeze(n),u)throw new b("effect:type-error","Accepts only one color",{});u=xr(e)}else{const f=tt(e);if(Object.isFrozen(n))throw new b("effect:type-error"," parameters not consecutive",{lengths:n});n.push(f),n.length===3&&T(f,e)}if(n.length<2||n.length>3)throw new b("effect:type-error",`Expected {2,3}, Actual: {${n.length}}`,{lengths:n});return new Et(n[0],n[1],n[2]||0,u||St("black"))}function pr(r){let n=1,u=0,e=0;return j(r.parameters,3),r.parameters[0]&&(n=O(r.parameters[0])),r.parameters[1]&&(u=tt(r.parameters[1]),T(u,r.parameters[1])),r.parameters[2]&&(e=O(r.parameters[2])),new B(n,u,e)}function j(r,n){if(r.length>n)throw new b("effect:type-error",`Function supports up to ${n} parameters, Actual: ${r.length}`,{parameters:r})}function L(r){if(r.type==="color")return"";if(r.unit){if(r.unit in K)return"";if(r.unit in W)return"";if(r.unit==="%")return""}return""}function T(r,n){if(r<0)throw new b("effect:type-error",`Negative values are not allowed, Actual: ${r}`,{term:n})}function mr(r){if(r.type!=="quantity"||r.unit!==null)throw new b("effect:type-error",`Expected , Actual: ${L(r)}`,{term:r})}function gr(r){if(r.type!=="quantity"||r.unit!==null&&r.unit!=="%")throw new b("effect:type-error",`Expected or , Actual: ${L(r)}`,{term:r})}ur(X,Error),X.prototype.format=function(r){var n="Error: "+this.message;if(this.location){var u,e=null;for(u=0;u `+k+` -`+Y+` | -`+F.line+" | "+p+` -`+Y+" | "+V("",f.column-1," ")+V("",d,"^")}else n+=` - at `+k}return n},X.buildMessage=function(r,n){var u={literal:function(p){return'"'+f(p.text)+'"'},class:function(p){var d=p.parts.map(function(C){return Array.isArray(C)?F(C[0])+"-"+F(C[1]):F(C)});return"["+(p.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function e(p){return p.charCodeAt(0).toString(16).toUpperCase()}function f(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+e(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+e(d)})}function F(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+e(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+e(d)})}function k(p){return u[p.type](p)}function N(p){var d,C,v=p.map(k);if(v.sort(),v.length>0){for(d=1,C=1;d, Actual: ${L(r)}`,{term:r})}const K={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function yr(r){if(r.type!=="quantity"||!(r.value===0&&r.unit===null||r.unit&&K[r.unit]!=null))throw new b("effect:type-error",`Expected , Actual: ${L(r)}`,{term:r})}function O(r){gr(r);const n=r.value;return T(n,r),r.unit==="%"?.01*n:n}function vr(r){return mr(r),T(r.value,r),r.value}function wr(r){return dr(r),r.value*W[r.unit]||0}function tt(r){return yr(r),r.value*K[r.unit]||0}function xr(r){switch(r.colorType){case"hex":return Te(r.value);case"named":return St(r.value);case"function":return Mr(r.value)}}function St(r){if(!De(r))throw new b("effect:unknown-color",`color '${r}' isn't valid`,{namedColor:r});return Ze(r)}const br=/^rgba?/i,Ar=/^hsla?/i;function Mr(r){if(j(r.parameters,4),br.test(r.name))return[O(r.parameters[0]),O(r.parameters[1]),O(r.parameters[2]),r.parameters[3]?O(r.parameters[3]):1];if(Ar.test(r.name))return Be(vr(r.parameters[0]),O(r.parameters[1]),O(r.parameters[2]),r.parameters[3]?O(r.parameters[3]):1);throw new b("effect:syntax-error",`Invalid color function '${r.name}'`,{colorFunction:r})}export{nr as C,or as O,Er as a,Or as c}; diff --git a/custom-toc-separator/assets/pbf-D-y3_eZO-CKuZ8F1K.js b/custom-toc-separator/assets/pbf-D-y3_eZO-CKuZ8F1K.js new file mode 100644 index 00000000..6538bf41 --- /dev/null +++ b/custom-toc-separator/assets/pbf-D-y3_eZO-CKuZ8F1K.js @@ -0,0 +1 @@ +import{K as d,dB as g}from"./story-DT1Ep1ux.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,u=new TextDecoder("utf-8"),c=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,e,i=0,s=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,e,i,s)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getUint32(e+4,!0)*p;return this._skip(8),i}getSFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getInt32(e+4,!0)*p;return this._skip(8),i}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),a=t(r,e,i,s);return r.release(),a}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=o.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let e=this._pos,i=0,s=0;if(this._end-e>=10)do{if(s=t[e++],i|=127&s,!(128&s)||(s=t[e++],i|=(127&s)<<7,!(128&s))||(s=t[e++],i|=(127&s)<<14,!(128&s))||(s=t[e++],i|=(127&s)<<21,!(128&s))||(s=t[e++],i+=268435456*(127&s),!(128&s))||(s=t[e++],i+=34359738368*(127&s),!(128&s))||(s=t[e++],i+=4398046511104*(127&s),!(128&s))||(s=t[e++],i+=562949953421312*(127&s),!(128&s))||(s=t[e++],i+=72057594037927940*(127&s),!(128&s))||(s=t[e++],i+=9223372036854776e3*(127&s),!(128&s)))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;e!==this._end&&(s=t[e],128&s);)++e,i+=(127&s)*r,r*=128;if(e===this._end)throw new Error("Varint overrun!");++e,i+=s*r}return this._pos=e,i}_decodeSVarint(){const t=this._data;let e,i=0,s=0;const r=1&t[this._pos];if(s=t[this._pos++],i|=127&s,!(128&s)||(s=t[this._pos++],i|=(127&s)<<7,!(128&s))||(s=t[this._pos++],i|=(127&s)<<14,!(128&s))||(s=t[this._pos++],i|=(127&s)<<21,!(128&s))||(s=t[this._pos++],i+=268435456*(127&s),!(128&s))||(s=t[this._pos++],i+=34359738368*(127&s),!(128&s))||(s=t[this._pos++],i+=4398046511104*(127&s),!(128&s)))return r?-(i+1)/2:i/2;if(e=BigInt(i),s=t[this._pos++],e+=0x2000000000000n*BigInt(127&s),!(128&s)||(s=t[this._pos++],e+=0x100000000000000n*BigInt(127&s),!(128&s))||(s=t[this._pos++],e+=0x8000000000000000n*BigInt(127&s),!(128&s)))return Number(r?-(e+1n)/2n:e/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,e,i){if((i=Math.min(this._end,i))-e>c){const a=t.subarray(e,i);return u.decode(a)}let s="",r="";for(let a=e;a{n._data=null,n._dataView=null});export{o}; diff --git a/custom-toc-separator/assets/pbf-D-y3_eZO-kB76Yuqq.js b/custom-toc-separator/assets/pbf-D-y3_eZO-kB76Yuqq.js deleted file mode 100644 index 960eaf51..00000000 --- a/custom-toc-separator/assets/pbf-D-y3_eZO-kB76Yuqq.js +++ /dev/null @@ -1 +0,0 @@ -import{K as d,dB as g}from"./story-OUarUCIt.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,u=new TextDecoder("utf-8"),c=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,e,i=0,s=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,e,i,s)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getUint32(e+4,!0)*p;return this._skip(8),i}getSFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getInt32(e+4,!0)*p;return this._skip(8),i}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),a=t(r,e,i,s);return r.release(),a}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=o.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let e=this._pos,i=0,s=0;if(this._end-e>=10)do{if(s=t[e++],i|=127&s,!(128&s)||(s=t[e++],i|=(127&s)<<7,!(128&s))||(s=t[e++],i|=(127&s)<<14,!(128&s))||(s=t[e++],i|=(127&s)<<21,!(128&s))||(s=t[e++],i+=268435456*(127&s),!(128&s))||(s=t[e++],i+=34359738368*(127&s),!(128&s))||(s=t[e++],i+=4398046511104*(127&s),!(128&s))||(s=t[e++],i+=562949953421312*(127&s),!(128&s))||(s=t[e++],i+=72057594037927940*(127&s),!(128&s))||(s=t[e++],i+=9223372036854776e3*(127&s),!(128&s)))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;e!==this._end&&(s=t[e],128&s);)++e,i+=(127&s)*r,r*=128;if(e===this._end)throw new Error("Varint overrun!");++e,i+=s*r}return this._pos=e,i}_decodeSVarint(){const t=this._data;let e,i=0,s=0;const r=1&t[this._pos];if(s=t[this._pos++],i|=127&s,!(128&s)||(s=t[this._pos++],i|=(127&s)<<7,!(128&s))||(s=t[this._pos++],i|=(127&s)<<14,!(128&s))||(s=t[this._pos++],i|=(127&s)<<21,!(128&s))||(s=t[this._pos++],i+=268435456*(127&s),!(128&s))||(s=t[this._pos++],i+=34359738368*(127&s),!(128&s))||(s=t[this._pos++],i+=4398046511104*(127&s),!(128&s)))return r?-(i+1)/2:i/2;if(e=BigInt(i),s=t[this._pos++],e+=0x2000000000000n*BigInt(127&s),!(128&s)||(s=t[this._pos++],e+=0x100000000000000n*BigInt(127&s),!(128&s))||(s=t[this._pos++],e+=0x8000000000000000n*BigInt(127&s),!(128&s)))return Number(r?-(e+1n)/2n:e/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,e,i){if((i=Math.min(this._end,i))-e>c){const a=t.subarray(e,i);return u.decode(a)}let s="",r="";for(let a=e;a{n._data=null,n._dataView=null});export{o}; diff --git a/custom-toc-separator/assets/pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js b/custom-toc-separator/assets/pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js deleted file mode 100644 index 56978120..00000000 --- a/custom-toc-separator/assets/pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js +++ /dev/null @@ -1 +0,0 @@ -import{aC as k,dh as u,o as m}from"./story-OUarUCIt.js";import{o as T}from"./pbf-D-y3_eZO-kB76Yuqq.js";import{a as q,i as F,c as l}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as I}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const b=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let j=class{constructor(r){this._options=r,this.geometryTypes=b,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new I}prepareFeatures(r){this._vertexDimension=2,r.hasZ&&this._vertexDimension++,r.hasM&&this._vertexDimension++}finishFeatureResult(r){if(!r?.features||!r.hasZ||!this._options.sourceSpatialReference||!r.spatialReference||k(r.spatialReference,this._options.sourceSpatialReference)||r.spatialReference.vcsWkid)return;const e=u(this._options.sourceSpatialReference)/u(r.spatialReference);if(e!==1)for(const t of r.features){if(!q(t))continue;const s=t.geometry.coords;for(let a=2;ae+t,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(r,e){r.coords[this._coordinatePtr++]=e}addCoordinatePoint(r,e){r.coords.push(e)}addLength(r,e){r.lengths.push(e)}addQueryGeometry(r,e){r.queryGeometry=e.queryGeometry,r.queryGeometryType=e.queryGeometryType}createPointGeometry(){return new l}};const g=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],p=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],y=["upperLeft","lowerLeft"];function f(r){return r>=g.length?null:g[r]}function w(r){return r>=p.length?null:p[r]}function d(r){return r>=y.length?null:y[r]}function h(r,e){return e>=r.geometryTypes.length?null:r.geometryTypes[e]}function S(r,e,t){const s=r.asUnsafe(),a=e.createPointGeometry(t);for(;s.next();)switch(s.tag()){case 3:{const n=s.getUInt32(),o=s.pos()+n;let i=0;for(;s.pos()e+t,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(r,e){r.coords[this._coordinatePtr++]=e}addCoordinatePoint(r,e){r.coords.push(e)}addLength(r,e){r.lengths.push(e)}addQueryGeometry(r,e){r.queryGeometry=e.queryGeometry,r.queryGeometryType=e.queryGeometryType}createPointGeometry(){return new l}};const g=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],p=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],y=["upperLeft","lowerLeft"];function f(r){return r>=g.length?null:g[r]}function w(r){return r>=p.length?null:p[r]}function d(r){return r>=y.length?null:y[r]}function h(r,e){return e>=r.geometryTypes.length?null:r.geometryTypes[e]}function S(r,e,t){const s=r.asUnsafe(),a=e.createPointGeometry(t);for(;s.next();)switch(s.tag()){case 3:{const n=s.getUInt32(),o=s.pos()+n;let i=0;for(;s.pos(){const r=Y(e,o,n);for(const c of t){const i=I(o,c,n);for(const s in r)i[s]=r[s]}}}function Y(e,t,o){if(e?.type==="resource")return k(e,t,o);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:r}=C;return{read:n,write:r}}}}function k(e,t,o){const n=$(t,o);return{type:String,read:(r,c,i)=>{const s=N(r,c,i);return n.type===String?s:typeof n.type=="function"?new n.type({url:s}):void 0},write:{writer(r,c,i,s){if(!s?.resources)return typeof r=="string"?void(c[i]=h(r,s)):void(c[i]=r.write({},s));const p=E(r),a=h(p,{...s,verifyItemRelativeUrls:s?.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},b.NO),d=n.type!==String&&(!J(this)||s?.origin&&this.originIdOf(o)>A(s.origin)),u={object:this,propertyName:o,value:r,targetUrl:a,dest:c,targetPropertyName:i,context:s,params:e};s?.portalItem&&a&&!O(a)?d&&e?.contentAddressed?g(u):d?q(u):z(u):s?.portalItem&&(a==null||P(a)!=null||v(a)||d)?g(u):c[i]=a}}}}function g(e){const{targetUrl:t,params:o,value:n,context:r,dest:c,targetPropertyName:i}=e;if(!r.portalItem)return;const s=x(t),p=U(n,t,r);if(o?.contentAddressed&&p.type!=="json")return void r.messages?.push(new S("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${p.type} with content addressing. Content addressing is only supported for json resources.`,{content:p}));const a=o?.contentAddressed&&p.type==="json"?D(p.jsonString):s?.filename??K(),d=R(o?.prefix??s?.prefix,a),u=`${d}.${y(p)}`;if(o?.contentAddressed&&r.resources&&p.type==="json"){const f=r.resources.toKeep.find(({resource:m})=>m.path===u)??r.resources.toAdd.find(({resource:m})=>m.path===u);if(f)return void(c[i]=f.resource.itemRelativeUrl)}const l=r.portalItem.resourceFromPath(u);v(t)&&r.resources&&r.resources.pendingOperations.push(B(t).then(f=>{l.path=`${d}.${y({type:"blob",blob:f})}`,c[i]=l.itemRelativeUrl}).catch(()=>{}));const w=o?.compress??!1;r.resources&&j({...e,resource:l,content:p,compress:w,updates:r.resources.toAdd}),c[i]=l.itemRelativeUrl}function q(e){const{context:t,targetUrl:o,params:n,value:r,dest:c,targetPropertyName:i}=e;if(!t.portalItem)return;const s=t.portalItem.resourceFromPath(o),p=U(r,o,t),a=y(p),d=F(s.path),u=n?.compress??!1;a===d?(t.resources&&j({...e,resource:s,content:p,compress:u,updates:t.resources.toUpdate}),c[i]=o):g(e)}function z({context:e,targetUrl:t,dest:o,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[n]=t)}function j({object:e,propertyName:t,updates:o,resource:n,content:r,compress:c}){const i=s=>{G(e,t,s)};o.push({resource:n,content:r,compress:c,finish:i})}function U(e,t,o){return typeof e=="string"?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(o))}}function E(e){return e==null?null:typeof e=="string"?e:e.url}function G(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{L as C}; diff --git a/custom-toc-separator/assets/persistable-C6RBwzJi-DSWzGhuz.js b/custom-toc-separator/assets/persistable-C6RBwzJi-DSWzGhuz.js new file mode 100644 index 00000000..af4e30dc --- /dev/null +++ b/custom-toc-separator/assets/persistable-C6RBwzJi-DSWzGhuz.js @@ -0,0 +1 @@ +import{jA as I,jB as $,jy as N,dY as h,jC as b,bO as A,cx as O,jD as P,cO as v,jE as x,o as S,bX as R,jF as B,gF as F,jG as C}from"./story-DT1Ep1ux.js";import{k as D}from"./MD5-CHHr-oed-SuyrCYQ0.js";import{n as J}from"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import{r as K}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{e as y}from"./resourceExtension-CdQvIDKV-iZLDgXmu.js";function L(e){const t=e?.origins??[void 0];return(o,n)=>{const r=Y(e,o,n);for(const c of t){const i=I(o,c,n);for(const s in r)i[s]=r[s]}}}function Y(e,t,o){if(e?.type==="resource")return k(e,t,o);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:r}=C;return{read:n,write:r}}}}function k(e,t,o){const n=$(t,o);return{type:String,read:(r,c,i)=>{const s=N(r,c,i);return n.type===String?s:typeof n.type=="function"?new n.type({url:s}):void 0},write:{writer(r,c,i,s){if(!s?.resources)return typeof r=="string"?void(c[i]=h(r,s)):void(c[i]=r.write({},s));const p=E(r),a=h(p,{...s,verifyItemRelativeUrls:s?.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},b.NO),d=n.type!==String&&(!J(this)||s?.origin&&this.originIdOf(o)>A(s.origin)),u={object:this,propertyName:o,value:r,targetUrl:a,dest:c,targetPropertyName:i,context:s,params:e};s?.portalItem&&a&&!O(a)?d&&e?.contentAddressed?g(u):d?q(u):z(u):s?.portalItem&&(a==null||P(a)!=null||v(a)||d)?g(u):c[i]=a}}}}function g(e){const{targetUrl:t,params:o,value:n,context:r,dest:c,targetPropertyName:i}=e;if(!r.portalItem)return;const s=x(t),p=U(n,t,r);if(o?.contentAddressed&&p.type!=="json")return void r.messages?.push(new S("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${p.type} with content addressing. Content addressing is only supported for json resources.`,{content:p}));const a=o?.contentAddressed&&p.type==="json"?D(p.jsonString):s?.filename??K(),d=R(o?.prefix??s?.prefix,a),u=`${d}.${y(p)}`;if(o?.contentAddressed&&r.resources&&p.type==="json"){const f=r.resources.toKeep.find(({resource:m})=>m.path===u)??r.resources.toAdd.find(({resource:m})=>m.path===u);if(f)return void(c[i]=f.resource.itemRelativeUrl)}const l=r.portalItem.resourceFromPath(u);v(t)&&r.resources&&r.resources.pendingOperations.push(B(t).then(f=>{l.path=`${d}.${y({type:"blob",blob:f})}`,c[i]=l.itemRelativeUrl}).catch(()=>{}));const w=o?.compress??!1;r.resources&&j({...e,resource:l,content:p,compress:w,updates:r.resources.toAdd}),c[i]=l.itemRelativeUrl}function q(e){const{context:t,targetUrl:o,params:n,value:r,dest:c,targetPropertyName:i}=e;if(!t.portalItem)return;const s=t.portalItem.resourceFromPath(o),p=U(r,o,t),a=y(p),d=F(s.path),u=n?.compress??!1;a===d?(t.resources&&j({...e,resource:s,content:p,compress:u,updates:t.resources.toUpdate}),c[i]=o):g(e)}function z({context:e,targetUrl:t,dest:o,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[n]=t)}function j({object:e,propertyName:t,updates:o,resource:n,content:r,compress:c}){const i=s=>{G(e,t,s)};o.push({resource:n,content:r,compress:c,finish:i})}function U(e,t,o){return typeof e=="string"?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(o))}}function E(e){return e==null?null:typeof e=="string"?e:e.url}function G(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{L as C}; diff --git a/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-3834DwlL.js b/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-3834DwlL.js new file mode 100644 index 00000000..7802a87e --- /dev/null +++ b/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-3834DwlL.js @@ -0,0 +1 @@ +import{v as l,S as s,i as R,j as S,gH as p,l as k,dg as D}from"./story-DT1Ep1ux.js";import{V as G}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{G as H}from"./normalizeUtilsSync-CBU7m8rm-RygHJ7YV.js";import{V as g,E as y,w as z,Q as d}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as m}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as a}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as x,Z as h}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";let e=class extends S{constructor(o){super(o)}get bounds(){const o=this.coords;return o?.extent==null?null:p(o.extent)}get coords(){const o=this.element.georeference?.coords;return G(o,this.spatialReference).geometry}get normalizedCoords(){return k.fromJSON(H(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};l([s()],e.prototype,"spatialReference",void 0),l([s()],e.prototype,"element",void 0),l([s()],e.prototype,"bounds",null),l([s()],e.prototype,"coords",null),l([s()],e.prototype,"normalizedCoords",null),l([s()],e.prototype,"normalizedBounds",null),e=l([R("esri.layers.support.MediaElementView")],e);const t=D(),i=m(),u=m(),c=m();function $(o,r,n){return x(t,r[0],r[1],1),h(t,t,g(i,n)),t[2]===0?a(o,t[0],t[1]):a(o,t[0]/t[2],t[1]/t[2])}function q(o,r,n){return f(u,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),f(c,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),y(o,z(u,u),c),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function f(o,r,n,v,C,j,B,V,b){d(o,r,v,j,n,C,B,1,1,1),x(t,V,b,1),z(i,o);const[w,E,M]=h(t,t,g(i,i));return d(i,w,0,0,0,E,0,0,0,M),y(o,i,o)}export{$ as K,q as M,e as o}; diff --git a/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-DDSQwPJw.js b/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-DDSQwPJw.js deleted file mode 100644 index 2a87d00d..00000000 --- a/custom-toc-separator/assets/perspectiveUtils-Bu88xlbg-DDSQwPJw.js +++ /dev/null @@ -1 +0,0 @@ -import{v as l,S as s,i as R,j as S,gH as p,l as k,dg as D}from"./story-OUarUCIt.js";import{V as G}from"./projection-BA9M1R7d-Cytmrlsd.js";import{G as H}from"./normalizeUtilsSync-CBU7m8rm-BlgdaSVE.js";import{V as g,E as y,w as z,Q as d}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as m}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as a}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as x,Z as h}from"./vec32-D9GsKZ1t-iWg2zFa3.js";let e=class extends S{constructor(o){super(o)}get bounds(){const o=this.coords;return o?.extent==null?null:p(o.extent)}get coords(){const o=this.element.georeference?.coords;return G(o,this.spatialReference).geometry}get normalizedCoords(){return k.fromJSON(H(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};l([s()],e.prototype,"spatialReference",void 0),l([s()],e.prototype,"element",void 0),l([s()],e.prototype,"bounds",null),l([s()],e.prototype,"coords",null),l([s()],e.prototype,"normalizedCoords",null),l([s()],e.prototype,"normalizedBounds",null),e=l([R("esri.layers.support.MediaElementView")],e);const t=D(),i=m(),u=m(),c=m();function $(o,r,n){return x(t,r[0],r[1],1),h(t,t,g(i,n)),t[2]===0?a(o,t[0],t[1]):a(o,t[0]/t[2],t[1]/t[2])}function q(o,r,n){return f(u,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),f(c,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),y(o,z(u,u),c),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function f(o,r,n,v,C,j,B,V,b){d(o,r,v,j,n,C,B,1,1,1),x(t,V,b,1),z(i,o);const[w,E,M]=h(t,t,g(i,i));return d(i,w,0,0,0,E,0,0,0,M),y(o,i,o)}export{$ as K,q as M,e as o}; diff --git a/custom-toc-separator/assets/pieChart-qcxaoQkv-BaGPkv1X.js b/custom-toc-separator/assets/pieChart-qcxaoQkv-BaGPkv1X.js deleted file mode 100644 index 207891fb..00000000 --- a/custom-toc-separator/assets/pieChart-qcxaoQkv-BaGPkv1X.js +++ /dev/null @@ -1 +0,0 @@ -import{k0 as Q}from"./story-OUarUCIt.js";import{B as Te,U as Le,A as je,u as Ie,n as M}from"./Tick-DUHqbpyB-iDoSp0SS.js";import{m as Ne,ap as Ce,V as Oe,at as v,am as Re,n as ae,ax as Me,aw as F,ay as pe,az as ye,ao as me,c as A,aA as H,aB as S,aC as ve,ai as Se,H as be,aD as Be,U as we,B as re,ar as Fe,s as He}from"./Theme-rblUnB2V-DrMnmN3S.js";import{i as Ve}from"./ColorSet-DkIwOmgs-BSZuvnWe.js";import{o as Ye}from"./DefaultTheme-Bt5OI-Ht-BpAhXUxl.js";import"./main-lj2zzr_L.js";class te extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Se(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=S(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this.setRaw("x",void 0),this.setRaw("y",void 0),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*S(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*S(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Xe=Math.max,fe=Math.min,C=Math.sin,q=Math.sqrt,x=1e-12,K=Math.PI,ne=K/2,ze=2*K;function We(d){return d>1?0:d<-1?K:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function qe(d){return d.innerRadius}function Ee(d){return d.outerRadius}function Ue(d){return d.startAngle}function Ke(d){return d.endAngle}function $e(d){return d&&d.padAngle}function Ze(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,c=g*y-n*o;if(!(c*cD*D+X*X&&(j=V,I=Y),{cx:j,cy:I,x01:-n,y01:-g,x11:j*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=qe,t=Ee,e=M(0),i=null,s=Ue,r=Ke,l=$e,a=null,y=Ie(o);function o(){var n,g,c=+d.apply(this,arguments),h=+t.apply(this,arguments),m=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-m),b=f>m;if(a||(a=n=y()),hx)if(P>ze-x)a.moveTo(h*B(m),h*C(m)),a.arc(0,0,h,m,f,!b),c>x&&(a.moveTo(c*B(f),c*C(f)),a.arc(0,0,c,f,m,b));else{var u,p,R=m,T=f,w=m,L=f,j=P,I=P,V=l.apply(this,arguments)/2,Y=V>x&&(i?+i.apply(this,arguments):q(c*c+h*h)),N=fe(Ae(h-c)/2,+e.apply(this,arguments)),k=N,D=N;if(Y>x){var X=Pe(Y/c*C(V)),le=Pe(Y/h*C(V));(j-=2*X)>x?(w+=X*=b?1:-1,L-=X):(j=0,w=L=(m+f)/2),(I-=2*le)>x?(R+=le*=b?1:-1,T-=le):(I=0,R=T=(m+f)/2)}var z=h*B(R),W=h*C(R),$=c*B(L),Z=c*C(L);if(N>x){var O,G=h*B(T),J=h*C(T),oe=c*B(w),ue=c*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,h,D,b),p=ee(G,J,$,Z,h,D,b),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&j>x?k>x?(u=ee($,Z,G,J,c,-k,b),p=ee(z,W,oe,ue,c,-k,b),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=S(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Oe.classNames.concat([se.className])});class Je extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ve.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class E extends Te{_afterNew(){this._defaultThemes.push(Je.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([E.className])});class U extends Le{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeSlices())}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeLabels())}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeTicks())})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("fillPattern",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset();const e=this.get("patterns");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}if(t.get("fillPattern")==null){let e=this.get("patterns");e&&t.setRaw("fillPattern",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([U.className])});class _e extends E{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let h=l.value,m=Math.min(y,o);h=Math.max(m*h,m-Math.min(i,e))/m,n=Re(0,0,s,r,h),this.setPrivateRaw("irModifyer",h/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const c=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-c*(a.bottom+a.top)/2,dx:-c*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(h=>{h._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(h=>{h._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([_e.className])});class xe extends U{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:me(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:me(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>je._new(this._root,{themeTags:me(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const c=a.get("fill");o._setDefault("fill",c),o._setDefault("stroke",c);const h=a.get("fillPattern");o._setDefault("fillPattern",h)}let n=Se(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let c=r+g.get("radius",0),h=r*S(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:h}),c*=-1,c-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:h}),c+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",c),g.set("y",r*S(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=S(a),n=this.labelsContainer,g=n.get("paddingLeft",0),c=n.get("paddingRight",0);let h=0,m=0;h=i.x(),m=i.y();let f=[];if(h!=0||m!=0){if(i.get("textType")=="circular"){const b=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);h=b*H(u),m=b*S(u)}let P=-c;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:h+P,y:m},{x:h,y:m}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:S(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/custom-toc-separator/assets/pieChart-qcxaoQkv-D3YMGvQS.js b/custom-toc-separator/assets/pieChart-qcxaoQkv-D3YMGvQS.js new file mode 100644 index 00000000..3eb6ced3 --- /dev/null +++ b/custom-toc-separator/assets/pieChart-qcxaoQkv-D3YMGvQS.js @@ -0,0 +1 @@ +import{k0 as Q}from"./story-DT1Ep1ux.js";import{B as Te,U as Le,A as je,u as Ie,n as M}from"./Tick-DUHqbpyB-RP-X2t6b.js";import{m as Ne,ap as Ce,V as Oe,at as v,am as Re,n as ae,ax as Me,aw as F,ay as pe,az as ye,ao as me,c as A,aA as H,aB as S,aC as ve,ai as Se,H as be,aD as Be,U as we,B as re,ar as Fe,s as He}from"./Theme-rblUnB2V-Cwu0Sicn.js";import{i as Ve}from"./ColorSet-DkIwOmgs-BsDJZ3_f.js";import{o as Ye}from"./DefaultTheme-Bt5OI-Ht-BJrIQ0SQ.js";import"./main-BTdHgocv.js";class te extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Se(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=S(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this.setRaw("x",void 0),this.setRaw("y",void 0),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*S(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*S(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Xe=Math.max,fe=Math.min,C=Math.sin,q=Math.sqrt,x=1e-12,K=Math.PI,ne=K/2,ze=2*K;function We(d){return d>1?0:d<-1?K:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function qe(d){return d.innerRadius}function Ee(d){return d.outerRadius}function Ue(d){return d.startAngle}function Ke(d){return d.endAngle}function $e(d){return d&&d.padAngle}function Ze(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,c=g*y-n*o;if(!(c*cD*D+X*X&&(j=V,I=Y),{cx:j,cy:I,x01:-n,y01:-g,x11:j*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=qe,t=Ee,e=M(0),i=null,s=Ue,r=Ke,l=$e,a=null,y=Ie(o);function o(){var n,g,c=+d.apply(this,arguments),h=+t.apply(this,arguments),m=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-m),b=f>m;if(a||(a=n=y()),hx)if(P>ze-x)a.moveTo(h*B(m),h*C(m)),a.arc(0,0,h,m,f,!b),c>x&&(a.moveTo(c*B(f),c*C(f)),a.arc(0,0,c,f,m,b));else{var u,p,R=m,T=f,w=m,L=f,j=P,I=P,V=l.apply(this,arguments)/2,Y=V>x&&(i?+i.apply(this,arguments):q(c*c+h*h)),N=fe(Ae(h-c)/2,+e.apply(this,arguments)),k=N,D=N;if(Y>x){var X=Pe(Y/c*C(V)),le=Pe(Y/h*C(V));(j-=2*X)>x?(w+=X*=b?1:-1,L-=X):(j=0,w=L=(m+f)/2),(I-=2*le)>x?(R+=le*=b?1:-1,T-=le):(I=0,R=T=(m+f)/2)}var z=h*B(R),W=h*C(R),$=c*B(L),Z=c*C(L);if(N>x){var O,G=h*B(T),J=h*C(T),oe=c*B(w),ue=c*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,h,D,b),p=ee(G,J,$,Z,h,D,b),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&j>x?k>x?(u=ee($,Z,G,J,c,-k,b),p=ee(z,W,oe,ue,c,-k,b),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=S(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Oe.classNames.concat([se.className])});class Je extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ve.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class E extends Te{_afterNew(){this._defaultThemes.push(Je.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([E.className])});class U extends Le{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeSlices())}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeLabels())}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeTicks())})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("fillPattern",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset();const e=this.get("patterns");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}if(t.get("fillPattern")==null){let e=this.get("patterns");e&&t.setRaw("fillPattern",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([U.className])});class _e extends E{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let h=l.value,m=Math.min(y,o);h=Math.max(m*h,m-Math.min(i,e))/m,n=Re(0,0,s,r,h),this.setPrivateRaw("irModifyer",h/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const c=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-c*(a.bottom+a.top)/2,dx:-c*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(h=>{h._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(h=>{h._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([_e.className])});class xe extends U{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:me(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:me(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>je._new(this._root,{themeTags:me(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const c=a.get("fill");o._setDefault("fill",c),o._setDefault("stroke",c);const h=a.get("fillPattern");o._setDefault("fillPattern",h)}let n=Se(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let c=r+g.get("radius",0),h=r*S(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:h}),c*=-1,c-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:h}),c+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",c),g.set("y",r*S(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=S(a),n=this.labelsContainer,g=n.get("paddingLeft",0),c=n.get("paddingRight",0);let h=0,m=0;h=i.x(),m=i.y();let f=[];if(h!=0||m!=0){if(i.get("textType")=="circular"){const b=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);h=b*H(u),m=b*S(u)}let P=-c;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:h+P,y:m},{x:h,y:m}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:S(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/custom-toc-separator/assets/plane-Dt8R0KeE-CP4TXD5k.js b/custom-toc-separator/assets/plane-Dt8R0KeE-CP4TXD5k.js new file mode 100644 index 00000000..9b7a8add --- /dev/null +++ b/custom-toc-separator/assets/plane-Dt8R0KeE-CP4TXD5k.js @@ -0,0 +1 @@ +import{cY as G,dg as N,ha as x,ae as H}from"./story-DT1Ep1ux.js";import{y as I,b as L,S as $,L as d,r as _,j as y,R as V,l as M,_ as p}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import{n as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as K}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{e as Y}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{o as k}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as z}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function X(t,r){return I(t,r)/L(t)}function _t(t,r){const e=I(t,r)/(L(t)*L(r));return-x(e)}function Mt(t,r,e){M(C,t),M(v,r);const c=I(C,v),i=x(c),n=$(C,C,v);return I(n,e)<0?2*Math.PI-i:i}const C=N(),v=N();let S=class E{constructor(r){this._create=r,this._items=new Array,this._itemsPtr=0}get(){return this._itemsPtr===0&&G(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const r=2*this._itemsPtr;this._items.length>r&&(this._items.length=r),this._itemsPtr=0}static createVec2f64(){return new E(k)}static createVec3f64(){return new E(N)}static createVec4f64(){return new E(z)}static createMat3f64(){return new E(J)}static createMat4f64(){return new E(K)}static createQuatf64(){return new E(Y)}get test(){}};const St=S.createVec2f64(),f=S.createVec3f64(),W=S.createVec4f64();S.createMat3f64();const mt=S.createMat4f64(),gt=S.createQuatf64();function Ot(t){const r=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],e=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],c=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(r,e,c))}function Dt(t,r){const e=Math.sqrt(r[0]*r[0]+r[4]*r[4]+r[8]*r[8]),c=Math.sqrt(r[1]*r[1]+r[5]*r[5]+r[9]*r[9]),i=Math.sqrt(r[2]*r[2]+r[6]*r[6]+r[10]*r[10]);return p(t,e,c,i),t}function Z(t,r,e){Math.abs(t[0])>Math.abs(t[1])?p(r,0,1,0):p(r,1,0,0),$(e,t,r),$(r,e,t),M(e,e),M(r,r)}function Q(t=O){return[t[0],t[1],t[2],t[3]]}function lt(t=O[0],r=O[1],e=O[2],c=O[3]){return B(t,r,e,c,W.get())}function tt(t,r){return B(r[0],r[1],r[2],r[3],t)}function Ct(t){return t}function B(t,r,e,c,i=Q()){return i[0]=t,i[1]=r,i[2]=e,i[3]=c,i}function rt(t,r,e){const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],i=Math.abs(c-1)>1e-5&&c>1e-12?1/Math.sqrt(c):1;return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=-(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]),e}function et(t,r,e,c=Q()){const i=e[0]-r[0],n=e[1]-r[1],a=e[2]-r[2],o=t[0]-r[0],D=t[1]-r[1],l=t[2]-r[2],m=n*l-a*D,F=a*o-i*l,b=i*D-n*o,w=m*m+F*F+b*b,q=Math.abs(w-1)>1e-5&&w>1e-12?1/Math.sqrt(w):1;return c[0]=m*q,c[1]=F*q,c[2]=b*q,c[3]=-(c[0]*t[0]+c[1]*t[1]+c[2]*t[2]),c}function ct(t,r,e,c=0,i=Math.floor(e*(1/3)),n=Math.floor(e*(2/3))){if(e<3)return!1;r(g,c);let a=i,o=!1;for(;a=0}function bt(t,r,e){const c=d(f.get(),t,-t[3]),i=ot(t,_(f.get(),r,c),f.get());return y(e,i,c),e}function wt(t,r,e,c){const i=t,n=f.get(),a=f.get();Z(i,n,a);const o=_(f.get(),e,r),D=X(n,o),l=X(a,o),m=X(i,o);return p(c,D,l,m)}function ot(t,r,e){const c=d(f.get(),t,I(t,r));return _(e,r,c),e}function qt(t,r){return Math.abs(j(t,r))}function j(t,r){return I(t,r)+t[3]}var s;function A(t){return t===s.INTERSECTS_INSIDE_OUT||t===s.INTERSECTS_OUTSIDE_IN}function R(t,r,e,c,i){const n=I(t,e),a=j(t,r);if(n===0)return a>=0?s.INSIDE:s.OUTSIDE;let o=-a/n;return c&u.CLAMP&&(o=H(o,0,1)),!(c&u.INFINITE_MIN)&&o<0||!(c&u.INFINITE_MAX)&&o>1?a>=0?s.INSIDE:s.OUTSIDE:(y(i,r,d(i,e,o)),a>=0?s.INTERSECTS_INSIDE_OUT:s.INTERSECTS_OUTSIDE_IN)}(function(t){t[t.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",t[t.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE"})(s||(s={}));const O=[0,0,1,0];var u;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(u||(u={}));const at=u.INFINITE_MIN|u.INFINITE_MAX,nt=u.INFINITE_MAX;export{Z as $,rt as B,bt as D,et as G,B as H,Dt as I,W as J,ct as K,pt as M,Ct as N,wt as O,qt as P,At as S,Ut as T,$t as _,lt as a,St as c,_t as e,f,Ft as g,Pt as h,gt as i,tt as j,X as l,Rt as m,mt as o,Mt as r,Ot as u,j as w,Q as y}; diff --git a/custom-toc-separator/assets/plane-Dt8R0KeE-DlxNxa6f.js b/custom-toc-separator/assets/plane-Dt8R0KeE-DlxNxa6f.js deleted file mode 100644 index 74828815..00000000 --- a/custom-toc-separator/assets/plane-Dt8R0KeE-DlxNxa6f.js +++ /dev/null @@ -1 +0,0 @@ -import{cY as G,dg as N,ha as x,ae as H}from"./story-OUarUCIt.js";import{y as I,b as L,S as $,L as d,r as _,j as y,R as V,l as M,_ as p}from"./vec32-D9GsKZ1t-iWg2zFa3.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import{n as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as K}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{e as Y}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{o as k}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as z}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function X(t,r){return I(t,r)/L(t)}function _t(t,r){const e=I(t,r)/(L(t)*L(r));return-x(e)}function Mt(t,r,e){M(C,t),M(v,r);const c=I(C,v),i=x(c),n=$(C,C,v);return I(n,e)<0?2*Math.PI-i:i}const C=N(),v=N();let S=class E{constructor(r){this._create=r,this._items=new Array,this._itemsPtr=0}get(){return this._itemsPtr===0&&G(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const r=2*this._itemsPtr;this._items.length>r&&(this._items.length=r),this._itemsPtr=0}static createVec2f64(){return new E(k)}static createVec3f64(){return new E(N)}static createVec4f64(){return new E(z)}static createMat3f64(){return new E(J)}static createMat4f64(){return new E(K)}static createQuatf64(){return new E(Y)}get test(){}};const St=S.createVec2f64(),f=S.createVec3f64(),W=S.createVec4f64();S.createMat3f64();const mt=S.createMat4f64(),gt=S.createQuatf64();function Ot(t){const r=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],e=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],c=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(r,e,c))}function Dt(t,r){const e=Math.sqrt(r[0]*r[0]+r[4]*r[4]+r[8]*r[8]),c=Math.sqrt(r[1]*r[1]+r[5]*r[5]+r[9]*r[9]),i=Math.sqrt(r[2]*r[2]+r[6]*r[6]+r[10]*r[10]);return p(t,e,c,i),t}function Z(t,r,e){Math.abs(t[0])>Math.abs(t[1])?p(r,0,1,0):p(r,1,0,0),$(e,t,r),$(r,e,t),M(e,e),M(r,r)}function Q(t=O){return[t[0],t[1],t[2],t[3]]}function lt(t=O[0],r=O[1],e=O[2],c=O[3]){return B(t,r,e,c,W.get())}function tt(t,r){return B(r[0],r[1],r[2],r[3],t)}function Ct(t){return t}function B(t,r,e,c,i=Q()){return i[0]=t,i[1]=r,i[2]=e,i[3]=c,i}function rt(t,r,e){const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],i=Math.abs(c-1)>1e-5&&c>1e-12?1/Math.sqrt(c):1;return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=-(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]),e}function et(t,r,e,c=Q()){const i=e[0]-r[0],n=e[1]-r[1],a=e[2]-r[2],o=t[0]-r[0],D=t[1]-r[1],l=t[2]-r[2],m=n*l-a*D,F=a*o-i*l,b=i*D-n*o,w=m*m+F*F+b*b,q=Math.abs(w-1)>1e-5&&w>1e-12?1/Math.sqrt(w):1;return c[0]=m*q,c[1]=F*q,c[2]=b*q,c[3]=-(c[0]*t[0]+c[1]*t[1]+c[2]*t[2]),c}function ct(t,r,e,c=0,i=Math.floor(e*(1/3)),n=Math.floor(e*(2/3))){if(e<3)return!1;r(g,c);let a=i,o=!1;for(;a=0}function bt(t,r,e){const c=d(f.get(),t,-t[3]),i=ot(t,_(f.get(),r,c),f.get());return y(e,i,c),e}function wt(t,r,e,c){const i=t,n=f.get(),a=f.get();Z(i,n,a);const o=_(f.get(),e,r),D=X(n,o),l=X(a,o),m=X(i,o);return p(c,D,l,m)}function ot(t,r,e){const c=d(f.get(),t,I(t,r));return _(e,r,c),e}function qt(t,r){return Math.abs(j(t,r))}function j(t,r){return I(t,r)+t[3]}var s;function A(t){return t===s.INTERSECTS_INSIDE_OUT||t===s.INTERSECTS_OUTSIDE_IN}function R(t,r,e,c,i){const n=I(t,e),a=j(t,r);if(n===0)return a>=0?s.INSIDE:s.OUTSIDE;let o=-a/n;return c&u.CLAMP&&(o=H(o,0,1)),!(c&u.INFINITE_MIN)&&o<0||!(c&u.INFINITE_MAX)&&o>1?a>=0?s.INSIDE:s.OUTSIDE:(y(i,r,d(i,e,o)),a>=0?s.INTERSECTS_INSIDE_OUT:s.INTERSECTS_OUTSIDE_IN)}(function(t){t[t.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",t[t.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE"})(s||(s={}));const O=[0,0,1,0];var u;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(u||(u={}));const at=u.INFINITE_MIN|u.INFINITE_MAX,nt=u.INFINITE_MAX;export{Z as $,rt as B,bt as D,et as G,B as H,Dt as I,W as J,ct as K,pt as M,Ct as N,wt as O,qt as P,At as S,Ut as T,$t as _,lt as a,St as c,_t as e,f,Ft as g,Pt as h,gt as i,tt as j,X as l,Rt as m,mt as o,Mt as r,Ot as u,j as w,Q as y}; diff --git a/custom-toc-separator/assets/popupUtils-B0uZcXX0-EZv1BfXi.js b/custom-toc-separator/assets/popupUtils-B0uZcXX0-EZv1BfXi.js deleted file mode 100644 index 2464e573..00000000 --- a/custom-toc-separator/assets/popupUtils-B0uZcXX0-EZv1BfXi.js +++ /dev/null @@ -1 +0,0 @@ -import{bL as u,ej as f,ek as m,el as p,em as o,en as b,eo as g,ep as F,eq as w}from"./story-OUarUCIt.js";function D({displayField:e,editFieldsInfo:i,fields:t,objectIdField:s,title:l},n){if(!t)return null;const a=h({editFieldsInfo:i,fields:t,objectIdField:s},n);if(!a.length)return null;const r=N({titleBase:l,fields:t,displayField:e}),c=C();return new u({title:r,content:c,fieldInfos:a})}function T(e){const{title:i,graphic:t}=e??{},{attributes:s,sourceLayer:l}=t??{},n=l&&"displayField"in l?l.displayField:null,a=n?s?.[n]:null,r=t?.getObjectId()?.toString();return i||a||r||""}const y=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):w(e,i);function L({fields:e,ignoreFieldTypes:i,sortDisabled:t}){const s=e;return i&&(e=e.filter(l=>!i.includes(l.type))),e===s&&(e=e.slice()),t!==!0&&e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:d(e)?-1:d(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function h(e,i){const t=i?.visibleFieldNames;return L({fields:e.fields??[],ignoreFieldTypes:i?.ignoreFieldTypes||S,sortDisabled:i?.sortDisabled}).map(s=>new f({fieldName:s.name,isEditable:m(s,e),label:s.alias,format:v(s),visible:y(s,{...e,visibleFieldNames:t})}))}function v(e){switch(e.type){case"small-integer":case"integer":case"single":return new o({digitSeparator:!0,places:0});case"double":return new o({digitSeparator:!0,places:2});case"string":return p(e.name)?new o({digitSeparator:!0,places:0}):void 0;default:return}}function C(){return[new b,new g]}function N(e){const i=F(e),{titleBase:t}=e;return i?`${t}: {${i.trim()}}`:t??""}function d(e){return(e.name&&e.name.toLowerCase())==="name"?!0:e.alias?.toLowerCase()==="name"}const S=["geometry","blob","raster","guid","xml"];export{T as L,D as w}; diff --git a/custom-toc-separator/assets/popupUtils-B0uZcXX0-mkpGjfro.js b/custom-toc-separator/assets/popupUtils-B0uZcXX0-mkpGjfro.js new file mode 100644 index 00000000..c4d7e218 --- /dev/null +++ b/custom-toc-separator/assets/popupUtils-B0uZcXX0-mkpGjfro.js @@ -0,0 +1 @@ +import{bL as u,ej as f,ek as m,el as p,em as o,en as b,eo as g,ep as F,eq as w}from"./story-DT1Ep1ux.js";function D({displayField:e,editFieldsInfo:i,fields:t,objectIdField:s,title:l},n){if(!t)return null;const a=h({editFieldsInfo:i,fields:t,objectIdField:s},n);if(!a.length)return null;const r=N({titleBase:l,fields:t,displayField:e}),c=C();return new u({title:r,content:c,fieldInfos:a})}function T(e){const{title:i,graphic:t}=e??{},{attributes:s,sourceLayer:l}=t??{},n=l&&"displayField"in l?l.displayField:null,a=n?s?.[n]:null,r=t?.getObjectId()?.toString();return i||a||r||""}const y=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):w(e,i);function L({fields:e,ignoreFieldTypes:i,sortDisabled:t}){const s=e;return i&&(e=e.filter(l=>!i.includes(l.type))),e===s&&(e=e.slice()),t!==!0&&e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:d(e)?-1:d(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function h(e,i){const t=i?.visibleFieldNames;return L({fields:e.fields??[],ignoreFieldTypes:i?.ignoreFieldTypes||S,sortDisabled:i?.sortDisabled}).map(s=>new f({fieldName:s.name,isEditable:m(s,e),label:s.alias,format:v(s),visible:y(s,{...e,visibleFieldNames:t})}))}function v(e){switch(e.type){case"small-integer":case"integer":case"single":return new o({digitSeparator:!0,places:0});case"double":return new o({digitSeparator:!0,places:2});case"string":return p(e.name)?new o({digitSeparator:!0,places:0}):void 0;default:return}}function C(){return[new b,new g]}function N(e){const i=F(e),{titleBase:t}=e;return i?`${t}: {${i.trim()}}`:t??""}function d(e){return(e.name&&e.name.toLowerCase())==="name"?!0:e.alias?.toLowerCase()==="name"}const S=["geometry","blob","raster","guid","xml"];export{T as L,D as w}; diff --git a/custom-toc-separator/assets/popupUtils-nV1O8RUO-911d_F5-.js b/custom-toc-separator/assets/popupUtils-nV1O8RUO-911d_F5-.js deleted file mode 100644 index d817fe5f..00000000 --- a/custom-toc-separator/assets/popupUtils-nV1O8RUO-911d_F5-.js +++ /dev/null @@ -1 +0,0 @@ -import{j1 as r,ed as c}from"./story-OUarUCIt.js";async function m(e,d=e.popupTemplate){if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:i}=d,{objectIdField:p,typeIdField:n,globalIdField:u,relationships:a}=e;if(s.includes("*"))return["*"];const o=i?r(e):[],l=c(e.fieldsIndex,[...s,...o]);return n&&l.push(n),l&&p&&e.fieldsIndex?.has(p)&&!l.includes(p)&&l.push(p),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a&&a.forEach(f=>{const{keyField:t}=f;l&&t&&e.fieldsIndex?.has(t)&&!l.includes(t)&&l.push(t)}),l}function I(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{m as h,I as m}; diff --git a/custom-toc-separator/assets/popupUtils-nV1O8RUO-BOsTLw9-.js b/custom-toc-separator/assets/popupUtils-nV1O8RUO-BOsTLw9-.js new file mode 100644 index 00000000..5a8c2d85 --- /dev/null +++ b/custom-toc-separator/assets/popupUtils-nV1O8RUO-BOsTLw9-.js @@ -0,0 +1 @@ +import{j1 as r,ed as c}from"./story-DT1Ep1ux.js";async function m(e,d=e.popupTemplate){if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:i}=d,{objectIdField:p,typeIdField:n,globalIdField:u,relationships:a}=e;if(s.includes("*"))return["*"];const o=i?r(e):[],l=c(e.fieldsIndex,[...s,...o]);return n&&l.push(n),l&&p&&e.fieldsIndex?.has(p)&&!l.includes(p)&&l.push(p),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a&&a.forEach(f=>{const{keyField:t}=f;l&&t&&e.fieldsIndex?.has(t)&&!l.includes(t)&&l.push(t)}),l}function I(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{m as h,I as m}; diff --git a/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-Br9_-LS_.js b/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-Br9_-LS_.js new file mode 100644 index 00000000..871f1de9 --- /dev/null +++ b/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-Br9_-LS_.js @@ -0,0 +1 @@ +import{N as u,K as l}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{d6 as E,J as f}from"./story-DT1Ep1ux.js";async function d(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return E(e);const n=f.WGS84;return await u(t,n),l(e,n)}function p(e,t){if(!c(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function c(e,t){return!!e.typeKeywords?.includes(t)}function L(e){return c(e,y.HOSTED_SERVICE)}function A(e,t){const n=e.typeKeywords;if(n){const r=n.indexOf(t);r>-1&&n.splice(r,1)}}function m(e,t,n){n?p(e,t):A(e,t)}async function R(e){const t=e.clone().normalize();let n;if(t.length>1)for(const r of t)n?r.width>n.width&&(n=r):n=r;else n=t[0];return d(n)}const y={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer"};function M(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let o=!i||i.includes("features:user:edit"),s=!!n&&!!i?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?s=o=!0:s&&(o=!0),{features:{edit:o,fullEdit:s},content:{updateItem:a}}}export{y as E,L as I,m as L,R as S,A as l,M as m,c as o,p as u}; diff --git a/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-DkJqoRnI.js b/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-DkJqoRnI.js deleted file mode 100644 index 0fcbd188..00000000 --- a/custom-toc-separator/assets/portalItemUtils-B8bw6SAG-DkJqoRnI.js +++ /dev/null @@ -1 +0,0 @@ -import{N as u,K as l}from"./projection-BA9M1R7d-Cytmrlsd.js";import{d6 as E,J as f}from"./story-OUarUCIt.js";async function d(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return E(e);const n=f.WGS84;return await u(t,n),l(e,n)}function p(e,t){if(!c(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function c(e,t){return!!e.typeKeywords?.includes(t)}function L(e){return c(e,y.HOSTED_SERVICE)}function A(e,t){const n=e.typeKeywords;if(n){const r=n.indexOf(t);r>-1&&n.splice(r,1)}}function m(e,t,n){n?p(e,t):A(e,t)}async function R(e){const t=e.clone().normalize();let n;if(t.length>1)for(const r of t)n?r.width>n.width&&(n=r):n=r;else n=t[0];return d(n)}const y={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer"};function M(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let o=!i||i.includes("features:user:edit"),s=!!n&&!!i?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?s=o=!0:s&&(o=!0),{features:{edit:o,fullEdit:s},content:{updateItem:a}}}export{y as E,L as I,m as L,R as S,A as l,M as m,c as o,p as u}; diff --git a/custom-toc-separator/assets/portalLayers-Bh9bAhk4-DRZYQiud.js b/custom-toc-separator/assets/portalLayers-Bh9bAhk4-DRZYQiud.js deleted file mode 100644 index 2a17a3b8..00000000 --- a/custom-toc-separator/assets/portalLayers-Bh9bAhk4-DRZYQiud.js +++ /dev/null @@ -1 +0,0 @@ -import{o as b,gG as f}from"./story-OUarUCIt.js";import{b as S}from"./associatedFeatureServiceUtils-Bu76-Sxs-x2LVHZf-.js";import{p as I,g as h,o as v}from"./fetchService-DbaKmJhP-DoSq_UWg.js";import w from"./PortalItem-CctGdnxF-DgukgleB.js";import{o as p}from"./portalItemUtils-B8bw6SAG-DkJqoRnI.js";import"./main-lj2zzr_L.js";import"./arcgisLayerUrl-HNYh8jvG-DDFS2Vkh.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";class M{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function l(e){const t={id:e.id,name:e.name},a=h(e.type);return a!=="FeatureLayer"&&(t.layerType=a),t}async function P(e,t,a){if(e?.layers==null||e?.tables==null){const r=await a.fetchServiceMetadata(t,{customParameters:o(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(l),e.tables=e.tables||r?.tables?.map(l)}return e}function o(e){if(!e)return null;const{layers:t,tables:a}=e;return t?.length?t[0]:a?.length?a[0]:null}function T(e,t){return t==null?null:[...e.layers||[],...e.tables||[]].find(a=>a.id===t)}function ue(e,t){return[...e.layers||[],...e.tables||[]].filter(({layerType:a})=>a?a===t:t==="ArcGISFeatureLayer")}function L(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function ie(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function G(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function C(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=n.layers?.map(l)}const{serverUrl:r,portalItem:s}=await S(e.url,{sceneLayerItem:e,customParameters:o(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData().catch(()=>null);if(n?.tables)t.tables=n.tables.map(l);else{const c=await a.fetchServiceMetadata(r,{customParameters:o(n)?.customParameters}).catch(()=>null);t.tables=c?.tables?.map(l)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function F(e){let{portalItem:t}=e;!t||t instanceof w||(t=new w(t));const a=await D(t);return new a.constructor({portalItem:t,...a.properties})}async function D(e){await e.load();const t=new M;return $(await g(e,t))}async function g(e,t){switch(e.type){case"3DTiles Service":return x();case"CSV":return A();case"Feature Collection":return K(e);case"Feature Service":return j(e,t);case"Feed":return q();case"GeoJson":return k();case"Group Layer":return B();case"Image Service":return V(e,t);case"KML":return U();case"Knowledge Graph Layer":return E();case"Map Service":return O(e,t);case"Media Layer":return H();case"Scene Service":return _(e,t);case"Stream Service":return W();case"Vector Tile Service":return J();case"WFS":return R();case"WMS":return z();case"WMTS":return Z();default:throw new b("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function $(e){const t=e.className,a=I[t];return{constructor:await a(),properties:e.properties}}async function O(e,t){return await Q(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function j(e,t){const a=await N(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,n={sourceJSON:r};return a.id!=null&&(n.layerId=a.id),{className:s||"FeatureLayer",properties:n}}return{className:"GroupLayer"}}async function _(e,t){const a=await N(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:r}=await S(e.url,{sceneLayerItem:e});return(await t.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof a=="object"){const r={};let s;if(a.id!=null?(r.layerId=a.id,s=`${e.url}/layers/${a.id}`):s=e.url,e.typeKeywords?.length){for(const c of Object.keys(f))if(e.typeKeywords.includes(c))return{className:f[c]}}const n=await t.fetchServiceMetadata(s,{customParameters:await t.fetchCustomParameters(e,c=>o(c)?.customParameters)});return{className:f[n?.layerType]||"SceneLayer",properties:r}}return a===!1&&(await t.fetchServiceMetadata(e.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function K(e){await e.load();const t=p(e,"Map Notes"),a=p(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(p(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return L(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function V(e,t){await e.load();const a=e.typeKeywords?.map(m=>m.toLowerCase())??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r?.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const n=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),y=n.capabilities?.toLowerCase().includes("tilesonly"),u=n.tileInfo?.format?.toLowerCase()??"",i=c==null&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(u);return c==="map"||i||y?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function W(){return{className:"StreamLayer"}}function J(){return{className:"VectorTileLayer"}}function k(){return{className:"GeoJSONLayer"}}function x(){return{className:"IntegratedMesh3DTilesLayer"}}function A(){return{className:"CSVLayer"}}function U(){return{className:"KMLLayer"}}function E(){return{className:"KnowledgeGraphLayer"}}function R(){return{className:"WFSLayer"}}function z(){return{className:"WMSLayer"}}function Z(){return{className:"WMTSLayer"}}function q(){return{className:"StreamLayer"}}function B(){return{className:"GroupLayer"}}function H(){return{className:"MediaLayer"}}async function Q(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function N(e,t,a){const{url:r,type:s}=e,n=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(n){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,i=>o(i)?.customParameters)});return{id:u.id,className:h(u.type),sourceJSON:u}}return{}}await e.load();let c=await t.fetchItemData(e);if(n){const u=await P(c,r,t),i=d(u);if(typeof i=="object"){const m=T(u,i.id);i.className=G(m?.layerType)}return i}if(s==="Scene Service"&&(c=await C(e,c,t)),L(c)>0)return d(c);const y=await t.fetchServiceMetadata(r);return a&&(y.tables=await a()),d(y)}function d(e){return L(e)===1&&{id:o(e)?.id}}Object.freeze(Object.defineProperty({__proto__:null,fromItem:F,selectLayerClassPath:g},Symbol.toStringTag,{value:"Module"}));export{g as L,P as a,ie as c,M as e,G as i,o as l,ue as n,C as o,l as t,L as u}; diff --git a/custom-toc-separator/assets/portalLayers-Bh9bAhk4-iIxSwWC_.js b/custom-toc-separator/assets/portalLayers-Bh9bAhk4-iIxSwWC_.js new file mode 100644 index 00000000..217ce093 --- /dev/null +++ b/custom-toc-separator/assets/portalLayers-Bh9bAhk4-iIxSwWC_.js @@ -0,0 +1 @@ +import{o as b,gG as f}from"./story-DT1Ep1ux.js";import{b as S}from"./associatedFeatureServiceUtils-Bu76-Sxs-Loz2AEbg.js";import{p as I,g as h,o as v}from"./fetchService-DbaKmJhP-DL4bBdhv.js";import w from"./PortalItem-CctGdnxF-C39Ug2k8.js";import{o as p}from"./portalItemUtils-B8bw6SAG-Br9_-LS_.js";import"./main-BTdHgocv.js";import"./arcgisLayerUrl-HNYh8jvG-AfUT31Ae.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";class M{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function l(e){const t={id:e.id,name:e.name},a=h(e.type);return a!=="FeatureLayer"&&(t.layerType=a),t}async function P(e,t,a){if(e?.layers==null||e?.tables==null){const r=await a.fetchServiceMetadata(t,{customParameters:o(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(l),e.tables=e.tables||r?.tables?.map(l)}return e}function o(e){if(!e)return null;const{layers:t,tables:a}=e;return t?.length?t[0]:a?.length?a[0]:null}function T(e,t){return t==null?null:[...e.layers||[],...e.tables||[]].find(a=>a.id===t)}function ue(e,t){return[...e.layers||[],...e.tables||[]].filter(({layerType:a})=>a?a===t:t==="ArcGISFeatureLayer")}function L(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function ie(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function G(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function C(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=n.layers?.map(l)}const{serverUrl:r,portalItem:s}=await S(e.url,{sceneLayerItem:e,customParameters:o(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData().catch(()=>null);if(n?.tables)t.tables=n.tables.map(l);else{const c=await a.fetchServiceMetadata(r,{customParameters:o(n)?.customParameters}).catch(()=>null);t.tables=c?.tables?.map(l)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function F(e){let{portalItem:t}=e;!t||t instanceof w||(t=new w(t));const a=await D(t);return new a.constructor({portalItem:t,...a.properties})}async function D(e){await e.load();const t=new M;return $(await g(e,t))}async function g(e,t){switch(e.type){case"3DTiles Service":return x();case"CSV":return A();case"Feature Collection":return K(e);case"Feature Service":return j(e,t);case"Feed":return q();case"GeoJson":return k();case"Group Layer":return B();case"Image Service":return V(e,t);case"KML":return U();case"Knowledge Graph Layer":return E();case"Map Service":return O(e,t);case"Media Layer":return H();case"Scene Service":return _(e,t);case"Stream Service":return W();case"Vector Tile Service":return J();case"WFS":return R();case"WMS":return z();case"WMTS":return Z();default:throw new b("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function $(e){const t=e.className,a=I[t];return{constructor:await a(),properties:e.properties}}async function O(e,t){return await Q(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function j(e,t){const a=await N(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,n={sourceJSON:r};return a.id!=null&&(n.layerId=a.id),{className:s||"FeatureLayer",properties:n}}return{className:"GroupLayer"}}async function _(e,t){const a=await N(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:r}=await S(e.url,{sceneLayerItem:e});return(await t.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof a=="object"){const r={};let s;if(a.id!=null?(r.layerId=a.id,s=`${e.url}/layers/${a.id}`):s=e.url,e.typeKeywords?.length){for(const c of Object.keys(f))if(e.typeKeywords.includes(c))return{className:f[c]}}const n=await t.fetchServiceMetadata(s,{customParameters:await t.fetchCustomParameters(e,c=>o(c)?.customParameters)});return{className:f[n?.layerType]||"SceneLayer",properties:r}}return a===!1&&(await t.fetchServiceMetadata(e.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function K(e){await e.load();const t=p(e,"Map Notes"),a=p(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(p(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return L(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function V(e,t){await e.load();const a=e.typeKeywords?.map(m=>m.toLowerCase())??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r?.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const n=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),y=n.capabilities?.toLowerCase().includes("tilesonly"),u=n.tileInfo?.format?.toLowerCase()??"",i=c==null&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(u);return c==="map"||i||y?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function W(){return{className:"StreamLayer"}}function J(){return{className:"VectorTileLayer"}}function k(){return{className:"GeoJSONLayer"}}function x(){return{className:"IntegratedMesh3DTilesLayer"}}function A(){return{className:"CSVLayer"}}function U(){return{className:"KMLLayer"}}function E(){return{className:"KnowledgeGraphLayer"}}function R(){return{className:"WFSLayer"}}function z(){return{className:"WMSLayer"}}function Z(){return{className:"WMTSLayer"}}function q(){return{className:"StreamLayer"}}function B(){return{className:"GroupLayer"}}function H(){return{className:"MediaLayer"}}async function Q(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function N(e,t,a){const{url:r,type:s}=e,n=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(n){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,i=>o(i)?.customParameters)});return{id:u.id,className:h(u.type),sourceJSON:u}}return{}}await e.load();let c=await t.fetchItemData(e);if(n){const u=await P(c,r,t),i=d(u);if(typeof i=="object"){const m=T(u,i.id);i.className=G(m?.layerType)}return i}if(s==="Scene Service"&&(c=await C(e,c,t)),L(c)>0)return d(c);const y=await t.fetchServiceMetadata(r);return a&&(y.tables=await a()),d(y)}function d(e){return L(e)===1&&{id:o(e)?.id}}Object.freeze(Object.defineProperty({__proto__:null,fromItem:F,selectLayerClassPath:g},Symbol.toStringTag,{value:"Module"}));export{g as L,P as a,ie as c,M as e,G as i,o as l,ue as n,C as o,l as t,L as u}; diff --git a/custom-toc-separator/assets/portalUtils-CKN9iXwH-BVEO1U-S.js b/custom-toc-separator/assets/portalUtils-CKN9iXwH-BVEO1U-S.js deleted file mode 100644 index a5b0bc81..00000000 --- a/custom-toc-separator/assets/portalUtils-CKN9iXwH-BVEO1U-S.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u}from"./story-OUarUCIt.js";function f(r,n){return r===null?n:new u({url:r.field("url")})}export{f as n}; diff --git a/custom-toc-separator/assets/portalUtils-CKN9iXwH-CegMKdRo.js b/custom-toc-separator/assets/portalUtils-CKN9iXwH-CegMKdRo.js new file mode 100644 index 00000000..9f190ed4 --- /dev/null +++ b/custom-toc-separator/assets/portalUtils-CKN9iXwH-CegMKdRo.js @@ -0,0 +1 @@ +import{r as u}from"./story-DT1Ep1ux.js";function f(r,n){return r===null?n:new u({url:r.field("url")})}export{f as n}; diff --git a/custom-toc-separator/assets/project-DQKhruav-BOvaUqEJ.js b/custom-toc-separator/assets/project-DQKhruav-BOvaUqEJ.js deleted file mode 100644 index acf796c7..00000000 --- a/custom-toc-separator/assets/project-DQKhruav-BOvaUqEJ.js +++ /dev/null @@ -1 +0,0 @@ -import{v as s,S as i,i as l,bG as d,e as S,bM as n,bK as f,f as y}from"./story-OUarUCIt.js";import{y as g,a as R}from"./utils-9sQxfkoa-Djr5L7DU.js";import{f as w}from"./utils-Bq23Xwmj-CIl5z47y.js";let e=class extends S{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const O=e,j=d(O);async function N(o,t,r){t=j(t);const a=g(o),m={...a.query,f:"json",...t.toJSON()},p=t.outSpatialReference,u=f(t.geometries[0]),c=R(m,r);return y(a.path+"/project",c).then(({data:{geometries:h}})=>w(h,u,p))}export{O as f,N as j}; diff --git a/custom-toc-separator/assets/project-DQKhruav-C6Tnpe-k.js b/custom-toc-separator/assets/project-DQKhruav-C6Tnpe-k.js new file mode 100644 index 00000000..f29a5bb8 --- /dev/null +++ b/custom-toc-separator/assets/project-DQKhruav-C6Tnpe-k.js @@ -0,0 +1 @@ +import{v as s,S as i,i as l,bG as d,e as S,bM as n,bK as f,f as y}from"./story-DT1Ep1ux.js";import{y as g,a as R}from"./utils-9sQxfkoa-CwJW9dca.js";import{f as w}from"./utils-Bq23Xwmj-Csxw19qV.js";let e=class extends S{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const O=e,j=d(O);async function N(o,t,r){t=j(t);const a=g(o),m={...a.query,f:"json",...t.toJSON()},p=t.outSpatialReference,u=f(t.geometries[0]),c=R(m,r);return y(a.path+"/project",c).then(({data:{geometries:h}})=>w(h,u,p))}export{O as f,N as j}; diff --git a/custom-toc-separator/assets/projectBuffer-CvCBvJ6W-CMjj6oJy.js b/custom-toc-separator/assets/projectBuffer-CvCBvJ6W-CMjj6oJy.js new file mode 100644 index 00000000..c1febc8b --- /dev/null +++ b/custom-toc-separator/assets/projectBuffer-CvCBvJ6W-CMjj6oJy.js @@ -0,0 +1 @@ +import{dk as O,dl as m,dm as K,B as R0,ae as u0,bj as l0,dn as C0,aC as f0,p as _0,db as A0,dc as P0,dd as S0,dp as O0,dq as s0,dr as M0,ds as N0,dt as i0,du as r0,dv as c0}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";const x0=Math.PI/180,v0=/(?:SPHEROID|ELLIPSOID)\[([^\]]+)]/i,N=O.radius,S=O.eccentricitySquared,L0={a1:N*S,a2:N*S*N*S,a3:N*S*S/2,a4:N*S*N*S*2.5,a5:N*S+N*S*S/2,a6:1-S},D0={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:O.radius,f:O.flattening},4490:{a:6378137,f:1/298.257222101},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:m.radius,f:m.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:K.radius,f:K.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:K.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};var a;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",e[e.WGS84=2]="WGS84",e[e.WEB_MERCATOR=3]="WEB_MERCATOR",e[e.WGS84_ECEF=4]="WGS84_ECEF",e[e.CGCS2000=5]="CGCS2000",e[e.SPHERICAL_MARS_PCPF=6]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=7]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=8]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=9]="GCSMOON2000",e[e.LON_LAT=10]="LON_LAT",e[e.PLATE_CARREE=11]="PLATE_CARREE"})(a||(a={}));const o0={[a.WGS84]:{[a.CGCS2000]:l,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.CGCS2000]:{[a.CGCS2000]:l,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.GCSMARS2000]:{[a.CGCS2000]:null,[a.GCSMARS2000]:l,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:Z,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.GCSMOON2000]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:l,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:Y,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.WEB_MERCATOR]:{[a.CGCS2000]:B,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:B,[a.SPHERICAL_ECEF]:I0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:l,[a.PLATE_CARREE]:d0,[a.WGS84]:B,[a.WGS84_ECEF]:W0},[a.WGS84_ECEF]:{[a.CGCS2000]:T,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:T,[a.SPHERICAL_ECEF]:q0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:m0,[a.PLATE_CARREE]:H0,[a.WGS84]:T,[a.WGS84_ECEF]:l},[a.SPHERICAL_ECEF]:{[a.CGCS2000]:d,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:d,[a.SPHERICAL_ECEF]:l,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:K0,[a.PLATE_CARREE]:T0,[a.WGS84]:d,[a.WGS84_ECEF]:B0},[a.SPHERICAL_MARS_PCPF]:{[a.CGCS2000]:null,[a.GCSMARS2000]:a0,[a.GCSMOON2000]:null,[a.LON_LAT]:a0,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:l,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.SPHERICAL_MOON_PCPF]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:$,[a.LON_LAT]:$,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:l,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.UNKNOWN]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:null,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:l,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.LON_LAT]:{[a.CGCS2000]:l,[a.GCSMARS2000]:l,[a.GCSMOON2000]:l,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:Z,[a.SPHERICAL_MOON_PCPF]:Y,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.PLATE_CARREE]:{[a.CGCS2000]:F,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:F,[a.SPHERICAL_ECEF]:p0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:h0,[a.PLATE_CARREE]:l,[a.WGS84]:F,[a.WGS84_ECEF]:U0}};function G0(e,t,n=E0()){return e==null||t==null?null:k0(e,t,n).projector}function X(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=_0(e,1)),A0(e)?t.spatialReferenceId=a.SPHERICAL_ECEF:P0(e)?t.spatialReferenceId=a.WGS84:S0(e)?t.spatialReferenceId=a.WEB_MERCATOR:O0(e)?t.spatialReferenceId=a.PLATE_CARREE:e.wkt===s0.wkt?t.spatialReferenceId=a.WGS84_ECEF:e.wkid===M0.CGCS2000?t.spatialReferenceId=a.CGCS2000:e.wkt===N0.wkt?t.spatialReferenceId=a.SPHERICAL_MARS_PCPF:e.wkt===i0.wkt?t.spatialReferenceId=a.SPHERICAL_MOON_PCPF:r0(e)?t.spatialReferenceId=a.GCSMARS2000:c0(e)?t.spatialReferenceId=a.GCSMOON2000:t.spatialReferenceId=a.UNKNOWN):a.UNKNOWN}function l(e,t,n,E){e!==n&&(n[E++]=e[t++],n[E++]=e[t++],n[E]=e[t])}function B(e,t,n,E){n[E]=h*(e[t]/c),n[E+1]=h*(t0-2*Math.atan(Math.exp(-e[t+1]/c))),n[E+2]=e[t+2]}function I0(e,t,n,E){const u=e[t]/c,C=t0-2*Math.atan(Math.exp(-e[t+1]/c)),f=c+e[t+2],R=Math.cos(C)*f;n[E]=Math.cos(u)*R,n[E+1]=Math.sin(u)*R,n[E+2]=Math.sin(C)*f}function W0(e,t,n,E){B(e,t,n,E),H(n,E,n,E)}function F0(e,t,n,E,u){const C=.4999999*k,f=u0(p*e[t+1],-C,C),R=Math.sin(f);n[E++]=p*e[t]*u.radius,n[E++]=u.halfSemiMajorAxis*Math.log((1+R)/(1-R)),n[E]=e[t+2]}function I(e,t,n,E){F0(e,t,n,E,O)}function W(e,t,n,E){n[E]=e[t]*e0,n[E+1]=e[t+1]*e0,n[E+2]=e[t+2]}function F(e,t,n,E){n[E]=e[t]*n0,n[E+1]=e[t+1]*n0,n[E+2]=e[t+2]}function d0(e,t,n,E){B(e,t,n,E),W(n,E,n,E)}function H0(e,t,n,E){T(e,t,n,E),W(n,E,n,E)}function T0(e,t,n,E){d(e,t,n,E),W(n,E,n,E)}function p0(e,t,n,E){F(e,t,n,E),j(n,E,n,E)}function h0(e,t,n,E){F(e,t,n,E),I(n,E,n,E)}function U0(e,t,n,E){F(e,t,n,E),H(n,E,n,E)}function z(e,t,n,E,u){const C=u+e[t+2],f=p*e[t+1],R=p*e[t],_=Math.cos(f)*C;n[E]=Math.cos(R)*_,n[E+1]=Math.sin(R)*_,n[E+2]=Math.sin(f)*C}function Y(e,t,n,E){z(e,t,n,E,m.radius)}function Z(e,t,n,E){z(e,t,n,E,K.radius)}function j(e,t,n,E){z(e,t,n,E,O.radius)}function V(e,t,n,E,u){const C=e[t],f=e[t+1],R=e[t+2],_=Math.sqrt(C*C+f*f+R*R),P=C0(R/(_===0?1:_)),A=Math.atan2(f,C);n[E++]=h*A,n[E++]=h*P,n[E]=_-u}function $(e,t,n,E){V(e,t,n,E,m.radius)}function a0(e,t,n,E){V(e,t,n,E,K.radius)}function d(e,t,n,E){V(e,t,n,E,O.radius)}function K0(e,t,n,E){d(e,t,n,E),I(n,E,n,E)}function B0(e,t,n,E){d(e,t,n,E),H(n,E,n,E)}function j0(e,t,n,E,u){const C=p*e[t],f=p*e[t+1],R=e[t+2],_=Math.sin(f),P=Math.cos(f),A=u.radius/Math.sqrt(1-u.eccentricitySquared*_*_);n[E++]=(A+R)*P*Math.cos(C),n[E++]=(A+R)*P*Math.sin(C),n[E++]=(A*(1-u.eccentricitySquared)+R)*_}function H(e,t,n,E){j0(e,t,n,E,O)}function T(e,t,n,E){const u=L0,C=e[t],f=e[t+1],R=e[t+2];let _,P,A,i,r,w,q,s,M,U,y,b,g,L,o,x,v,D,G,J,Q;_=Math.abs(R),P=C*C+f*f,A=Math.sqrt(P),i=P+R*R,r=Math.sqrt(i),J=Math.atan2(f,C),w=R*R/i,q=P/i,L=u.a2/r,o=u.a3-u.a4/r,q>.3?(s=_/r*(1+q*(u.a1+L+w*o)/r),G=Math.asin(s),U=s*s,M=Math.sqrt(1-U)):(M=A/r*(1-w*(u.a5-L-q*o)/r),G=Math.acos(M),U=1-M*M,s=Math.sqrt(U)),y=1-O.eccentricitySquared*U,b=O.radius/Math.sqrt(y),g=u.a6*b,L=A-b*M,o=_-g*s,v=M*L+s*o,x=M*o-s*L,D=x/(g/y+v),G+=D,Q=v+x*D/2,R<0&&(G=-G),n[E++]=h*J,n[E++]=h*G,n[E]=Q}function q0(e,t,n,E){T(e,t,n,E),j(n,E,n,E)}function m0(e,t,n,E){T(e,t,n,E),I(n,E,n,E)}function k0(e,t,n){if(e==null||t==null||n.source.spatialReference===e&&n.dest.spatialReference===t)return n;const E=X(e,n.source),u=X(t,n.dest);return E===a.UNKNOWN&&u===a.UNKNOWN?f0(e,t)?n.projector=l:n.projector=null:n.projector=o0[E][u],n}function E0(){return{source:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},projector:l}}const z0={spatialReference:null,spatialReferenceId:a.UNKNOWN},V0={spatialReference:null,spatialReferenceId:a.UNKNOWN},w0=E0(),p=l0(1),h=R0(1),k=Math.PI,t0=.5*k,c=O.radius,e0=c*k/180,n0=180/(c*k);function y0(e,t,n,E,u,C,f=Math.floor(e.length/3)){const R=G0(t,u,w0);if(R==null)return!1;if(R===l){if(e===E&&n===C)return!0;const P=n+3*f;for(let A=n,i=C;A.3?(s=_/r*(1+q*(u.a1+L+w*o)/r),G=Math.asin(s),U=s*s,M=Math.sqrt(1-U)):(M=A/r*(1-w*(u.a5-L-q*o)/r),G=Math.acos(M),U=1-M*M,s=Math.sqrt(U)),y=1-O.eccentricitySquared*U,b=O.radius/Math.sqrt(y),g=u.a6*b,L=A-b*M,o=_-g*s,v=M*L+s*o,x=M*o-s*L,D=x/(g/y+v),G+=D,Q=v+x*D/2,R<0&&(G=-G),n[E++]=h*J,n[E++]=h*G,n[E]=Q}function q0(e,t,n,E){T(e,t,n,E),j(n,E,n,E)}function m0(e,t,n,E){T(e,t,n,E),I(n,E,n,E)}function k0(e,t,n){if(e==null||t==null||n.source.spatialReference===e&&n.dest.spatialReference===t)return n;const E=X(e,n.source),u=X(t,n.dest);return E===a.UNKNOWN&&u===a.UNKNOWN?f0(e,t)?n.projector=l:n.projector=null:n.projector=o0[E][u],n}function E0(){return{source:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},projector:l}}const z0={spatialReference:null,spatialReferenceId:a.UNKNOWN},V0={spatialReference:null,spatialReferenceId:a.UNKNOWN},w0=E0(),p=l0(1),h=R0(1),k=Math.PI,t0=.5*k,c=O.radius,e0=c*k/180,n0=180/(c*k);function y0(e,t,n,E,u,C,f=Math.floor(e.length/3)){const R=G0(t,u,w0);if(R==null)return!1;if(R===l){if(e===E&&n===C)return!0;const P=n+3*f;for(let A=n,i=C;Ai.map(i=>d[i]); -import{_ as C}from"./main-lj2zzr_L.js";import{cV as U,d9 as ln,$ as an,da as un,db as V,J as A,aC as x,aY as m,o as cn,dc as K,dd as B,de as $,c_ as N,w as fn,n as hn,l as pn,m as dn,G as mn,df as g,dg as Y,dh as q,cU as gn,b1 as wn}from"./story-OUarUCIt.js";import{G as _n,n as O,E as yn}from"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";function D(e,t,n,s,i,r){return M[0]=e,M[1]=t,M[2]=n,O(M,s,0,i,r,0)}const M=Y();let S=0;class k{static fromGE(t){const n=new k;return n._wkt=t.wkt,n._wkid=t.wkid,n._isInverse=t.isInverse,n}constructor(t){this.uid=S++,t?(this._wkt=t.wkt!=null?t.wkt:null,this._wkid=t.wkid!=null?t.wkid:-1,this._isInverse=t.isInverse!=null&&t.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=S++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=S++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=S++}getInverse(){const t=new k;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}let Z=class v{static cacheKey(t,n){return[t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??"",n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??""].join()}static fromGE(t){const n=new v;let s="";for(const i of t.steps){const r=k.fromGE(i);n.steps.push(r),s+=r.uid.toString()+","}return n._cachedProjection={},n._gtlistentry=null,n._chain=s,n}constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t?.steps)for(const n of t.steps)n instanceof k?this.steps.push(n):this.steps.push(new k({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse}))}getInverse(){const t=new v;t.steps=[];for(let n=this.steps.length-1;n>=0;n--){const s=this.steps[n];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const n of this.steps)t+=n.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,n,s){this._cachedProjection[v.cacheKey(t,n)]=s}getCachedGeTransformation(t,n){let s="";for(const r of this.steps)s+=r.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const i=this._cachedProjection[v.cacheKey(t,n)];return i===void 0?null:i}};function kn(e,t,n){if(t==null||n==null||n.vcsWkid||x(t,n)||g(t)||g(n))return null;const s=q(t)/q(n);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return i=>vn(i,s);case"polyline":case"esriGeometryPolyline":return i=>xn(i,s);case"polygon":case"esriGeometryPolygon":return i=>Rn(i,s);case"multipoint":case"esriGeometryMultipoint":return i=>jn(i,s);case"extent":case"esriGeometryEnvelope":return i=>Pn(i,s);default:return null}}function vn(e,t){e?.z!=null&&(e.z*=t)}function Rn(e,t){if(e)for(const n of e.rings)for(const s of n)s.length>2&&(s[2]*=t)}function xn(e,t){if(e)for(const n of e.paths)for(const s of n)s.length>2&&(s[2]*=t)}function jn(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}function Pn(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let d=null,w=null,R=null,E={};const b=new gn;function z(){return!!d&&wn()}function J(){return!!z()||(U(b),j(),!1)}function zn(e,t){return!e||!t||_(e,t)||J()}function Gn(e,t){return!_(e,t)&&!z()}function j(e){return R==null&&(R=Promise.all([ln(),C(()=>import("./geometryEngineBase-DueYg7ux-CCeespPx.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.g),C(()=>import("./hydrated-CplJC1Fs-BcGP1hGu.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url)])),R.then(([,t,{hydratedAdapter:n}])=>{an(e),w=n,d=t.default,d._enableProjection(un),b.notify()})}function F(e,t,n=null,s=null){return Array.isArray(e)?e.length===0?[]:W(w,e,e[0].spatialReference,t,n,s):W(w,[e],e.spatialReference,t,n,s)[0]}function W(e,t,n,s,i=null,r=null){if(n==null||s==null)return t;if(_(n,s,i))return t.map(o=>L(o,n,s));if(i==null&&V(n))return t.map(o=>L(o,n,A.WGS84)).map(o=>P(o,s));if(i==null&&V(s))return t.map(o=>P(o,A.WGS84)).map(o=>L(o,A.WGS84,s));if(i==null){const o=Z.cacheKey(n,s);E[o]!==void 0?i=E[o]:((i=Q(n,s,void 0))==null&&(i=new Z),E[o]=i)}if(d==null||e==null)throw new T;return r!=null?d._project(e,t,n,s,i,r):d._project(e,t,n,s,i)}function In(e,t){const n=H([e],t);return n.pending!=null?{pending:n.pending,geometry:null}:n.geometries!=null?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function H(e,t){if(!z()){for(const n of e)if(n!=null&&!x(n.spatialReference,t)&&m(n.spatialReference)&&m(t)&&!_(n.spatialReference,t))return U(b),{pending:j(),geometries:null}}return{pending:null,geometries:e.map(n=>n==null?null:x(n.spatialReference,t)?n:m(n.spatialReference)&&m(t)?P(n,t):null)}}function Q(e,t,n=null){if(e==null||t==null)return null;if(d==null||w==null)throw new T;const s=d._getTransformation(w,e,t,n,n?.spatialReference);return s!==null?Z.fromGE(s):null}function Mn(e,t,n=null){if(d==null||w==null)throw new T;const s=d._getTransformationBySuitability(w,e,t,n,n?.spatialReference);if(s!==null){const i=[];for(const r of s)i.push(Z.fromGE(r));return i}return[]}class T extends cn{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function Sn(){d=null,w=null,R=null,E={}}const En={get loadPromise(){return R}};function P(e,t){try{const n=F(e,t);return n==null?null:("xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax),kn(n.type,e.spatialReference,t)?.(n),n)}catch(n){if(!(n instanceof T))throw n;return null}}async function Ln(e,t,n){const s=e.spatialReference;return s!=null&&t!=null&&await X(s,t,null,n),P(e,t)}function _(e,t,n){return!n&&(!!x(e,t)||m(e)&&m(t)&&!!_n(e,t,yn))}function Zn(e,t){if(x(e,t))return!0;if(!m(e)||!m(t))return!1;const n=K(e)||B(e)||$(e),s=K(t)||B(t)||$(t);return n&&s}async function X(e,t,n,s){if(z())return N(s);if(Array.isArray(e)){for(const{source:i,dest:r,geographicTransformation:o}of e)if(i&&r&&!_(i,r,o))return j(s)}else if(e&&t&&!_(e,t,n))return j(s);return N(s)}function L(e,t,n){return e?"x"in e?nn(e,t,new fn,n,0):"xmin"in e?rn(e,t,new hn,n,0):"rings"in e?sn(e,t,new pn,n,0):"paths"in e?en(e,t,new dn,n,0):"points"in e?tn(e,t,new mn,n,0):null:null}function On(e,t,n=t.spatialReference,s=0){return n!=null&&e.spatialReference!=null&&nn(e,e.spatialReference,t,n,s)!=null}function nn(e,t,n,s,i){u[0]=e.x,u[1]=e.y;const r=e.z;return u[2]=r!==void 0?r:i,O(u,t,0,u,s,0)?(n.x=u[0],n.y=u[1],n.spatialReference=s,r!==void 0||g(s)?(n.z=u[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),e.m===void 0?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Tn(e,t,n=t.spatialReference,s=0){return e.spatialReference!=null&&n!=null&&tn(e,e.spatialReference,t,n,s)!=null}function tn(e,t,n,s,i){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,p=[];for(const c of r)p.push(c[0],c[1],o?c[2]:i);if(!O(p,t,0,p,s,0,h))return null;const f=o||g(s);for(let c=0;ci.map(i=>d[i]); +import{_ as C}from"./main-BTdHgocv.js";import{cV as U,d9 as ln,$ as an,da as un,db as V,J as A,aC as x,aY as m,o as cn,dc as K,dd as B,de as $,c_ as N,w as fn,n as hn,l as pn,m as dn,G as mn,df as g,dg as Y,dh as q,cU as gn,b1 as wn}from"./story-DT1Ep1ux.js";import{G as _n,n as O,E as yn}from"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function D(e,t,n,s,i,r){return M[0]=e,M[1]=t,M[2]=n,O(M,s,0,i,r,0)}const M=Y();let S=0;class k{static fromGE(t){const n=new k;return n._wkt=t.wkt,n._wkid=t.wkid,n._isInverse=t.isInverse,n}constructor(t){this.uid=S++,t?(this._wkt=t.wkt!=null?t.wkt:null,this._wkid=t.wkid!=null?t.wkid:-1,this._isInverse=t.isInverse!=null&&t.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=S++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=S++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=S++}getInverse(){const t=new k;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}let Z=class v{static cacheKey(t,n){return[t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??"",n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??""].join()}static fromGE(t){const n=new v;let s="";for(const i of t.steps){const r=k.fromGE(i);n.steps.push(r),s+=r.uid.toString()+","}return n._cachedProjection={},n._gtlistentry=null,n._chain=s,n}constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t?.steps)for(const n of t.steps)n instanceof k?this.steps.push(n):this.steps.push(new k({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse}))}getInverse(){const t=new v;t.steps=[];for(let n=this.steps.length-1;n>=0;n--){const s=this.steps[n];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const n of this.steps)t+=n.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,n,s){this._cachedProjection[v.cacheKey(t,n)]=s}getCachedGeTransformation(t,n){let s="";for(const r of this.steps)s+=r.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const i=this._cachedProjection[v.cacheKey(t,n)];return i===void 0?null:i}};function kn(e,t,n){if(t==null||n==null||n.vcsWkid||x(t,n)||g(t)||g(n))return null;const s=q(t)/q(n);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return i=>vn(i,s);case"polyline":case"esriGeometryPolyline":return i=>xn(i,s);case"polygon":case"esriGeometryPolygon":return i=>Rn(i,s);case"multipoint":case"esriGeometryMultipoint":return i=>jn(i,s);case"extent":case"esriGeometryEnvelope":return i=>Pn(i,s);default:return null}}function vn(e,t){e?.z!=null&&(e.z*=t)}function Rn(e,t){if(e)for(const n of e.rings)for(const s of n)s.length>2&&(s[2]*=t)}function xn(e,t){if(e)for(const n of e.paths)for(const s of n)s.length>2&&(s[2]*=t)}function jn(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}function Pn(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let d=null,w=null,R=null,E={};const b=new gn;function z(){return!!d&&wn()}function J(){return!!z()||(U(b),j(),!1)}function zn(e,t){return!e||!t||_(e,t)||J()}function Gn(e,t){return!_(e,t)&&!z()}function j(e){return R==null&&(R=Promise.all([ln(),C(()=>import("./geometryEngineBase-DueYg7ux-CCeespPx.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.g),C(()=>import("./hydrated-CplJC1Fs-Bf311639.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url)])),R.then(([,t,{hydratedAdapter:n}])=>{an(e),w=n,d=t.default,d._enableProjection(un),b.notify()})}function F(e,t,n=null,s=null){return Array.isArray(e)?e.length===0?[]:W(w,e,e[0].spatialReference,t,n,s):W(w,[e],e.spatialReference,t,n,s)[0]}function W(e,t,n,s,i=null,r=null){if(n==null||s==null)return t;if(_(n,s,i))return t.map(o=>L(o,n,s));if(i==null&&V(n))return t.map(o=>L(o,n,A.WGS84)).map(o=>P(o,s));if(i==null&&V(s))return t.map(o=>P(o,A.WGS84)).map(o=>L(o,A.WGS84,s));if(i==null){const o=Z.cacheKey(n,s);E[o]!==void 0?i=E[o]:((i=Q(n,s,void 0))==null&&(i=new Z),E[o]=i)}if(d==null||e==null)throw new T;return r!=null?d._project(e,t,n,s,i,r):d._project(e,t,n,s,i)}function In(e,t){const n=H([e],t);return n.pending!=null?{pending:n.pending,geometry:null}:n.geometries!=null?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function H(e,t){if(!z()){for(const n of e)if(n!=null&&!x(n.spatialReference,t)&&m(n.spatialReference)&&m(t)&&!_(n.spatialReference,t))return U(b),{pending:j(),geometries:null}}return{pending:null,geometries:e.map(n=>n==null?null:x(n.spatialReference,t)?n:m(n.spatialReference)&&m(t)?P(n,t):null)}}function Q(e,t,n=null){if(e==null||t==null)return null;if(d==null||w==null)throw new T;const s=d._getTransformation(w,e,t,n,n?.spatialReference);return s!==null?Z.fromGE(s):null}function Mn(e,t,n=null){if(d==null||w==null)throw new T;const s=d._getTransformationBySuitability(w,e,t,n,n?.spatialReference);if(s!==null){const i=[];for(const r of s)i.push(Z.fromGE(r));return i}return[]}class T extends cn{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function Sn(){d=null,w=null,R=null,E={}}const En={get loadPromise(){return R}};function P(e,t){try{const n=F(e,t);return n==null?null:("xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax),kn(n.type,e.spatialReference,t)?.(n),n)}catch(n){if(!(n instanceof T))throw n;return null}}async function Ln(e,t,n){const s=e.spatialReference;return s!=null&&t!=null&&await X(s,t,null,n),P(e,t)}function _(e,t,n){return!n&&(!!x(e,t)||m(e)&&m(t)&&!!_n(e,t,yn))}function Zn(e,t){if(x(e,t))return!0;if(!m(e)||!m(t))return!1;const n=K(e)||B(e)||$(e),s=K(t)||B(t)||$(t);return n&&s}async function X(e,t,n,s){if(z())return N(s);if(Array.isArray(e)){for(const{source:i,dest:r,geographicTransformation:o}of e)if(i&&r&&!_(i,r,o))return j(s)}else if(e&&t&&!_(e,t,n))return j(s);return N(s)}function L(e,t,n){return e?"x"in e?nn(e,t,new fn,n,0):"xmin"in e?rn(e,t,new hn,n,0):"rings"in e?sn(e,t,new pn,n,0):"paths"in e?en(e,t,new dn,n,0):"points"in e?tn(e,t,new mn,n,0):null:null}function On(e,t,n=t.spatialReference,s=0){return n!=null&&e.spatialReference!=null&&nn(e,e.spatialReference,t,n,s)!=null}function nn(e,t,n,s,i){u[0]=e.x,u[1]=e.y;const r=e.z;return u[2]=r!==void 0?r:i,O(u,t,0,u,s,0)?(n.x=u[0],n.y=u[1],n.spatialReference=s,r!==void 0||g(s)?(n.z=u[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),e.m===void 0?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Tn(e,t,n=t.spatialReference,s=0){return e.spatialReference!=null&&n!=null&&tn(e,e.spatialReference,t,n,s)!=null}function tn(e,t,n,s,i){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,p=[];for(const c of r)p.push(c[0],c[1],o?c[2]:i);if(!O(p,t,0,p,s,0,h))return null;const f=o||g(s);for(let c=0;c{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,m(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2]),m(n,o[3])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,m(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2]),m(n,o[3])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;sE()?(r[0]=o[0]/s,r[1]=o[1]/s,r[2]=o[2]/s):(r[0]=1,r[1]=0,r[2]=0),a}function O(r,o,a){const s=o[0],t=o[1],c=o[2],i=o[3],u=a[0],n=a[1],e=a[2],h=a[3];return r[0]=s*h+i*u+t*e-c*n,r[1]=t*h+i*n+c*u-s*e,r[2]=c*h+i*e+s*n-t*u,r[3]=i*h-s*u-t*n-c*e,r}function K(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+i*u,r[1]=t*n+c*u,r[2]=c*n-t*u,r[3]=i*n-s*u,r}function Q(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n-c*u,r[1]=t*n+i*u,r[2]=c*n+s*u,r[3]=i*n-t*u,r}function U(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+t*u,r[1]=t*n-s*u,r[2]=c*n+i*u,r[3]=i*n-c*u,r}function V(r,o){const a=o[0],s=o[1],t=o[2];return r[0]=a,r[1]=s,r[2]=t,r[3]=Math.sqrt(Math.abs(1-a*a-s*s-t*t)),r}function d(r,o,a,s){const t=o[0],c=o[1],i=o[2],u=o[3];let n,e,h,f,l,m=a[0],p=a[1],q=a[2],g=a[3];return e=t*m+c*p+i*q+u*g,e<0&&(e=-e,m=-m,p=-p,q=-q,g=-g),1-e>E()?(n=Math.acos(e),h=Math.sin(n),f=Math.sin((1-s)*n)/h,l=Math.sin(s*n)/h):(f=1-s,l=s),r[0]=f*t+l*m,r[1]=f*c+l*p,r[2]=f*i+l*q,r[3]=f*u+l*g,r}function rr(r){const o=z,a=o(),s=o(),t=o(),c=Math.sqrt(1-a),i=Math.sqrt(a);return r[0]=c*Math.sin(2*Math.PI*s),r[1]=c*Math.cos(2*Math.PI*s),r[2]=i*Math.sin(2*Math.PI*t),r[3]=i*Math.cos(2*Math.PI*t),r}function or(r,o){const a=o[0],s=o[1],t=o[2],c=o[3],i=a*a+s*s+t*t+c*c,u=i?1/i:0;return r[0]=-a*u,r[1]=-s*u,r[2]=-t*u,r[3]=c*u,r}function sr(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=o[3],r}function S(r,o){const a=o[0]+o[4]+o[8];let s;if(a>0)s=Math.sqrt(a+1),r[3]=.5*s,s=.5/s,r[0]=(o[5]-o[7])*s,r[1]=(o[6]-o[2])*s,r[2]=(o[1]-o[3])*s;else{let t=0;o[4]>o[0]&&(t=1),o[8]>o[3*t+t]&&(t=2);const c=(t+1)%3,i=(t+2)%3;s=Math.sqrt(o[3*t+t]-o[3*c+c]-o[3*i+i]+1),r[t]=.5*s,s=.5/s,r[3]=(o[3*c+i]-o[3*i+c])*s,r[c]=(o[3*c+t]+o[3*t+c])*s,r[i]=(o[3*i+t]+o[3*t+i])*s}return r}function tr(r,o,a,s){const t=.5*Math.PI/180;o*=t,a*=t,s*=t;const c=Math.sin(o),i=Math.cos(o),u=Math.sin(a),n=Math.cos(a),e=Math.sin(s),h=Math.cos(s);return r[0]=c*n*h-i*u*e,r[1]=i*u*h+c*n*e,r[2]=i*n*e-c*u*h,r[3]=i*n*h+c*u*e,r}function ar(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}const cr=Z,ir=w,ur=F,nr=O,er=N,hr=R,Mr=W,b=k,fr=b,j=B,lr=j,A=C,mr=D,pr=G;function qr(r,o,a){const s=T(o,a);return s<-.999999?(x(M,gr,o),X(M)<1e-6&&x(M,dr,o),Y(M,M),L(r,M,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(x(M,o,a),r[0]=M[0],r[1]=M[1],r[2]=M[2],r[3]=1+s,A(r,r))}const M=v(),gr=_(1,0,0),dr=_(0,1,0);function xr(r,o,a,s,t,c){return d(P,o,t,c),d(y,a,s,c),d(r,P,y,2*c*(1-c)),r}const P=I(),y=I();function Ar(r,o,a,s){const t=Pr;return t[0]=a[0],t[3]=a[1],t[6]=a[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-o[0],t[5]=-o[1],t[8]=-o[2],A(r,S(r,t))}const Pr=$();Object.freeze(Object.defineProperty({__proto__:null,add:ur,calculateW:V,conjugate:sr,copy:cr,dot:hr,equals:pr,exactEquals:mr,fromEuler:tr,fromMat3:S,getAxisAngle:J,identity:H,invert:or,len:fr,length:b,lerp:Mr,mul:nr,multiply:O,normalize:A,random:rr,rotateX:K,rotateY:Q,rotateZ:U,rotationTo:qr,scale:er,set:ir,setAxes:Ar,setAxisAngle:L,slerp:d,sqlerp:xr,sqrLen:lr,squaredLength:j,str:ar},Symbol.toStringTag,{value:"Module"}));export{L as A,or as L,tr as O,ir as T,mr as X,qr as Y,O as _,J as j,sr as v}; diff --git a/custom-toc-separator/assets/quat-BODLR7mS-Cqne66qw.js b/custom-toc-separator/assets/quat-BODLR7mS-Cqne66qw.js new file mode 100644 index 00000000..da58c971 --- /dev/null +++ b/custom-toc-separator/assets/quat-BODLR7mS-Cqne66qw.js @@ -0,0 +1 @@ +import{n as $}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as I}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{dg as v,hZ as _}from"./story-DT1Ep1ux.js";import{n as E,o as z}from"./common-CYWrYyJl-E8-sukrT.js";import{y as T,S as x,F as X,l as Y}from"./vec32-D9GsKZ1t-BgEUcZRJ.js";import{p as Z,y as w,g as F,o as N,w as R,A as W,x as k,q as B,L as C,E as D,O as G}from"./vec42-D8CJyqHG-DnfLTeQH.js";function H(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function L(r,o,a){a*=.5;const s=Math.sin(a);return r[0]=s*o[0],r[1]=s*o[1],r[2]=s*o[2],r[3]=Math.cos(a),r}function J(r,o){const a=2*Math.acos(o[3]),s=Math.sin(a/2);return s>E()?(r[0]=o[0]/s,r[1]=o[1]/s,r[2]=o[2]/s):(r[0]=1,r[1]=0,r[2]=0),a}function O(r,o,a){const s=o[0],t=o[1],c=o[2],i=o[3],u=a[0],n=a[1],e=a[2],h=a[3];return r[0]=s*h+i*u+t*e-c*n,r[1]=t*h+i*n+c*u-s*e,r[2]=c*h+i*e+s*n-t*u,r[3]=i*h-s*u-t*n-c*e,r}function K(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+i*u,r[1]=t*n+c*u,r[2]=c*n-t*u,r[3]=i*n-s*u,r}function Q(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n-c*u,r[1]=t*n+i*u,r[2]=c*n+s*u,r[3]=i*n-t*u,r}function U(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+t*u,r[1]=t*n-s*u,r[2]=c*n+i*u,r[3]=i*n-c*u,r}function V(r,o){const a=o[0],s=o[1],t=o[2];return r[0]=a,r[1]=s,r[2]=t,r[3]=Math.sqrt(Math.abs(1-a*a-s*s-t*t)),r}function d(r,o,a,s){const t=o[0],c=o[1],i=o[2],u=o[3];let n,e,h,f,l,m=a[0],p=a[1],q=a[2],g=a[3];return e=t*m+c*p+i*q+u*g,e<0&&(e=-e,m=-m,p=-p,q=-q,g=-g),1-e>E()?(n=Math.acos(e),h=Math.sin(n),f=Math.sin((1-s)*n)/h,l=Math.sin(s*n)/h):(f=1-s,l=s),r[0]=f*t+l*m,r[1]=f*c+l*p,r[2]=f*i+l*q,r[3]=f*u+l*g,r}function rr(r){const o=z,a=o(),s=o(),t=o(),c=Math.sqrt(1-a),i=Math.sqrt(a);return r[0]=c*Math.sin(2*Math.PI*s),r[1]=c*Math.cos(2*Math.PI*s),r[2]=i*Math.sin(2*Math.PI*t),r[3]=i*Math.cos(2*Math.PI*t),r}function or(r,o){const a=o[0],s=o[1],t=o[2],c=o[3],i=a*a+s*s+t*t+c*c,u=i?1/i:0;return r[0]=-a*u,r[1]=-s*u,r[2]=-t*u,r[3]=c*u,r}function sr(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=o[3],r}function S(r,o){const a=o[0]+o[4]+o[8];let s;if(a>0)s=Math.sqrt(a+1),r[3]=.5*s,s=.5/s,r[0]=(o[5]-o[7])*s,r[1]=(o[6]-o[2])*s,r[2]=(o[1]-o[3])*s;else{let t=0;o[4]>o[0]&&(t=1),o[8]>o[3*t+t]&&(t=2);const c=(t+1)%3,i=(t+2)%3;s=Math.sqrt(o[3*t+t]-o[3*c+c]-o[3*i+i]+1),r[t]=.5*s,s=.5/s,r[3]=(o[3*c+i]-o[3*i+c])*s,r[c]=(o[3*c+t]+o[3*t+c])*s,r[i]=(o[3*i+t]+o[3*t+i])*s}return r}function tr(r,o,a,s){const t=.5*Math.PI/180;o*=t,a*=t,s*=t;const c=Math.sin(o),i=Math.cos(o),u=Math.sin(a),n=Math.cos(a),e=Math.sin(s),h=Math.cos(s);return r[0]=c*n*h-i*u*e,r[1]=i*u*h+c*n*e,r[2]=i*n*e-c*u*h,r[3]=i*n*h+c*u*e,r}function ar(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}const cr=Z,ir=w,ur=F,nr=O,er=N,hr=R,Mr=W,b=k,fr=b,j=B,lr=j,A=C,mr=D,pr=G;function qr(r,o,a){const s=T(o,a);return s<-.999999?(x(M,gr,o),X(M)<1e-6&&x(M,dr,o),Y(M,M),L(r,M,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(x(M,o,a),r[0]=M[0],r[1]=M[1],r[2]=M[2],r[3]=1+s,A(r,r))}const M=v(),gr=_(1,0,0),dr=_(0,1,0);function xr(r,o,a,s,t,c){return d(P,o,t,c),d(y,a,s,c),d(r,P,y,2*c*(1-c)),r}const P=I(),y=I();function Ar(r,o,a,s){const t=Pr;return t[0]=a[0],t[3]=a[1],t[6]=a[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-o[0],t[5]=-o[1],t[8]=-o[2],A(r,S(r,t))}const Pr=$();Object.freeze(Object.defineProperty({__proto__:null,add:ur,calculateW:V,conjugate:sr,copy:cr,dot:hr,equals:pr,exactEquals:mr,fromEuler:tr,fromMat3:S,getAxisAngle:J,identity:H,invert:or,len:fr,length:b,lerp:Mr,mul:nr,multiply:O,normalize:A,random:rr,rotateX:K,rotateY:Q,rotateZ:U,rotationTo:qr,scale:er,set:ir,setAxes:Ar,setAxisAngle:L,slerp:d,sqlerp:xr,sqrLen:lr,squaredLength:j,str:ar},Symbol.toStringTag,{value:"Module"}));export{L as A,or as L,tr as O,ir as T,mr as X,qr as Y,O as _,J as j,sr as v}; diff --git a/custom-toc-separator/assets/query-BAUG6dav-B1Pjv1dO.js b/custom-toc-separator/assets/query-BAUG6dav-B1Pjv1dO.js deleted file mode 100644 index c96a1733..00000000 --- a/custom-toc-separator/assets/query-BAUG6dav-B1Pjv1dO.js +++ /dev/null @@ -1 +0,0 @@ -import"./story-OUarUCIt.js";import"./Query-BrwMGK8U-gUIs0TS1.js";import{u as O,s as S}from"./executeQueryJSON-CcHnccia-C6q0seac.js";import{g as P,T as b}from"./executeQueryPBF-o8010HS9-DA2vEqjE.js";import"./FeatureSet-BkVNthuN-C5Zta7rI.js";import"./AttachmentInfo-D9RFO8W2-qR5MPnw_.js";import"./RelationshipQuery-DJsz3K0U-CjRN9GkI.js";import{executeBinsQuery as k}from"./executeBinsQuery-26-59HNS-DM7KQ_00.js";import{i as v,e as z}from"./executeForIds-Z1gkLduF-BLtp2DWt.js";import{executeRelationshipQuery as D,executeRelationshipQueryForCount as G}from"./executeRelationshipQuery-BlX9_g4g-BPTwePaV.js";import{executeTopFeaturesQuery as K}from"./executeTopFeaturesQuery-CjTd36wS-GRkP5V6Y.js";import{executeForTopIds as M}from"./executeForTopIds-BWxBZygF-U3ALYew8.js";import{executeForTopExtents as V}from"./executeForTopExtents-3NOTiZTn-D9Zdubzg.js";import{executeForTopCount as X}from"./executeForTopCount-Dx1gCDe1-Dh8nZiiP.js";import"./main-lj2zzr_L.js";import"./Field-C6hA1tZj-DY7R6puO.js";import"./fieldType-CD2CL2hr-D-1zqE7t.js";import"./TimeExtent-Cn0Jofqr-BYNqT7sE.js";import"./utils-9sQxfkoa-Djr5L7DU.js";import"./query-DFW9-NG_-CLOB0soI.js";import"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import"./normalizeUtilsCommon-CRJlkfEA-v9PmQ4u7.js";import"./utils-Bq23Xwmj-CIl5z47y.js";import"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import"./pbf-D-y3_eZO-kB76Yuqq.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-Dr42wv_P.js";import"./projection-BA9M1R7d-Cytmrlsd.js";import"./projectBuffer-CvCBvJ6W-CiwR2FyN.js";import"./featureConversionUtils-D6hFQ4Af-KBDvMG4y.js";import"./BinsQuery-DjwQZqB8-xSRrS-fI.js";import"./queryUtils-Brxu6254-BZ9oWgik.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./queryTopFeatures-IbhAPJlP-B2OySQ6g.js";import"./TopFeaturesQuery-Ckj_IYM7-DeZUhxHa.js";export{k as executeBinsQuery,v as executeForCount,P as executeForExtent,z as executeForIds,X as executeForTopCount,V as executeForTopExtents,M as executeForTopIds,O as executeQueryJSON,S as executeRawQueryJSON,b as executeRawQueryPBF,D as executeRelationshipQuery,G as executeRelationshipQueryForCount,K as executeTopFeaturesQuery}; diff --git a/custom-toc-separator/assets/query-BAUG6dav-COvgrIOn.js b/custom-toc-separator/assets/query-BAUG6dav-COvgrIOn.js new file mode 100644 index 00000000..ee7888fc --- /dev/null +++ b/custom-toc-separator/assets/query-BAUG6dav-COvgrIOn.js @@ -0,0 +1 @@ +import"./story-DT1Ep1ux.js";import"./Query-BrwMGK8U-FWeI_AU8.js";import{u as O,s as S}from"./executeQueryJSON-CcHnccia-BAMZ5LEx.js";import{g as P,T as b}from"./executeQueryPBF-o8010HS9-Bi7xykzy.js";import"./FeatureSet-BkVNthuN-CvGbjjZL.js";import"./AttachmentInfo-D9RFO8W2-B1dXzA4o.js";import"./RelationshipQuery-DJsz3K0U-ueD2VMB6.js";import{executeBinsQuery as k}from"./executeBinsQuery-26-59HNS-CAw0ShUR.js";import{i as v,e as z}from"./executeForIds-Z1gkLduF-CKWTLnam.js";import{executeRelationshipQuery as D,executeRelationshipQueryForCount as G}from"./executeRelationshipQuery-BlX9_g4g-fmuGrfyT.js";import{executeTopFeaturesQuery as K}from"./executeTopFeaturesQuery-CjTd36wS-D3nv6Tqg.js";import{executeForTopIds as M}from"./executeForTopIds-BWxBZygF-BPk9RKm-.js";import{executeForTopExtents as V}from"./executeForTopExtents-3NOTiZTn-CDRqhE8I.js";import{executeForTopCount as X}from"./executeForTopCount-Dx1gCDe1-Bt3EwZwA.js";import"./main-BTdHgocv.js";import"./Field-C6hA1tZj-aKnzhZ32.js";import"./fieldType-CD2CL2hr-B2sVi9me.js";import"./TimeExtent-Cn0Jofqr-BFc609ot.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./query-DFW9-NG_-SSagAgRu.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";import"./featureConversionUtils-D6hFQ4Af-C534NCdS.js";import"./BinsQuery-DjwQZqB8-BqGeRmeR.js";import"./queryUtils-Brxu6254-qwN-s2Og.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./queryTopFeatures-IbhAPJlP-ChckWHgQ.js";import"./TopFeaturesQuery-Ckj_IYM7-Bpv1sLOF.js";export{k as executeBinsQuery,v as executeForCount,P as executeForExtent,z as executeForIds,X as executeForTopCount,V as executeForTopExtents,M as executeForTopIds,O as executeQueryJSON,S as executeRawQueryJSON,b as executeRawQueryPBF,D as executeRelationshipQuery,G as executeRelationshipQueryForCount,K as executeTopFeaturesQuery}; diff --git a/custom-toc-separator/assets/query-DFW9-NG_-CLOB0soI.js b/custom-toc-separator/assets/query-DFW9-NG_-CLOB0soI.js deleted file mode 100644 index d2ebb339..00000000 --- a/custom-toc-separator/assets/query-DFW9-NG_-CLOB0soI.js +++ /dev/null @@ -1 +0,0 @@ -import{a as p,f as S,bX as x,bM as f,bK as E}from"./story-OUarUCIt.js";import{B as O}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-BnQaWPAo.js";import{n as R}from"./queryZScale-BiYV6Pr6-Dr42wv_P.js";function m(r){const e={};for(const i in r){if(i==="declaredClass")continue;const t=r[i];if(t!=null&&typeof t!="function")if(Array.isArray(t)){e[i]=[];for(let n=0;ne.data.attachmentGroups)}async function Q(r,t,o){const{objectIds:n}=t,e=[];for(const a of n)e.push(p(r.path+"/"+a+"/attachments",o));return Promise.all(e).then(a=>n.map((c,s)=>({parentObjectId:c,attachmentInfos:a[s].data.attachmentInfos})))}export{N as executeAttachmentQuery,Q as fetchAttachments,J as processAttachmentQueryResult}; diff --git a/custom-toc-separator/assets/queryAttachments-Bgvu3RnK-knzGTJg_.js b/custom-toc-separator/assets/queryAttachments-Bgvu3RnK-knzGTJg_.js new file mode 100644 index 00000000..3688e3db --- /dev/null +++ b/custom-toc-separator/assets/queryAttachments-Bgvu3RnK-knzGTJg_.js @@ -0,0 +1 @@ +import{bZ as f,jo as u,f as p}from"./story-DT1Ep1ux.js";import{f as d}from"./query-DFW9-NG_-SSagAgRu.js";import{h as y}from"./AttachmentInfo-D9RFO8W2-B1dXzA4o.js";import"./main-BTdHgocv.js";import"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import"./normalizeUtilsCommon-CRJlkfEA-B1kxVr8K.js";import"./utils-9sQxfkoa-CwJW9dca.js";import"./utils-Bq23Xwmj-Csxw19qV.js";import"./pbfQueryUtils-F4ZE8-K8-Psrw5bE3.js";import"./pbf-D-y3_eZO-CKuZ8F1K.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-BSxy2N4g.js";import"./projection-BA9M1R7d-DTN1X2Bt.js";import"./projectBuffer-CvCBvJ6W-CMjj6oJy.js";function I(r){const t=r.toJSON();return t.attachmentTypes&&(t.attachmentTypes=t.attachmentTypes.join(",")),t.keywords&&(t.keywords=t.keywords.join(",")),t.globalIds&&(t.globalIds=t.globalIds.join(",")),t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.size&&(t.size=t.size.join(",")),t}function J(r,t){const o={};for(const n of t){const{parentObjectId:e,parentGlobalId:a,attachmentInfos:c}=n;for(const s of c){const{id:i}=s,h=f(u(`${r.path}/${e}/attachments/${i}`)),m=y.fromJSON(s);m.set({url:h,parentObjectId:e,parentGlobalId:a}),o[e]?o[e].push(m):o[e]=[m]}}return o}function N(r,t,o){let n={query:d({...r.query,f:"json",...I(t)})};return o&&(n={...o,...n,query:{...o.query,...n.query}}),p(r.path+"/queryAttachments",n).then(e=>e.data.attachmentGroups)}async function Q(r,t,o){const{objectIds:n}=t,e=[];for(const a of n)e.push(p(r.path+"/"+a+"/attachments",o));return Promise.all(e).then(a=>n.map((c,s)=>({parentObjectId:c,attachmentInfos:a[s].data.attachmentInfos})))}export{N as executeAttachmentQuery,Q as fetchAttachments,J as processAttachmentQueryResult}; diff --git a/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-B2OySQ6g.js b/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-B2OySQ6g.js deleted file mode 100644 index 6e72491f..00000000 --- a/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-B2OySQ6g.js +++ /dev/null @@ -1 +0,0 @@ -import{a as p,f as c,bX as F,bK as f,bM as d}from"./story-OUarUCIt.js";import{B as E}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{f as x}from"./query-DFW9-NG_-CLOB0soI.js";import{n as j}from"./queryZScale-BiYV6Pr6-Dr42wv_P.js";const a="Layer does not support extent calculation.";function O(o,r){const n=o.geometry,t=o.toJSON(),e=t;if(n!=null&&(e.geometry=JSON.stringify(n),e.geometryType=f(n),e.inSR=d(n.spatialReference)),t.topFilter?.groupByFields&&(e.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),t.topFilter?.orderByFields&&(e.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(e.topFilter=JSON.stringify(e.topFilter)),t.objectIds&&(e.objectIds=t.objectIds.join(",")),t.orderByFields&&(e.orderByFields=t.orderByFields.join(",")),t.outFields&&!(r?.returnCountOnly||r?.returnExtentOnly||r?.returnIdsOnly)?t.outFields.includes("*")?e.outFields="*":e.outFields=t.outFields.join(","):delete e.outFields,t.outSR?e.outSR=d(t.outSR):n&&t.returnGeometry&&(e.outSR=e.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const l=t.timeExtent,{start:i,end:u}=l;i==null&&u==null||(e.time=i===u?i:`${i??"null"},${u??"null"}`),delete t.timeExtent}return e}async function b(o,r,n,t){const e=await s(o,r,"json",t);return j(r,n,e.data),e}async function h(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{objectIds:[]}}:s(o,r,"json",n,{returnIdsOnly:!0})}async function w(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{count:0,extent:null}}:s(o,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(a);if(e.hasOwnProperty("count"))throw new Error(a);return t})}function I(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):s(o,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function s(o,r,n,t={},e={}){const l=typeof o=="string"?p(o):o,i=r.geometry?[r.geometry]:[];return t.responseType="json",E(i,null,t).then(u=>{const y=u?.[0];y!=null&&((r=r.clone()).geometry=y);const m=x({...l.query,f:n,...e,...O(r,e)});return c(F(l.path,"queryTopFeatures"),{...t,query:{...m,...t.query}})})}export{h as B,w as R,I as S,b as g}; diff --git a/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-ChckWHgQ.js b/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-ChckWHgQ.js new file mode 100644 index 00000000..a81dd4ad --- /dev/null +++ b/custom-toc-separator/assets/queryTopFeatures-IbhAPJlP-ChckWHgQ.js @@ -0,0 +1 @@ +import{a as p,f as c,bX as F,bK as f,bM as d}from"./story-DT1Ep1ux.js";import{B as E}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{f as x}from"./query-DFW9-NG_-SSagAgRu.js";import{n as j}from"./queryZScale-BiYV6Pr6-BSxy2N4g.js";const a="Layer does not support extent calculation.";function O(o,r){const n=o.geometry,t=o.toJSON(),e=t;if(n!=null&&(e.geometry=JSON.stringify(n),e.geometryType=f(n),e.inSR=d(n.spatialReference)),t.topFilter?.groupByFields&&(e.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),t.topFilter?.orderByFields&&(e.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(e.topFilter=JSON.stringify(e.topFilter)),t.objectIds&&(e.objectIds=t.objectIds.join(",")),t.orderByFields&&(e.orderByFields=t.orderByFields.join(",")),t.outFields&&!(r?.returnCountOnly||r?.returnExtentOnly||r?.returnIdsOnly)?t.outFields.includes("*")?e.outFields="*":e.outFields=t.outFields.join(","):delete e.outFields,t.outSR?e.outSR=d(t.outSR):n&&t.returnGeometry&&(e.outSR=e.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const l=t.timeExtent,{start:i,end:u}=l;i==null&&u==null||(e.time=i===u?i:`${i??"null"},${u??"null"}`),delete t.timeExtent}return e}async function b(o,r,n,t){const e=await s(o,r,"json",t);return j(r,n,e.data),e}async function h(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{objectIds:[]}}:s(o,r,"json",n,{returnIdsOnly:!0})}async function w(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{count:0,extent:null}}:s(o,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(a);if(e.hasOwnProperty("count"))throw new Error(a);return t})}function I(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):s(o,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function s(o,r,n,t={},e={}){const l=typeof o=="string"?p(o):o,i=r.geometry?[r.geometry]:[];return t.responseType="json",E(i,null,t).then(u=>{const y=u?.[0];y!=null&&((r=r.clone()).geometry=y);const m=x({...l.query,f:n,...e,...O(r,e)});return c(F(l.path,"queryTopFeatures"),{...t,query:{...m,...t.query}})})}export{h as B,w as R,I as S,b as g}; diff --git a/custom-toc-separator/assets/queryUtils-Brxu6254-BZ9oWgik.js b/custom-toc-separator/assets/queryUtils-Brxu6254-BZ9oWgik.js deleted file mode 100644 index 5661b635..00000000 --- a/custom-toc-separator/assets/queryUtils-Brxu6254-BZ9oWgik.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as F}from"./main-lj2zzr_L.js";import{eM as O,eN as U,aK as A,aq as j,aY as h,aC as m,eO as _,dd as u,b as N,eP as P,g as T,eQ as g,ca as q,cb as B,eR as I,cZ as E,eS as p}from"./story-OUarUCIt.js";import{N as J,O as R,J as L}from"./projection-BA9M1R7d-Cytmrlsd.js";import{B as Q}from"./normalizeUtils-Bxmy9MNI-DaA_UEnd.js";import{a as S}from"./json-BI97KiBB-Ce5cWfI2.js";const c=[0,0];function d(e,n){if(!n)return null;if("x"in n){const i={x:0,y:0};return[i.x,i.y]=e(n.x,n.y,c),n.z!=null&&(i.z=n.z),n.m!=null&&(i.m=n.m),i}if("xmin"in n){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(n.xmin,n.ymin,c),[i.xmax,i.ymax]=e(n.xmax,n.ymax,c),n.hasZ&&(i.zmin=n.zmin,i.zmax=n.zmax,i.hasZ=!0),n.hasM&&(i.mmin=n.mmin,i.mmax=n.mmax,i.hasM=!0),i}return"rings"in n?{rings:x(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:x(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:w(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function x(e,n){const i=[];for(const t of e)i.push(w(t,n));return i}function w(e,n){const i=[];for(const t of e){const a=n(t[0],t[1],[0,0]);i.push(a),t.length>2&&a.push(t[2]),t.length>3&&a.push(t[3])}return i}async function b(e,n){if(!e||!n)return;const i=Array.isArray(e)?e.map(t=>t.geometry!=null?t.geometry.spatialReference:null).filter(j):[e];await J(i.map(t=>({source:t,dest:n})))}const M=d.bind(null,O),z=d.bind(null,U);function v(e,n,i,t){if(!e||(i||(i=n,n=e.spatialReference),!h(n)||!h(i)||m(n,i)))return e;if(_(n,i)){const a=u(i)?M(e):z(e);return a.spatialReference=i,a}return R(S,[e],n,i,null,t)[0]}class Y{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,i,t,a){if(!n?.length||!i||!t||m(i,t))return n;const s={geometries:n,inSpatialReference:i,outSpatialReference:t,geographicTransformation:a,resolve:N()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:i,inSpatialReference:t,outSpatialReference:a,resolve:s,geographicTransformation:o}=n;_(t,a)?u(a)?s(i.map(M)):s(i.map(z)):s(R(S,i,t,a,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const $=new Y;function ne(e,n,i,t){return $.push(e,n,i,t)}const C=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),y=Object.freeze({});async function ie(e,n,i){const{outFields:t,orderByFields:a,groupByFieldsForStatistics:s,outStatistics:o}=e;if(t)for(let r=0;rv(t,p));return(await k())(o.spatialReference,o,n,s)}async function k(){return(await F(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.g)).geodesicBuffer}export{ne as C,ie as D,C as Z,b as f,v as h,y as p,D as v}; diff --git a/custom-toc-separator/assets/queryUtils-Brxu6254-qwN-s2Og.js b/custom-toc-separator/assets/queryUtils-Brxu6254-qwN-s2Og.js new file mode 100644 index 00000000..52e464bd --- /dev/null +++ b/custom-toc-separator/assets/queryUtils-Brxu6254-qwN-s2Og.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{_ as F}from"./main-BTdHgocv.js";import{eM as O,eN as U,aK as A,aq as j,aY as h,aC as m,eO as _,dd as u,b as N,eP as P,g as T,eQ as g,ca as q,cb as B,eR as I,cZ as E,eS as p}from"./story-DT1Ep1ux.js";import{N as J,O as R,J as L}from"./projection-BA9M1R7d-DTN1X2Bt.js";import{B as Q}from"./normalizeUtils-Bxmy9MNI-CU9ui3_0.js";import{a as S}from"./json-BI97KiBB-Ce5cWfI2.js";const c=[0,0];function d(e,n){if(!n)return null;if("x"in n){const i={x:0,y:0};return[i.x,i.y]=e(n.x,n.y,c),n.z!=null&&(i.z=n.z),n.m!=null&&(i.m=n.m),i}if("xmin"in n){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(n.xmin,n.ymin,c),[i.xmax,i.ymax]=e(n.xmax,n.ymax,c),n.hasZ&&(i.zmin=n.zmin,i.zmax=n.zmax,i.hasZ=!0),n.hasM&&(i.mmin=n.mmin,i.mmax=n.mmax,i.hasM=!0),i}return"rings"in n?{rings:x(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:x(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:w(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function x(e,n){const i=[];for(const t of e)i.push(w(t,n));return i}function w(e,n){const i=[];for(const t of e){const a=n(t[0],t[1],[0,0]);i.push(a),t.length>2&&a.push(t[2]),t.length>3&&a.push(t[3])}return i}async function b(e,n){if(!e||!n)return;const i=Array.isArray(e)?e.map(t=>t.geometry!=null?t.geometry.spatialReference:null).filter(j):[e];await J(i.map(t=>({source:t,dest:n})))}const M=d.bind(null,O),z=d.bind(null,U);function v(e,n,i,t){if(!e||(i||(i=n,n=e.spatialReference),!h(n)||!h(i)||m(n,i)))return e;if(_(n,i)){const a=u(i)?M(e):z(e);return a.spatialReference=i,a}return R(S,[e],n,i,null,t)[0]}class Y{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,i,t,a){if(!n?.length||!i||!t||m(i,t))return n;const s={geometries:n,inSpatialReference:i,outSpatialReference:t,geographicTransformation:a,resolve:N()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:i,inSpatialReference:t,outSpatialReference:a,resolve:s,geographicTransformation:o}=n;_(t,a)?u(a)?s(i.map(M)):s(i.map(z)):s(R(S,i,t,a,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const $=new Y;function ne(e,n,i,t){return $.push(e,n,i,t)}const C=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),y=Object.freeze({});async function ie(e,n,i){const{outFields:t,orderByFields:a,groupByFieldsForStatistics:s,outStatistics:o}=e;if(t)for(let r=0;rv(t,p));return(await k())(o.spatialReference,o,n,s)}async function k(){return(await F(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.g)).geodesicBuffer}export{ne as C,ie as D,C as Z,b as f,v as h,y as p,D as v}; diff --git a/custom-toc-separator/assets/queryZScale-BiYV6Pr6-BSxy2N4g.js b/custom-toc-separator/assets/queryZScale-BiYV6Pr6-BSxy2N4g.js new file mode 100644 index 00000000..4fe55d28 --- /dev/null +++ b/custom-toc-separator/assets/queryZScale-BiYV6Pr6-BSxy2N4g.js @@ -0,0 +1 @@ +import{o as n}from"./projection-BA9M1R7d-DTN1X2Bt.js";function s(r,f,e){if(!e?.features||!e.hasZ)return;const o=n(e.geometryType,f,r.outSpatialReference);if(o!=null)for(const t of e.features)o(t.geometry)}export{s as n}; diff --git a/custom-toc-separator/assets/queryZScale-BiYV6Pr6-Dr42wv_P.js b/custom-toc-separator/assets/queryZScale-BiYV6Pr6-Dr42wv_P.js deleted file mode 100644 index 9929a6d0..00000000 --- a/custom-toc-separator/assets/queryZScale-BiYV6Pr6-Dr42wv_P.js +++ /dev/null @@ -1 +0,0 @@ -import{o as n}from"./projection-BA9M1R7d-Cytmrlsd.js";function s(r,f,e){if(!e?.features||!e.hasZ)return;const o=n(e.geometryType,f,r.outSpatialReference);if(o!=null)for(const t of e.features)o(t.geometry)}export{s as n}; diff --git a/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C-zaFCqp.js b/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C-zaFCqp.js new file mode 100644 index 00000000..2ffa8bcf --- /dev/null +++ b/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C-zaFCqp.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-B4-kNUBs.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-Bf311639.js"])))=>i.map(i=>d[i]); +import{_ as Nn}from"./main-BTdHgocv.js";import{n as Y,p as O,aq as En,l as tn,w as N,aG as _n,o as gn,i3 as T,i4 as v,i5 as an,i6 as vn,i7 as Tn,J as yn}from"./story-DT1Ep1ux.js";import{_ as B,W as Cn,K as W,J as Wn,Y as rn}from"./projection-BA9M1R7d-DTN1X2Bt.js";var nn;function dn(n,t,i){return!Wn(n,t,i)}function z(n,t,i){const o=dn(n,t,i);if(o&&!B())throw new gn("rasterprojectionhelper-project","projection engine is not loaded");return o}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(nn||(nn={}));const ln=(n,t,i,o=0)=>{if(i[0]===1)return[0,0];let a=1,e=-1,s=1,c=-1;for(let f=0;fn[f]?n[f]:a,e=e>n[f]?e:n[f],s=s>n[f+1]?n[f+1]:s,c=c>n[f+1]?c:n[f+1]);const{cols:l,rows:r}=t,u=(e-a)/l/i[0],w=(c-s)/r/i[1],g=2*o;let x=0,h=!1,m=[0,0];for(let f=0;fx&&(x=R+b,m=[R,b]),g&&x>g){h=!0;break}}if(h)break}return m},zn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},F=32,J=4,$=J,Z=new Map,H=new Map,K=500;let X=null;async function Dn(){X&&B()||(B()||await Cn(),X=await Nn(()=>import("./geometryEngine-CdPoFSE4-B4-kNUBs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))}function Ln(n,t,i){return z(n.spatialReference,t),i?rn(t,n.spatialReference,n):rn(n.spatialReference,t,n)}function Qn(n,t,i,o=null){const a=n.spatialReference;if(!a||!t||a.equals(t))return n;z(a,t,o);const e=i.center,s=new Y({xmin:e.x-n.x/2,xmax:e.x+n.x/2,ymin:e.y-n.y/2,ymax:e.y+n.y/2,spatialReference:a}),c=W(s,t,o),l=E(t);return c==null||l!=null&&c.width>=l?q(n,a,t):{x:c.width,y:c.height}}function q(n,t,i){const o=O(t)/O(i);return{x:n.x*o,y:n.y*o}}function cn(n,t,i){const{spatialReference:o}=i;if(!o||!t||o.equals(t))return n;if(o.isGeographic&&t.isGeographic)return q(n,o,t);if(z(o,t),!X)throw new gn("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:a,y:e}=n;const s=(a+e)/2*O(o);let c=1;s>30&&(c=30/s,a*=c,e*=c);const l=256,r=a*l/2,u=e*l/2,{x:w,y:g}=i.center,x=[];for(let S=0;S<=l;S++)x.push([w-r,g-u+S*e]);for(let S=1;S<=l;S++)x.push([w-r+S*a,g+u]);for(let S=1;S<=l;S++)x.push([w+r,g+u-S*e]);for(let S=1;S=M)return q(n,o,t);const y=X.planarArea(m),p=a*e*l*l,d=Math.sqrt(y/p)/c,R={x:f.width/c/l,y:f.height/c/l},b={x:a*d,y:e*d},G=R.x*R.y;return Math.abs(G-b.x*b.y)/G<.1?R:b}function k(n,t=.01){return O(n)?t/O(n):0}function fn(n,t,i=null,o=!0){const a=n.spatialReference;if(a.equals(t))return n;z(a,t,i);const e=W(n,t,i);return o&&e&&wn([n],[e],a,t),e}function wn(n,t,i,o){const a=D(i,!0),e=D(o,!0),s=k(i,K),c=k(o,K);if(s&&a!=null&&e!=null)for(let l=0;l=e[1]-c&&Math.abs(u-a[0])new N(c[0],c[1],i)),s=W(e,o,a);return a&&wn(e,s,i,o),s.map(c=>c?[c.x,c.y]:[NaN,NaN])}function jn(n){const{inSR:t,outSR:i,datumTransformation:o}=n,a=I(t),{points:e,mask:s}=en(n,a);if(!t.isGeographic){const l=t.wkid?T.coordsys(t.wkid):T.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);an.projToGeog(l,e.length,e)}if(o!=null&&o.steps.length){let l;if(i.isGeographic&&(l=e.map(([r])=>r>179.9955?1:r<-179.9955?-1:0)),o.steps.forEach(r=>{const u=r.wkid?T.geogtran(r.wkid):T.fromString(v.PE_TYPE_GEOGTRAN,r.wkt);vn.geogToGeog(u,e.length,e,null,r.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let r=0;r179.9955?1:w<-179.9955?-1:0;u&&g&&u!==g&&(e[r][0]=u>0?w+360:w-360)}}if(!i.isGeographic){const l=I(i,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];Yn(e,r);const u=i.wkid?T.coordsys(i.wkid):T.fromString(i.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,i.wkt2||i.wkt);an.geogToProj(u,e.length,e)}let c=e;if(s&&e.length!==s.length){c=[];for(let l=0,r=0;lf.getInclusive()===1&&f.getKind()===1);if(!s){if(s=a.find(f=>f.getInclusive()===1&&f.getKind()===0),!s)return null;e=!0}const c=i?0:(o.getNorthPoleLocation()===2?1:0)|(o.getSouthPoleLocation()===2?2:0),l=o.isPannableRectangle(),r=s.getCoord();if(e)return{isEnvelope:e,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:c};let u=0;const w=[];let[g,x]=r[0],[h,m]=r[0];for(let f=0,M=r.length;fy?h:y,m=m>p?m:p}return{isEnvelope:!1,isPannable:l,vertices:r,coef:w,bbox:[g,x,h,m],poleLocation:c}}function en(n,t){const i=[],{cols:o,rows:a,xres:e,yres:s,usePixelCenter:c}=n;let{xmin:l,ymax:r}=n;if(c&&(l+=e/2,r-=s/2),t==null){for(let x=0;x=x&&p<=m;for(let R=0;R=h&&b<=f&&(i.push([p,b]),u[y]=1)}}return{points:i,mask:u}}const w=t.coef,g=[];for(let x=0;x=R&&h<=b){const S=p*h+d;m.push(S),f.push(G)}}let M=m;if(m.length>2){let y=f[0]===2?0:f[0],p=m[0];M=[];for(let d=1;dd-R)}else m[0]>m[1]&&(M=[m[1],m[0]]);g.push(M)}for(let x=0,h=0;x=y[0]&&m<=y[1]&&(i.push([m,M]),u[h]=1);else if(y.length>2){let p=!1;for(let d=0;d=y[d]&&m<=y[d+1]){p=!0;break}p&&(i.push([m,M]),u[h]=1)}}}return{points:i,mask:u}}function Yn(n,t){const[i,o]=t;for(let a=0;ao)&&(n[a]=[NaN,NaN])}}function Mn(n,t){const i=E(n[0].spatialReference);if(n.length<2||i==null||(t=t??k(n[0].spatialReference),(n=n.filter(c=>c.width>t)).length===1))return n[0];let{xmin:o,xmax:a,ymin:e,ymax:s}=n[0];for(let c=1;ck(a)){const{xmin:r,xmax:u}=n;for(let w=0;w<=e;w++){const g=w===0?r:-s/2,x=w===e?u-s*w:s/2;l[w]=new Y({xmin:g,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return Mn(l.map(r=>xn(r,t,i,o)).filter(En))}function Un(n,t,i){if(n.type==="extent"){const{xmin:o,ymin:a,xmax:e,ymax:s,spatialReference:c}=n;n=new tn({rings:[[[o,s],[e,s],[e,a],[o,a],[o,s]]],spatialReference:c})}return n.spatialReference.equals(t)?n:(z(n.spatialReference,t,i),W(n,t,i))}function qn(n,t){const i=E(t);if(i==null)return null;let{xmin:o,ymin:a,xmax:e,ymax:s}=n;const c=n.spatialReference,l=new tn({spatialReference:c,rings:[[[o,a],[e,a],[e,s],[o,s],[o,a]]]}),r=W(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:u}=r,w=k(c),g=new Y({spatialReference:t});for(let x=0;x<2;x++){o=e=u[x][0][0],a=s=u[x][0][1];for(let h=0;hu[x][h][0]?u[x][h][0]:o,e=eu[x][h][1]?u[x][h][1]:a,s=s=s.ymax))return null;if(!o||!s)return s;const c=D(e,!0),l=D(t,!0);if(c==null||l==null)return s;const r=k(e,.001),u=k(e,K),w=k(t,.001);if(Math.abs(s.xmin-l[0])u){s.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,e)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmax,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmax=Math.max.apply(null,m)}if(xu){s.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,e)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmin,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmin=Math.min.apply(null,m)}}else{const g=k(t,.001);Math.abs(s.xmin-l[0])0&&o.outofBoundPointCount$)&&(dn(l,r,n.datumTransformation)&&(l.isGeographic||I(l)),i=[J,J],o=V({...n,spacing:i}),a={cols:o.size[0]+1,rows:o.size[1]+1},s=ln(o.offsets,a,i,$)),o.error=s,i[0]>1&&(o.coefficients=mn(o.offsets,a,e)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:i};else{const u=I(l);if(u!=null&&!u.isEnvelope){const w=Bn(l),g=Rn(n.projectedExtent,w),{offsets:x}=V({...n,srcBufferExtent:g,spacing:i}),h=mn(x,a,e);o.gcsGrid={offsets:x,coefficients:h,spacing:i}}}return o}function V(n){const{projectedExtent:t,srcBufferExtent:i,pixelSize:o,datumTransformation:a,rasterTransform:e}=n,s=t.spatialReference,c=i.spatialReference,l=z(s,c),{xmin:r,ymin:u,xmax:w,ymax:g}=t,x=E(c),h=x!=null&&(n.hasWrapAround||e?.type==="gcs-shift"),m=n.spacing||[F,F],f=m[0]*o.x,M=m[1]*o.y,y=m[0]===1,p=Math.ceil((w-r)/f-.1/m[0])+(y?0:1),d=Math.ceil((g-u)/M-.1/m[1])+(y?0:1),R=On({cols:p,rows:d,xmin:r,ymax:g,xres:f,yres:M,inSR:s,outSR:c,datumTransformation:a,preferPE:m[0]<=J,usePixelCenter:y}),b=[];let G,S=0;const _=y?-1:NaN,{xmin:L,xmax:j,ymax:Q,width:bn,height:Pn}=i,Gn=k(c,K),kn=x!=null&&L>0&&j>x/2;let on=!1;if(l){const C=I(s);on=C!=null&&C.poleLocation>0}for(let C=0;Cj&&P[0]>x/2-Gn?P[0]-=x:h&&C===0&&P[0]<0&&kn&&!e&&(P[0]+=x),!P||isNaN(P[0])||isNaN(P[1]))b.push(_),b.push(_),U.push(null),S++;else{if(e){const sn=e.inverseTransform(new N({x:P[0],y:P[1],spatialReference:c}));P=[sn.x,sn.y]}U.push(P),C>0&&h&&G[A]&&P[0]j&&P[0]>x&&(P[0]-=x)),b.push((P[0]-L)/bn),b.push((Q-P[1])/Pn)}}G=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:S,spacing:m,size:y?[p,d]:[p-1,d-1]}}function mn(n,t,i){const{cols:o,rows:a}=t,e=new Float32Array((o-1)*(a-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),c=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const c=n.xmin-a;s=-Math.ceil(c/e)}return new Y({spatialReference:n.spatialReference,xmin:n.xmin+s*e,ymin:n.ymin,xmax:n.xmax+s*e,ymax:n.ymax})}function Vn(n,t,i){const{storageInfo:o,pixelSize:a}=t;let e=0,s=!1;const{pyramidResolutions:c}=o,l=o.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(c!=null&&c.length){const h=c[c.length-1],m=(h.x+h.y)/2,f=(a.x+a.y)/2;if(r<=f)e=0;else if(r>=m)e=c.length,s=r/m>8;else{let y,p=f;for(let d=1;d<=c.length;d++){if(y=(c[d-1].x+c[d-1].y)/2,r<=y){r===y?e=d:i==="down"?(e=d-1,s=r/p>8):e=i==="up"||r-p>y-r||r/p>2?d:d-1;break}p=y}}const M=e===0?a:c[e-1];return s&&Math.min(M.x,M.y)*O(t.spatialReference)>19567&&(s=!1),{pyramidLevel:e,pyramidResolution:new N({x:M.x,y:M.y,spatialReference:t.spatialReference}),excessiveReading:s}}const u=Math.log(n.x/a.x)/Math.LN2,w=Math.log(n.y/a.y)/Math.LN2,g=t.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(u,w)):i==="up"?Math.ceil(Math.max(u,w)):Math.round((u+w)/2),e<0?e=0:e>g&&(s=e>g+3,e=g);const x=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:s}}function pn(n,t){const{pixelSize:i,extent:o}=n,a=Ln(o,t,!1);return Rn(Fn(o,(i.x+i.y)/16),t,a)}function nt(n,t,i){const o=i?.tileSize,a=i?.alignGlobalDatasetWithAGOL,{extent:e,spatialReference:s,pixelSize:c}=n,l=cn(c,t,e);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const r=(l.x+l.y)/2,u=O(t),w=r*u*96*39.37,g=t.isGeographic?256/o*2958287637958547e-7:256/o*591657527591555e-6;let x=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const h=pn(n,t),m=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(g/2/w)/Math.LN2));if(!x&&a&&(t.isGeographic||t.isWebMercator)){const S=E(t);if(x=Sn(h)>0||S!=null&&h.width>S/4,!x&&S!=null){let _=-1;if(m<3)_=2**m*r*o;else if(n.storageInfo){const{maximumPyramidLevel:j=0,pyramidScalingFactor:Q=2}=n.storageInfo;_=Q**j*r*o}const L=Math.ceil(S/_);x=L===1||L===2&&S/2-h.xmax<_}}let f,M=w;const y=1.001,p=Math.min(2,Math.max(1.414,n.storageInfo?.pyramidScalingFactor||2));if(x){M=g;const S=t.isGeographic?1341104507446289e-21:.29858214164761665,_=S*(96*u*39.37),L=t.isGeographic?4326:3857;f=cn({x:S,y:S},s,pn(n,new yn({wkid:L}))),f.x*=M/_,f.y*=M/_}else{f={x:c.x,y:c.y};let S=0;for(;M=G;)M/=p,f.x/=p,f.y/=p,d.push(M),R.push({x:f.x,y:f.y});return{projectedPixelSize:l,scales:d,srcResolutions:R,isCustomTilingScheme:!x}}export{dn as $,Un as F,Zn as K,Dn as L,Vn as Q,nt as U,Qn as W,Hn as X,$n as Y,E as k,fn as n,Rn as o,Ln as p,pn as r,Sn as s}; diff --git a/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C6XacwGz.js b/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C6XacwGz.js deleted file mode 100644 index eaae8454..00000000 --- a/custom-toc-separator/assets/rasterProjectionHelper-Calp0o_1-C6XacwGz.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-csWZJ4px.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BcGP1hGu.js"])))=>i.map(i=>d[i]); -import{_ as Nn}from"./main-lj2zzr_L.js";import{n as Y,p as O,aq as En,l as tn,w as N,aG as _n,o as gn,i3 as T,i4 as v,i5 as an,i6 as vn,i7 as Tn,J as yn}from"./story-OUarUCIt.js";import{_ as B,W as Cn,K as W,J as Wn,Y as rn}from"./projection-BA9M1R7d-Cytmrlsd.js";var nn;function dn(n,t,i){return!Wn(n,t,i)}function z(n,t,i){const o=dn(n,t,i);if(o&&!B())throw new gn("rasterprojectionhelper-project","projection engine is not loaded");return o}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(nn||(nn={}));const ln=(n,t,i,o=0)=>{if(i[0]===1)return[0,0];let a=1,e=-1,s=1,c=-1;for(let f=0;fn[f]?n[f]:a,e=e>n[f]?e:n[f],s=s>n[f+1]?n[f+1]:s,c=c>n[f+1]?c:n[f+1]);const{cols:l,rows:r}=t,u=(e-a)/l/i[0],w=(c-s)/r/i[1],g=2*o;let x=0,h=!1,m=[0,0];for(let f=0;fx&&(x=R+b,m=[R,b]),g&&x>g){h=!0;break}}if(h)break}return m},zn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},F=32,J=4,$=J,Z=new Map,H=new Map,K=500;let X=null;async function Dn(){X&&B()||(B()||await Cn(),X=await Nn(()=>import("./geometryEngine-CdPoFSE4-csWZJ4px.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))}function Ln(n,t,i){return z(n.spatialReference,t),i?rn(t,n.spatialReference,n):rn(n.spatialReference,t,n)}function Qn(n,t,i,o=null){const a=n.spatialReference;if(!a||!t||a.equals(t))return n;z(a,t,o);const e=i.center,s=new Y({xmin:e.x-n.x/2,xmax:e.x+n.x/2,ymin:e.y-n.y/2,ymax:e.y+n.y/2,spatialReference:a}),c=W(s,t,o),l=E(t);return c==null||l!=null&&c.width>=l?q(n,a,t):{x:c.width,y:c.height}}function q(n,t,i){const o=O(t)/O(i);return{x:n.x*o,y:n.y*o}}function cn(n,t,i){const{spatialReference:o}=i;if(!o||!t||o.equals(t))return n;if(o.isGeographic&&t.isGeographic)return q(n,o,t);if(z(o,t),!X)throw new gn("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:a,y:e}=n;const s=(a+e)/2*O(o);let c=1;s>30&&(c=30/s,a*=c,e*=c);const l=256,r=a*l/2,u=e*l/2,{x:w,y:g}=i.center,x=[];for(let S=0;S<=l;S++)x.push([w-r,g-u+S*e]);for(let S=1;S<=l;S++)x.push([w-r+S*a,g+u]);for(let S=1;S<=l;S++)x.push([w+r,g+u-S*e]);for(let S=1;S=M)return q(n,o,t);const y=X.planarArea(m),p=a*e*l*l,d=Math.sqrt(y/p)/c,R={x:f.width/c/l,y:f.height/c/l},b={x:a*d,y:e*d},G=R.x*R.y;return Math.abs(G-b.x*b.y)/G<.1?R:b}function k(n,t=.01){return O(n)?t/O(n):0}function fn(n,t,i=null,o=!0){const a=n.spatialReference;if(a.equals(t))return n;z(a,t,i);const e=W(n,t,i);return o&&e&&wn([n],[e],a,t),e}function wn(n,t,i,o){const a=D(i,!0),e=D(o,!0),s=k(i,K),c=k(o,K);if(s&&a!=null&&e!=null)for(let l=0;l=e[1]-c&&Math.abs(u-a[0])new N(c[0],c[1],i)),s=W(e,o,a);return a&&wn(e,s,i,o),s.map(c=>c?[c.x,c.y]:[NaN,NaN])}function jn(n){const{inSR:t,outSR:i,datumTransformation:o}=n,a=I(t),{points:e,mask:s}=en(n,a);if(!t.isGeographic){const l=t.wkid?T.coordsys(t.wkid):T.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);an.projToGeog(l,e.length,e)}if(o!=null&&o.steps.length){let l;if(i.isGeographic&&(l=e.map(([r])=>r>179.9955?1:r<-179.9955?-1:0)),o.steps.forEach(r=>{const u=r.wkid?T.geogtran(r.wkid):T.fromString(v.PE_TYPE_GEOGTRAN,r.wkt);vn.geogToGeog(u,e.length,e,null,r.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let r=0;r179.9955?1:w<-179.9955?-1:0;u&&g&&u!==g&&(e[r][0]=u>0?w+360:w-360)}}if(!i.isGeographic){const l=I(i,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];Yn(e,r);const u=i.wkid?T.coordsys(i.wkid):T.fromString(i.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,i.wkt2||i.wkt);an.geogToProj(u,e.length,e)}let c=e;if(s&&e.length!==s.length){c=[];for(let l=0,r=0;lf.getInclusive()===1&&f.getKind()===1);if(!s){if(s=a.find(f=>f.getInclusive()===1&&f.getKind()===0),!s)return null;e=!0}const c=i?0:(o.getNorthPoleLocation()===2?1:0)|(o.getSouthPoleLocation()===2?2:0),l=o.isPannableRectangle(),r=s.getCoord();if(e)return{isEnvelope:e,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:c};let u=0;const w=[];let[g,x]=r[0],[h,m]=r[0];for(let f=0,M=r.length;fy?h:y,m=m>p?m:p}return{isEnvelope:!1,isPannable:l,vertices:r,coef:w,bbox:[g,x,h,m],poleLocation:c}}function en(n,t){const i=[],{cols:o,rows:a,xres:e,yres:s,usePixelCenter:c}=n;let{xmin:l,ymax:r}=n;if(c&&(l+=e/2,r-=s/2),t==null){for(let x=0;x=x&&p<=m;for(let R=0;R=h&&b<=f&&(i.push([p,b]),u[y]=1)}}return{points:i,mask:u}}const w=t.coef,g=[];for(let x=0;x=R&&h<=b){const S=p*h+d;m.push(S),f.push(G)}}let M=m;if(m.length>2){let y=f[0]===2?0:f[0],p=m[0];M=[];for(let d=1;dd-R)}else m[0]>m[1]&&(M=[m[1],m[0]]);g.push(M)}for(let x=0,h=0;x=y[0]&&m<=y[1]&&(i.push([m,M]),u[h]=1);else if(y.length>2){let p=!1;for(let d=0;d=y[d]&&m<=y[d+1]){p=!0;break}p&&(i.push([m,M]),u[h]=1)}}}return{points:i,mask:u}}function Yn(n,t){const[i,o]=t;for(let a=0;ao)&&(n[a]=[NaN,NaN])}}function Mn(n,t){const i=E(n[0].spatialReference);if(n.length<2||i==null||(t=t??k(n[0].spatialReference),(n=n.filter(c=>c.width>t)).length===1))return n[0];let{xmin:o,xmax:a,ymin:e,ymax:s}=n[0];for(let c=1;ck(a)){const{xmin:r,xmax:u}=n;for(let w=0;w<=e;w++){const g=w===0?r:-s/2,x=w===e?u-s*w:s/2;l[w]=new Y({xmin:g,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return Mn(l.map(r=>xn(r,t,i,o)).filter(En))}function Un(n,t,i){if(n.type==="extent"){const{xmin:o,ymin:a,xmax:e,ymax:s,spatialReference:c}=n;n=new tn({rings:[[[o,s],[e,s],[e,a],[o,a],[o,s]]],spatialReference:c})}return n.spatialReference.equals(t)?n:(z(n.spatialReference,t,i),W(n,t,i))}function qn(n,t){const i=E(t);if(i==null)return null;let{xmin:o,ymin:a,xmax:e,ymax:s}=n;const c=n.spatialReference,l=new tn({spatialReference:c,rings:[[[o,a],[e,a],[e,s],[o,s],[o,a]]]}),r=W(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:u}=r,w=k(c),g=new Y({spatialReference:t});for(let x=0;x<2;x++){o=e=u[x][0][0],a=s=u[x][0][1];for(let h=0;hu[x][h][0]?u[x][h][0]:o,e=eu[x][h][1]?u[x][h][1]:a,s=s=s.ymax))return null;if(!o||!s)return s;const c=D(e,!0),l=D(t,!0);if(c==null||l==null)return s;const r=k(e,.001),u=k(e,K),w=k(t,.001);if(Math.abs(s.xmin-l[0])u){s.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,e)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmax,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmax=Math.max.apply(null,m)}if(xu){s.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,e)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmin,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmin=Math.min.apply(null,m)}}else{const g=k(t,.001);Math.abs(s.xmin-l[0])0&&o.outofBoundPointCount$)&&(dn(l,r,n.datumTransformation)&&(l.isGeographic||I(l)),i=[J,J],o=V({...n,spacing:i}),a={cols:o.size[0]+1,rows:o.size[1]+1},s=ln(o.offsets,a,i,$)),o.error=s,i[0]>1&&(o.coefficients=mn(o.offsets,a,e)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:i};else{const u=I(l);if(u!=null&&!u.isEnvelope){const w=Bn(l),g=Rn(n.projectedExtent,w),{offsets:x}=V({...n,srcBufferExtent:g,spacing:i}),h=mn(x,a,e);o.gcsGrid={offsets:x,coefficients:h,spacing:i}}}return o}function V(n){const{projectedExtent:t,srcBufferExtent:i,pixelSize:o,datumTransformation:a,rasterTransform:e}=n,s=t.spatialReference,c=i.spatialReference,l=z(s,c),{xmin:r,ymin:u,xmax:w,ymax:g}=t,x=E(c),h=x!=null&&(n.hasWrapAround||e?.type==="gcs-shift"),m=n.spacing||[F,F],f=m[0]*o.x,M=m[1]*o.y,y=m[0]===1,p=Math.ceil((w-r)/f-.1/m[0])+(y?0:1),d=Math.ceil((g-u)/M-.1/m[1])+(y?0:1),R=On({cols:p,rows:d,xmin:r,ymax:g,xres:f,yres:M,inSR:s,outSR:c,datumTransformation:a,preferPE:m[0]<=J,usePixelCenter:y}),b=[];let G,S=0;const _=y?-1:NaN,{xmin:L,xmax:j,ymax:Q,width:bn,height:Pn}=i,Gn=k(c,K),kn=x!=null&&L>0&&j>x/2;let on=!1;if(l){const C=I(s);on=C!=null&&C.poleLocation>0}for(let C=0;Cj&&P[0]>x/2-Gn?P[0]-=x:h&&C===0&&P[0]<0&&kn&&!e&&(P[0]+=x),!P||isNaN(P[0])||isNaN(P[1]))b.push(_),b.push(_),U.push(null),S++;else{if(e){const sn=e.inverseTransform(new N({x:P[0],y:P[1],spatialReference:c}));P=[sn.x,sn.y]}U.push(P),C>0&&h&&G[A]&&P[0]j&&P[0]>x&&(P[0]-=x)),b.push((P[0]-L)/bn),b.push((Q-P[1])/Pn)}}G=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:S,spacing:m,size:y?[p,d]:[p-1,d-1]}}function mn(n,t,i){const{cols:o,rows:a}=t,e=new Float32Array((o-1)*(a-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),c=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const c=n.xmin-a;s=-Math.ceil(c/e)}return new Y({spatialReference:n.spatialReference,xmin:n.xmin+s*e,ymin:n.ymin,xmax:n.xmax+s*e,ymax:n.ymax})}function Vn(n,t,i){const{storageInfo:o,pixelSize:a}=t;let e=0,s=!1;const{pyramidResolutions:c}=o,l=o.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(c!=null&&c.length){const h=c[c.length-1],m=(h.x+h.y)/2,f=(a.x+a.y)/2;if(r<=f)e=0;else if(r>=m)e=c.length,s=r/m>8;else{let y,p=f;for(let d=1;d<=c.length;d++){if(y=(c[d-1].x+c[d-1].y)/2,r<=y){r===y?e=d:i==="down"?(e=d-1,s=r/p>8):e=i==="up"||r-p>y-r||r/p>2?d:d-1;break}p=y}}const M=e===0?a:c[e-1];return s&&Math.min(M.x,M.y)*O(t.spatialReference)>19567&&(s=!1),{pyramidLevel:e,pyramidResolution:new N({x:M.x,y:M.y,spatialReference:t.spatialReference}),excessiveReading:s}}const u=Math.log(n.x/a.x)/Math.LN2,w=Math.log(n.y/a.y)/Math.LN2,g=t.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(u,w)):i==="up"?Math.ceil(Math.max(u,w)):Math.round((u+w)/2),e<0?e=0:e>g&&(s=e>g+3,e=g);const x=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:s}}function pn(n,t){const{pixelSize:i,extent:o}=n,a=Ln(o,t,!1);return Rn(Fn(o,(i.x+i.y)/16),t,a)}function nt(n,t,i){const o=i?.tileSize,a=i?.alignGlobalDatasetWithAGOL,{extent:e,spatialReference:s,pixelSize:c}=n,l=cn(c,t,e);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const r=(l.x+l.y)/2,u=O(t),w=r*u*96*39.37,g=t.isGeographic?256/o*2958287637958547e-7:256/o*591657527591555e-6;let x=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const h=pn(n,t),m=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(g/2/w)/Math.LN2));if(!x&&a&&(t.isGeographic||t.isWebMercator)){const S=E(t);if(x=Sn(h)>0||S!=null&&h.width>S/4,!x&&S!=null){let _=-1;if(m<3)_=2**m*r*o;else if(n.storageInfo){const{maximumPyramidLevel:j=0,pyramidScalingFactor:Q=2}=n.storageInfo;_=Q**j*r*o}const L=Math.ceil(S/_);x=L===1||L===2&&S/2-h.xmax<_}}let f,M=w;const y=1.001,p=Math.min(2,Math.max(1.414,n.storageInfo?.pyramidScalingFactor||2));if(x){M=g;const S=t.isGeographic?1341104507446289e-21:.29858214164761665,_=S*(96*u*39.37),L=t.isGeographic?4326:3857;f=cn({x:S,y:S},s,pn(n,new yn({wkid:L}))),f.x*=M/_,f.y*=M/_}else{f={x:c.x,y:c.y};let S=0;for(;M=G;)M/=p,f.x/=p,f.y/=p,d.push(M),R.push({x:f.x,y:f.y});return{projectedPixelSize:l,scales:d,srcResolutions:R,isCustomTilingScheme:!x}}export{dn as $,Un as F,Zn as K,Dn as L,Vn as Q,nt as U,Qn as W,Hn as X,$n as Y,E as k,fn as n,Rn as o,Ln as p,pn as r,Sn as s}; diff --git a/custom-toc-separator/assets/rasterUtils-DqAu9qES-BGxTS9rh.js b/custom-toc-separator/assets/rasterUtils-DqAu9qES-BGxTS9rh.js deleted file mode 100644 index 951c2b0e..00000000 --- a/custom-toc-separator/assets/rasterUtils-DqAu9qES-BGxTS9rh.js +++ /dev/null @@ -1 +0,0 @@ -import{s as E}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{B as C,F as A,M as _,G as T,c as s,U as M}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as h,V as O}from"./Texture-BCt2hphT-Bv29bzNX.js";function w(e,t,n="nearest",i=!1){const r=!(i&&t.pixelType==="u8"),u=r?A.FLOAT:A.UNSIGNED_BYTE,a=t.pixels==null||t.pixels.length===0?null:r?t.getAsRGBAFloat():t.getAsRGBA(),f=e.capabilities.textureFloatLinear,o=new h;return o.width=t.width,o.height=t.height,o.internalFormat=r?C.RGBA32F:M.RGBA,o.samplingMode=!f||n!=="bilinear"&&n!=="cubic"?_.NEAREST:_.LINEAR,o.dataType=u,o.wrapMode=T.CLAMP_TO_EDGE,new O(e,o,a)}function L(e,t){const{spacing:n,offsets:i,coefficients:r,size:[u,a]}=t,f=n[0]>1,o=new h;o.width=f?4*u:u,o.height=a,o.internalFormat=C.RGBA32F,o.dataType=A.FLOAT,o.samplingMode=_.NEAREST,o.wrapMode=T.CLAMP_TO_EDGE;const l=new Float32Array(f?u*a*16:2*i.length);if(f&&r!=null)for(let c=0,m=0;c{const r=t.get(i)||t.get(i+"[0]");r&&U(e,i,n[i],r)})}function R(e,t,n,i){n.length===i.length&&(i.some(r=>r==null)||n.some(r=>r==null)||n.forEach((r,u)=>{t.setUniform1i(r,u),e.bindTexture(i[u],u)}))}function U(e,t,n,i){if(i===null||n==null)return!1;const{info:r}=i;switch(r.type){case s.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case s.FLOAT_VEC2:e.setUniform2fv(t,n);break;case s.FLOAT_VEC3:e.setUniform3fv(t,n);break;case s.FLOAT_VEC4:e.setUniform4fv(t,n);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case s.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case s.BOOL:e.setUniform1i(t,n?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(t,n);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(t,n);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{k as F,v as G,w as L,L as M,R as N,x as U,B as V,V as b,I as k,G as w,N as x}; diff --git a/custom-toc-separator/assets/rasterUtils-DqAu9qES-Ce2xEM6w.js b/custom-toc-separator/assets/rasterUtils-DqAu9qES-Ce2xEM6w.js new file mode 100644 index 00000000..0faf72a9 --- /dev/null +++ b/custom-toc-separator/assets/rasterUtils-DqAu9qES-Ce2xEM6w.js @@ -0,0 +1 @@ +import{s as E}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{B as C,F as A,M as _,G as T,c as s,U as M}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as h,V as O}from"./Texture-BCt2hphT-B6HwLstV.js";function w(e,t,n="nearest",i=!1){const r=!(i&&t.pixelType==="u8"),u=r?A.FLOAT:A.UNSIGNED_BYTE,a=t.pixels==null||t.pixels.length===0?null:r?t.getAsRGBAFloat():t.getAsRGBA(),f=e.capabilities.textureFloatLinear,o=new h;return o.width=t.width,o.height=t.height,o.internalFormat=r?C.RGBA32F:M.RGBA,o.samplingMode=!f||n!=="bilinear"&&n!=="cubic"?_.NEAREST:_.LINEAR,o.dataType=u,o.wrapMode=T.CLAMP_TO_EDGE,new O(e,o,a)}function L(e,t){const{spacing:n,offsets:i,coefficients:r,size:[u,a]}=t,f=n[0]>1,o=new h;o.width=f?4*u:u,o.height=a,o.internalFormat=C.RGBA32F,o.dataType=A.FLOAT,o.samplingMode=_.NEAREST,o.wrapMode=T.CLAMP_TO_EDGE;const l=new Float32Array(f?u*a*16:2*i.length);if(f&&r!=null)for(let c=0,m=0;c{const r=t.get(i)||t.get(i+"[0]");r&&U(e,i,n[i],r)})}function R(e,t,n,i){n.length===i.length&&(i.some(r=>r==null)||n.some(r=>r==null)||n.forEach((r,u)=>{t.setUniform1i(r,u),e.bindTexture(i[u],u)}))}function U(e,t,n,i){if(i===null||n==null)return!1;const{info:r}=i;switch(r.type){case s.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case s.FLOAT_VEC2:e.setUniform2fv(t,n);break;case s.FLOAT_VEC3:e.setUniform3fv(t,n);break;case s.FLOAT_VEC4:e.setUniform4fv(t,n);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case s.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case s.BOOL:e.setUniform1i(t,n?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(t,n);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(t,n);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{k as F,v as G,w as L,L as M,R as N,x as U,B as V,V as b,I as k,G as w,N as x}; diff --git a/custom-toc-separator/assets/rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js b/custom-toc-separator/assets/rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js deleted file mode 100644 index a1c13c10..00000000 --- a/custom-toc-separator/assets/rasterizingUtils-BmlDdKBf-Bdn1Ul1Y.js +++ /dev/null @@ -1 +0,0 @@ -import{l as v}from"./floatRGBA-4pIJN00G-DCWbfrRi.js";import{iW as y}from"./story-OUarUCIt.js";import{t as F,c as A,o as C}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const D=a=>a==="vertical"||a==="horizontal"||a==="cross"||a==="esriSFSCross"||a==="esriSFSVertical"||a==="esriSFSHorizontal";function $(a,d,M){const i=d.style,h=y(Math.ceil(M)),t=D(i)?8*h:16*h,o=2*h;a.width=t,a.height=t;const e=a.getContext("2d");e.strokeStyle="#ffffff",e.lineWidth=h,e.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(e.moveTo(t/2,-o),e.lineTo(t/2,t+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(e.moveTo(-o,t/2),e.lineTo(t+o,t/2)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSBackwardDiagonal"||(e.moveTo(-o,-o),e.lineTo(t+o,t+o),e.moveTo(t-o,-o),e.lineTo(t+o,o),e.moveTo(-o,t-o),e.lineTo(o,t+o)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSForwardDiagonal"&&i!=="esriSFSDiagonalCross"||(e.moveTo(t+o,-o),e.lineTo(-o,t+o),e.moveTo(o,-o),e.lineTo(-o,o),e.moveTo(t+o,t-o),e.lineTo(t-o,t+o)),e.stroke();const m=e.getImageData(0,0,a.width,a.height),s=new Uint8Array(m.data);let c;for(let n=0;nn+l,0),M=Math.round(d*F),i=1,h=new Float32Array(M*i);let t=0,o=0,e=.5,m=!0;for(const n of a){for(t=o,o+=n*F;e<=o;){const l=e-.5,r=Math.min(Math.abs(e-t),Math.abs(e-o));h[l]=m?-r:r,e++}m=!m}const s=h.length,c=new Uint8Array(4*s);for(let n=0;na==="vertical"||a==="horizontal"||a==="cross"||a==="esriSFSCross"||a==="esriSFSVertical"||a==="esriSFSHorizontal";function $(a,d,M){const i=d.style,h=y(Math.ceil(M)),t=D(i)?8*h:16*h,o=2*h;a.width=t,a.height=t;const e=a.getContext("2d");e.strokeStyle="#ffffff",e.lineWidth=h,e.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(e.moveTo(t/2,-o),e.lineTo(t/2,t+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(e.moveTo(-o,t/2),e.lineTo(t+o,t/2)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSBackwardDiagonal"||(e.moveTo(-o,-o),e.lineTo(t+o,t+o),e.moveTo(t-o,-o),e.lineTo(t+o,o),e.moveTo(-o,t-o),e.lineTo(o,t+o)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSForwardDiagonal"&&i!=="esriSFSDiagonalCross"||(e.moveTo(t+o,-o),e.lineTo(-o,t+o),e.moveTo(o,-o),e.lineTo(-o,o),e.moveTo(t+o,t-o),e.lineTo(t-o,t+o)),e.stroke();const m=e.getImageData(0,0,a.width,a.height),s=new Uint8Array(m.data);let c;for(let n=0;nn+l,0),M=Math.round(d*F),i=1,h=new Float32Array(M*i);let t=0,o=0,e=.5,m=!0;for(const n of a){for(t=o,o+=n*F;e<=o;){const l=e-.5,r=Math.min(Math.abs(e-t),Math.abs(e-o));h[l]=m?-r:r,e++}m=!m}const s=h.length,c=new Uint8Array(4*s);for(let n=0;n{let i,s,l,u,r;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(i=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await i.text(),t!=="json")))){try{s=JSON.parse(u||null)}catch(n){const b={...n,url:o,requestOptions:a};throw new p("request:server",n.message,b)}if(s.error){const n={...s.error,url:o,requestOptions:a};throw new p("request:server",s.error.message,n)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":r=i;break;case"json":r=s;break;case"native":r=l;break;case"text":r=u;break;default:r=e.data}return{data:r,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{h as execute}; diff --git a/custom-toc-separator/assets/request-5gjwL9xx-DalXceV9.js b/custom-toc-separator/assets/request-5gjwL9xx-DalXceV9.js deleted file mode 100644 index 025f47fe..00000000 --- a/custom-toc-separator/assets/request-5gjwL9xx-DalXceV9.js +++ /dev/null @@ -1 +0,0 @@ -import{o as p}from"./story-OUarUCIt.js";import"./main-lj2zzr_L.js";function h(o,a){let t=a.responseType;t?t!=="array-buffer"&&t!=="blob"&&t!=="json"&&t!=="native"&&t!=="native-request-init"&&t!=="text"&&(t="text"):t="json",a.responseType=t;const c=a.signal;return delete a.signal,globalThis.invokeStaticMessage("request",{url:o,options:a},{signal:c}).then(async e=>{let i,s,l,u,r;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(i=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await i.text(),t!=="json")))){try{s=JSON.parse(u||null)}catch(n){const b={...n,url:o,requestOptions:a};throw new p("request:server",n.message,b)}if(s.error){const n={...s.error,url:o,requestOptions:a};throw new p("request:server",s.error.message,n)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":r=i;break;case"json":r=s;break;case"native":r=l;break;case"text":r=u;break;default:r=e.data}return{data:r,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{h as execute}; diff --git a/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-BuJzHX4v.js b/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-BuJzHX4v.js deleted file mode 100644 index 38e7960c..00000000 --- a/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-BuJzHX4v.js +++ /dev/null @@ -1 +0,0 @@ -import{f as r}from"./story-OUarUCIt.js";async function o(a,e){const{data:n}=await r(a,{responseType:"image",...e});return n}export{o as r}; diff --git a/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-CZrsQx74.js b/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-CZrsQx74.js new file mode 100644 index 00000000..81dde717 --- /dev/null +++ b/custom-toc-separator/assets/requestImageUtils-Ut4YcoNU-CZrsQx74.js @@ -0,0 +1 @@ +import{f as r}from"./story-DT1Ep1ux.js";async function o(a,e){const{data:n}=await r(a,{responseType:"image",...e});return n}export{o as r}; diff --git a/custom-toc-separator/assets/resourceExtension-CdQvIDKV-CYtArgCw.js b/custom-toc-separator/assets/resourceExtension-CdQvIDKV-CYtArgCw.js deleted file mode 100644 index 44753efe..00000000 --- a/custom-toc-separator/assets/resourceExtension-CdQvIDKV-CYtArgCw.js +++ /dev/null @@ -1 +0,0 @@ -import{gF as o}from"./story-OUarUCIt.js";function c(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const a=o(p);return t[a]||n}const i={},n="text/plain",l=i[n],t={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const p in t)i[t[p]]=p;export{c as e}; diff --git a/custom-toc-separator/assets/resourceExtension-CdQvIDKV-iZLDgXmu.js b/custom-toc-separator/assets/resourceExtension-CdQvIDKV-iZLDgXmu.js new file mode 100644 index 00000000..7636bff7 --- /dev/null +++ b/custom-toc-separator/assets/resourceExtension-CdQvIDKV-iZLDgXmu.js @@ -0,0 +1 @@ +import{gF as o}from"./story-DT1Ep1ux.js";function c(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const a=o(p);return t[a]||n}const i={},n="text/plain",l=i[n],t={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const p in t)i[t[p]]=p;export{c as e}; diff --git a/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DJoDGZfh.js b/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DJoDGZfh.js new file mode 100644 index 00000000..09d6f452 --- /dev/null +++ b/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DJoDGZfh.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-DwzNb5YY.js","./story-DT1Ep1ux.js","./main-BTdHgocv.js","./main-Cypivj38.css","./story-BJ0ejR9b.css"])))=>i.map(i=>d[i]); +import{_}from"./main-BTdHgocv.js";import{jx as y,$ as S,o as v,iF as E}from"./story-DT1Ep1ux.js";import{r as F}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{getSiblingOfSameTypeI as O,contentToBlob as m}from"./resourceUtils-rTM6Iemx-DwzNb5YY.js";async function b(s,t,r){const o=await w(s,t,r);await I(o,t,r)}async function x(s,t,r,o,a){const c=await w(r,o,a);await s.update({data:t}),await I(c,o,a)}async function w(s,t,r){if(!t?.resources)return;const o=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{o.delete(e),s.paths.push(e)});const p=[],h=[],u=[];for(const e of t.resources.toUpdate)if(o.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:g,finish:d}=e,i=O(n,F());s.paths.push(i.path),p.push({resource:i,content:await m(g),compress:e.compress}),d&&u.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),o.has(e.resource.path))o.delete(e.resource.path);else{p.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource))}if(p.length||h.length){const{addOrUpdateResources:e}=await _(()=>import("./resourceUtils-rTM6Iemx-DwzNb5YY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);await e(t.portalItem,p,"add",r),await e(t.portalItem,h,"update",r)}if(u.forEach(e=>e()),f.length===0)return o;const l=await y(f);if(S(r),l.length>0)throw new v("save:resources","Failed to save one or more resources",{errors:l});return o}async function I(s,t,r){if(!s||!t.portalItem)return;const o=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);o.push(c.portalItem.removeResource(c,r))}await E(o)}export{x as F,b as T}; diff --git a/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DTC51C_z.js b/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DTC51C_z.js deleted file mode 100644 index 77f04757..00000000 --- a/custom-toc-separator/assets/resourceUtils-BmW6QqlX-DTC51C_z.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-LGtMSbcd.js","./story-OUarUCIt.js","./main-lj2zzr_L.js","./main-Cypivj38.css","./story-DSWe5kwC.css"])))=>i.map(i=>d[i]); -import{_}from"./main-lj2zzr_L.js";import{jx as y,$ as S,o as v,iF as E}from"./story-OUarUCIt.js";import{r as F}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{getSiblingOfSameTypeI as O,contentToBlob as m}from"./resourceUtils-rTM6Iemx-LGtMSbcd.js";async function b(s,t,r){const o=await w(s,t,r);await I(o,t,r)}async function x(s,t,r,o,a){const c=await w(r,o,a);await s.update({data:t}),await I(c,o,a)}async function w(s,t,r){if(!t?.resources)return;const o=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{o.delete(e),s.paths.push(e)});const p=[],h=[],u=[];for(const e of t.resources.toUpdate)if(o.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:g,finish:d}=e,i=O(n,F());s.paths.push(i.path),p.push({resource:i,content:await m(g),compress:e.compress}),d&&u.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),o.has(e.resource.path))o.delete(e.resource.path);else{p.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource))}if(p.length||h.length){const{addOrUpdateResources:e}=await _(()=>import("./resourceUtils-rTM6Iemx-LGtMSbcd.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);await e(t.portalItem,p,"add",r),await e(t.portalItem,h,"update",r)}if(u.forEach(e=>e()),f.length===0)return o;const l=await y(f);if(S(r),l.length>0)throw new v("save:resources","Failed to save one or more resources",{errors:l});return o}async function I(s,t,r){if(!s||!t.portalItem)return;const o=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);o.push(c.portalItem.removeResource(c,r))}await E(o)}export{x as F,b as T}; diff --git a/custom-toc-separator/assets/resourceUtils-Ds65naCv-C_KiPREG.js b/custom-toc-separator/assets/resourceUtils-Ds65naCv-C_KiPREG.js new file mode 100644 index 00000000..729a8009 --- /dev/null +++ b/custom-toc-separator/assets/resourceUtils-Ds65naCv-C_KiPREG.js @@ -0,0 +1 @@ +import{K as L}from"./story-DT1Ep1ux.js";import{D as i}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=i.KTX2_ENCODING}}function v(t){return t?.type==="encoded-mesh-texture"}async function w(t){const r=new Blob([t]),o=await r.text();return JSON.parse(o)}async function p(t,r){if(r===i.KTX2_ENCODING)return new h(t);const o=new Blob([t],{type:r}),n=URL.createObjectURL(o),e=new Image;if(L("esri-iPhone"))return new Promise((d,m)=>{const c=()=>{a(),d(e)},s=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),e.removeEventListener("load",c),e.removeEventListener("error",s)};e.addEventListener("load",c),e.addEventListener("error",s),e.src=n});try{e.src=n,await e.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),e}export{h as d,v as f,w as h,p as l}; diff --git a/custom-toc-separator/assets/resourceUtils-Ds65naCv-CrS2VhCe.js b/custom-toc-separator/assets/resourceUtils-Ds65naCv-CrS2VhCe.js deleted file mode 100644 index a40b4141..00000000 --- a/custom-toc-separator/assets/resourceUtils-Ds65naCv-CrS2VhCe.js +++ /dev/null @@ -1 +0,0 @@ -import{K as L}from"./story-OUarUCIt.js";import{D as i}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=i.KTX2_ENCODING}}function v(t){return t?.type==="encoded-mesh-texture"}async function w(t){const r=new Blob([t]),o=await r.text();return JSON.parse(o)}async function p(t,r){if(r===i.KTX2_ENCODING)return new h(t);const o=new Blob([t],{type:r}),n=URL.createObjectURL(o),e=new Image;if(L("esri-iPhone"))return new Promise((d,m)=>{const c=()=>{a(),d(e)},s=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),e.removeEventListener("load",c),e.removeEventListener("error",s)};e.addEventListener("load",c),e.addEventListener("error",s),e.src=n});try{e.src=n,await e.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),e}export{h as d,v as f,w as h,p as l}; diff --git a/custom-toc-separator/assets/resourceUtils-rTM6Iemx-DwzNb5YY.js b/custom-toc-separator/assets/resourceUtils-rTM6Iemx-DwzNb5YY.js new file mode 100644 index 00000000..8737acda --- /dev/null +++ b/custom-toc-separator/assets/resourceUtils-rTM6Iemx-DwzNb5YY.js @@ -0,0 +1 @@ +import{bX as f,o as m,gF as v,f as b}from"./story-DT1Ep1ux.js";import"./main-BTdHgocv.js";async function I(e,t={},s){await e.load(s);const r=f(e.itemUrl,"resources"),{start:c=1,num:d=10,sortOrder:l="asc",sortField:u="resource"}=t,i={query:{start:c,num:d,sortOrder:l,sortField:u,token:e.apiKey},signal:s?.signal},a=await e.portal.request(r,i);return{total:a.total,nextStart:a.nextStart,resources:a.resources.map(({created:n,size:p,resource:o})=>({created:new Date(n),size:p,resource:e.resourceFromPath(o)}))}}async function P(e,t,s,r){const c=new Map;for(const{resource:l,content:u,compress:i,access:a}of t){if(!l.hasPath())throw new m(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[n,p]=h(l.path),o=`${n}/${i??""}/${a??""}`;c.has(o)||c.set(o,{prefix:n,compress:i,access:a,files:[]}),c.get(o).files.push({fileName:p,content:u})}await e.load(r);const d=f(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:l,compress:u,access:i,files:a}of c.values())for(let n=0;n({created:new Date(n),size:p,resource:e.resourceFromPath(o)}))}}async function P(e,t,s,r){const c=new Map;for(const{resource:l,content:u,compress:i,access:a}of t){if(!l.hasPath())throw new m(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[n,p]=h(l.path),o=`${n}/${i??""}/${a??""}`;c.has(o)||c.set(o,{prefix:n,compress:i,access:a,files:[]}),c.get(o).files.push({fileName:p,content:u})}await e.load(r);const d=f(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:l,compress:u,access:i,files:a}of c.values())for(let n=0;nr==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{f as d,d as i}; diff --git a/custom-toc-separator/assets/saveUtils-CIYk-dsQ-LlVI_Glz.js b/custom-toc-separator/assets/saveUtils-CIYk-dsQ-LlVI_Glz.js new file mode 100644 index 00000000..d96cccef --- /dev/null +++ b/custom-toc-separator/assets/saveUtils-CIYk-dsQ-LlVI_Glz.js @@ -0,0 +1 @@ +import{o as l}from"./story-DT1Ep1ux.js";async function d(t){const s=[];for(const o of t.allLayers)if("beforeSave"in o&&typeof o.beforeSave=="function"){const e=o.beforeSave();e&&s.push(e)}await Promise.allSettled(s)}const i=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function f(t,s,o){let e=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{f as d,d as i}; diff --git a/custom-toc-separator/assets/scaleUtils-DxsfQwK1-BDJMc0pY.js b/custom-toc-separator/assets/scaleUtils-DxsfQwK1-BDJMc0pY.js new file mode 100644 index 00000000..44b960f7 --- /dev/null +++ b/custom-toc-separator/assets/scaleUtils-DxsfQwK1-BDJMc0pY.js @@ -0,0 +1 @@ +import{p as c,eJ as o,eK as r}from"./story-DT1Ep1ux.js";const i=96;function p(n,t){const e=n.extent,u=n.width,f=c(e?.spatialReference);return e&&u?e.width/u*f*o*i:0}function m(n,t){return n/(c(t)*o*i)}function w(n,t,e){return a(n,t)&&s(n,e)}function a(n,t){return t===0||r(n,t)||nt}export{w as b,p as c,m as f}; diff --git a/custom-toc-separator/assets/scaleUtils-DxsfQwK1-rzzukPSH.js b/custom-toc-separator/assets/scaleUtils-DxsfQwK1-rzzukPSH.js deleted file mode 100644 index 58d886f9..00000000 --- a/custom-toc-separator/assets/scaleUtils-DxsfQwK1-rzzukPSH.js +++ /dev/null @@ -1 +0,0 @@ -import{p as c,eJ as o,eK as r}from"./story-OUarUCIt.js";const i=96;function p(n,t){const e=n.extent,u=n.width,f=c(e?.spatialReference);return e&&u?e.width/u*f*o*i:0}function m(n,t){return n/(c(t)*o*i)}function w(n,t,e){return a(n,t)&&s(n,e)}function a(n,t){return t===0||r(n,t)||nt}export{w as b,p as c,m as f}; diff --git a/custom-toc-separator/assets/screen-BGsID61t-CdgdVIWY.js b/custom-toc-separator/assets/screen-BGsID61t-CdgdVIWY.js new file mode 100644 index 00000000..c469e153 --- /dev/null +++ b/custom-toc-separator/assets/screen-BGsID61t-CdgdVIWY.js @@ -0,0 +1,8 @@ +import{c0 as pe,eT as ht,eU as Ot,f6 as Z,fY as tt,f7 as Et,f9 as At,e$ as Q,fb as dt,f2 as B,fG as Pt,fg as G,fo as ct,f4 as $,eX as Tt,gc as me,gb as ve,fu as xt,f0 as Ht,fn as ye,eY as ge,f8 as be,eV as ut,e_ as ke,f1 as It,gy as St}from"./story-DT1Ep1ux.js";import{o as xe}from"./vue.esm-bundler-D2erd_gM-upufHWko.js";import{Z as Se}from"./toggle-switch-control-B4JzuvHa-GDrthgIt.js";import"./main-BTdHgocv.js";var Dt={exports:{}},we=Dt.exports,Nt;function Pe(){return Nt||(Nt=1,function(V,L){(function(j,y){V.exports=y(xe)})(typeof self<"u"?self:we,function(j){return function(){var y={388:function(l,d){var s,i,c;(function(S,E){i=[],s=E,c=typeof s=="function"?s.apply(d,i):s,c===void 0||(l.exports=c)})(typeof self<"u"&&self,function(){function S(){var E=Object.getOwnPropertyDescriptor(document,"currentScript");if(!E&&"currentScript"in document&&document.currentScript||E&&E.get!==S&&document.currentScript)return document.currentScript;try{throw new Error}catch(q){var A,F,T,f=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,x=/@([^@]*):(\d+):(\d+)\s*$/gi,m=f.exec(q.stack)||x.exec(q.stack),K=m&&m[1]||!1,et=m&&m[2]||!1,J=document.location.href.replace(document.location.hash,""),R=document.getElementsByTagName("script");K===J&&(A=document.documentElement.outerHTML,F=new RegExp("(?:[^\\n]+?\\n){0,"+(et-2)+"}[^<]* - + diff --git a/custom-toc-separator/index-ca-fr.html b/custom-toc-separator/index-ca-fr.html index bc61cf52..62dcd054 100644 --- a/custom-toc-separator/index-ca-fr.html +++ b/custom-toc-separator/index-ca-fr.html @@ -15,7 +15,7 @@ src="https://www.canada.ca/etc/designs/canada/cdts/gcweb/v5_0_2/cdts/compiled/wet-fr.js" data-cdts-setup='{"cdnEnv": "prod"}' > - + diff --git a/custom-toc-separator/index.html b/custom-toc-separator/index.html index 1d7c1daa..a327ebd4 100644 --- a/custom-toc-separator/index.html +++ b/custom-toc-separator/index.html @@ -8,7 +8,7 @@ RAMP Storylines - +